Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. <?php $when = date("F j"); if ($when == "March 7") echo "Today is March 7th!"; ?> See if that does what your looking for.
  2. Hmm...I don't see why it wouldn't. So your saying an error appears even if they aren't blank and they have more than two characters?
  3. <?php if ($_POST["action"] == "signup") { $valid=1; if ($_POST['name']=="") { $valid=0; $style_name = "background-color:#FF5959"; $error_name = "Your name seems to be mising?<br>"; } if (($_POST['address']=="") || (strlen($_POST['address']) < 2)) { $valid=0; $style_address = "background-color:#FF5959"; $error_address = "There is a problem with the address field?<br>"; } if (($_POST['address1']=="") || (strlen($_POST['address1']) < 2)) { $valid=0; $style_address = "background-color:#FF5959"; $error_address = "There is a problem with the address field?<br>"; } if (($_POST['address2']=="") || (strlen($_POST['address2']) < 2)) { $valid=0; $style_address = "background-color:#FF5959"; $error_address = "There is a problem with the address field?<br>"; } if (($_POST['address3']=="") || (strlen($_POST['address3']) < 2)) { $valid=0; $style_address = "background-color:#FF5959"; $error_address = "There is a problem with the address field?<br>"; } if (($_POST['address4']=="") || (strlen($_POST['address4']) < 2)) { $valid=0; $style_address = "background-color:#FF5959"; $error_address = "There is a problem with the address field?<br>"; } if (($_POST['county']=="") || (strlen($_POST['county'])<2)) { $valid=0; $style_county = "background-color:#FF5959"; $error_county = "The County field is blank?<br>"; } } ?> You had to change that line to: if (($_POST['county']=="") || (strlen($_POST['county'])<2)) {
  4. It should be if (($_POST['address'] == "") || (strlen($_POST['address']) < 2)) {
  5. <?php if (isset($_POST['submit'])){ $to="".$_POST['friendemail'].""; $subject="".$_POST['yourname']." wants you to check this hot website!"; $mail_from="from: ".$_POST['youremail']." \n"; $mail_from .="Content-Type: text/html; charset=utf-8 \n"; $message="<font size=\"2\" face=\"Verdana\"> <b>".$_POST['friendemail']."</b>,<br /> ".$_POST['yourname']." wants you to check this website!!:<br /> <a href=\"www.boricua-racing.com/forum/index.php\">Yo visit our site bro. You can enjoy the community and the staffs. Visita Nuestra pagina de Boricua-Racing. Eres Fiebru ? No te lo pierdas y disfrute ahora.</a> </font>"; $sentmail = mail($to,$subject,$message,$mail_from); echo "We have dispatch an e-mail to your friend.E-mail enviado a su amigo."; }else{ } ?>
  6. Your going about checking if they are on/offline the wrong way. Here is the best way of doing it: Make a field in the users table called "last_active" as a datetime On every page update that field with the current time, using the function NOW() (example below). This code is best put in a header file that is included on every page. To check which users, or if a specific user is online, it only takes a simple query. I will also give examples of this. EXAMPLES: To update the last_active field in the database UPDATE users SET last_active=NOW() WHERE userID=users_ID_Here Here is how you would display if someone is currently online (meaning they have clicked within the last 5 minutes). <?php $query = mysql_query("SELECT COUNT(*) FROM users WHERE last_active > (NOW() - INTERVAL 5 MINUTE) AND userID=users_ID_here"); $num = mysql_result($query, 0); if ($num > 0){ echo "User is ONLINE"; } else { echo "User is OFFLINE"; } ?> Here is how to get ALL users online within the last 5 minutes <?php $query = mysql_query("SELECT username FROM users WHERE last_active > (NOW() - INTERVAL 5 MINUTE)"); while ($row = mysql_fetch_assoc($query)){ echo $row['username'] . '<br />'; } ?>
  7. To maintain a session, make sure your calling session_start() at the top of every page. The manual tells/shows you how to use the setcookie() function.
  8. Try changing your query to: $sql = mysql_query("SELECT DISTINCT(date) FROM db");
  9. No, only when your dealing with the database. If your using that "40" in a select statement, then yes, use the function on it. If your going to use it in a query, I would use it just in case. Better safe than sorry.
  10. ALWAYS use mysql_real_escape_string() on all variables used in a query.
  11. Are you asking how to get the value of the session? <?php session_start(); //print out the username stored in the session echo $_SESSION['username']; //Assign the session to a variable $var = $_SESSION['username']; ?> As for storing it in the database, you would just use an INSERT query. This site has a lot of tutorials that would help you: http://www.tizag.com/phpT/
  12. Look in your hosts control panel, usually there will be a place where you can change it.
  13. If your able to use sessions, use them instead of cookies. From my understanding, cookies are more prone to be hacked and changed.
  14. If you need someone to just give you all the code, you should go to a freelance site and pay someone to code it for you. This forum is for help, not to program things for people. If you post code and your problem, then someone would be more than happy to help you. There are plenty of free forum softwares out there, just Google it.
  15. Thats a pretty big hassle, it also makes it difficult to search very well...especially if you need multiple photos. If you have access to a database, why not use it? It makes life so much easier.
  16. Both. Store the path to the file in the database along with who posted it, the description, and any other things you need. This way you can very easily get what you need and have easy access to any information you want.
  17. Yes, it's possible using PHP and MySQL. The difficulty depends on your skill level, but it isn't a very complicated script. If you don't know how to program, I'm sure there is a free gallery script out there that will suit your needs, just Google it.
  18. What format and type is your date field?
  19. Oops, I meant index.php. Sorry.
  20. Will you post some code from topmenu.php?
  21. To redirect, use the header() function. header("Location: adminreg.php"); To add another field you just follow the same steps you already did. Add the HTML form On signup_ac.php just add the field to your list $userID = $_POST['userID']; //make sure you name your input "userID" if you use this Add the information to your query
  22. It's just going to be a blank page: <?php include('adminconnect.php'); // table name $tbl_name="adminusers"; // values sent from form $name=$_POST['name']; $address=$_POST['address']; $address1=$_POST['address1']; $address2=$_POST['address2']; $address3=$_POST['address3']; $address4=$_POST['address4']; $county=$_POST['county']; $zip=$_POST['zip']; $telephone=$_POST['telephone']; $email=$_POST['email']; $username=$_POST['username']; $password=$_POST['password']; $sql="INSERT INTO $tbl_name(name, address, address1, address2, address3, address4, county, zip, telephone, email, username, password)VALUES('$name', '$address', '$address1', '$address2','$address3', '$address4','$county' ,'$zip', '$telephone', '$email', '$username', '$password')"; $result=mysql_query($sql)or die(mysql_error()."<p>With Query<br>$sql"); ?>
  23. Strange, because when I used your code on my server it was using GET instead of post, so I took out that first form tag and it worked fine. This is the exact code I used, worked find in Mozilla and IE. <!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>e-commerce admin page sample |item</title> <link href="../Admin_files/admin.css" rel="stylesheet" type="text/css" /> <script type="text/JavaScript" src="../Admin_files/wrapper.js"></script> </head> <body> <div id="Box"> <div id="logoBox"><a href="http://www.btrax.com/" target="_blank"><img src="../Admin_files/logo.gif" width="51" height="125" border="0" /></a></div> <div id="contentBox"> <!-- logo start --> <div id="container"> <div class="padTop28"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- logo finish --> <!-- menu start --> <div id="container"> <div id="menu1"> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/new.php" class="black">Order</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../admin_files/sales.php" class="black">Sales</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_on"><a href="../admin_files/list.php" class="black">Edit item</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../shipping/current.php" class="black">Postage fee</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_on"><!-- --></div> <div id="menu_text_off"><a href="../shipping/current.php" class="black_on">Add User</a></div> <div id="menu_space1"><!-- --></div> <div id="menu_off"><!-- --></div> <div id="menu_text_off"><a href="../shipping/current.php" class="black">Add Product</a></div> <div id="menu_space1"><!-- --></div> </div> <div class="clr"><!-- --></div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div id="dotted"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div class="padTop5"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div id="menu2"> <div id="menu_hide"> <!-- --> </div> <div id="menu_text_off"> </div> <div id="menu_space1"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <div class="padTop38"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- menu finish --> <!-- top start --> <div id="container"> <div id="line"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <div id="containerBg1"> <div class="padTop15"> <!-- --> </div> <div class="clr"> <!-- --> </div> <div id="titleText">REGISTER EMPLOYEE</div> <div class="clr"> <!-- --> </div> <div class="padTop15"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <!-- top finish --> <!-- data title start --> <div id="containerBg2"> <div class="padTop2"> <!-- --> </div> <div class="clr"> <!-- --> </div> <form name="form1" method="post" action="signup_ac.php"> <table align="center"> <tr valign="baseline"> <td nowrap align="right">Name:</td> <td><input type="text" name="name" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Address:</td> <td><input type="text" name="address" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Address1:</td> <td><input type="text" name="address1" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Address2:</td> <td><input type="text" name="address2" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Address3:</td> <td><input type="text" name="address3" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Address4:</td> <td><input type="text" name="address4" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">County:</td> <td><input type="text" name="county" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Zip:</td> <td><input type="text" name="zip" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Telephone:</td> <td><input type="text" name="telephone" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Email:</td> <td><input type="text" name="email" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Username:</td> <td><input type="text" name="username" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Password:</td> <td><input type="password" name="password" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td><input type="submit" value="Insert record"></td> </tr> </table> </form> <p> </p> </div> <!-- btm start --> <div id="containerBg1"> <div class="padTop15"> <!-- --> </div> <div class="clr"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <div id="container"> <div id="line"> <!-- --> </div> </div> <div class="clr"> <!-- --> </div> <div class="padTop16"> <!-- --> </div> <div class="clr"> <!-- --> </div> <!-- btm finish --> </div> </body> </html>
  24. Look at these lines right here <div id="Box"> <div id="logoBox"><a href="http://www.btrax.com/" target="_blank"><img src="../Admin_files/logo.gif" width="51" height="125" border="0" /></a></div> <div id="contentBox"> <form> You just need to take out the <form> Thats messing everything up.
×
×
  • 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.