-
Posts
49 -
Joined
-
Last visited
Never
Everything posted by ReKoNiZe
-
Try seperating everything in parenthesis. That is usually the issue with longer if statements like that.
-
[SOLVED] Parse Error that I don't understand.
ReKoNiZe replied to frostyhorse's topic in PHP Coding Help
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> />"; } ?> -
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"))){
-
[SOLVED] Parse Error that I don't understand.
ReKoNiZe replied to frostyhorse's topic in PHP Coding Help
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. -
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
-
Every cycle through the while() loop you are overwriting $string. Do $string .= to concate.
-
Output a repeated value only once in a PHP drop-down list
ReKoNiZe replied to Fabrizzio PHP's topic in PHP Coding Help
Try using $_POST['select'] then. -
Have you ran your query in phpMyAdmin or on the database at all to make sure you are receiving data?
-
[SOLVED] Parse Error that I don't understand.
ReKoNiZe replied to frostyhorse's topic in PHP Coding Help
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:) -
You could just do : $tel_number= ereg_replace("[^0-9]", "", $tel_number); which will strip anything that is not a 0-9.
-
[SOLVED] combining two WHILE statements into one
ReKoNiZe replied to dachshund's topic in PHP Coding Help
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. -
need to control a td column with CSS within PHP code
ReKoNiZe replied to webguync's topic in PHP Coding Help
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 {} -
[SOLVED] combining two WHILE statements into one
ReKoNiZe replied to dachshund's topic in PHP Coding Help
Okay so it looks like you're wanting to associate the username with the comment they make? -
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'>
-
I want the searched keyword to appear on the page
ReKoNiZe replied to Chrisj's topic in PHP Coding Help
For the inner_results.htm you might need to make that a .php extension and then do: echo "You searched $keywords"; -
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
-
I want the searched keyword to appear on the page
ReKoNiZe replied to Chrisj's topic in PHP Coding Help
Sounds like you just need to echo $keywords; -
[SOLVED] combining two WHILE statements into one
ReKoNiZe replied to dachshund's topic in PHP Coding Help
I've read your other post about the comments, why are you needing to do two seperate queries? -
Forgot Password form not working, need another set of eyes.
ReKoNiZe replied to blesseld's topic in PHP Coding Help
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"); -
Output a repeated value only once in a PHP drop-down list
ReKoNiZe replied to Fabrizzio PHP's topic in PHP Coding Help
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. -
[SOLVED] Parse Error that I don't understand.
ReKoNiZe replied to frostyhorse's topic in PHP Coding Help
<? 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. -
Forgot Password form not working, need another set of eyes.
ReKoNiZe replied to blesseld's topic in PHP Coding Help
$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. -
So when they're logged in you see nothing at all? Not even anything echo'd by the else statement?
-
He gave you the query, you still need to do a mysql_query(); and then echo the results to the browser.