Undefined variable when using $_SERVER['PHP_SELF']


Posted on 16th Feb 2014 07:03 pm by admin

Hi guyz, please suggest me something...
On first.php I have one input field NAME, and on posting the form it moves to "second.php" showing the entered value of input field using $_POST, everything works fine....

But on second page, I have 'n' number of results coming from database. So to control their display,
Did you know?Explore Trending and Topic pages for more stories like this.
I use pagination.....< [1] 2, 3 > its like only 10 records in one shot

when I click on 2, to see the records from 11-20

URL get change to http://localhost/test/second.php?pg=2
from http://localhost/test/second.php
and start displaying message Notice : Undefined variable NAME on line 18, whereas earlier it was defined for the page

I m using <a href='{$_SERVER['PHP_SELF']}?pg=$x'>$x</a> for paging

What is the possible solution and why its not recognizing the posted variable now??
No comments posted yet

Your Answer:

Login to answer
331 Like 47 Dislike
Previous forums Next forums
Other forums

weeks in a year
hi,

i found this snippet on php.net
QuoteFor the week number for weeks starting on Sunday:

$action = "insert"; //$action = $_GET['action'];
$action = "insert";
//$action = $_GET['action'];

why is this invalid type? I am

array & querys help/advice.
Ok so here goes , I have a mysql database and basically here's what I need to do.

// foreach

Quick Question about echo value
Hey guys, I'm trying to get something to show differently in one of my scripts. I'm trying to make

Custom list order
Hi there,

I have checked this tutorial and it's great till the point where I want to display

Help With editting and deleting form
Hallo !!

So look at this image :

http://img194.imageshack.us/img194/8272/snapshot5f.pn

How to display random record from table?
I have the following code:

Code: <?php
$display_block .= "<input type=

division gives infinity anser
int main()
{
int z=0;
int i=1/z;
cout<
}

It doesn't throw a

Best way to check for end of a record and send it back to the first record
I'm hoping someone can help me out and explain the best way to accomplish this.

What I'm doin

array_diff weirdness
I'm using the following bit of code

$diff = array_diff($pids, $pidlist);
$diff = array_va

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash