Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 04-16-2010, 02:45 AM   #1
Senior Member
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
Quoting issue in PHP

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?

Old 04-16-2010, 03:05 AM   #2
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

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

Old 04-16-2010, 06:53 AM   #3
Senior Member
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

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

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


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

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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:59 PM.

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