LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 04-16-2010, 02:45 AM   #1
resetreset
Senior Member
 
Registered: Mar 2008
Location: India
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,320

Rep: Reputation: 51
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.
 
Old 04-16-2010, 03:05 AM   #2
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

Rep: Reputation: 58
As this is a get you will receive this value in

Code:
$_GET["page"]
 
Old 04-16-2010, 06:53 AM   #3
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,376

Rep: Reputation: 147Reputation: 147
You need to escape quotes inside quotes, thus you would replace a " with \"

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl quoting issue in CGI script (MySQL program) resetreset Programming 10 01-28-2009 01:25 AM
Quoting issue in Perl/MySQL program resetreset Programming 4 01-14-2009 06:44 AM
Perl quoting issue resetreset Programming 8 01-10-2009 08:58 AM
bash - quoting RGummi Linux - General 3 10-21-2006 03:06 PM


All times are GMT -5. The time now is 03:42 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration