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

331 Like 47 Dislike
Previous php-forum Next php-forum
Other php-forum

Why is my row count 0?
Here's the MySQL query i'm running. It basically pulls data from 2 tables based on some data passed.

ImageCreate()
When I create an image and add text to it I want my text to be replaced with a PNG image, because th

how can we add data from dynamic fields to mysql db in php
i have a script which i found on the internet. i modify that script according to my needs. what is i

There was a problem with the request. (Code: 0)
Any Idea what could cause this? I get it randomly at best. But with both IE and FF. It derives from

Get last modified date of web page
Hai All,

In php how can i get last modified date of a give web page . I have tried to g

include function being weird?
I have a very simple system to grab an IP outputted by a PHP file.. (for a project I have) but it ou

PHP code needed to get/post form fields and request mysql query results.
I'm new to PHP

I've created an html form to allow the user to request a basic telephone dire

A little help needed passing hidden values to next page
I have a page that has hidden values in a form.

example
Code: <input name='signupID

PHP doesn't send my mail
Hi all, I found this and used it to send mail. Simple contact form with some required fields. The va

Select question
Hi,

First I would like to say that php is pretty new for me..
so please don't shoot me if

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