Jump to content
Old threads will finally start getting archived ×
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 ×

Gemini 🤖

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Gemini 🤖's Achievements

Member

Member (2/5)

0

Reputation

  1. Ok thanks! I am gonna request the limit be removed or something :-), but i have one more question, so when I send a message through mail() on my server it takes like up to two hours to send (I sent one to an AOL account and it took three days!!!) is this aol, mail(), or godaddy?
  2. Hello, I have been working on my website lateley and realized that godaddy only allows a 1000 email limit. I am sure this will be fine when the site first launches but if I get more and more users it will cause some issues. How can I fix this? Is there like a function that can bypass this or something??? Thanks in advance :-)
  3. so i am trying to add the date into my mysql database, but no matter what i do it wont work. If tried $today=date('F j, Y h:i'); But that didnt work, well it did but i didnt have mysql set to the DATETIME function thingy so when i tried to sort it it wouldnt sort them correctly. Here is the code that im using <?php //This code checks to make sure they are logged in BEFORE they can access the webpage session_start(); if(!isset($_SESSION['myusername'])){ //If he is not logged in, go to index.php header("location:/si/onikz/index.php"); }else{ //If he is logged in do nothing and go on to the rest of the code. } include("../housekeeping/dbconnect.php"); $to = $_POST['to']; $from = $_SESSION['myusername']; $subject= $_POST['Subject']; $message= $_POST['Message']; $today=date('F j, Y h:i'); $results="INSERT INTO `SocInt`.`email` ( `id` , `to` , `from` , `subject` , `message`, `date` ) VALUES ( NULL, '$to', '$from', '$subject', '$message', '$today' );"; if(mysql_query($results)) { echo"<center>"; echo"Your message was successful!<br/>"; echo "<meta http-equiv=\"Refresh\" content=\"1; URL=http://onikz.com/si/email/index.php?inbox=Inbox\">"; echo "<a href=\"http://onikz.com/si/email/index.php?inbox=Inbox\">Click here if you are not automatically redirected</a>"; echo"</center>"; }else{echo"Sorry, an error occured, please contact the administrator or try again." . mysql_error();} ?> When i go to the inbox section of the mail all of the dates are listed as 00000000 sniffle Also when i try and sort them using this code $sql ="SELECT * FROM `SocInt`.`email` WHERE `to`='$username' ORDER BY 'date' DESC"; Will they sort from newest to oldest
  4. So i just uploaded everything to godaddy(yay...onikz.com) anyways, i am making a social network but its still very beta, i am having a problem with my this code: Basically whats going on is, i need it to print out the email onto the screen, but it wont for some reason. Can you spot the problem?? NOTE: this is inbox.php?id=(a number goes here, depending on what message you pick) <?php //This code checks to make sure they are logged in BEFORE they can access the webpage session_start(); if(!isset($_SESSION['myusername'])){ //If he is not logged in, go to index.php header("location:/si/onikz/index.php"); }else{ //If he is logged in do nothing and go on to the rest of the code. } ?> <!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>Email: Inbox</title> <link rel="stylesheet" href="http://onikz.com/si/housekeeping/css.css" type="text/css" media="screen" /> <body> <div id="content"> <div id="email"> <?php inbox($id); //Calls the inbox function ?> </div> </div> <?php //This adds the menu to the program include("menu.php"); ?> </body> </html> <?php function inbox($id){ //THIS CODE JUST SHOWS THE BUTTONS //They are disquised as links with a button exterior //THIS IS THE CODE THAT DISPLAYS THE MESSAGE. include("../housekeeping/dbconnect.php"); //conects to database $username=$_SESSION["myusername"]; //assigns the user name to $username $sql ="SELECT * FROM `SocInt`.`email` WHERE `id`='$id'"; //This selects the message fromt he database $result=mysql_query($sql); $count=1; while($row = mysql_fetch_array($result)){ //This displays the message $to = $row[to]; $from=$row[from]; $subject=$row[subject]; $message=$row[message]; $id=$row[id]; if($to == $username){ //This double checks to make sure the username also //matches echo"<center><table id=\"Message\">"; echo"<tr><td>From:</td><td>$from</td></tr>"; echo "<tr><td>Subject</td><td>$subject</td></tr>"; echo "<tr><td>Message</td><td>$message</td></tr>"; echo"</table></center>"; echo "hello"; } } } ?> Heres the webpage were it gives them the option to view the message. This then sends them to the above code. <?php //This code checks to make sure they are logged in BEFORE they can access the webpage session_start(); if(!isset($_SESSION['myusername'])){ //If he is not logged in, go to index.php header("location:/si/onikz/index.php"); }else{ //If he is logged in do nothing and go on to the rest of the code. } ?> <!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>Email</title> <link rel="stylesheet" href="http://onikz.com/si/housekeeping/css.css" type="text/css" media="screen" /> <body> <div id="content"> <div id="email"> <?php email(); //Calls the email function ?> </div> </div> <?php //This adds the menu tot he program include("menu.php"); ?> </body> </html> <?php function email(){ buttons(); } function buttons(){ echo "<center><form mehtod=\"get\"><input type=\"submit\" value=\"Inbox\" name=\"inbox\" />"; echo "<input type=\"submit\" value=\"Outbox\" name=\"outbox\" />"; echo "<input type=\"submit\" value=\"Compose\" name=\"compose\" /></form></center>"; if(isset($_GET["inbox"])){ inbox(); } if(isset($_GET["outbox"])){ outbox(); } if(isset($_GET["compose"])){ compose(); } return ; } function inbox(){ include("../housekeeping/dbconnect.php"); $username=$_SESSION["myusername"]; //This selects the message where it has not been read alread, thats why it only pick $sql ="SELECT * FROM `SocInt`.`email` WHERE `to`='$username'"; $result=mysql_query($sql); $count=1; while($row = mysql_fetch_array($result)){ $to = $row[to]; $from=$row[from]; $subject=$row[subject]; $message=$row[message]; $id=$row[id]; if($to == $username){ echo"<table id=\"emailInbox\">"; echo"<tr id=\"emailInbox\"><td id=\"emailInbox\">Option</td><td id=\"emailInbox\">From</td><td id=\"emailInbox\">Subject</td></tr>"; echo"<tr id=\"emailInbox\"><td id=\"emailInbox\"><a href=\"inbox.php?id=$id\">View</a></td><td id=\"emailInbox\">$from</td><td id=\"emailInbox\">$subject</td>"; echo"</table>"; } } } function outbox(){ include("../housekeeping/dbconnect.php"); $username=$_SESSION["myusername"]; //This selects the message where it has not been read alread, thats why it only pick //the messages with stats to 0 $sql ="SELECT * FROM `SocInt`.`email` WHERE `from`='$username'"; $result=mysql_query($sql); $count=1; while($row = mysql_fetch_array($result)){ $to = $row[to]; $from=$row[from]; $subject=$row[subject]; $message=$row[message]; $id=$row[id]; echo "<center>"; echo "<table border=\"1\" cellpadding=\"5\" width=\"400px\">"; echo "<td></td>"; echo "<th rowspan\"3\"> Email Number " .$count." </th>"; echo "<tr>"; echo "<th scope=\"row\" width=\"50px\">From</th>"; echo "<td>$from</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" width=\"50px\">Subject</th>"; echo "<td>$subject</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" width=\"50px\">Message</th>"; echo "<td>$message</td>"; echo "</tr>"; echo "<tr></tr>"; echo "</table>"; echo "</center>"; $count++;} } function compose(){ echo "<center>"; echo "<form action=\"sendmail.php\" method=\"post\" name=\"email\">"; echo "<table>"; echo "<tr>"; echo " <td>To:</td>"; echo "<td><input name=\"to\" type=\"text\" size=\"50\" maxlength=\"70\" /></td>"; echo " </tr>"; echo " <tr>"; echo " <td>Subject</td>"; echo " <td><input name=\"Subject\" type=\"text\" size=\"50\" maxlength=\"70\" /><br /></td>"; echo " </tr>"; echo " <tr>"; echo " <td>Message</td>"; echo " <td><textarea name=\"Message\" cols=\"38\" rows=\"5\"></textarea></td>"; echo " </tr>"; echo " <tr>"; echo " <td>Options</td>"; echo " <td><input name=\"send\" type=\"submit\" value=\"Send\" /></td>"; echo " </tr>"; echo " </table>"; echo "</form>"; echo"</center>"; } ?>
  5. Yeah there is a folder called housekeeping. But every time i try and include the entire menu.html path it wont work. I start with C:\xampp\htdocs\si\onikz\housekeeping\menu.html
  6. So it wont include menu.html No matter how i type it in it keeps returning an error Warning: include(menu.html) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\SI\onikz\email\index.php on line 28 Heres the code...its the email function that retrieves the message. <?php //This code checks to make sure they are logged in BEFORE they can access the webpage session_start(); if(!isset($_SESSION['myusername'])){ //If he is not logged in, go to index.php header("location:/SI/onikz/index.php"); }else{ //If he is logged in do nothing and go on to the rest of the code. } ?> <!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>Email</title> <link rel="stylesheet" href=".housekeeping/css.css" type="text/css" media="screen" /> <body> <div id="content"> <?php email(); //Calls the email function ?> </div> <?php //This adds the menu tot he program include("menu.html"); ?> </body> </html> <?php function email(){ buttons(); } function buttons(){ echo "<center><form mehtod=\"get\"><input type=\"submit\" value=\"Inbox\" name=\"inbox\" />"; echo "<input type=\"submit\" value=\"Outbox\" name=\"outbox\" />"; echo "<input type=\"submit\" value=\"Compose\" name=\"compose\" /></form></center>"; if(isset($_GET["inbox"])){ inbox(); } if(isset($_GET["outbox"])){ outbox(); } if(isset($_GET["compose"])){ compose(); } return ; } function inbox(){ include('/xampp/htdocs/SI/onikz/dbconnect.php'); $username=$_SESSION["myusername"]; //This selects the message where it has not been read alread, thats why it only pick //the messages with stats to 0 $sql ="SELECT * FROM `abhsoc`.`email` WHERE `to`='$username'"; $result=mysql_query($sql); $count=1; while($row = mysql_fetch_array($result)){ $to = $row[to]; $from=$row[from]; $subject=$row[subject]; $message=$row[message]; $id=$row[id]; if($to == $username){ echo"<table><tr>"; echo"<td><a href=\"inbox.php?id=$id\">View</a></td><td>$from</td><td>$subject</td>"; echo"</table>"; } } } function outbox(){ include('/xampp/htdocs/SI/onikz/dbconnect.php'); $username=$_SESSION["myusername"]; //This selects the message where it has not been read alread, thats why it only pick //the messages with stats to 0 $sql ="SELECT * FROM `abhsoc`.`email` WHERE `from`='$username'"; $result=mysql_query($sql); $count=1; while($row = mysql_fetch_array($result)){ $to = $row[to]; $from=$row[from]; $subject=$row[subject]; $message=$row[message]; $id=$row[id]; echo "<center>"; echo "<table border=\"1\" cellpadding=\"5\" width=\"400px\">"; echo "<td></td>"; echo "<th rowspan\"3\"> Email Number " .$count." </th>"; echo "<tr>"; echo "<th scope=\"row\" width=\"50px\">From</th>"; echo "<td>$from</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" width=\"50px\">Subject</th>"; echo "<td>$subject</td>"; echo "</tr>"; echo "<tr>"; echo "<th scope=\"row\" width=\"50px\">Message</th>"; echo "<td>$message</td>"; echo "</tr>"; echo "<tr></tr>"; echo "</table>"; echo "</center>"; $count++;} } function compose(){ echo "<center>"; echo "<form action=\"sendmail.php\" method=\"post\" name=\"email\">"; echo "<table>"; echo "<tr>"; echo " <td>To:</td>"; echo "<td><input name=\"to\" type=\"text\" size=\"50\" maxlength=\"70\" /></td>"; echo " </tr>"; echo " <tr>"; echo " <td>Subject</td>"; echo " <td><input name=\"Subject\" type=\"text\" size=\"50\" maxlength=\"70\" /><br /></td>"; echo " </tr>"; echo " <tr>"; echo " <td>Message</td>"; echo " <td><textarea name=\"Message\" cols=\"38\" rows=\"5\"></textarea></td>"; echo " </tr>"; echo " <tr>"; echo " <td>Options</td>"; echo " <td><input name=\"send\" type=\"submit\" value=\"Send\" /></td>"; echo " </tr>"; echo " </table>"; echo "</form>"; echo"</center>"; } ?> Also, it wont include the CSS file! With the link tag. If i put the entire css code into the program it displays it correct but i dont want it like that. Also When i plug in the entire menu.html code into the program instead of using the include() function, it still wont work. It works with all the other pages its just this one that is being dumb...Cry
  7. So everthing worked good until i added the login script (By login script i mean the one that checks to make sure you logged in) to my home page. but when i added it it stopped working. Heres the code...It keepes giving me a redirect error. im so confused i dont know what to do. THIS IS EMAIL/INDEX.PHP <?php $title="Social Intelligence:Email"; //Sets up the title include("/xampp/htdocs/SI/onikz/housekeeping/template.php"); //Gets the template ?> <tr> <td colspan="1" valign="top" width="90%" id="content"><?php email(); //Calls the welcome function?></td> </tr> <tr> <td colspan="1" align="center" valign="top" width="90%" height="30" id="footer">© 2008 Onikz.com</td> </tr> </table> </body> </html> <?php function email(){ echo "This will be the email section!"; } ?> It messes up up there around the include section. when i took out the include section it worked, but i need the included statement in there. This is like my homemade template. After i added the login check script it started giving me redirect error, whenever i would logout and click on the link. <? //This code checks to make sure they are logged in BEFORE they can access the webpage session_start(); if(!isset($_SESSION['myusername'])){ //If he is not logged in, go to index.php header("location:index.php"); }else{ //If he is logged in do nothing and go on to the rest of the code. } ?> <!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><?php echo $title; ?></title> <style type="text/css"> a:hover{ color:white; background-color:#669900; text-decoration:underline; padding-right:18px; padding-left:2px; } a{ color:#669900; text-decoration:none; padding-left:2px; padding-right:18px; float:left; } #main-menu{ border-bottom:#CCCCCC; border-left:#CCCCCC; border:1px; background-color:#ffffff; } body{ color: #666666; font-family: arial,lucida grande,verdana,sans serif; font-size: 12px; line-height: 18px; background-color:#eee9bf; } h3{ margin:0; padding:0; } table{ border:1px; border-color:#CCCCCC; border-style:solid; } td#main-menu{ border-right-color:#ffffff; border-left-color:#ffffff; border-style:solid; border-top-color:#CCCCCC; background-color:#F7F7F7; } td#header{ padding-top:25px; background-color:#FFFFFF; } td#footer{ background-color:#F7F7F7; } td#content{ background-color:#FFFFFF; border-right-color:#F7F7F7; border-right-style:solid; border-width:10px; border-left-color:#F7F7F7; border-left-style:solid; } </style> </head> <body> <table cellpadding="0" cellspacing="1" width="100%" height="100%"> <tr > <td colspan="1" align="center" valign="top" width="90%" height="75" bordercolor="#FFFFFF" id="header"><font size="55">Social Intelligence</font></td> </tr> <tr > <td colspan="1" align="center" valign="top" width="90%" height="35" id="main-menu"><?php include("main_menu.php"); ?></Td> </tr>
  8. Heres my code where it gets stuck at... <?php $title="Social Intelligence:Email"; //Sets up the title include("/xampp/htdocs/SI/onikz/housekeeping/template.php"); //Gets the template ?> <tr> <td colspan="1" valign="top" width="90%" id="content"><?php email(); //Calls the welcome function?></td> </tr> <tr> <td colspan="1" align="center" valign="top" width="90%" height="30" id="footer">© 2008 Onikz.com</td> </tr> </table> </body> </html> <?php function email(){ echo "This will be the email section!"; } ?> Now when i check it the only problem was the include("/xampp/htdocs/SI/onikz/housekeeping/template.php"); function. It worked for ever and the second i added the login in script to the template page it broke everything...lol heres the template page. <? //This code checks to make sure they are logged in BEFORE they can access the webpage session_start(); if(!isset($_SESSION['myusername'])){ //If he is not logged in, go to index.php header("location:index.php"); }else{ //If he is logged in do nothing and go on to the rest of the code. } ?> <!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><?php echo $title; ?></title> <style type="text/css"> a:hover{ color:white; background-color:#669900; text-decoration:underline; padding-right:18px; padding-left:2px; } a{ color:#669900; text-decoration:none; padding-left:2px; padding-right:18px; float:left; } #main-menu{ border-bottom:#CCCCCC; border-left:#CCCCCC; border:1px; background-color:#ffffff; } body{ color: #666666; font-family: arial,lucida grande,verdana,sans serif; font-size: 12px; line-height: 18px; background-color:#eee9bf; } h3{ margin:0; padding:0; } table{ border:1px; border-color:#CCCCCC; border-style:solid; } td#main-menu{ border-right-color:#ffffff; border-left-color:#ffffff; border-style:solid; border-top-color:#CCCCCC; background-color:#F7F7F7; } td#header{ padding-top:25px; background-color:#FFFFFF; } td#footer{ background-color:#F7F7F7; } td#content{ background-color:#FFFFFF; border-right-color:#F7F7F7; border-right-style:solid; border-width:10px; border-left-color:#F7F7F7; border-left-style:solid; } </style> </head> <body> <table cellpadding="0" cellspacing="1" width="100%" height="100%"> <tr > <td colspan="1" align="center" valign="top" width="90%" height="75" bordercolor="#FFFFFF" id="header"><font size="55">Social Intelligence</font></td> </tr> <tr > <td colspan="1" align="center" valign="top" width="90%" height="35" id="main-menu"><?php include("main_menu.php"); ?></Td> </tr> PS: The template is homemade without that smarty thing (That i cant figure out for the life of me...urg)...lol
  9. Ok so i created a social networking program for my school. Its coded in php and using the MySQL database. In this teachers and students can communicate through an internal emailing system (Kind of like what myspace and facebook do)...well my teachers said it would be alot better if they could just get the emails sent straight to them and not have check the social network all the time. So do you know how i would do this? Also how would they reply? i mean, how would the user get the message. thats where im stuck. 1. Send mail from students to teachers email (mail(); i think) 2. HOW do i receive mail and distribute it to the correct students Anything on this subject would be helpful.
  10. ok so i have an internal email system, where any one who is a member can send each other a message. Well i got it to display the messages and everything but i cant get it to delete the message. here is the code. email_inbox.php <?php $title="Email: Inbox"; include("body.php"); include("dbconnect.php"); $username=$_SESSION["myusername"]; //This selects the message where it has not been read alread, thats why it only pick //the messages with stats to 0 $sql ="SELECT * FROM `abhs`.`messages` WHERE `to`='$username' AND `stats`='0'"; $result=mysql_query($sql); echo"<center>"; echo"<table width=\"515\" border=\"1\" cellpadding=\"5\" bgcolor=\"#00ffff\">"; echo"<tr>"; echo"<td width=\"65\">Status</td>"; echo"<td width=\"100\">To </td>"; echo"<td width=\"100\">From </td>"; echo"<td width=\"150\">Subject </td>"; echo"<td width=\"100\">Options</td>"; echo"</tr>"; echo"</table>"; echo"</center>"; while($row = mysql_fetch_array($result)){ $to = $row[to]; $from=$row[from]; $subject=$row[subject]; $message=$row[message]; $id=$row[id]; echo"<center>"; echo"<table width=\"515\" border=\"1\" cellpadding=\"5\" bgcolor=\"#ececec\">"; echo"<tr>"; echo"<td width=\"65\">Unread</td>"; echo"<td width=\"100\">$to </td>"; echo"<td width=\"100\">$from </td>"; echo"<td width=\"150\">$subject </td>"; echo"<td width=\"100\"><form method=\"get\" name=\"options\"><input type=\"submit\" name=\"view\"value=\"View\"></form>"; echo"</tr>"; echo"</table>"; if(isset($_GET["view"])==1){ echo"<table width=\"500\" border=\"1\" cellpadding=\"5\">"; echo"<tr>"; echo"<td bgcolor=\"#00FFFF\" width=\"100\">To: </td>"; echo"<td bgcolor=\"#CCFFFF\"> $to </td>"; echo "</tr>"; echo "<tr>"; echo "<td bgcolor=\"#00FF00\" width=\"100\">From: </td>"; echo "<td bgcolor=\"#99CCFF\">$from</td>"; echo "</tr>"; echo "<tr>"; echo "<td bgcolor=\"#00FFFF\" width=\"100\">Subject: </td>"; echo "<td bgcolor=\"#CCFFFF\">$subject</td>"; echo "</tr>"; echo "<tr>"; echo "<td bgcolor=\"#00FF00\" width=\"100\">Message: </td>"; echo "<td bgcolor=\"#99CCFF\">$message</td>"; echo "</tr>"; echo "</table>"; echo "<br>"; echo "<br>"; echo "<br>"; echo "<br>"; echo "</center>"; } } ?> Ok so you can see i dont have a "Delete" Button up there, but when i had the the else{ //code that deletes the message } it wouldnt work becuase it would right away delete the message the second i got to this page. How would i go about deleting a message, but only the message he click delete on.
  11. So my code is only printing out one row. Not all the rows that apply. Do you see anything wrong. I cant figure out. Is there a certain code to use??? This is the code that prints the results. It only prints the first restult it finds in mysql <?php include("dbconnect.php"); $username=$_SESSION["myusername"]; $sql ="SELECT * FROM `abhs`.`messages` WHERE `to`='$username' LIMIT 0 , 30"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); ?> <table width="500" border="1" cellpadding="5"> <tr> <td bgcolor="#00FFFF">To: </td> <td bgcolor="#CCFFFF"><?php echo $rows['to']; ?></td> </tr> <tr> <td bgcolor="#00FF00">From: </td> <td bgcolor="#99CCFF"><?php echo $rows['from']; ?></td> </tr> <tr> <td bgcolor="#00FFFF">Subject: </td> <td bgcolor="#CCFFFF"><?php echo $rows['subject'];?></td> </tr> <tr> <td bgcolor="#00FF00">Message: </td> <td bgcolor="#99CCFF"><?php echo $rows['message'];?></td> </tr> </table>
  12. Ok so i created a social networking website for my school, so teachers and fellow students can communiticate easier. Well i created the internal email system and its up and running OK not great but its a start. SOOO, my question is, i created this but when it goes to Mysql it only pulls out the first set of information it sees. Heres the code. EMAIL_COMPOSE.PHP <?php //sets title $title="Compose!"; //includes the body file. This has all the style and html elements include("body.php"); ?> <center> <P>Sending a message via ABHS Online Community is different! Please view the tutorial.</P> <form action="send_success.php" method="post" name="email"> <table> <tr> <td>To:</td> <td><input name="to" type="text" size="65" maxlength="70" /></td> </tr> <tr> <td>Subject</td> <td><input name="Subject" type="text" size="65" maxlength="70" /><br /></td> </tr> <tr> <td>Message</td> <td><textarea name="Message" cols="49" rows="5"></textarea></td> </tr> <tr> <td>Options</td> <td><input name="send" type="submit" value="Send" /></td> </tr> </table> </form> </center> SEND_SUCCESS.PHP <?php include("dbconnect.php"); include("email.php"); $to = $_POST['to']; $from = $_SESSION['myusername']; $subject= $_POST['Subject']; $message= $_POST['Message']; $results="INSERT INTO `abhs`.`messages` ( `id` , `to` , `from` , `subject` , `message` ) VALUES ( NULL , '$to', '$from', '$subject', '$message' )"; if(mysql_query($results)) { echo"<center>"; echo"Your message was successful!"; echo"</center>"; }else{echo"Sorry, an error occured, please contact the administrator or try again.";} ?> </div> </body> </html> EMAIL_INBOX.PHP <?php include("dbconnect.php"); $username=$_SESSION["myusername"]; $sql ="SELECT * FROM `abhs`.`messages` WHERE `to`='$username' LIMIT 0 , 30"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); ?> <table width="500" border="1" cellpadding="5"> <tr> <td bgcolor="#00FFFF">To: </td> <td bgcolor="#CCFFFF"><?php echo $rows['to']; ?></td> </tr> <tr> <td bgcolor="#00FF00">From: </td> <td bgcolor="#99CCFF"><?php echo $rows['from']; ?></td> </tr> <tr> <td bgcolor="#00FFFF">Subject: </td> <td bgcolor="#CCFFFF"><?php echo $rows['subject'];?></td> </tr> <tr> <td bgcolor="#00FF00">Message: </td> <td bgcolor="#99CCFF"><?php echo $rows['message'];?></td> </tr> </table>
  13. JEEZ, sorry scott, lol. ok so i did what you told me to but it fixed the parse error. but no for some reason it doesnt put the information INTO the database.
  14. please help i cant figure out where the heck this is coming from im about to go crazy here...*cry cry* <? //This code checks to make sure they are logged in BEFORE they can access the webpage session_start(); if(!isset($_SESSION['myusername'])){ //If he is not logged in, go to index.php header("location:index.php"); }else{ //If he is logged in do nothing and go on to the rest of the code. } ?> <!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>Send Status</title> </head> <body> <?php //Includes header file include("header.php"); ?> <div id="Mbody"> <?php //declares database variables $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="abhs"; // Database name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sendto=$_POST['sendto']; //inserts the data into the database. ERROR IS PRODUCED HERE FOR SOME REASON??? HERE IS WHAT THE ERROR SAYS. //Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\abhs\send_success.php on line 43 $sql='INSERT INTO `abhs`.`messages` (`to` ,`from` ,`subject` ,`message` ) VALUES ( '$_POST['sendto']'; '$_SESSION['myusername']', '$_POST['subject']', '$_POST['message']' )'; $result=mysql_query($sql); if($result){ echo "Successful<BR>"; echo "<a href=members_home.php>View your topic</a>"; } else { echo "ERROR"; } ?> </div> </body> </html>
×
×
  • 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.