473,473 Members | 1,477 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help needed - URL parameters do not update variables

Hello everyone,

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.

Joe
Jul 17 '05 #1
2 1908
Do you have something like this on your page?
$start = 1;

If yes, did you put it in an IF statement like this?
if(!isset($start)){
$start=1;
}else{
$start=$start;//this line not necessary to work, just here for mental
visualization
}

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

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!

--ScareCrowe

"Joe Lui" <jo*****@hotmail.com> wrote in message
news:66**************************@posting.google.c om...
Hello everyone,

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.

Joe



-----= 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! =-----
Jul 17 '05 #2
Joe Lui <jo*****@hotmail.com> wrote or quoted:
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?


The line:

$start = $_GET['start'];

....by the sound of it.
--
__________
|im |yler http://timtyler.org/ ti*@tt1lock.org Remove lock to reply.
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
by: stu_gots | last post by:
I have been losing sleep over this puzzle, and I'm convinced my train of thought is heading in the wrong direction. It is difficult to explain my circumstances, so I will present an identical...
13
by: EggsAckley | last post by:
Hi: I have a file that I have been told is a SQL Server backup from a server somewhere. The file is about 200MB in size I am trying to create the database on my local server using RESTORE. I...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
9
by: Dom Boyce | last post by:
Hi First up, I am using MS Access 2002. I have a database which records analyst rating changes for a list of companies on a daily basis. Unfortunately, the database has been set up (by my...
7
by: Aaron | last post by:
Complete code follows. I am new to .NET programming (and programming in general) and I am having a difficult time understanding how to fill a variable in one sub, and then access it from...
2
by: andy6 | last post by:
I am using the following code and SQL Profiler shows no activity when I step through the .update line. Do you see a syntax error? Thanks! using (SqlConnection cn = new SqlConnection(cnStr)) {...
2
by: Hexman | last post by:
Hello All, Well I'm stumped once more. Need some help. Writing a simple select and update program using VB.Net 2005 and an Access DB. I'm using parameters in my update statement and when trying...
6
by: Takeadoe | last post by:
Dear NG, Can someone assist me with writing the little code that is needed to run an update table query each time the database is opened? From what I've been able to glean from this group, the...
15
by: Jay | last post by:
I have a multi threaded VB.NET application (4 threads) that I use to send text messages to many, many employees via system.timer at a 5 second interval. Basically, I look in a SQL table (queue) to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.