What is wrong with this php code?

Status
Not open for further replies.

Sridhar_Rao

In the zone
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:
<?
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.
 

furious_gamer

Excessive happiness
^^ 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.
 

victor_rambo

हॉर्न ओके प्लीज़
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:
OP
Sridhar_Rao

Sridhar_Rao

In the zone
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.:p

I was looking for you, victor_rambo; are you rohan shenoy by any chance?
 

Dhanushkodi

Right off the assembly line
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
 
Status
Not open for further replies.
Top Bottom