Forum Moderators: coopster

Message Too Old, No Replies

view_job?id=50 -? not working after php files

         

brodie_r

2:19 pm on May 15, 2006 (gmt 0)

10+ Year Member



I created some php files which work perfectly fine on all servers i have tested it on, but using the view_job?id=x, x being whatever the job number is. I just installed xampp on a server 2003 box and it wont work with the?id=50, it just shows a blank page. Every other .php page works in the site but not the ones with?id=x.

Im so stumped, i can not figure this out. I have tried everything from permissions to browsers. Could someone please help. I have also tried php version 4 & 5, both have problems. :(

I edited the view_job page to have a static record of say view_job?id=60, and it worked? but it doesnt work when linking off a main page.. PLZ HELP!

jatar_k

3:29 pm on May 15, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



it could be a register_globals [php.net] problem

in your script do you use $_GET['id'] at some point or do you just reference $id?

brodie_r

1:05 am on May 16, 2006 (gmt 0)

10+ Year Member



For you to understand my layout. I have a list jobs page, lists all the jobs and the job numbers. You then click on a job to view more details of it. This then goes to the view_job?id=

So my code on the view_job.php page to extract the id is:
$query ="SELECT * FROM jobs WHERE job_id='$id'";

And the code on the list_jobs.php page is:
<a href="view_job.php?id=<?php echo $job_id;?>"><img src="view.jpg" alt="View Job" width="12" height="16" border="0" /></a>

eelixduppy

1:08 am on May 16, 2006 (gmt 0)



try changing the query to:
$query ="SELECT * FROM jobs WHERE job_id='".$_GET['id']."'";

eelix

Steerpike

2:33 am on May 16, 2006 (gmt 0)

10+ Year Member




If you've just installed xampp have you created the associated database and populated it?

Is this the only php page that is failing that requires a mysql connection? If not it sounds like a connection issue.

eelixduppy

3:05 am on May 16, 2006 (gmt 0)



If it is a connection issue, adding error_reporting(E_ALL); at the top of the page will tell.

brodie_r

3:06 am on May 16, 2006 (gmt 0)

10+ Year Member



Nah the sql connection is fine as basic php pages of returning results work, only when using the $id it failed.

Anyways i got it working, thanks for all your help.

It was the register globals, it is now turned off by default.. Once it was on everything worked fine.

Thank you :)