SkyRanger Posted April 21, 2007 Share Posted April 21, 2007 I am having a major brain dump problem. here is what I have: include_once("config.php"); checkLoggedIn("no"); $title="My Site"; if(isset($_POST["submit"])) { field_validator("login name", $_POST["login"], "alphanumeric", 4, 15); field_validator("password", $_POST["password"], "string", 4, 15); if($messages){ doIndex(); exit; } if( !($row = checkPass($_POST["login"], $_POST["password"])) ) { $messages[]="Incorrect login/password, try again"; } if($messages){ doIndex(); exit; } cleanMemberSession($row["login"], $row["password"]); header("Location: members/office.php"); } else { doIndex(); } function doIndex() { global $messages; global $title; <html> <body> <?php if($messages) { displayErrors($messages); } ?> <form action="<?php print $_SERVER["PHP_SELF"]; ?>" method="POST"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="30"> <tr> <td width="54%" height="30" align="right" valign="middle"> <b> <font face="Verdana" size="1">Username: </font></b></td> <td width="17%" height="30"> <b> <input type="text" name="login" value="<?php print isset($_POST["login"]) ? $_POST["login"] : "" ; ?>" maxlength="15" size="19"></b></td> <td width="8%" height="30"> <p align="right"><b> <font face="Verdana" size="1">Password: </font></b></td> <td width="100%" height="30"> <b><input type="password" name="password" value="" maxlength="15" size="19"></b> <input type="image" src="images/loginnow.png" value="submit" alt="Submit" width="15" height="15" valign="middle"></td> </tr> </table></form> I am totally lost on why this is not submitting. Anybody have any ideas? Link to comment https://forums.phpfreaks.com/topic/48034-solved-submit-problem/ Share on other sites More sharing options...
ted_chou12 Posted April 21, 2007 Share Posted April 21, 2007 I dont believe you have used the php tags correctly: <?php include_once("config.php"); checkLoggedIn("no"); $title="My Site"; if(isset($_POST["submit"])) { field_validator("login name", $_POST["login"], "alphanumeric", 4, 15); field_validator("password", $_POST["password"], "string", 4, 15); if($messages){ doIndex(); exit; } if( !($row = checkPass($_POST["login"], $_POST["password"])) ) { $messages[]="Incorrect login/password, try again"; } if($messages){ doIndex(); exit; } cleanMemberSession($row["login"], $row["password"]); header("Location: members/office.php"); } else { doIndex(); } function doIndex() { global $messages; global $title; ?> <html> <body> <?php if($messages) { displayErrors($messages); } ?> <form action="<?php print $_SERVER["PHP_SELF"]; ?>" method="POST"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="30"> <tr> <td width="54%" height="30" align="right" valign="middle"> <b> <font face="Verdana" size="1">Username: </font></b></td> <td width="17%" height="30"> <b> <input type="text" name="login" value="<?php print isset($_POST["login"]) ? $_POST["login"] : "" ; ?>" maxlength="15" size="19"></b></td> <td width="8%" height="30"> <p align="right"><b> <font face="Verdana" size="1">Password: </font></b></td> <td width="100%" height="30"> <b><input type="password" name="password" value="" maxlength="15" size="19"></b> <input type="image" src="images/loginnow.png" value="submit" alt="Submit" width="15" height="15" valign="middle"></td> </tr> </table></form> Link to comment https://forums.phpfreaks.com/topic/48034-solved-submit-problem/#findComment-234792 Share on other sites More sharing options...
SkyRanger Posted April 21, 2007 Author Share Posted April 21, 2007 Yeah, that is what I have, just forgot to put the <?php at the top of my code post. Link to comment https://forums.phpfreaks.com/topic/48034-solved-submit-problem/#findComment-234810 Share on other sites More sharing options...
paul2463 Posted April 21, 2007 Share Posted April 21, 2007 from what I can see, you are missing a closing brace of the doIndex() function Link to comment https://forums.phpfreaks.com/topic/48034-solved-submit-problem/#findComment-234817 Share on other sites More sharing options...
SkyRanger Posted April 21, 2007 Author Share Posted April 21, 2007 Yeah that is there, or I would be getting a $_end error, which i could fix. This is driving me crazy. When I remove all of the HTML code it works no problem. When I stick it in the HTML it just refreshes the page without logging me in. Link to comment https://forums.phpfreaks.com/topic/48034-solved-submit-problem/#findComment-234831 Share on other sites More sharing options...
paul2463 Posted April 21, 2007 Share Posted April 21, 2007 is the HTML code a direct copy of your working page or are we going to correct all your typos from that part too??? Link to comment https://forums.phpfreaks.com/topic/48034-solved-submit-problem/#findComment-234837 Share on other sites More sharing options...
SkyRanger Posted April 21, 2007 Author Share Posted April 21, 2007 No it is not a direct copy, it is just the table where the form is sitting in, If I posted the whole code you would get lost in it because there is so much. Don't tell me I have typo's...lol because i will start beating my head off my keyboard for not noticing them...lol Checking code for typos, I have typed so much code in the past few days I wouldn't be surprised. Link to comment https://forums.phpfreaks.com/topic/48034-solved-submit-problem/#findComment-234840 Share on other sites More sharing options...
paul2463 Posted April 21, 2007 Share Posted April 21, 2007 you are mssing the name attribute from your submit image statement. try this <input type="image" src="images/loginnow.png" "value="submit" name="submit" alt="Submit" width="15" height="15" valign="middle"> without it if(isset($_POST["submit"])) { will never be set and will never work Link to comment https://forums.phpfreaks.com/topic/48034-solved-submit-problem/#findComment-234843 Share on other sites More sharing options...
SkyRanger Posted April 21, 2007 Author Share Posted April 21, 2007 omg, why I never seen that is beyond me. Thanks paul, that solved it. Link to comment https://forums.phpfreaks.com/topic/48034-solved-submit-problem/#findComment-234846 Share on other sites More sharing options...
SkyRanger Posted April 21, 2007 Author Share Posted April 21, 2007 Spoke too soon...lol, Works awesome if FF but not in IE. Link to comment https://forums.phpfreaks.com/topic/48034-solved-submit-problem/#findComment-234850 Share on other sites More sharing options...
paul2463 Posted April 21, 2007 Share Posted April 21, 2007 use the same image submit button code as above but change if(isset($_POST["submit"])) { to if(isset($_POST["submit_x"])) { //this is sent when an image submit button is pushed works both in FF and IE7 Link to comment https://forums.phpfreaks.com/topic/48034-solved-submit-problem/#findComment-234864 Share on other sites More sharing options...
SkyRanger Posted April 21, 2007 Author Share Posted April 21, 2007 woohoo, paul you are a life saver, now I can finally mark this topic as solved. Link to comment https://forums.phpfreaks.com/topic/48034-solved-submit-problem/#findComment-234867 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.