Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
August 3, 2004, 3:41 pm
rate this thread
I am new to PHP and web server in general so please bear with me if
it's an obvious mistake.
My problem is that parameters entered in URL do not update php
variables. I am using IIS on winxp pro with the latest php installed.
PHP seems working fine, i.e. <?php echo '<p>Hello World</p>'; ?>
works as expected.
I am building an automated photo gallery that displays 15 thumbnails
on a page. The starting thumbnail is controlled by a variable called
$start, with initial value = 1. To see the next 15 thumbnails, $start
will be updated to 16. The link look like this: <a
href="gallery.php?start=16">. However, $start is not updated after
the link is clicked. What did I miss?
Is it a php programming problem? Or do I need to configure (if
necessary) my web server? can anyone provide a simple example to
demonstrate how URL parameters work? Please help. Thank you.
Re: Help needed - URL parameters do not update variables
$start = 1;
If yes, did you put it in an IF statement like this?
$start=$start;//this line not necessary to work, just here for mental
try putting (echo 'start = '.$start;) at the very beginning of the script
on gallery.php. When you click the links, is $start reflecting the value you
You need to give more info for us to help you much more than this. A snippet
of your code or something.
Starting out, I made the mistake of declaring a variable in my script
without the IF ISSET statement, thereby overwriting the variable every time.
Putting the IF ISSET statement in there will see if $start is set and if it
is, it will leave it alone! If it's not set, the server will assume the user
has just arrived at the page, and set the $start value to 1.
Let us know!
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----