Jump to content

[SOLVED] Submit Problem


SkyRanger

Recommended Posts

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.