Jump to content

ReKoNiZe

Members
  • Posts

    49
  • Joined

  • Last visited

    Never

Everything posted by ReKoNiZe

  1. Try seperating everything in parenthesis. That is usually the issue with longer if statements like that.
  2. Change all of this: else { include('menu1.php'); echo '<br> <? while($row= mysql_fetch_array($result)) { $id = $row[id]; $name = $row[name]; $age = $row[age]; $breed = $row[breed]; $color = $row[color]; $gender = $row[gender]; ?> <? echo $id ?> <a href= 'view.php?id=<? echo $id ?>'><? echo $name ?> </a> <? echo $age ?> <? echo $color ?> <? echo $breed ?> <? echo $gender ?> <br> <?}?> '} ?> to this: else { include('menu1.php'); echo '<br /'; while($row= mysql_fetch_array($result)) { $id = $row[id]; $name = $row[name]; $age = $row[age]; $breed = $row[breed]; $color = $row[color]; $gender = $row[gender]; echo $id . "<a href='view.php?id=$id'>$name</a><br />"; echo $age . "<br />"; echo $color . "<br />"; echo $breed . "<br />"; echo $gender . "<br> />"; } ?>
  3. Try putting parens around everything in your if statement. Like so: if(isset(($_SESSION['username']=="Admin") || ($_SESSION['user_id']=="Cetanu") || ($_SESSION['user_id']=="Chris P"))){
  4. You have Sire's, just like I was explaining earlier, you need to escape those. So for the Sire's and Dam's, do Sire\'s and Dam\'s.
  5. You have "// Select your database" but you never select a database. You need a : mysql_select_db($database) or die("Unable to connect to database"); You need to have that before you run your query
  6. Every cycle through the while() loop you are overwriting $string. Do $string .= to concate.
  7. Have you ran your query in phpMyAdmin or on the database at all to make sure you are receiving data?
  8. When you use echo, you have to use either single quotes or double quotes. So Echo 'Hello' or echo "Hello". Take the follow sentence for example. John said, "Hello, my name is John". You would use echo with single quotes. echo ' John said, "Hello, my name is John".'; If you used double quotes, you would be ending the end of the echo. Hope that makes sense:)
  9. You could just do : $tel_number= ereg_replace("[^0-9]", "", $tel_number); which will strip anything that is not a 0-9.
  10. Just don't close the connection til the end. do a mysql_connect() at the beginning of all your queries etc and then do the if/else and then close at the end. Put mysql_close(); right before <?php include "../template/footer.php"; ?> Only need the one connection for the whole thing.
  11. For any of the TD's you want to play with, just do something like: <td class="Myclass"> And for the CSS use td.Myclass {}
  12. Okay so it looks like you're wanting to associate the username with the comment they make?
  13. Using empty() should work: if(!empty($image)) <td width='100px' height='101px' [b]background='$image'[/b] VALIGN='middle'> else <td width='100px' height='101px' [b]background='[b]Stacks/template.jpg[/b]'[/b] VALIGN='middle'>
  14. For the inner_results.htm you might need to make that a .php extension and then do: echo "You searched $keywords";
  15. Issue is right here: $message=mysql_fetch_assoc($message); You're assigning a variable to itself. Change the variable to like $MessageReceived=mysql_fetch_assoc($message); and update the rest of your variables
  16. I've read your other post about the comments, why are you needing to do two seperate queries?
  17. Gotcha, careful though. You still have code using $username later on: mysql_query("update tbnlmembers set pass='$upassword' where email='$username'") or die("cannot send your password");
  18. Do this: echo "The borough is $select<br />"; echo "The the Institutes are:<br /><ul>"; while($row_list=mysql_fetch_assoc($query)) echo "<li>$row_list['menu_name']</li>"; echo "</ul><br />"; Excuse the cheap formatting, was just an example, you have to loop through all of your array and list each one.
  19. <? session_name('usersession'); session_start(); ?> <html> <head> <title>Equine Revolution's Equine Registry</title> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body> <center> <table id="main"> <tr><td> <p><h1>Register A Horse</h1> <? if(!isset($peacock)) { include('menu2.php'); include('loginform.php'); exit(); } else { include('menu1.php'); echo ' <p> <form action="insert.php" method="post"> Name: <input type="text" name="name" /> <br> Age: <input type="text" name="age" /> <br> Breed: <input type="text" name="breed" /> <br> Color: <input type="text" name="color" /> <br> Height: <input type="text" name="height" /> <br> Gender: <input type="text" name="gender" /> <br> Sire: <input type="text" name="sire" /> <br> Sire's Sire: <input type="text" name="siresire" /> <br> Sire's Dam: <input type="text" name="siredam" /> <br> Dam: <input type="text" name="dam" /> <br> Dam's Sire: <input type="text" name="damsire" /> <br> Dam's Dam: <input type="text" name="damdam" /> <br> Owner: <input type="text" name="owner" /> <br> Origins: <input type="text" name="origins" /> <br> Type: <input type="text" name="type" /> <br> <input type="submit" /> </form> </p>'; } ?> <p> <? include('foot.php'); ?> </p> </td></tr> <tr><td></td></tr> </table> </center> </body> </html> You were using echo with double-quotations and then using double-quotations for all of your form/html stuff. You also did not end your echo. Copy the code above, changed echo " to echo ' and also put the last ' before your semicolon.
  20. $username = $_POST["email"]; $res = mysql_query("select * from tbnlmembers where email='$email'") or die("cannot select from email"); Why are you not doing $res = mysql_query("select * from tbnlmembers where email='$username'") or die("cannot select from email"); You assigned $username to the email but never use the variable. Also assigning the variable $email twice:) Your query is returning nothing.
  21. So when they're logged in you see nothing at all? Not even anything echo'd by the else statement?
  22. He gave you the query, you still need to do a mysql_query(); and then echo the results to the browser.
×
×
  • 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.