This is a discussion on "[SOLVED] email question" within the PHP Forum section. This forum, and the thread "[SOLVED] email question are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] email question
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
[SOLVED] email question
hi,
I have just created a email blast in the php along with a table subscribers in the photos database, and tested at http://localhost:8888/24/emailblast.php. Not sure why it didn't show me the result after I sendt the testing News letter to those email records which has been inserted into database table 'subscribers' from database 'photos'? Any inputs will be great appreciated!!!
|
|
|
|
#2
|
||||
|
||||
|
Re: email question
Hi,
In your form, you have mispelt "value" in the hidden element named "op", this would mean the $_POST['op'] will never = 'send'; Cheers,
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#3
|
|||
|
|||
|
Re: email question
You can actually do this with a bit less code. The hidden value is unnecessary because you need a subject to send an email anyway so you can just check to see if the subject is set. I'm not sure where this script is going to be used, but its always a good idea to validate user input.
I also cleaned up you code a bit: single quotes and the "." concatenation operator are always much faster than double quotes. If you have a double-quoted string, then the PHP interpreter has to check the whole string for inline variables. Also, if you use single quotes, then you don't have to escape the double quotes in your HTML code.... So, check this out. I know this may seem a bit trivial for such a small project, but if you write clean, efficient code from the beginning on, then when you have a larger project, you will notice the difference:
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#4
|
||||
|
||||
|
Re: email question
Thanks for that Jan. I didn't know you could do it like that, saves adding slashes to everything!
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#5
|
|||
|
|||
|
Re: email question
I'm not sure if ending the PHP tags is more efficient than using echo, but for readability its much nicer.
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#6
|
|||
|
|||
|
Re: email question
Great help, I am using your codes which is much less codes and easy to read! Much appreciated!!
Do I need to modify the php.ini file? Because when I click on send. I got this Fatal error: Call to undefined function mysl_select_db() in /Applications/MAMP/htdocs/24/emailblast.php on line 8 Not sure what is wrong with "mysql_select_db('photos')" |
|
#7
|
||||
|
||||
|
Re: email question
yes you need to enable the mysql extension
do you want a copy of my php.ini file?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#8
|
|||
|
|||
|
remote emailblast error
Hi alexgeek,
Yes, I'd like to have your php.ini file. After I sumbitted the emailblast.php at http://www.sandragreen.com/emailblast.php I've got this errors: Fatal error: Call to undefined function: mysl_select_db() in /home/sandr10/public_html/emailblast.php on line 8, after I uploaded emailblast.php to the remote server. Quote:
I heartfully appreciated your help!!! |
|
#9
|
||||
|
||||
|
Re: remote emailblast error
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| email security question... | MikeTheVike | Web Page Design | 3 | May 6th, 2008 20:16 |
| [SOLVED] Form to email script with checkboxes | Posie | PHP Forum | 4 | Dec 10th, 2007 03:54 |
| [SOLVED] sending email once form submitted | Emzi | PHP Forum | 5 | Nov 21st, 2007 14:25 |
| [SOLVED] Form Submit To Email | longstand | PHP Forum | 17 | Nov 13th, 2007 13:16 |
| [SOLVED] Form to email with checkbox | itsdesign | PHP Forum | 4 | Oct 29th, 2007 00:57 |