Jump to content


Newsletter?


9 replies to this topic

#1 pistonsfreak

    Young Padawan

  • Members
  • Pip
  • 174 posts

Posted 27 May 2007 - 01:34 PM

I am in the process of coding yet another website and I was wondering if there is any code out there to produce a newsletter or a free program I can download to send one out. I cant find one so any help would be appreciated.

Thanks

#2 curthard89

    Young Padawan

  • Members
  • Pip
  • 226 posts

Posted 27 May 2007 - 03:44 PM

if your coding a website, why dont u code it urself? lol

#3 Chaos King

    Senior Programmer

  • P2L Staff
  • PipPipPip
  • 676 posts
  • Gender:Male
  • Location:Florida

Posted 27 May 2007 - 06:26 PM

Now now. Lets not get too vicious. It was a simple question, that harsh of an answer was not needed.

http://www.google.com/search?hl=en&cli...amp;btnG=Search

I hope this search has helped you.

#4 pistonsfreak

    Young Padawan

  • Members
  • Pip
  • 174 posts

Posted 28 May 2007 - 08:25 PM

View Postpistonsfreak, on May 27 2007, 02:34 PM, said:

I am in the process of coding yet another website and I was wondering if there is any code out there to produce a newsletter or a free program I can download to send one out. I cant find one so any help would be appreciated.

Thanks

Because I am intermediate coder I dont knw that much about PHP, and yes it helped me out a lot thanks :D

#5 pistonsfreak

    Young Padawan

  • Members
  • Pip
  • 174 posts

Posted 28 May 2007 - 08:57 PM

at one point it gives me the code "CREATE TABLE nl_subscribe ( em varchar(75) NOT NULL default '', status varchar(10) NOT NULL defult '') TYPE=MyISAM;" says its incorrect where the flaw?

#6 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 28 May 2007 - 09:48 PM

CREATE TABLE `nl_subscribe` ( `em` varchar(75) NOT NULL DEFAULT '', `status` varchar(10) NOT NULL DEFAULT '') TYPE=MyISAM;

Try that. There was a simple miss-type where it said 'defult' instead of 'default' like it should.

#7 pistonsfreak

    Young Padawan

  • Members
  • Pip
  • 174 posts

Posted 29 May 2007 - 08:58 AM

thanks maybe i should start paying more attention to the code and stop wasting peoples time lol thanks

Edited by pistonsfreak, 29 May 2007 - 08:58 AM.


#8 pistonsfreak

    Young Padawan

  • Members
  • Pip
  • 174 posts

Posted 29 May 2007 - 04:36 PM

<? $status = "OK";  // setting the flag to check the status
$msg="";          // setting the variable for message
if (!stristr($em,"@") OR !stristr($em,".")) {
$msg="Your email address is not correct<BR>";
$status= "NOTOK";} 
 echo "<br><br>";
if($status=="OK"){// Now the email is valid and we can add to our database
$query=("INSERT INTO nl_subscribe (em,status) VALUES ('$em','subscribe')");
$result=mysql_query($query);
echo "<center>THANK YOU <br>Thanks for subscribing to our newsletter and any time you can unsubscribe by clicking a link in your newsletter</center>";
          }
else {echo "<center>$msg </center>";}  // this will display the error message if email address is not valid one.
?> 

the problem is when I enter my email to put into the table it says its not valid, the email is pistonsfreak3632@gmail.com

thanks

#9 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 29 May 2007 - 07:51 PM

Bit of poor code there if you copy-pasted it from a tutorial or something.
I don't feel like writting more and editing my long email-validating code for you, but this should be a workable change of your existing script.

<?php
$msg = ''; // Setting the variable for message

// Regex Validate Email
if(!preg_match('#([._a-z0-9-]+[._a-z0-9-]*)@(([a-z0-9-]+\.)*([a-z0-9-]+)(\.[a-z]{2,3})?)#i', $em))
  $msg = 'Your email address is not correct<br />';

echo "<br /><br />";

if(empty($msg)){ // Now the email is valid and we can add to our database
  mysql_query("INSERT INTO `nl_subscribe`(`em`, `status`) VALUES('".mysql_real_escape_string($em)."', 'subscribe')") or die(mysql_error());
  echo '<center>THANK YOU<br />Thanks for subscribing to our newsletter and any time you can unsubscribe by clicking a link in your newsletter</center>';
}
else
  echo "<center>{$msg}</center>"; // this will display the error message if email address is not valid one.
?>

If you would like a safer script, simply PM me and I can send you a draft of my own.

#10 Tarquin

    Young Padawan

  • Members
  • Pip
  • 67 posts
  • Gender:Male
  • Location:London
  • Interests:I'm a huge Crystal Palace fan (Soccer team in England for you Americans)

Posted 30 May 2007 - 03:36 PM

I really wouldn't recommend using http://www.plus2net....tter_script.php for your tutorial, the whole tutorial I feel is crap.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users