Jump to content

crawlerbasher

Members
  • Posts

    70
  • Joined

  • Last visited

    Never

About crawlerbasher

  • Birthday 08/24/1977

Contact Methods

  • Website URL
    http://www.crawlerbasher.net

Profile Information

  • Gender
    Male
  • Location
    UK

crawlerbasher's Achievements

Member

Member (2/5)

0

Reputation

  1. I've been googling with very little sucsse to find out if and how I can define a certain font to be used in the message body wtih out the viewer having to have the font installed on there computer. Is this at all possible?
  2. ok that seems to have fixed it. Because I've been cutting and pasting other coding I've done in other scripts. and might have cut a bit too much line.
  3. What could cause a script to miss 1 database entry. I've got 5 database entry and the script only shows 4. And for some resion it always misses id number 2 but when its edited in the mysql then another database entry goes missing. $con = mysql_connect($db_server, $db_username, $db_password); // Connects to your database if (!$con) { die('Could not connect: ' . mysql_error()); // error message when failed to connect. } mysql_select_db($db_name) or die(mysql_error()); $query = "SELECT * FROM GalkaDownloads ORDER BY `name` ASC"; $result = mysql_query( $query ); $data = mysql_fetch_assoc($result); while($data = mysql_fetch_assoc($result)) { ?> <tr> <td align="left" valign="top" bgcolor="#FFFFFF"><a href="download.php?id=<?php echo $data['id']; ?>"><?php echo $data['name']; ?></a></td> <td align="left" valign="top" bgcolor="#FFFFFF"><?php echo $data['Category']; ?></td> <td align="center" valign="top" bgcolor="#FFFFFF"><strong><?php echo $data['count']; ?></strong></td> <td align="left" valign="top" bgcolor="#FFFFFF"><?php echo nl2br($data['information']); ?></td> </tr> <?php } ?>
  4. I've tried that and get no error messages now. But now its just not updating it. I've checked it to make sure that the tables name are the same in the script and that the casing match too.
  5. I'm trying to update my database but keep getting this error. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Title' = 'Testing today', 'Story' = 'This' WHERE 'id' = ''' at line 1 I can't seem to find whats causing the problem. This is the code. $id = $_POST['id']; $Story = $_POST['Story']; $Title = $_POST['Title']; mysql_query("UPDATE TaruNews SET 'Title' = '$Title', 'Story' = '$Story' WHERE 'id' = '$id'")or die(mysql_error());
  6. ok found out what was going wrong, in the email header needed to add this. "Content-type:text/html; charset=US-ASCII" . "\r\n" blow the MINE type. Blow is what it looks like. // Insert you code for processing the form here, e.g emailing the submission, entering it into a database. $title = strip_tags($_POST['Title']); $stroy = strip_tags($_POST['Story']); $email = strip_tags($_POST['Email']); $yourname = strip_tags($_POST['YourName']); $youremail = strip_tags($_POST['YourEmail']); $from_header = "From: $youremail" . "\r\n" . "Reply-To: $youremail" . "\r\n" . "Content-type:text/html; charset=US-ASCII" . "\r\n". "MIME-Version: 1.0" . "\r\n" . "X-Mailer: PHP/" . phpversion() . "\r\n" . "Content-Language: en-gb";
  7. I've been looking all over the internet to find out what I'm doing wrong here. I've even tried looking at the source code of the email to match that for the template. But no matter what I try, I can't seem to get it the view the email with out it show all the html codes. This is the same for outlook 2007 and google mail. Below is part of the code for the emailing script. $title = strip_tags($_POST['Title']); $stroy = strip_tags($_POST['Story']); $email = strip_tags($_POST['Email']); $yourname = strip_tags($_POST['YourName']); $youremail = strip_tags($_POST['YourEmail']); $from_header = "From: $youremail" . "\r\n" . "Reply-To: $youremail" . "\r\n" . "MIME-Version: 1.0" . "\r\n" . "X-Mailer: PHP/" . phpversion() . "\r\n" . "Content-Language: en-gb"; if (is_numeric ($story)) { echo "Please go back and try again"; } else { require("config.php"); $con = mysql_connect($db_server, $db_username, $db_password); // Connects to your database if (!$con) { die('Could not connect: ' . mysql_error()); // error message when failed to connect. } mysql_select_db($db_name) or die(mysql_error()); $query = "SELECT * FROM TaruNews WHERE id = $stroy LIMIT 1"; $result = mysql_query( $query ); $num = mysql_num_rows($result); $data = mysql_fetch_assoc($result); if( $num > 0 ) { $text = $data['Story']; //send mail - $subject & $contents come from surfer input mail($email, $title, $text, $from_header); // redirect back to url visitor came from echo "<p><b>Thank you ".$yourname.", The Email as been sent to ".$email."<b></p>"; mysql_close($con); // close conection after information has been injected in to the mysql If anyone has any idea on resolving this issue please let me know. I've tried adding the html headers and footer tags around the $data['Story'] but that dose not work as well. I can't understand why the html codes are showing up rather than formatting the email it self.
  8. Thank you. I was looking at something like this to find if the variable existed or not. But was not working. But your code was shorter and cleaner and worked. Thank you.
  9. $email = strip_tags($_GET['e']); if (is_numeric ($email)) { echo "True"; } else { echo "False"; } This is a peace of code that I'm working with. Now I know how to connect to database and that. But the one thing that I've no idea on how to do is this. Checking the number stored in the Variable and comparing that with the id stored in the database. An example. $email = 1 Database has an id that contains 1 $email = 43 Database has an id that contains 43 $email = 54 Database has no id that contains 54 and so the script is not executed.
  10. Whats Smarty templates? The only resion I've seen {comment} in templates becuase of somthing like it on the phpbb style forum. Where ppl can customize the forum template.
  11. its so that others can creat custom templates or to intergrate the guest book into there site.
  12. When I was learning the basics of PHP I found this book very useful. Sams teach your self php, mysql database and appachy in 24 hours. It showed me some every day use of php and gived me a better understanding. The book will not teach everything, just the basics to help you understand and learn basic scripting. And as you start to get better you can start to desgin your own guest book and interactive pages. This site and a forum is a great place for information and help if you get stuck. And www.php.net has loads of information on diffrent codes and funcanlitys.
  13. Ok I don't know where to begin to look for the information I need. So I'm posting here so that some one might have an idea from what I've described. And help me find what I'm looking for. I would like to be able to use a php script that could phase a HTML and add part of its codes to the HTML its phased. So where it would have in the HTML code {comment} {date} {name} {Race} {Nation} {Rank} {email} {url} etc... Then it would put in the place of it the output from the database to them markings. eg.. Where it says {email} it would be replace with a HTML code like mailto: and then the information from the database. If you understand what I'm trying to get at. Could you please help me find a good tutorial on doing somthing like this. Thank You.
×
×
  • 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.