Jump to content

jacob1986

Members
  • Posts

    37
  • Joined

  • Last visited

Everything posted by jacob1986

  1. I have typed some code (from a book) but I keep getting the errors - 'Notice: Undefined index: id in C:\xampp\htdocs\article_detail.php on line 2' and 'Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\article_detail.php on line 14'. I have highlighted (in bold) both the second and fourteenth line (errors from above) in the code. What I should see is a page like the one described below. ****************************************** My article title goes here published At: 2014-02-11 this is article content ************************************************************** The code is as followed: <?php $id= $_GET["id"]; $server="localhost"; $dbuser="root"; $password=""; $link=mysqli_connect($server,$dbuser,$password); mysqli_select_db($link,"blog"); $sql="SELECT * FORM article WHERE id=$id"; $result=mysqli_query($link,$sql); $row=mysqli_fetch_array($result); $title=$row["title"]; $content=$row["content"]; $publication_date=$row["publication_date"]; mysqli_close($link); ?> <h3><?php echo $title;?></h3> Published At:<?php echo $publication_date; ?> <p><?php echo $content; ?></p>
  2. Would it be feasible for someone to tell me if my code is good enough to deter and admonish spammers? Moreover; I have sorted the original problem(s) of the thread. <?php if($_POST['robots'] != '') { echo 'No spammers here!'; } else { // Process the the form } $to = '[email protected]'; $subject = 'info help '; $message = 'From: ' . $_POST['name'] . "\n"; $message .= 'Email from: ' . $_POST['email'] . "\n"; $message .= "Message:\n" . $_POST['Message'] . "\n\n"; $headers .= 'Cc: [email protected]'; mail($to, $subject, $message, $headers); mail ($email, $subject, $message, "from:".$from); header('Location: xxxxxxxx.com/thank-you.html'); exit(); ?>
  3. Foremost: thank-you for helping me (to all posters). I am going to start again from scratch (building a form and php in Dreamweaver) then I will write the php code again from (as I said) scratch... I will ask for help in the next days to fathom the code operations (argument and so forth). Once again thank-you.
  4. <?php $email="info@xxxxxxninja"; $to ="[email protected]"; $subject=$_POST['Subject']; $message=$_POST['Message']; $headers = 'From: reply.info@xxxxxx'. "\r\n" . $headers .= 'Reply-To: xxxxxxx' . "\r\n" . $headers .= 'Cc: [email protected]' . "\r\n" . X-Mailer: PHP/' . phpversion(); mail ($email, $subject, $message, $headers, $from); Print "Your Message has been sent"; ?>
  5. I quickly changed the code to the following (as below) but still the same problem occurs? $headers = 'From: [email protected]'. "\r\n" . $headers .= 'Reply-To: websiteinfotest.ninja' . "\r\n" . $headers .= 'Cc: [email protected]' . "\r\n" .
  6. I moved the Cc and from as the fourth argument (the argument is the $from="[email protected]" lines under <?php right?) but now I don't receive any emails to my Cc email client plus the information I receive in the email looks like this... [email protected] <subject line> From [email protected] <[email protected]> To [email protected] Cc [email protected] Reply-to [email protected] php code: <?php $email="[email protected]"; $to ="[email protected]"; $subject=$_POST['Subject']; $message=$_POST['Message']; $headers = 'From: [email protected]'. "\r\n" . $headers = 'Reply-To: websiteinfotest.ninja' . "\r\n" . $headers = 'Cc: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail ($email, $subject, $message, $headers, $from); Print "Your Message has been sent"; ?>
  7. Can I please ask for help in regards to another small problem, I have the php code below but every time I send a message it doesn't send to my first email address ([email protected]) but instead only sends the message to my Cc profile [email protected]? Moreover; I also not fixed my initial problem of 'seeing the person email address' in subject line an example of what I mean is below (Example php Code). All I want is to send a message from my webpage to my email client and be able to see the person's name in subject field, plus the person's email address in the reply-to field (of my email client) and lastly have the message send to my first email address and the Cc. Please help! Example php Code: <?php $from="[email protected]"; $email="[email protected]"; $to ="[email protected]"; $subject=$_POST['Subject']; $message=$_POST['Message']; $headers.= "Cc:[email protected]"; mail ($email, $subject, $message, $headers, "From:".$from); Print "Your Message has been sent"; ?> Example of Email problem: A message that you sent contained a recipient address that was incorrectly constructed: From:[email protected] missing or malformed local part (expected word or "<") The message has not been delivered to any recipients. ------ This is a copy of your message, including all the headers. ------ To: [email protected] Subject: [email protected] Cc:[email protected] iooioo
  8. I did write it... as in open php file in dreamweaver - cut html code, then proceeded to write the aforementioned php code from a watching a youtube example of said code.
  9. I copied it from a youtube video and thought it meant to say form.
  10. I'm kind of stuck... where is my spelling bad?
  11. I have written a small contact form using .php in Dreamweaver, the message from the webpage does send... except but I cannot see (in my email client) the recipients email address to send the reply to? Moreover; the webpage has three text boxes ‘Name, Email and Message’, in my email client - I can see the person’s name (in subject line), ‘To’... shows up as my email address - i.e. [email protected] and the message is shown as it should be? The code I have written is as followed: <?php $from="[email protected]"; $email="[email protected]"; $to ="[email protected]"; $subject=$_POST['Subject']; $message=$_POST[ 'Message']; mail ( $email, $subject, $message, "From:".$form); Print "Your Message has been sent"; ?>
×
×
  • 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.