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

Performance impact of cookies
Hi, I was just wondering what impact there would be in terms of performance if you where to set then

Am I setting up my sites oldschool?
Ok,

When I create a site I open a basic template that I have created that consists of a css f

Upload file and add HTML
Hey everyone,

I have a client has meeting agendas and minutes that should be posted online. I

column name cancatenation within PL/SQL
I have a PLSQL store procedure, and the following statement is part of a subquery
fname||lnam

Help on query replacing the date
Hi Pals,

i want to replace the current date in a column to some value say C or D or any n

Comparing Values
Hi
I'm reading data from a database and this seems to work OK.

Each system has an associat

While Problem
i am having a problem with a while statement here is the code
Code: [Select]<?php
sess

making web pages for accounts
Hello, I would like to make pages for accounts on my website im making (its not a real website..im j

Please help with code for SMTP authenticated PHP email form
Hello, I'm creating a PHP email form, and for this particular server, I have to use SMTP Authenticat

Connecion issue
Hi,

For some reason, I keep getting this error when trying to connect:

Warning: mysql_

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