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,
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

The repetition structure: the while statement not working
New programming student, have assignment as follows:
A restaurant has 4 lunch combos for custom

filesize() returns 0
I have a socket program that runs in an infinite loop, listening for connections, in this socket I h

Using Windows message as a Handle
Hi,

I am writing one of my first multithreaded programs.

In one of the thread,

Basic Question about Threading and PHP...
I have a page that I am working on and it is taking several hours to process. The basics of what th

Search function
I am looking for some guidance from the experts.

I am trying to create a search function. It

Using cURL to PUT
Can somebody help with the correct php code to make a cURL PUT request. Here is a sample of code bel

How could I do this?
Ive got a simple lottery game, and am using an sql database to keep track of the numbers bought. But

Amend code to allow multiple attachments
Hi

I have a php page that allows the user to browse to a file (image) then sumbit, the confi

help with php
It's not displaying or pulling anything out of the database.


Code: <html><

help with image text
Hi ...

see i need the text of the name and number to start in the center and always be in the

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