LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Quoting issue in PHP (https://www.linuxquestions.org/questions/programming-9/quoting-issue-in-php-802340/)

resetreset 04-16-2010 02:45 AM

Quoting issue in PHP
 
Hi,
I have a PHP script which will show info from 5 lines in a MySQL database, with a "next" button to show the next 5 lines and so on.
Initially it'll get called with a ?page=1 in the args in the URL, and then onward I want the "next" button to link to the same script , but with a ?page=2 in the args.
First of all, how can I access the "page" variable inside the script to see what args it's been given? (sorry, extremely newbie question here :) )

And secondly, what will the code for the "next" button look like? If the script is called "seenames.php", I want this:
print "A HREF="...cgi/seenames.php?page=$page+1">Next</A> ,
if you get my meaning. But what will the quoting for the above line be? I'm sure I've got it wrong. Can anyone help?


Thanks.

PMP 04-16-2010 03:05 AM

As this is a get you will receive this value in

Code:

$_GET["page"]

graemef 04-16-2010 06:53 AM

You need to escape quotes inside quotes, thus you would replace a " with \"

$anchor = "A HREF=\"...cgi/seenames.php?page=$page+1\">Next</A>"


All times are GMT -5. The time now is 04:05 AM.