Jump to content

TheFreak

Members
  • Posts

    39
  • Joined

  • Last visited

    Never

About TheFreak

  • Birthday 10/31/1987

Contact Methods

  • Website URL
    http://howimetyourmother.info/

Profile Information

  • Gender
    Male

TheFreak's Achievements

Member

Member (2/5)

0

Reputation

  1. I changed the code a bit and it worked,even though its the same :/ if ($check2 != 0) { print "<br>UserName Already present,please choose another."; ?> <META http-equiv="refresh" content="0;URL=registration.php"> <?php } else { $sql ="INSERT INTO users (username, password, email, address, city, pcode, memplan) VALUES ('$username', '$password', '$email', '$address', '$city', '$pcode', '$memplan')"; $sql1= mysql_query($sql) or die("Could not get user address"); print " <br>User added,Thankyou"; $_SESSION['username'] = $username; ?> <META http-equiv="refresh" content="0;URL=index.php"> <?php }
  2. Here is my code,first i am getting a warning PHP Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent in C:\Documents and Settings\Freak\Desktop\Mainsite\registration.php on line 2 PHP Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent in C:\Documents and Settings\Freak\Desktop\Mainsite\registration.php on line 2 Second i am getting redirected to registration.php even though user is not present already in database.It should only redirect when user is already present. My Code <?php session_start(); include 'connect.php'; include 'functions.php'; ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="style.css" type="text/css" /> </head> <body> <span style="text-align: left; color: #941515; font-family:Verdana,Helvetica,Arial,sans-serif; font-size:13px; position: absolute; top:1%; left:250px;"><?php include 'memmenu.php'; ?></span> <span style="text-align: left; color: #941515; font-family:Verdana,Helvetica,Arial,sans-serif; font-size:13px; position: absolute; top:3%; left:710px;"><a href="">HOME</a> | <a href="">MEMBERSHIP PLANS</a> | <a href="">STORES</a> | <a href="">CARE</a></span> <table> <tr> <td> <span style="position: relative; margin-left: 42px ; "> <img src="images/logo.gif" width="189" height="74"/> </span> </td> <td> <div class="searchmain"> <div class="searchtext"> SEARCH </div> <select class="searchside"><option>All</option><option>Director</option><option>Genre</option><option>Producer</option></select> <div> <form> <input name="login" type="text" class="searchinner" /> </form> </div> <div class="searchside"> </div> </div> </td> </tr> </table> <div align="center" class="regcont"> <div> <ul class="top blue"> <li><a href="index.php" title="">MOVIES</a></li> <li><a href="common.php" title="">TELEVISION</a></li> <li><a href="documentary.php" title="" >DOCUMENTRIES</a></li> <li><a href="plays.php" title="">PLAYS</a></li> <li><a href="kids.php" title="">KIDS</a></li> <li><a href="videos.php" title="">VIDEOS</a></li> <li><a href="stores.php" title="">STORES</a></li> </ul> </div> <div class="regbox"> <?php if(isset($_POST['submit'])) { $username= clean($_POST['username']); $password= clean($_POST['password']); $email= clean($_POST['email']); $address= clean($_POST['address']); $fname= clean($_POST['fname']); $lname= clean($_POST['lname']); $pcode= clean($_POST['pcode']); $memplan= $_POST['memplan']; $password= md5($password); $check2 = 0; $check="SELECT * FROM users WHERE username = '$username'"; $check1=mysql_query($check) or die("Could not get category address"); $check2 = mysql_num_rows($check1); if ($check2 != 0) { print "<br>UserName Already present,please choose another."; print "<META http-equiv='refresh' content='0;URL='registration.php'>" ; } else { $sql ="INSERT INTO users (username, password, email, address, city, pcode, memplan) VALUES ('$username', '$password', '$email', '$address', '$city', '$pcode', '$memplan')"; $sql1= mysql_query($sql) or die("Could not get user address"); print " <br>User added,Thankyou"; $_SESSION['username'] = $username; print "<meta http-equiv='refresh' content='0;url=index.php'>" ; } print "</td></tr></table>"; } else { print "<br><br><h3>REGISTRATION</h3><br>"; ?> <form id="Form" name="Form" method="POST" action=""> <table width="300" border="0" align="center" cellpadding="2" cellspacing="0"> <tr> <td width="112"><b><br><h5>UserName</h5></b></td> <td width="188"><br><input name="username" type="text" class="textfield" id="username" /></td> </tr> <tr> <td width="112"><b><br><h5>Password</h5></b></td> <td width="188"><br><input name="password" type="text" class="textfield" id="password" /></td> </tr> <tr> <tr> <td width="112"><b><br><h5>Email</h5></b></td> <td width="188"><br><input name="email" type="text" class="textfield" id="email" /></td> </tr> <tr> <td width="112"><b><br><h5>Address</h5></b></td> <td width="188"><br><input name="address" type="text" class="textfield" id="address" /></td> </tr> <tr> <td width="112"><b><br><h5>City</h5></b></td> <td width="188"><br><input name="city" type="text" class="textfield" id="city" /></td> </tr> <tr> <td width="112"><b><br><h5>Pin Code</h5></b></td> <td width="188"><br><input name="pcode" type="text" class="textfield" id="pcode" /></td> </tr> <tr> <td width="112"><b><br><h5>Plan</h5></b></td> <td width="188"><br><select name="memplan" class="textfield"><option name="memplan" value="Platimun">Platinum</option><option name="memplan" value="Gold">Gold</option><option name="memplan" value="Silver">Silver</option></td> </tr> <td> </td> <td><br><input type="submit" name="submit" value="submit" /></td> </tr> </table> </form> <?php } ?> </div> </div> <p> <a href="http://jigsaw.w3.org/css-validator/check/referer"> <img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /> </a> </p> </body> </html>
  3. I want to use this CSS code to make the typing space for my search bar i.e for 'form' tag,though i dont know what to use as a html code ? .searchinner { border:1px; border-style: solid; width: 200px; height: 15px; position: relative; top: -8%; left: 15%; }
  4. I am trying to shift my "maincont" and everything in the center,but for some reason it wont,even if i used align.Heres my code. HTML: <body> <div align="center" class="maincont"> <div id="menucontainer" > <div id="menunav" > <ul> <li><a href="" title="css website navigation menus" class="current"><span>Movies</span></a></li> <li><a href="" title="css website navigation menus"><span>Television</span></a></li> <li><a href="" title="css website navigation menus"><span>Documentries</span></a></li> <li><a href="" title="css website navigation menus"><span>Plays</span></a></li> <li><a href="" title="css website navigation menus"><span>Kids</span></a></li> <li><a href="" title="css website navigation menus"><span>Videos</span></a></li> <li><a href="" title="css website navigation menus"><span>Stores</span></a></li> </ul> </div> </div> </div> </body> CSS: *{ list-style:none; } #menucontainer{ position:relative; height:50px; color:#FFFFFF; background:#383636; width:100%; font-family:Helvetica,Arial,Verdana,sans-serif; } #menunav{ position:relative; height:38px; font-size:12px; text-transform:uppercase; font-weight:bold; background:#fff url(images/background.jpg) repeat-x bottom left; padding:0 0 0 20px;} #menunav ul{ margin:0; padding:0; list-style-type:none; width:auto; float:left;} #menunav ul li{ display:block; float:left; margin:0 1px;} #menunav ul li a{ display:block; float:left; color:#EAF3F8; text-decoration:none; padding:0 0 0 20px; height:38px;} #menunav ul li a span{ padding:12px 20px 0 0; height:21px; float:left;} #menunav ul li a:hover{ color:#fff; background:transparent url(images/hover.jpg) repeat-x bottom left;} #menunav ul li a:hover span{ display:block; width:auto; cursor:pointer;} #menunav ul li a.current, #menunav ul li a.current:hover{ color:#fff; background:#1D6893 url(images/left.jpg) no-repeat top left; line-height:275%;} #menunav ul li a.current span{ display:block; padding:0 20px 0 0; width:auto; background:#383636 url(images/right.jpg) no-repeat top right; height:38px;} .maincont { border-style: solid; align:center; border-width: 1px; width: 900px; height: 900px }
  5. Well its again going to the first else i.e showing the search username field Here is my changed code if(isset($_POST['submit'])) { $username= clean($_POST['username']); $check="SELECT * FROM users WHERE username = '$username'"; $check1=mysql_query($check) or die("Could not get category address"); $check2 = mysql_num_rows($check1); if ($check2 == 0) { print "<br>UserName not present,please choose another."; } elseif(isset($_POST['edit'])) { print $username; } else { print "<br><br>Please fill in the details to add a user.<br>"; ?> <form id="Form" name="Form" method="POST" action=""> <table width="300" border="0" align="center" cellpadding="2" cellspacing="0"> <tr> <td width="112"><b><br>UserName</b></td> <td width="188"><br><input name="username" type="text" class="textfield" id="username" /></td> </tr> <tr> <td width="112"><b><br>Password</b></td> <td width="188"><br><input name="password" type="text" class="textfield" id="password" /></td> </tr> <td> </td> <td><br><input type="submit" name="edit" value="Edit" /></td> </tr> </table> </form> <?php print "</td></tr></table>"; } } else { ?> <form id="Form" name="Form" method="POST" action=""> <table width="300" border="0" align="center" cellpadding="2" cellspacing="0"> <tr> <td width="112"><b><br>UserName</b></td> <td width="188"><br><input name="username" type="text" class="textfield" id="username" /></td> </tr> <td> </td> <td><br><input type="submit" name="submit" value="submit" /></td> </tr> </table> </form> <?php } ?>
  6. But i want to update the user details in the second if
  7. I am trying to edit the details of a user present in a database by searching his username in the database first (my first If - Else condition,if i dont find the username in the database fine,else onto my second nested if - else) and then editing it.When i input a username and it finds it in the database it gives me option to edit it,but when i press "Edit" it again reaches to the search username form,instead of printing the username.Please help if(isset($_POST['submit'])) { $username= clean($_POST['username']); $check="SELECT * FROM users WHERE username = '$username'"; $check1=mysql_query($check) or die("Could not get category address"); $check2 = mysql_num_rows($check1); if ($check2 == 0) { print "<br>UserName not present,please choose another."; } else { if(isset($_POST['edit'])) { print $username; //This is just to check if the output is right or not,ill put UPDATE sql query here. } else { print "<br><br>Please fill in the details to add a user.<br>"; ?> <form id="Form" name="Form" method="POST" action=""> <table width="300" border="0" align="center" cellpadding="2" cellspacing="0"> <tr> <td width="112"><b><br>UserName</b></td> <td width="188"><br><input name="username" type="text" class="textfield" id="username" /></td> </tr> <tr> <td width="112"><b><br>Password</b></td> <td width="188"><br><input name="password" type="text" class="textfield" id="password" /></td> </tr> <tr> <tr> <td width="112"><b><br>Email</b></td> <td width="188"><br><input name="email" type="text" class="textfield" id="email" /></td> </tr> <td> </td> <td><br><input type="submit" name="edit" value="Edit" /></td> </tr> </table> </form> <?php print "</td></tr></table>"; } } } else { ?> <form id="Form" name="Form" method="POST" action=""> <table width="300" border="0" align="center" cellpadding="2" cellspacing="0"> <tr> <td width="112"><b><br>UserName</b></td> <td width="188"><br><input name="username" type="text" class="textfield" id="username" /></td> </tr> <td> </td> <td><br><input type="submit" name="submit" value="submit" /></td> </tr> </table> </form> <?php } ?>
  8. I know form.These are the set of values i retrieved from the database(it went through a lot of changes and all)so i want to send the final value to different page for more calculations.
  9. Hey, Please may i know how can i transfer a set of values like "username" and "john" to other page without putting them in cookies? Thanks
  10. i don't know about it. I was more into showing the user how much time is left,don't want to use ajax but a simple php time clock types.
  11. I am making a script which waits for only 6 hours for the user to accept the challenge and if he doesn't he loses the challenge.How can i do that any guesses?
  12. I am planning to make a script with checks a value,if it is "1" or not in the database using AJAX and PHP. If it is "1" then i need to start a counter and after the counter comes to 0 somethings(some values) should be sent.
×
×
  • 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.