FarrisFahad 103 Junior Poster

Hi,

I am bilding a site that allow my users to accept payment for selling ad space. I want PayPal to be my payment getaway. Is this doable with PayPal?. I know IPN, but it doesn't work because I don't want to get payed, I want my user to get payed.
How is this possible?

Thanks,
Farris

FarrisFahad 103 Junior Poster

I have come up with a simple solution,
Here is the code,

<!-- If there are more results (End:1) -->
<?php if($pages > 1){ ?>
<div class="Pagination">
    <!-- If current page is not equal to 1 add 'First' button (End:2) -->
    <?php if($current_page != 1){ ?>
    <a href="index.php?page=1">First</a>
    <?php } ?>
    <!-- End:2 -->

    <!-- For loop (End:3) -->
    <?php for($x = ($current_page - 3); $x <= $pages; $x++){ ?>
        <!-- If current page is equal to page or $x disable link -->
        <?php if($x == $current_page){ echo $x; continue; } ?>

        <!-- If page or $x is smaller than 1 continue or do not show -->
        <?php if($x < 1){ continue; } ?>

        <!-- Here is the line which I added -->
        <?php if($x > $current_page + 3){ continue; } ?>
        <a href="index.php?page=<?php echo $x ?>"><?php echo $x; ?></a>
    <?php } ?>
    <!-- End:3 -->

    <!-- If current page is not the last one show 'Last' link -->
    <?php if($pages != $current_page){ --$x ?>
    <a href="index.php?page=<?php echo $x ?>">Last</a>
    <?php } ?>
</div>
<?php } ?>
<!-- End:1 -->



<?php if($x > $current_page + 3){ continue; } ?>

This line did the trick.

Thank you guys for your help,
Farris

FarrisFahad 103 Junior Poster

I am trying to paginate through a set of results. I know how to do a simple pagination, but I have a lot of records in the database. So the problem is that when I have a lot of pages, the number of links are also high, therefore breaking the page and making the page ugly.

What I want to accomplish is that I only want to show 7 links ...
First, 1, 2, 3, 4, 5, Last

Also I would like to centralize the current page when the user get to a higher page than 3, lets say 6 ...
The user will get ...
First, 3, 4, 5, 6, 7, 8, 9, Last

With 6 as the centralized number.

Here is the code ...

<!-- Pagination Setup -->
<?php isset($_GET["page"]) ? $current_page = $_GET["page"] : $current_page =  1; ?>
<?php $per_page = 2; $start = ($current_page - 1) * $per_page; ?>

And here is what I have come up with so far ...

<!-- If there are more results (End:1) -->
<?php if($pages > 1){ ?>
<div class="Pagination">
    <!-- If current page is not equal to 1 add 'First' button (End:2) -->
    <?php if($current_page != 1){ ?>
    <a href="index.php?page=1">First</a>
    <?php } ?>
    <!-- End:2 -->

    <!-- For loop (End:3) -->
    <?php for($x = ($current_page - 3); $x <= $pages; $x++){ ?>
        <!-- If current page is equal to page or $x disable link -->
        <?php if($x == $current_page){ echo $x; continue; } ?>

        <!-- …
FarrisFahad 103 Junior Poster

To rewrite the question better ...
How can I code faster? build websites faster?

I build websites from scratch, and I found that it is a lot of work.

FarrisFahad 103 Junior Poster

Hi,

I build websites using five basic languages. html, css, js, php, and mysql. I have build a lot of websites, but my problem is that everytime I start a new project I start with a blank page. It's time consuming. I wonder if any of you guys have a method that can make the building process easier?

please do not suggest templates, or wordpress or joomla. I like to build unique websites.

FarrisFahad 103 Junior Poster

Hi everyone,

Let's get to the question ... I am wondering if it is possible to build links or get higher ranking doing PPC. this is my theory, why don't people spend money on PPC to get visits and then those visitors will do SEO for them by linking to them and what ever effects ranking instead of hiring an SEO agent. you are going to spend money eventually, why not PPC?

I wonder if any of you tried this before or see it as a good idea? I haven't tried it yet, but I am planning to. Please share your thoughts :) ...

It's just that SEO agents are expensive. I have hired before, and they were expensive. For $99 USD you can do some basic SEO, what if you spend that on PPC. Don't you think that some visitors will link to your website???

Thanks for reading
Farris

FarrisFahad 103 Junior Poster

My favorite English word would be "Shit"
and in Arabic "Zagg"
Or as my family says "Botbot"
My favorite Arabic word would be "Ingezha" which means "Jump over it"
we use it when you ask for something, like can I drive your car? "Ingezha"
or on other words NO.

FarrisFahad 103 Junior Poster

I have solved the problem, I named one of the MySQL Colums update which was making a problem :) . I renamed the Colums from update to update_something and it worked, Yay :)

Thank you guys for your help :)

FarrisFahad 103 Junior Poster

this is the tinymce code ...

<script type="text/javascript" src="tinymce/js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
    selector: "textarea"
 });
</script>



<form id="form1" name="form1" method="post" action="Fourth.php?id=<?php echo $fetch["2"]; ?>">
          <table width="680" border="0" cellspacing="3" cellpadding="3">
            <tr>
              <td colspan="2">Update Thread:</td>
            </tr>
            <tr>
              <td width="90">Title:</td>
              <td width="569"><label for="textfield"></label>
              <input type="text" name="title" id="Title" /></td>
            </tr>
            <tr>
              <td colspan="2" align="center">Update</td>
            </tr>
            <tr>
              <td colspan="2"><label for="textarea"></label>
              <textarea name="text" id="textarea" cols="45" rows="5">
FarrisFahad 103 Junior Poster

Still Doesn't work

FarrisFahad 103 Junior Poster

Hi Dani,
Here is the code

I have replaced some values and variables to numbers ...

<?php

    require_once("../Includes/Con.php");

    $1 = $_SESSION["user_id"];
    $2 = $_GET["id"];
    $3 = mysql_real_escape_string($_POST["title"]);
    $4 = $_POST["text"];
    $5 = strftime("%y-%m-%d", time());

    if(!empty($3) && !empty($4)){
        if(mysql_query("INSERT INTO updates (1, 2, 3, 4, 5) VALUES ('{$1}','{$2}','{$3}', '{$4}', '{$5}')")){
            header("Location: ../First.php?id={$id}");
            exit;
        }else{
            $_SESSION["ERROR_UPDATE"] = "There was an error, please try again later.";
            header("Location: ../Second.php");
            exit;
        }
    }else{
        $_SESSION["EMPTY_UPDATE_BOX"] = "Please fill in the fields";
        header("Location: ../Third.php?id={$id}");
        exit;
    }

?>

Note that when I press the submit button in the form page which leads to hear the PHP will take you to Second.php, which is fail. I want it to instead go to First.php. But it seems like there is something wrong with the WYSIWYG. Any Ideas ...

FarrisFahad 103 Junior Poster

Hi, I just downloaded TinyMCE WYSIWYG, and I am doing an insert query into MySQL using PHP.
Everytime I submit the form it returns false. and if I toke out the textarea everything goes ok.
I am pretty sure it's TinyMCE. Have any of you came across this problem, am I missing something?
The code works fine when I load the page, TineMCE looks good, but when I submit the form it simply fails.
Please advise,
and thank you in advance
FarrisFahad