Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 24-01-2009, 02:36 PM   #1 (permalink)
In The Zone
 
Sridhar_Rao's Avatar
 
Join Date: Feb 2007
Posts: 353
Default What is wrong with this php code?


Hello,
I had created a html page with form in it. I submit the page to say result.php

<form name="poll" action="result.php" method="post" >

For some reasons, nothing was showing up in result.php page. I have checked and confirmed that the form is submitting correct values as they were delivered to my email. The values were not being received well the php page. I found this script in the net which is supposed to help see if the form submission works correctly or not. I changed the line to:

<form name="poll" action="x.php" method="post" >

Here is the content of page x.php

PHP Code:
<?
session_start
();

echo 
"<b>PHP Errors:</b><br><br>";// Displays general PHP errors.

error_reporting(E_ALL);

echo 
"<br><br>**********<br><br>";// This section is for checking Session Vars.



echo "<b>Session Values:</b> <pre>";
print_r($_SESSION); 
echo 
"</pre>";

echo 
"<br><br>**********<br><br>";// This section is for checking form submissions.

        
echo "<b>Post Values:</b><br><br>";
while(list(
$key,$value) = each($HTTP_POST_VARS)) { 
        if(
is_array($value)) { 

            while(list(
$key2,$value2)=each($value)) { 
                echo 
"array $key$key2 -> $value2"
                echo 
"<br>";
            } 
        } else { 
            echo 
"$key -> $value"
            echo 
"<br>";
        } 
    }
?>
The page calling this www.microrao.com/opinion.htm. The page gets redirected to x.php but nothing shows up. While google chorme throws up totally blank page, Firefox shows the php script partially.

Please look into this and let me know what the problem is.
__________________
Want to study M.Sc in any medical subjects? Read this www.microrao.com/msc.htm
Microx, a diagnostic microbiology laboratory software application www.labmicrox.com
Sridhar_Rao is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 24-01-2009, 03:55 PM   #2 (permalink)
Right Off the Assembly Line
 
Join Date: Oct 2008
Posts: 2
Default Re: What is wrong with this php code?

Make the first line
<?php
instead of
<?
qprojects is offline  
Old 24-01-2009, 04:54 PM   #3 (permalink)
Excessive happiness
 
furious_gamer's Avatar
 
Join Date: Jun 2008
Location: Bangalore
Posts: 2,975
Default Re: What is wrong with this php code?

^^ No need to do so. That one is short tags and cause no problems. The problem lies with the Web Server. Are you sure your Web Server runs any other PHP pages.Please check that out too.
__________________
My First Android phone : Samsung Galaxy SL i9003 - Rooted & Gingerbread XXKPQ
Updated : superteekz_V2 ROM for XXKPQ.

PS Request
furious_gamer is online now  
Old 24-01-2009, 06:11 PM   #4 (permalink)
In The Zone
 
Sridhar_Rao's Avatar
 
Join Date: Feb 2007
Posts: 353
Default Re: What is wrong with this php code?

Yes, php on other page is working fine, take a look at this php page in my site; www.microrao.com/terror_poll.php

I seriously wonder what is causing the problem!
__________________
Want to study M.Sc in any medical subjects? Read this www.microrao.com/msc.htm
Microx, a diagnostic microbiology laboratory software application www.labmicrox.com
Sridhar_Rao is offline  
Old 24-01-2009, 08:03 PM   #5 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: What is wrong with this php code?

The action attribute of your form is wrong, its pointing to "opinion.php" and not "x.php".
If x.php is accessed directly through address bar, I do get what is expected.

If the script is shown partially(if it really does), then you must use PHP complete opening tags, else allow short tags!
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता

Last edited by victor_rambo; 24-01-2009 at 08:05 PM. Reason: Automerged Doublepost
victor_rambo is offline  
Old 24-01-2009, 08:12 PM   #6 (permalink)
In The Zone
 
Sridhar_Rao's Avatar
 
Join Date: Feb 2007
Posts: 353
Smile Re: What is wrong with this php code?

Thanks for your replies!

I have been trying like mad over the past few hours getting it right. In the process, I have been juggling and changing the lines and links. Sometimes it was x.php, or x2.php or opinion.php. I was modifying codes, adding little by little and tried to determine where exactly was the mistake.

While doing this troubleshooting I came across a simple flaw, I missed a "}" in several of the scripts. Even though error reporting was on, it never got displayed. I fixed it and it now works.

I was looking for you, victor_rambo; are you rohan shenoy by any chance?
__________________
Want to study M.Sc in any medical subjects? Read this www.microrao.com/msc.htm
Microx, a diagnostic microbiology laboratory software application www.labmicrox.com
Sridhar_Rao is offline  
Old 24-01-2009, 08:32 PM   #7 (permalink)
Alpha Geek
 
sachin_kothari's Avatar
 
Join Date: Dec 2004
Location: Pune
Posts: 569
Default Re: What is wrong with this php code?

^^ yup, he is.
sachin_kothari is offline  
Old 24-01-2009, 09:06 PM   #8 (permalink)
हॉर्न ओके प्लीज़
 
victor_rambo's Avatar
 
Join Date: Sep 2007
Posts: 1,493
Default Re: What is wrong with this php code?

ya, I am Rohan Shenoy
__________________
विक्टर रॅंबो - चाणकया प्रभावित व्यक्ति

गीक होना माँगता
victor_rambo is offline  
Old 29-01-2009, 02:47 PM   #9 (permalink)
Right Off the Assembly Line
 
Join Date: Jan 2009
Location: tamil nadu
Posts: 1
Default Re: What is wrong with this php code?

hi friends...

its me dhanush... a new comer to ur discussions.....

myself too using php in connection with AJAX.

i wish to use objects in php.....

but i didnt receive any o/p.....

can anyone help me......

thanks in advance
Dhanushkodi is offline  
Old 29-01-2009, 04:18 PM   #10 (permalink)
Excessive happiness
 
furious_gamer's Avatar
 
Join Date: Jun 2008
Location: Bangalore
Posts: 2,975
Default Re: What is wrong with this php code?

Why dont you put your code and what o/p you got here
__________________
My First Android phone : Samsung Galaxy SL i9003 - Rooted & Gingerbread XXKPQ
Updated : superteekz_V2 ROM for XXKPQ.

PS Request
furious_gamer is online now  
Closed Thread

Bookmarks

Thread Tools
Display Modes

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
Unable to insert record (what's wrong with php code) Sridhar_Rao Programming 3 05-12-2008 06:49 PM
Whats wrong with this C++ code? zegulas Programming 3 06-03-2008 07:17 PM
lock code..not security code magneticme200 Mobiles and Tablets 3 29-12-2007 07:15 PM
What's wrong with CPU-Z ? mohit CPU / Motherboards 2 11-04-2005 11:44 AM
What's wrong with the cd? callsriram QnA (read only) 14 09-11-2004 07:00 PM

 
Latest Threads
- by gforz
- by soumya
- by Sujeet
- by icebags
- by Charan

Advertisement




All times are GMT +5.5. The time now is 03:06 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2