| | |
doesnt show anything
![]() |
•
•
Join Date: Sep 2007
Posts: 60
Reputation:
Solved Threads: 0
i am new to PHP. instead i learned the basic from w3schools and tizag. i'd created a registration form-like page using php tags, however when i uploaded to a php-based web hosting, i cant see anything..it juz show done in the browser status with blank page. Anyone kind enuf to check for me? much appreciate to those who help. Thanks.
PHP Syntax (Toggle Plain Text)
<?php $username = $_POST["name"]; $password = $_POST["password"]; $status = $_POST["status"]; $department = $_POST ["depart"]; $duemonth = $_POST ["due"]; $category = $_POST ["cate"]; $amount = $_POST ["amount"]; $specification = $_POST ["spec"]; if(!isset($_POST['submit'])){ ?> <html> <head> <title>::. CLAIM FORM</title> <link rel="stylesheet" type="text/css" href="my.css"> </head> <body> <br><br><br><br><br><br><br><br><br><br><br> <h1>Welcome to the claim page.</h1> <hr size=2 width=500px> <h1>Please fill in all the details as required. Incomplete data will not be considered.</h1> <div class="form-container"> <form method="post" action="<?php echo $PHP_SELF;?>"> <div><label>Name:<?php echo $_POST["name"];? ></label><br></div> <div><label for="type">Department:</label> <select name="depart"> <optgroup label="--- SELECT---"> <option>KKK</option> <option>KEE</option> <option>KPM</option> <option>KMP</option> <option>KKA</option> <option>KBP</option> <option>KAA</option> </optgroup> </select> </div> <div><label for="type">Due month:</label> <select name="due"> <optgroup label="--- SELECT---"> <option>JAN</option> <option>FEB</option> <option>MAC</option> <option>APR</option> <option>MAY</option> <option>JUN</option> <option>JUL</option> <option>AUG</option> <option>SEP</option> <option>OCT</option> <option>NOV</option> <option>DEC</option> </optgroup> </select> </div> <div><label for="type">Category:</label> <select name="cate"> <optgroup label="--- SELECT---"> <option>Faks</option> <option>Electricity</option> <option>Road tax</option> <option>Vehicle insurance</option> <option>Petrol</option> </optgroup> </select> </div> <div><label for="name">Amount:</label></div> <div><input type="text" name="amount" value="RM"></div> <div><label for="name">Specification:</label> <input type="text" name="spec" size="50"/></div> </form> <h1>Please upload the bill as we may process it as soon as possible. Thank You.</h1> <form enctype="multipart/form-data" action="uploader.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" > <h1>Choose a file to upload:</h1> <div><label><input name="uploadedfile" type="file" ><input type="submit" value="Upload File" ></label> </div></form> <br> <p class="submit"><input type="submit" value="Submit" ></p> </div> </body> </html> <? } else { <h1> Below is the infos you had submitted:</h1> echo "<h1>Department:</h1>" .$department.".<br/>"; echo "<h1>Due month:</h1>" .$duemonth.".<br/>"; echo "<h1>Category:</h1>" .$category.".<br/>"; echo "<h1>Amount:</h1>" .$amount.".<br/>"; echo "<h1>Specification:</h1>" .$specification.".<br/>";{ echo $f."<br />"; } } ?>
Last edited by evios; Mar 1st, 2008 at 10:09 am.
<div><label>Name:<?php echo $_POST["name"];? ></label><br></div> In this line, you have a whitespace after $_POST["name"];? here > It should have been like ?> .Turn on error reporting. It will help you identify your errors. If you have access to php.ini file, turn on display_errors. If you don't have access to php.ini file, then, put
php Syntax (Toggle Plain Text)
ini_set("display_errors","on"); error_reporting(E_ALL);
Cheers,
Naveen
Edit: More about error_reporting here .
Edit 2: And here is one more error. This line should be echo'ed as well.
<h1> Below is the infos you had submitted:</h1> Should have been echo "<h1> Below is the infos you had submitted:</h1>"; Edit 3:
{
echo $f."<br />";
} Last edited by nav33n; Mar 1st, 2008 at 10:27 am.
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
php Syntax (Toggle Plain Text)
<?php ini_set("display_errors","on"); error_reporting(E_ALL); $username = $_POST["name"]; $password = $_POST["password"]; $status = $_POST["status"]; $department = $_POST ["depart"]; $duemonth = $_POST ["due"]; $category = $_POST ["cate"]; $amount = $_POST ["amount"]; $specification = $_POST ["spec"]; if(!isset($_POST['submit'])){ ?> <html> <head> <title>::. CLAIM FORM</title> <link rel="stylesheet" type="text/css" href="my.css"> </head> <body> <br><br><br><br><br><br><br><br><br><br><br> <h1>Welcome to the claim page.</h1> <hr size=2 width=500px> <h1>Please fill in all the details as required. Incomplete data will not be considered.</h1> <div class="form-container"> <form method="post" action="<?php echo $PHP_SELF;?>"> <div><label>Name:<?php echo $_POST["name"];?></label><br></div> <div><label for="type">Department:</label> <select name="depart"> <optgroup label="--- SELECT---"> <option>KKK</option> <option>KEE</option> <option>KPM</option> <option>KMP</option> <option>KKA</option> <option>KBP</option> <option>KAA</option> </optgroup> </select> </div> <div><label for="type">Due month:</label> <select name="due"> <optgroup label="--- SELECT---"> <option>JAN</option> <option>FEB</option> <option>MAC</option> <option>APR</option> <option>MAY</option> <option>JUN</option> <option>JUL</option> <option>AUG</option> <option>SEP</option> <option>OCT</option> <option>NOV</option> <option>DEC</option> </optgroup> </select> </div> <div><label for="type">Category:</label> <select name="cate"> <optgroup label="--- SELECT---"> <option>Faks</option> <option>Electricity</option> <option>Road tax</option> <option>Vehicle insurance</option> <option>Petrol</option> </optgroup> </select> </div> <div><label for="name">Amount:</label></div> <div><input type="text" name="amount" value="RM"></div> <div><label for="name">Specification:</label> <input type="text" name="spec" size="50"/></div> </form> <h1>Please upload the bill as we may process it as soon as possible. Thank You.</h1> <form enctype="multipart/form-data" action="uploader.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" > <h1>Choose a file to upload:</h1> <div><label><input name="uploadedfile" type="file" ><input type="submit" value="Upload File" ></label> </div></form> <br> <p class="submit"><input type="submit" value="Submit" ></p> </div> </body> </html> <? } else { echo "<h1> Below is the infos you had submitted:</h1>"; echo "<h1>Department:</h1>" .$department.".<br/>"; echo "<h1>Due month:</h1>" .$duemonth.".<br/>"; echo "<h1>Category:</h1>" .$category.".<br/>"; echo "<h1>Amount:</h1>" .$amount.".<br/>"; echo "<h1>Specification:</h1>" .$specification.".<br/>"; echo $f."<br />"; } ?>
Check this and compare it with your script. Oh, btw, you can ignore notices(if you get any!).
Last edited by nav33n; Mar 1st, 2008 at 10:37 am.
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Sep 2007
Posts: 60
Reputation:
Solved Threads: 0
by the way, i created a login page, the submit button action is linked to welcome.php which shows the username on it. In this welcome.php also i created a link to the page where the codes shown above. However the username cant be shown at this page.
Look at this:
which is within form margin. Is there any problem with this as well?
Look at this:
PHP Syntax (Toggle Plain Text)
<div><label>Name:<?php echo $_POST["name"];?></label><br></div>
![]() |
Similar Threads
- installed games dont show up in registry (Windows NT / 2000 / XP)
- CD drive dnt show up (Storage)
- page doesnt load in opera and warning to IE users doesnt show help please? (PHP)
- help my cd drive doesnt read (C)
- IE won't let site show pictures. (Web Browsers)
- scanner wont show any scanned image/text (Troubleshooting Dead Machines)
- never taught how to show the VAT of a total. I know that u divide by 1.175 (Visual Basic 4 / 5 / 6)
- Windows Xp problem (Windows NT / 2000 / XP)
- windows xp startup (Windows NT / 2000 / XP)
Other Threads in the PHP Forum
- Previous Thread: PHP - sending data via hyperlink
- Next Thread: array
Views: 522 | Replies: 9
| Thread Tools | Search this Thread |
Tag cloud for PHP
access ajax apache api array auto box broken buttons cakephp cart check checkbox class classes cms code cookies database date development directory display download dropdown dropdownlist drupal dynamic echo email error file files folder form forms function functions header href htaccess html image images include insert ip java javascript joomla jquery limit link login loop mail menu mlm mod_rewrite multiple mysql order parse password paypal php problem query radio redirect regex remote rows script search security select server session soap sort sorting source sql string structure syntax table unicode update upload url user validation variable video web website wordpress xml







You are welcome!