Jump to content

Recommended Posts

i have done this a million times over and i cant seem to figure out why this is not working at alll

 

what problem i am having is on the regadd.php i can echo out all the user input but it wont update the database or redirect to profile.php

 

i have over look this a million times and just cant seem to pinpoint what the problem is.

 

 

This is signup.php?action=register

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>NeaNix.TV PODCAST YOUR LIFE!</title>
<style type="text/css" >
.border
{
border-style: solid;
border-width: 2px;
border-color: #999999;
}

body {
background-color: #000000;

color: #0099FF;
}
-->
input
{
background-image: url("http://www.phpbb-space.com/NeaNixtv/img/main.png");

color: #000000;
font-size: 75%;

border-style: solid;
border-width: 1px;
border-color: #FFFFFF;
}
.chatinput
{
background-image: url(img/main.png);
color: #0099FF;
font-size: 75%;
width: 100px;
border-style: solid;
border-width: 1px;
border-color: #FFFFFF;
}

.chatinputsubmit
{
background-color: #000000;

color: #0099FF;
font-size: 75%;
width: 100px;
border-style: solid;
border-width: 1px;
border-color: #FFFFFF;
}

textarea
{
background-color: #000000;

color: #0099FF;

border-style: solid;
border-width: 1px;
border-color: #FFFFFF;
}
A:link
{
text-decoration: underline; color: black;
}

A:visited
{
text-decoration: underline; color: #1DA2FF;
}

A:active
{
text-decoration: underline; color: #1DA2FF;
}

A:hover
{
text-decoration: underline; color: #1DA2FF;
}

td
{
color: #;

text-align: left;
}

td.options
{
text-align: right;
}

td.cat
{
width: 100%;
background-color: #222222;

color: #FFFFFF;

border-style: solid;
border-width: 1px;
border-color: #0099FF;
}

td.post
{
background-color: #222222;

color: #FFFFFF;

border-style: solid;
border-width: 1px;
border-color: #AAAA00;
}

.playerbox
{

border-color: #000000;
}

td.error
{
width: 100%;
background-color: #222222;

color: #0099FF;

border-style: solid;
border-width: 1px;
border-color: #AAAA00;

text-align: center;
}

td.moderator
{
border-style: solid;
border-width: 2px;
border-color: #FF0000;
}

td.quote_header
{
background-color: #FFFFAA;
color: #000000
}

td.quote
{
background-color: #444444;
color: #FFFFFF;
}



table.quote_border
{
border-style: solid:
border-width: 1px;
border-color: #99FF99;
}


.style2 {font-size: 9px}

</style>
</head>

