Professional Web Applications Themes

Login and New User Problems - Macromedia Dynamic HTML

I'm using php for my website and I add in the insert record and then check new user to a page. Then when I go check the page in my web browser it comes up blank. I'm getting the same problem with my page that I added the login to. I've rebuilt both of these pages, atleast ten times each, in any attempt to see if I was doing something wrong. Anyone have any idea what I'm doing wrong? (Which wouldn't surprise me, I'm new to php....:o )...

  1. #1

    Default Login and New User Problems

    I'm using php for my website and I add in the insert record and then check new
    user to a page. Then when I go check the page in my web browser it comes up
    blank. I'm getting the same problem with my page that I added the login to.
    I've rebuilt both of these pages, atleast ten times each, in any attempt to see
    if I was doing something wrong. Anyone have any idea what I'm doing wrong?
    (Which wouldn't surprise me, I'm new to php....:o )

    Lynx Blade Guest

  2. #2

    Default Re: Login and New User Problems

    Can you send a link to both pages? Better yet, attach the code. Thanks.
    thlokey Guest

  3. #3

    Default Re: Login and New User Problems

    Here is the code for the new user

    <?php require_once('../Connections/MySQL.php'); ?>
    <?php
    // *** Redirect if username exists
    $MM_flag="MM_insert";
    if (isset($_POST[$MM_flag])) {
    $MM_dupKeyRedirect="/arcadia/Ranking/ranking system.php";
    $loginUsername = $_POST['username'];
    $LoginRS__query = "SELECT username FROM userinfo WHERE username='" .
    $loginUsername . "'";
    mysql_select_db($database_MySQL, $MySQL);
    $LoginRS=mysql_query($LoginRS__query, $MySQL) or die(mysql_error());
    $loginFoundUser = mysql_num_rows($LoginRS);

    //if there is a row in the database, the username was found - can not add
    the requested username
    if($loginFoundUser){
    $MM_qsChar = "?";
    //append the username to the redirect page
    if (substr_count($MM_dupKeyRedirect,"?") >=1) $MM_qsChar = "&";
    $MM_dupKeyRedirect = $MM_dupKeyRedirect . $MM_qsChar
    .."requsername=".$loginUsername;
    header ("Location: $MM_dupKeyRedirect");
    exit;
    }
    }

    function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
    $theNotDefinedValue = "")
    {
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

    switch ($theType) {
    case "text":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
    break;
    case "long":
    case "int":
    $theValue = ($theValue != "") ? intval($theValue) : "NULL";
    break;
    case "double":
    $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" :
    "NULL";
    break;
    case "date":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
    break;
    case "defined":
    $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
    break;
    }
    return $theValue;
    }

    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
    $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }

    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
    $insertSQL = sprintf("INSERT INTO userinfo (username, password, fullname,
    accesslevel, age, gender, states, town, joined, lastadvancement, minorrank,
    majorrank, blackstar, tacticallevel, honorables, disciple, mentor, events,
    inbox, syal) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
    %s, %s, %s, %s, %s, %s)",
    GetSQLValueString($_POST['username'], "text"),
    GetSQLValueString($_POST['password'], "text"),
    GetSQLValueString($_POST['fullname'], "text"),
    GetSQLValueString($_POST['accesslevel'], "text"),
    GetSQLValueString($_POST['age'], "int"),
    GetSQLValueString($_POST['gender'], "text"),
    GetSQLValueString($_POST['states'], "text"),
    GetSQLValueString($_POST['town'], "text"),
    GetSQLValueString($_POST['joined'], "date"),
    GetSQLValueString($_POST['lastadvancement'], "date"),
    GetSQLValueString($_POST['minorrank'], "text"),
    GetSQLValueString($_POST['majorrank'], "text"),
    GetSQLValueString($_POST['blackstar'], "int"),
    GetSQLValueString($_POST['tacticallevel'], "int"),
    GetSQLValueString($_POST['honorables'], "int"),
    GetSQLValueString($_POST['disciple'], "text"),
    GetSQLValueString($_POST['mentor'], "text"),
    GetSQLValueString($_POST['events'], "int"),
    GetSQLValueString($_POST['inbox'], "int"),
    GetSQLValueString($_POST['syal'], "int"));

    mysql_select_db($database_MySQL, $MySQL);
    $Result1 = mysql_query($insertSQL, $MySQL) or die(mysql_error());

    $insertGoTo = "/arcadia/index.php";
    if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
    }
    header(sprintf("Location: %s", $insertGoTo));
    }
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; cht=iso-8859-1">
    <title>New User</title>
    </head>

    <body><table width="800" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td height="150" bgcolor="#FFFFFF"><img
    src="http://www.kervana.com/arcadia/Pictures/Layout/tsg1.png" width="800"
    height="100"></td>
    </tr>
    <tr>
    <td valign="top"><table width="800" border="0" cellspacing="0"
    cellpadding="0">
    <tr valign="top">
    <td width="125" height="600" valign="top" bgcolor="#FFFFFF"><table
    width="125" height="600" border="2" cellpadding="0" cellspacing="0">
    <tr>
    <td><object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
    rsion=6,0,29,0" width="125" height="600">
    <param name="movie"
    value="/arcadia/Pictures/leftnavbar2.swf">
    <param name="quality" value="high">
    <embed src="/arcadia/Pictures/leftnavbar2.swf"
    quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
    type="application/x-shockwave-flash" width="125" height="600"></embed>
    </object></td>
    </tr>
    </table></td>
    <td><table width="675" border="1" cellpadding="0" cellspacing="0"
    bordercolor="#000000">
    <tr>
    <td height="50">&nbsp;</td>
    </tr>
    </table>

    <table width="675" height="65" border="1" cellpadding="0"
    cellspacing="0">
    <tr>
    <td>Add a new user account, all fields are required </td>
    </tr>
    </table>
    <form action="<?php echo $editFormAction; ?>" method="POST"
    enctype="multipart/form-data" name="form1">
    <table width="675" height="900" border="1" cellpadding="0"
    cellspacing="0">
    <tr>
    <td width="350">Username</td>
    <td><input name="username" type="text" id="username"></td>
    </tr>
    <tr>
    <td width="350">Password</td>
    <td><input name="password" type="password" id="password"></td>
    </tr>
    <tr>
    <td width="350">Fullname</td>
    <td><input name="fullname" type="text" id="fullname"></td>
    </tr>
    <tr>
    <td width="350">Age</td>
    <td><input name="age" type="text" id="age" maxlength="3"></td>
    </tr>
    <tr>
    <td width="350">Gender</td>
    <td><select name="gender" id="gender">
    <option>Select One Gender</option>
    <option value="male">Male</option>
    <option value="female">Female</option>
    </select></td>
    </tr>
    <tr>
    <td width="350">State</td>
    <td><select name="states" id="states">
    <option value="Alabama">Alabama</option>
    <option value="Alaska">Alaska</option>
    <option value="Arizona">Arizona</option>
    <option value="Arkansas">Arkansas</option>
    <option value="California">California</option>
    <option value="Colorado">Colorado</option>
    <option value="Connecticut">Connecticut</option>
    <option value="Delaware">Delaware</option>
    <option value="District of Columbia">District of
    Columbia</option>
    <option value="Florida">Florida</option>
    <option value="Georgia">Georgia</option>
    <option value="Hawaii">Hawaii</option>
    <option value="Idaho">Idaho</option>
    <option value="Illinois">Illinois</option>
    <option value="Indiana">Indiana</option>
    <option value="Iowa">Iowa</option>
    <option value="Kansas">Kansas</option>
    <option value="Kentucky">Kentucky</option>
    <option value="Louisiana">Louisiana</option>
    <option value="Maine">Maine</option>
    <option value="Maryland">Maryland</option>
    <option value="Massachusetts">Massachusetts</option>
    <option value="Michigan">Michigan</option>
    <option value="Minnesota">Minnesota</option>
    <option value="Mississippi">Mississippi</option>
    <option value="Missouri">Missouri</option>
    <option value="Montana">Montana</option>
    <option value="Nebraska">Nebraska</option>
    <option value="Nevada">Nevada</option>
    <option value="New Hampshire">New Hampshire</option>
    <option value="New Jersey">New Jersey</option>
    <option value="New Mexico">New Mexico</option>
    <option value="New York">New York</option>
    <option value="North Carolina">North Carolina</option>
    <option value="North Dakota">North Dakota</option>
    <option value="Ohio">Ohio</option>
    <option value="Oklahoma">Oklahoma</option>
    <option value="Oregon">Oregon</option>
    <option value="Pennsylvania">Pennsylvania</option>
    <option value="Rhode Island">Rhode Island</option>
    <option value="South Carolina">South Carolina</option>
    <option value="South Dakota">South Dakota</option>
    <option value="Tennessee">Tennessee
    Lynx Blade Guest

Similar Threads

  1. User Login Problems
    By chieffan in forum Coldfusion - Getting Started
    Replies: 0
    Last Post: July 21st, 02:30 PM
  2. Login User from Novell Login
    By Mattastic in forum Coldfusion - Getting Started
    Replies: 0
    Last Post: June 7th, 03:16 PM
  3. user and admin login on same login page
    By davellaman in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: May 16th, 07:47 PM
  4. Replies: 0
    Last Post: July 9th, 11:13 PM
  5. Replies: 1
    Last Post: July 2nd, 03:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139