Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > PHP

Reply
 
LinkBack Thread Tools
Old October 6th, 2008, 06:28 AM   #1
New Member
 

Join Date: Sep 2007
Location: Rosebud
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 lockmac is on a distinguished road
works on my webserver, not another- cgi error

Hi guys. Just need some help- i did an assignment and it works perfectly on my php, iis and oracle install at home, but when i uploaded it to my schools webserver, some of the pages dont work, well i think they perform most of the database functions, but i then get the following:

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers.

Any one know why? Attached is the code for one of my pages.
BTW my tutor said its generally because i dont have the oci_free_statement and oci_close, but i do have these...

any help would be great thanks
Attached Files
File Type: php images.php (7.2 KB, 8 views)
lockmac is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old October 6th, 2008, 11:45 AM   #2
Aso
Most Reputable Member
 

Join Date: Oct 2007
Location: UK
Posts: 1,633
Blog Entries: 2
Thanks: 22
Thanked 84 Times in 79 Posts
Rep Altering Power: 0 Aso is on a distinguished road
Re: works on my webserver, not another- cgi error

The fact that it works on your development server does suggest it's a fault with your school's set-up.

I can't take a good look at the code right now (I need my syntax highlighter @ home!) but will do later
Aso is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old October 7th, 2008, 07:27 PM   #3
New Member
 

Join Date: Sep 2007
Location: Rosebud
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 lockmac is on a distinguished road
Re: works on my webserver, not another- cgi error

Am in need of urgent help! Its due on Friday and ive spent so long doing this and if doesnt work on their server ill get 0

majorly stressssing.


thanks guys
lockmac is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old October 8th, 2008, 06:38 AM   #4
Aso
Most Reputable Member
 

Join Date: Oct 2007
Location: UK
Posts: 1,633
Blog Entries: 2
Thanks: 22
Thanked 84 Times in 79 Posts
Rep Altering Power: 0 Aso is on a distinguished road
Re: works on my webserver, not another- cgi error

Everything looks OK- would be a little unsure about lines78/79;
Code:
            include("dbconnection.php");
            
$conn oci_connect($dbusername,$dbpassword,$dbservicename
If you're getting these values from dbconnection.php I would think they'd need to be declared global before you use them (better yet, use constants).

As I said before, the error message strongly hints that it is a server mis-configuration @ your school, since it runs fine at home.
Aso is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old October 8th, 2008, 07:14 AM   #5
New Member
 

Join Date: Sep 2007
Location: Rosebud
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 lockmac is on a distinguished road
Re: works on my webserver, not another- cgi error

Thanks for the reply mate. Figured out just before. Its because there are some $stmt variables in their (for connecting to oracle) which i hadnt closed off with oci_free_statement and oci_close.

Thanks for the help mate
lockmac is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old October 8th, 2008, 10:43 AM   #6
Aso
Most Reputable Member
 

Join Date: Oct 2007
Location: UK
Posts: 1,633
Blog Entries: 2
Thanks: 22
Thanked 84 Times in 79 Posts
Rep Altering Power: 0 Aso is on a distinguished road
Re: works on my webserver, not another- cgi error

Nice one! Glad ya fixed it
Aso is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old October 9th, 2008, 02:09 PM   #7
New Member
 

Join Date: May 2008
Location: Colorado
Age: 20
Posts: 29
Thanks: 0
Thanked 1 Time in 1 Post
Rep Altering Power: 0 luv2php is on a distinguished road
Re: works on my webserver, not another- cgi error

This really has nothing to do with your problem but I am just here to suggest it....

at the top of your "images.php" file, you have an if, else statement.

Code:
    if($_SESSION["loggedin"]==true)
    {
    }
    else
    {
    
header("location:login.php?login=fail&return=images.php");
    } 
when session_loggedin is true, it does nothing, making that if satement pretty much useless....
you should instead ask if it is NOT true, and redirect them if so in one single if like so:

Code:
    if(!$_SESSION["loggedin"])
    {
    
header("location:login.php?login=fail&return=images.php");
    } 
this one is asking if session_loggedin is FALSE, and if so, it will redirect, otherwise...it will move on. not really a big deal, but something you should try to practice.
luv2php is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Keep getting error message Microsoft VBScript runtime error '800a01a8' cpando1974 Classic ASP 2 August 7th, 2007 08:00 AM
Resetting webserver to default !!!!!! EnSComputers Your Design and Layout 3 April 23rd, 2007 08:25 AM
Webserver Question ugadawgvi Your Design and Layout 3 April 12th, 2007 07:51 AM


Search Engine Optimization by vBSEO 3.2.0 RC8