<body background="img/background.png">
<center>
<table width="998" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <!--DWLayoutTable-->
  <tr>
    <td height="50" colspan="10" valign="top"><a href="index.php?"><img src="img/nav.png" border="0" /></a></td>
  </tr>
  <tr>
    <td colspan="2" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="128" height="38"><a href="broadcast.php?"><img src="http://www.phpbb-space.com/NeaNixtv/img/broad.png" border="0"></a></td>
      </tr>
    </table>    </td>
    <td width="121" height="23" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="115" height="20"><div align="center">Welcome</div></td>
      </tr>
    </table>    </td>
    <td colspan="7" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="755" height="20"><a href="signup.php?"><img src="img/signup.png" border="0"/></a>  <a href="Browse.php"><img src="img/browse.png" border="0"/></a>  <a href="profile.php?"><img src="img/profile.png" border="0"/></a>  <a href="account.php?"><img src="img/account.png" border="0" /></a>  <a href="main_forum.php?"><img src="img/forums.png" border="0" /></a> </td>
      </tr>
    </table>    </td>
  </tr>
  <tr>
    <td height="21" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="115" height="21" valign="top"><center>

	<?
	if($_SESSION['myusername'] == '' )
	{ echo "Guest"; } else { echo $_SEESION['myusername']; }
	?>
							 </center></td>
      </tr>
    </table>    </td>
    <td width="172"> </td>
    <td width="4"> </td>
    <td width="39"> </td>
    <td width="253"> </td>
    <td width="29"> </td>
    <td width="234"> </td>
    <td width="17"> </td>
  </tr>
  <tr>
    <td width="46" height="14"></td>
    <td width="86"></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="23"></td>
    <td colspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="6" height="23" valign="top"><img src="http://www.phpbb-space.com/NeaNixtv/img/mainleft.png" /></td>
            <td width="367" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
              <!--DWLayoutTable-->
              <tr>
                <td width="367" height="23" valign="top" background="http://www.phpbb-space.com/NeaNixtv/img/main.png"><center>
                  <Strong>User Video</Strong>
                  </center></td>
                </tr>
            </table></td>
            <td width="7" valign="top"><img src="http://www.phpbb-space.com/NeaNixtv/img/mainright.png" /></td>
          </tr>
    </table></td>
    <td> </td>
    <td> </td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="6" height="23" valign="top"><img src="http://www.phpbb-space.com/NeaNixtv/img/mainleft.png" /></td>
        <td width="236" valign="top" background="http://www.phpbb-space.com/NeaNixtv/img/main.png"><div align="center"><Strong>Random Streams</Strong></div></td>
        <td width="6" valign="top"><img src="http://www.phpbb-space.com/NeaNixtv/img/mainright.png" /></td>
      </tr>
    </table></td>
    <td> </td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="6" height="23" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="6" height="23"><img src="http://www.phpbb-space.com/NeaNixtv/img/mainleft.png" /></td>
                </tr>
          </table></td>
            <td width="218" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                <!--DWLayoutTable-->
                <tr>
                  <td width="218" height="23" background="http://www.phpbb-space.com/NeaNixtv/img/main.png"><center><Strong>Sign up</Strong></center></td>
                </tr>
            </table></td>
            <td width="9" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                <!--DWLayoutTable-->
                <tr>
                  <td width="7" height="23" valign="top"><img src="http://www.phpbb-space.com/NeaNixtv/img/mainright.png" /></td>
                </tr>
            </table></td>
          </tr>
    </table></td>
    <td></td>
  </tr>
  <tr>
    <td height="119"></td>
    <td colspan="3" rowspan="5" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
      <!--DWLayoutTable-->
      <tr>
        <td width="378" height="312" valign="top" class="border"><center>
         <object width="351" height="284">
  <param name="movie" value="Player.swf">
  <embed src="player.swf"  type="application/x-shockwave-flash" height="284" width="351"> </embed>
  </object> <br />Views: 0 | Online: No
        </center></td>
          </tr>
      
      
    </table></td>
    <td> </td>
    <td> </td>
    <td rowspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="253" height="237" valign="top" class="border">Random Streams Here        </td>
          </tr>
      
      
      
    </table></td>
    <td></td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="border">
      <!--DWLayoutTable-->
      <tr>
        <td width="230" height="98"><form method="post" action="regadd.php?action=register">
	<table width="175" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="61" height="19" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="61" height="22" valign="top">Username</td>
      </tr>
    </table>    </td>
    <td width="144" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="110" height="19"><input type="text" name="myusername"  /></td>
      </tr>
    </table>    </td>
  </tr>
  <tr>
    <td height="19" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="61" height="16">Password</td>
      </tr>
    </table>    </td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="144" height="19"><input type="password" name="mypassword"  /></td>
      </tr>
    </table>    </td>
  </tr>
  <tr>
    <td height="19" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="61" height="22" valign="top">Age</td>
      </tr>
    </table>    </td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="144" height="19"><input type="text" name="myage"  /></td>
      </tr>
    </table>    </td>
  </tr>
  <tr>
    <td height="19" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="61" height="17">Email</td>
      </tr>
    </table>    </td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="144" height="19"><input type="text" name="myemail" /></td>
      </tr>
    </table>    </td>
  </tr>
  <tr>
    <td height="25" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="205" height="25"><input type="hidden" name="myip" value="<? $_SERVER["REMOTE_ADDR"]; ?>" />
	<input type="hidden" name="mylevel" value="1" ? />
	<input type="submit" Value= "Sign up" name="submit"/></td>
      </tr>
    </table>
    </td>
  </tr>
</table>	
	</form>	</td>
      </tr>
      
    </table>    </td>
    <td></td>
  </tr>
  
  <tr>
    <td height="23"></td>
    <td> </td>
    <td> </td>
    <td></td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="234" height="23"><img src="img/footer.png" width="234" height="23" /></td>
        </tr>
    </table></td>
    <td></td>
  </tr>
  <tr>
    <td height="95"></td>
    <td> </td>
    <td> </td>
    <td></td>
    <td> </td>
    <td></td>
  </tr>
  <tr>
    <td height="23"></td>
    <td> </td>
    <td> </td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="253" height="23"><img src="img/footer.png" width="252" height="23" /></td>
        </tr>
    </table></td>
    <td></td>
    <td> </td>
    <td></td>
  </tr>
  <tr>
    <td height="52"></td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td></td>
    <td> </td>
    <td></td>
  </tr>
  <tr>
    <td height="19"></td>
    <td colspan="4" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="380" height="19" valign="top"><img src="img/footer.png" width="380" height="23" /></td>
          </tr>
      
    </table></td>
    <td> </td>
    <td> </td>
    <td></td>
    <td> </td>
    <td></td>
  </tr>
  <tr>
    <td height="166"></td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td></td>
    <td> </td>
    <td></td>
  </tr>
