peranha
Members-
Posts
878 -
Joined
-
Last visited
Everything posted by peranha
-
use \r\n will cause a line break. <?php // Send the email. $subject = "Welcome"; $headers = 'Activation'; $message = "Thank you for registering. To activate your account, please click on this link:"; $message = $message. "www.domain.com/activate.php?x=" .mysql_insert_id(). "&y=$EmailCode"; $message = $message. ". \r\nYour username is $Username \r\n Your password is $Password2 !"; mail($Email, $subject, $message, $headers); ?>
-
Supposed to be Show - Like I say, I dont know what this does show.show, who not just show? This should be echo "<option value=\"{$show['Show']}\">{$show['ID']} {$show['Show']} {$show['StartTime']}</option>"; Show.Show is the database.table, this is not needed. you just need the field name. The drop down is displaying correctly, it is not getting the value due to the $show['show'] not being $show['Show'] as the database field is.
-
You only need to put in the field, not the database. Show.Show is the datase.table delete the first show so it is Also deleted the first ; it is not needed. "DELETE FROM `schedule` WHERE `Show`.`Show` ='{$_POST["toDelete"]}'";
-
Is the field show supposed to be Show, or show in the following line? echo "<option value=\"{$show['show']}\">{$show['ID']} {$show['Show']} {$show['StartTime']}</option>";
-
A Dropdown box with multiple columns? Populated from SQL
peranha replied to grahamb314's topic in PHP Coding Help
Yes that is correct, I have it going to test.php, you will have to change it to whatever page you want it to go to. EDIT You will not use post, you will use $_GET Links will look like this<a href=test.php?id=<?php echo $show['show']; ?> and on the next page, you will do $show = $_GET['id']; and do you sql queries from there. -
INSERT INTO user (lastip) VALUES ('$_SERVER['REMOTE_ADDR']')
-
A Dropdown box with multiple columns? Populated from SQL
peranha replied to grahamb314's topic in PHP Coding Help
<?php $query = "SELECT * FROM table "; $result = mysql_query($query) or die ("<b class='red'>There is nothing on record</b>".mysql_error()); //... process contents of $result ... // see if any rows were returned if (mysql_num_rows($result) > 0) { // yes // print them one after another echo "<table cellpadding=1 border=1 bgcolor='lightblue'>"; ?> <TR> <TH>header1</TH> <TH>header2</TH> </TR> <?php while($row = mysql_fetch_row($result)) { ?> <TR> <TD WIDTH="90"><a href=test.php><?php echo $row[0]; ?></a></TD> <TD WIDTH="90"><a href=test.php><?php echo $row[1]; ?></a></TD> </TR> <?php } ?> <?php } echo "</table>"; } ?> This will get a table and link what it outputs to test.php -
A Dropdown box with multiple columns? Populated from SQL
peranha replied to grahamb314's topic in PHP Coding Help
I dont think that you can put a table inside of a drop down. -
A Dropdown box with multiple columns? Populated from SQL
peranha replied to grahamb314's topic in PHP Coding Help
to this line, just add the genre field echo "<option value=\"{$show['show']}\">{$show['show']}</option>"; echo "<option value=\"{$show['show']}\">{$show['show']} {$show['genre']}</option>"; That will put the genre in the dropdown menu. if that is what you are talking about. -
just put this code on one page and see if it shows the image <img src="logo.gif" width="672" height="153" /> If you are using apache, check you apache error log and see what it tells you there, maybee it cant find the file for some reason, it isnt readable due to a htaccess file.
-
Is logo.gif in the same folder as these files, or is it in another folder?
-
what error are you getting?
-
Here is the code that will work to make sure every field is filled in. <?php error_reporting(E_ALL); $connection=mysql_connect("localhost","root","simles"); $db=mysql_select_db("coproj",$connection); $result = mysql_query("select Email from Accounts where AccountID='$_POST[username]'") or die(mysql_error()); if(!$result) { echo "AccountID does not exist."; echo '<a href="email.php">Return to password page</a>'; } $row = mysql_fetch_row($result); $accemail = $row[0]; echo "b" . $accemail; echo "c" . $_POST['oldemail']; if (trim($_POST['username']) == '') { die('You did not fill the Account ID field <a href="email.php">Return to change password page</a>'); } if (trim($_POST['identification']) == '') { die('You did not fill the Identification No field <a href="email.php">Return to change password page</a>'); } if (trim($_POST['answer']) == '') { die('You did not fill the Answer field  <a href="email.php">Return to change password page</a>'); } if (trim($_POST['question']) == '') { die('You did not fill the Secret Question field <a href="email.php">Return to change password page</a>'); } if (trim($_POST['oldemail']) == '') { die('You did not fill the Old Email field <a href="email.php">Return to change password page</a>'); } if (trim($_POST['newemail']) == '') { die('You did not fill the New Email field <a href="email.php">Return to change password page</a>'); } if (trim($_POST['newemail2']) == '') { die('You did not fill the Re-type New Email field <a href="email.php">Return to change password page</a>'); } else if ($_POST['oldemail'] != $accemail) { echo "email invalid."; echo '<a href="email.php">Return to email page</a>'; die(); } else if($_POST['newemail'] != $_POST['newemail2']) { echo "Your emails don't match."; echo '<a href="email.php">Return to change password page</a>'; die(); } $sql=mysql_query("UPDATE Accounts SET email='$_POST[newemail]' where Identification='$_POST[identification]' AND Answer='$_POST[answer]' AND SecretQuestion='$_POST[question]' AND username='$_POST[username]'") or die(mysql_error()); if($sql) { echo "You have successfully changed your email."; echo '<a href="index.php">Return to main page</a>'; } ?>
-
Yeah, mark the topic as solved if it is finished.
-
yeah, you have to delete the 2 echo statements out of the script I gave you.
-
$sql=mysql_query("UPDATE Accounts SET email='$_POST[newemail]' where Identification='$_POST[identification]' AND Answer='$_POST[answer]' AND SecretQuestion='$_POST[question]' AND username='$_POST[username]'") or die(mysql_error()); this where you error is coming from. You dont have a column username in you database.
-
that page is fine, this is what I have for the 2nd page, and it works fine on my server <?php error_reporting(E_ALL); $connection=mysql_connect("localhost","root","simles"); $db=mysql_select_db("coproj",$connection); $result = mysql_query("select Email from Accounts where AccountID='$_POST[username]'") or die(mysql_error()); if(!$result) { echo "AccountID does not exist."; echo '<a href="email.php">Return to password page</a>'; } $row = mysql_fetch_row($result); $accemail = $row[0]; echo "b" . $accemail; echo "c" . $_POST['oldemail']; if (!isset($_POST['username'])) { die('You did not fill the Account ID field <a href="email.php">Return to change password page</a>'); } if (!isset($_POST['identification'])) { die('You did not fill the Identification No field <a href="email.php">Return to change password page</a>'); } if (!isset($_POST['answer'])) { die('You did not fill the Answer field <a href="email.php">Return to change password page</a>'); } if (!isset($_POST['question'])) { die('You did not fill the Secret Question field <a href="email.php">Return to change password page</a>'); } if (!isset($_POST['oldemail'])) { die('You did not fill the Old Email field <a href="email.php">Return to change password page</a>'); } if (!isset($_POST['newemail'])) { die('You did not fill the New Email field <a href="email.php">Return to change password page</a>'); } if (!isset($_POST['newemail2'])) { die('You did not fill the Re-type New Email field <a href="email.php">Return to change password page</a>'); } if ($_POST['oldemail'] != $accemail) { echo "email invalid."; echo '<a href="email.php">Return to email page</a>'; die(); } if($_POST['newemail'] != $_POST['newemail2']) { echo "Your emails don't match."; echo '<a href="email.php">Return to change password page</a>'; die(); } $sql=mysql_query("UPDATE Accounts SET email='$_POST[newemail]' where Identification='$_POST[identification]' AND Answer='$_POST[answer]' AND SecretQuestion='$_POST[question]' AND username='$_POST[username]'") or die(mysql_error()); if($sql) { echo "You have successfully changed your email."; echo '<a href="index.php">Return to main page</a>'; } ?> you can delete the 2 echo lines once you are done with it, I just used them for testing, and it worked.
-
show the code for the page where you are submitting the data from. You should be getting it at least once with echo $_POST['oldemail'];
-
you should be getting more that just the error, are you getting the email twice, once, or not at all??
-
I added it to the one that I gave to you.
-
I updated the code above try it again.
-
Try this and see what you get I found another thing that i missed. you are not actually fetching the info from the database. <?php error_reporting(E_ALL); $connection=mysql_connect("localhost","root","simles"); $db=mysql_select_db("coproj",$connection); $result = mysql_query("select Email from Accounts where AccountID='$_POST[username]'") or die(mysql_error()); if(!$result) { echo "AccountID does not exist."; echo '<a href="email.php">Return to password page</a>'; } $accemail = mysql_fetch_row($result); else if (!isset($_POST['username'])) { die('You did not fill the Account ID field <a href="email.php">Return to change password page</a>'); } else if (!isset($_POST['identification'])) { die('You did not fill the Identification No field <a href="email.php">Return to change password page</a>'); } else if (!isset($_POST['answer'])) { die('You did not fill the Answer field <a href="email.php">Return to change password page</a>'); } else if (!isset($_POST['question'])) { die('You did not fill the Secret Question field <a href="email.php">Return to change password page</a>'); } else if (!isset($_POST['oldemail'])) { die('You did not fill the Old Email field <a href="email.php">Return to change password page</a>'); } else if (!isset($_POST['newemail'])) { die('You did not fill the New Email field <a href="email.php">Return to change password page</a>'); } else if (!isset($_POST['newemail2'])) { die('You did not fill the Re-type New Email field <a href="email.php">Return to change password page</a>'); } else if ($_POST['oldemail'] != $accemail) { echo "email invalid."; echo '<a href="email.php">Return to email page</a>'; } else if($_POST['newemail'] != $_POST['newemail2']) { echo "Your emails don't match."; echo '<a href="email.php">Return to change password page</a>'; } else $sql=mysql_query("UPDATE Accounts SET email='$_POST[newemail]' where Identification='$_POST[identification]' AND Answer='$_POST[answer]' AND SecretQuestion='$_POST[question]' AND username='$_POST[username]'") or die(mysql_error()); if($sql) { echo "You have successfully changed your email."; echo '<a href="index.php">Return to main page</a>'; } ?>