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

Home Posts Topics Members FAQ

Changed servers; odd problem

Hi group,

I recently switched hosts, and now my main controller page for my
website isn't working correctly anymore. It worked fine on the old
host. The new host uses 5.0.4 whereas the old host used PHP 4.*.

I used switch statements to swap out text and graphics depending on the
parameters defined in the URL. Now it looks like the controller page is
ignoring them.

Here's the page:

http://www.purple-pony.com/main.php?ID=0&S=0

When you click "Work" or "Links" you should get different content as
well as different images, but it seems to be defaulting to the "About"
page all the time.

Here is a sample of the switch statement I used:

<?php
switch ($S)
{
case 0:
echo "<img src=pix/about.gif border=0 /><br />";
break;
case 1:
echo "<img src=pix/work.gif width=64 height=33 alt=Work border=0
/><br />";
break;
case 2:
echo "<img src=pix/paintings.gif width=99 height=35 alt=Paintings
border=0 /><br />";
break;
case 3:
echo "<img src=pix/photos.gif width=74 height=31 alt=Photos border=0
/><br />";
break;
case 4:
echo "<img src=pix/photos.gif width=105 height=34 alt=Photos border=0
/><br />";
break;
case 5:
echo "<img src=pix/links.gif width=53 height=31 alt=Links border=0
/><br />";
break;
case 6:
echo "<img src=pix/thisnthat.gif width=133 height=32 alt=This N That
border=0 /><br />";
break;
case 7:
echo "<img src=pix/shop.gif width=56 height=37 alt=Shop border=0
/><br />";
break;
default:
echo "No number between 1 and 3";
}
?>

Has any syntax changed from 4 to 5? I'm something of a PHP noodler, so
I'm by no means an expert. Any suggestions would be appreciated.

Thanks,
Christine

Oct 14 '06 #1
4 1027
>I recently switched hosts, and now my main controller page for my
>website isn't working correctly anymore. It worked fine on the old
host. The new host uses 5.0.4 whereas the old host used PHP 4.*.

I used switch statements to swap out text and graphics depending on the
parameters defined in the URL. Now it looks like the controller page is
ignoring them.

Here's the page:

http://www.purple-pony.com/main.php?ID=0&S=0

When you click "Work" or "Links" you should get different content as
well as different images, but it seems to be defaulting to the "About"
page all the time.

Here is a sample of the switch statement I used:

<?php
switch ($S)
Register-globals is evil. Newer versions default it off, and
hopefully they will get rid of it entirely.

Use $_GET['S'], not $S.
Oct 14 '06 #2
insert either

$S = $_GET['S'];
$ID = $_GET['ID'];

or

extract($_GET);

at the top of the script; or do what mister Burditt proposes.

Oct 15 '06 #3
Thank you :-) I added in

switch ($_GET["S"])

and it works perfectly now :-)

Best,
Christine

Oct 15 '06 #4
Thanks so much Gordon. I'm glad the fix was so simple! I added in

switch ($_GET["S"])

at the top and it works! Thanks again.

Best,
Christine

Oct 15 '06 #5

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

Similar topics

6
by: Paul Winkler | last post by:
This is driving me up the wall... any help would be MUCH appreciated. I have a module that I've whittled down into a 65-line script in an attempt to isolate the cause of the problem. (Real...
9
by: john smile | last post by:
Hi All, I want to lock 2 tables on 2 servers using TABLOCKX hint. These tables function as semaphores in my application. It means when the tables are locked then other users will not be able to...
2
by: VasantKumar Naidu | last post by:
Hi, I am making a new website. I have booked the server space and upload it frequently as and when I change something in my site. The problem is: I change something in my start.html file...
22
by: Jason James | last post by:
Hi all, I have asked this question already, but this time I will ask it a different way. My MSDE service is running fine. However, when I try and browse my list of servers I get two...
3
by: rcamarda | last post by:
I do weekly full backups of my SQL databases via a scheduled T-SQL job. I noticed that I have some static databases that dont normally change, so I dont want to back it up if it has not changed,...
4
by: Dave Edwards | last post by:
I understand that I can fill a datagrid with multiple queries, but I cannot figure out how to fill a dataset with the same query but run against multiple SQL servers, the query , table structure...
0
by: Tahir | last post by:
HelpTopic: Import/Restore/Transfer, Only Updated/Changed/New Values Between Two SQL Servers Over Dialup Connection. -- Hi All, I need a little helping hand/Tips: The Problem & Situation: One...
11
by: Bocah Sableng | last post by:
Hi, I'm new member of this group. I had added new virtual host at my intranet server. The new virtual host configuration on httpd.conf is similar with the old one. At the new virtual host, the...
3
by: JohnGos | last post by:
Since around 10th May (a couple of days after the recent IE autoupdate), a web application which has worked without problem for several years has developed intermittent problems with data posted from...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
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,...
0
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: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.