</table>

</center>
<center>
<table width="997" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="997" height="50" background="img/footer.png"><center>NeaNix Productions</center></td>
  </tr>
</table>
</center>
</body>
</html>

 

this is regadd.php?

 

<?
include("Data/connect.php");

$myusername = $_POST['myusername'];
$mypassword = $_POST['mypassword'];
$myemail = $_POST['myemail'];
$myage = $_POST['myage'];
if ($action == register) {

if (!$myusername || !$mypassword) {
header("location:signup.php?fill=YOU MUST FILL OUT ALL FIELDS!");

exit;
}
$sql=mysql_num_rows(mysql_query("SELECT * FROM members WHERE username='$myusername'"));

if ($sql > 0) {
header("location:signup.php?user=USERNAME TAKEN!");

exit;
}

//check if passwords are the same
if ($mypassword != $vpassword) {
header("location:signup.php?pass=PASSWORD DO NOT MATCH!");

exit;
}
//end
//insert
$sql =("INSERT INTO members (Username, Password, Email, IP, Age, Level, Views, ShowName) VALUES('$myusername','$mypassword', '$myemail', '$ip', '$myage', '9', '0', '$myusername')");
$result=mysql_query($sql);
header("location:profile.php");
}

?>

Link to comment
https://forums.phpfreaks.com/topic/118502-solved-i-have-done-this-a-million-times/
Share on other sites

Ok first of try not to code with short tags (<? ?> or <?= ?>). Always use full tags (<?php ?> or <?php echo ?>).

 

Secondly you really need to clean up your HTML. A lot of the code is redundant, I mean why create a new table within each table cell!

 

Last of all tell us whats the code supposed to do and explain what happens when you run it.

Well, for the begining do these steps:

 

1.) Put or die (mysql_error()); on the of your queries to see if something is wrong there

2.) Try to echo your queries to see if you are getting any results

3.) echo this variables to see if you're getting anything in them

$myusername = $_POST['myusername'];
$mypassword = $_POST['mypassword'];
$myemail = $_POST['myemail'];
$myage = $_POST['myage'];

yes i am getting the info from them

 

didnt think that <? ?> and <?php ?> was any diffrent

 

and the reason i have tables in tables is so that it dosnt expand if another tables gets bigger beside it or something i have that happen alot.

 

and explain its simple. wildteen.

 

user inputs data to sign up with username password age email etc... and goes to regadd.php and checks the info if the username and password is NOT there then it will add it to the database. well in this case it isnt working

~Thanks

didnt think that <? ?> and <?php ?> was any diffrentq

Short tags is not always enabled, that is why I suggested you to use full tags.

 

and explain its simple. wildteen.

 

user inputs data to sign up with username password age email etc... and goes to regadd.php and checks the info if the username and password is NOT there then it will add it to the database. well in this case it isnt working and for the record wildteen88 NOT a NOOB to php

Seeing as you didn't make the effort to explain that in your original post, I didn't bother reading your code fully.

 

I never mentioned anything about you being a NOOB.

 

i know i taught u were being some new asshole. then i seen ur godly power to the side and was like better change that.

 

sorry

 

yeah but i dont know why it isnt working i have fixed 1 error i had and that was i forgot to add the second password field.

 

im not gettign any mysql errors as well

 

 

 

 

[sOLVED!!!!!!]

 

ok so u know like the smallest things can mess up the whole earths rotation.. well in this case it messed up the solar system

 

$action = $_REQUEST['action'];

 

i forgot to add that

 

so this is what was happening

if ($action == register) {

that was never being ran.

so the rest of the code was never being executed

 

GAW i am a NOOB :(

A bit late:

 

As far as I know, the URLs/paths you're redirecting to are malformed. An URL can't have spaces; they must be encoded to %20. Not sure if it'll make your script work, though.

 

Also, please take wildteen's advice. At least when you're posting this rather huge mix of HTML/CSS/PHP. With full tags the PHP gets highlighted, you see 8)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.