PHP - Moved: Simply Query
This topic has been moved to MySQL Help.
http://www.phpfreaks.com/forums/index.php?topic=358137.0 Similar TutorialsI'm pretty new to php... I need a short script that I can place at the top of my web page that does the following: In theory, a person only be able to access page2.php unless they come directly from page1.php (The message that appear should say you are not authorized to access this page) I do not want to create login of any kind... Can you help? thanx in advance! I am looking for a really simple link directory script. Something similar to http://www.cygnusdirectory.com/ but with a banner on top. Any suggestions / recommendations ?
I am running three scheduled tasks on my website. I am only allowed three per day by my host. I want to add another one. Can I simply call another php program from within a php program which is currently running ? I have a registration form and there is a part for Phone Numbers / Email it's option for either. My question is : The Field is a VARCHAR 255 , the max you can input on that registration field is 20 Characters? HOW Can i change the value to more like 30 - 40 characters ? please help. Hi all! I am building a website, and the users can create a pet name. I only want them to be able to use letters, numbers and underscores in the names. How can I do this? Thanks! I would also be using this for the usernames as well. Here is my pet creation code: adopt.php: Code: [Select] <?php session_start(); include("config536.php"); ?> <html> <head> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <?php if(!isset($_SESSION['username'])) { echo "<banner></banner><ubar><a href=login.php>Login</a> or <a href=register.php>Register</a></ubar><content><center><font size=6>Error!</font><br><br>You are not Logged In! Please <a href=login.php>Login</a> or <a href=register.php>Register</a> to Continue!</center></content><content><center><font size=6>Messages</font><br><br></center></content>"; } if(isset($_SESSION['username'])) { echo "<banner></banner><nav>$shownavbar</nav><ubar>$ubear</ubar><content><center><font size=6>Adopt a Pet</font><br><br>"; $thedateis = date('F jS, Y'); $getpetid = $_GET['petid']; $adopt = $_POST['submit']; $petname = $_POST['petname']; $petgen = $_POST['gender']; $thebq = "SELECT * FROM pets WHERE petid='$getpetid'"; $theb = mysql_query($thebq); while($prr = mysql_fetch_array($theb)) { $pid = $prr['petid']; $species = $prr['pname']; $number = $prr['number']; } if(!isset($getpetid)) { $pq = "SELECT * FROM pets WHERE petid != '0'"; $p = mysql_query($pq); while($pr = mysql_fetch_array($p)) { $pid = $pr['petid']; $ptype = $pr['pname']; $im = $pr['pimage']; $number = $pr['number']; $limited = $pr['limited']; $types = $pr['types']; echo "<b>$ptype</b><br><a href=?petid=$pid><img src=/images/pets/$im></a><br>Number: $number<br><br>"; } } if(isset($getpetid)) { ?> <form action="<?php echo "$PHP_SELF"; ?>" method="POST"> Please select a Name: <input type="name" name="petname" maxlength="15"><br> Pet Gender: <select name="gender"><option value="female">Female</option><option value="male">Male</option><br><br><input type="submit" name="submit" value="Adopt Pet"></form> <?php $checkitq = mysql_query("SELECT * FROM userpets WHERE userpetname='$petname'"); $gcheckit = @mysql_num_rows($checkitq); $tq = "SELECT * FROM users WHERE username='$showusername'"; $t = mysql_query($tq); while($rw = mysql_fetch_array($t)) { $grabnum = $rw['pets']; } if(isset($adopt)) { if($grabnum >= "4") { echo "<font color=red>Error! You already have 4 pets.</font>"; } if($petname == "") { echo "<font color=red>Error! Please type in a name for your pet.</font>"; } if($qcheckit == "1") { echo "<font color=red>Error! That pet name already exists!</font>"; } if($gcheckit == "0" && $petname != "" && $grabnum < "4") { mysql_query("INSERT INTO userpets (owner, userpetname, userpetspecies, userpettype, petdatecreated, gender, strength, defence, health, level, booksread, smart, hunger) VALUES ('$showusername', '$petname', '$species', 'Normal', '$thedateis', '$petgen', '1', '1', '10', '1', '0', 'Normal', 'Full')"); mysql_QUERY("UPDATE users SET pets=pets+1 WHERE username='$showusername'"); echo "<font color=green>Success! Your pet has been created!</font>"; } } } } ?> </html> Thanks in advance for the help everyone!! This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=329559.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=344191.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=311010.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=348956.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=319016.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=326252.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=321853.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=353189.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=327525.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=306850.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=334445.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=311619.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=353002.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=306079.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=325846.0 |