Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Tutorials > PHP Tutorials

Unregistered, Check out the Coder Battles in the Announcement and Game forums.

PHP Tutorials PHP Tutorials

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-06-2007, 09:57 AM
Jaan's Avatar   
Jaan Jaan is offline
<img src="http://forum.codecall.net/images/userbar/mod.png" alt="Mod">
 
Join Date: Dec 2006
Location: Estonia
Age: 17
Posts: 890
Last Blog:
Wadio Media Layout Com...
Credits: 56
Rep Power: 15
Jaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the rough
Send a message via MSN to Jaan
Default mail() function

You can send emails with this function.
It's syntax is very simple

Code:
mail(to,subject,message,headers,parameters)
example:

PHP Code:
mail("myemail@host.xxx""Hello!""Here will be my message""From: Jaan"); 
parameters is optional, it specifies an additional parameter to the sendmail program.

Here's little script with what you can send emails:

form.html

HTML Code:
<form action="send.php" method="post">
Your name: <input type="text" name="name" size="30"><br>
Email:<input type="text" name="email" size="30"><br>
Subject: <input type="text" name="subject" size="30"><br>
<textarea cols="60" rows="10" name="message"></textarea><br>
<input type="submit" value="Send">
</form>
send.php

PHP Code:
<?php

$email 
$_REQUEST['email'];
$name $_REQUEST['name'];
$subject $_REQUEST['subject'];
$message $_REQUEST['message'];

if(empty(
$email) or empty($name) or empty($subject) or empty($message)){
die(
"Please fill your form correctly!"); 
}else{
mail($email$subject$message"From: $name");
echo 
"Thank you!";
}

?>
Have fun!
Attached Files To view attachments in this forum your post count must be 1 or greater. You currently have 0 posts.
__________________


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
| Need help? Send a
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 01-06-2007, 01:09 PM
TcM's Avatar   
TcM TcM is offline
Moderator
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,306
Credits: 0
Rep Power: 74
TcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud of
Default

So this is something like to send email anonymously?
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-06-2007, 01:12 PM
Jaan's Avatar   
Jaan Jaan is offline
<img src="http://forum.codecall.net/images/userbar/mod.png" alt="Mod">
 
Join Date: Dec 2006
Location: Estonia
Age: 17
Posts: 890
Last Blog:
Wadio Media Layout Com...
Credits: 56
Rep Power: 15
Jaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the rough
Send a message via MSN to Jaan
Default

yup i guess.. but it still shows where this email came.. so
__________________


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
| Need help? Send a
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-06-2007, 11:16 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,234
Last Blog:
Passwords
Credits: 872
Rep Power: 20
John has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud of
Send a message via AIM to John Send a message via MSN to John
Default

Nice, it's nice to see people take advantage of the empty() function, 99% of the cases i see, people use !isset()
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-07-2007, 07:31 AM
Jaan's Avatar   
Jaan Jaan is offline
<img src="http://forum.codecall.net/images/userbar/mod.png" alt="Mod">
 
Join Date: Dec 2006
Location: Estonia
Age: 17
Posts: 890
Last Blog:
Wadio Media Layout Com...
Credits: 56
Rep Power: 15
Jaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the rough
Send a message via MSN to Jaan
Default

lol i use empty() because i remember when i learned php then this function was very simple to remember.. because empty is much simple word than isset
__________________


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
| Need help? Send a
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 01-08-2007, 02:02 AM
xtraze xtraze is offline
Programming God
 
Join Date: Dec 2006
Location: Sri lanka
Posts: 921
Credits: 5
Rep Power: 0
xtraze is on a distinguished road
Send a message via MSN to xtraze Send a message via Skype™ to xtraze
Default

I know of a Mobile service provider which let's users to recieve SMS/MMS via E-mail.
It goes like this, when the phone number (local) is 999999999 the e-mail will be 99999999@sms.mobitel.lk
9999999@mms.mobitel.lk

Now for the Q.s

#Can I add a attachment feature for this.

#Can I only ask the users for the phone number and Add "@xxx.mobitel.lk" at the end automatically

#Can I let users to choose whether SMS/MMS via a combo menu

This can lead to a free SMS service dudes, I made one for SMS myself, but still cannot do the combobox, and attachment. Have No Idea of how to use it, Really complicated.

Last edited by xXHalfSliceXx; 11-03-2007 at 03:18 AM. Reason: Spamed User
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 11-02-2007, 02:56 PM
sunnetmedia sunnetmedia is offline
Newbie
 
Join Date: Nov 2007
Posts: 1
Credits: 0
Rep Power: 0
sunnetmedia is on a distinguished road
Default

....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 11-18-2007, 11:32 AM
chathucj chathucj is offline
Newbie
 
Join Date: Nov 2007
Posts: 1
Credits: 0
Rep Power: 0
chathucj is on a distinguished road
Default wow!

how can i customize this one to sen SMS to Srilanka's MOBITEL network?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-06-2008, 06:15 AM
DoubleN DoubleN is offline
Newbie
 
Join Date: Feb 2008
Posts: 1
Credits: 0
Rep Power: 0
DoubleN is on a distinguished road
Default

Quote:
Originally Posted by xtraze View Post
I know of a Mobile service provider which let's users to recieve SMS/MMS via E-mail.
It goes like this, when the phone number (local) is 999999999 the e-mail will be 99999999@sms.mobitel.lk
9999999@mms.mobitel.lk

Now for the Q.s

#Can I add a attachment feature for this.

#Can I only ask the users for the phone number and Add "@xxx.mobitel.lk" at the end automatically

#Can I let users to choose whether SMS/MMS via a combo menu

This can lead to a free SMS service dudes, I made one for SMS myself, but still cannot do the combobox, and attachment. Have No Idea of how to use it, Really complicated.
yep u can do it
try to send 9471*******@sms.mobitel.lk
but....u'll be able to send only 120 character in Message
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-06-2008, 08:05 AM
Jaan's Avatar   
Jaan Jaan is offline
<img src="http://forum.codecall.net/images/userbar/mod.png" alt="Mod">
 
Join Date: Dec 2006
Location: Estonia
Age: 17
Posts: 890
Last Blog:
Wadio Media Layout Com...
Credits: 56
Rep Power: 15
Jaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the rough
Send a message via MSN to Jaan
Default

umm.. maybe 160?
__________________


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
| Need help? Send a
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
multi-pass preprocessing kenna C and C++ 11 08-14-2007 10:45 AM
Reg Fucntion pointers sowmi C and C++ 9 07-29-2007 03:29 AM
small help in this generator function plz SamehSpiky C and C++ 3 06-22-2007 11:47 AM
php mail function, how to use it? falco85 PHP Forum 3 08-21-2006 04:16 PM


All times are GMT -5. The time now is 03:15 AM.

Contest Stats

Xav ........ 1276.19
MeTh0Dz|Reb0rn ........ 1048.58
morefood2001 ........ 879.43
John ........ 872.39
marwex89 ........ 869.98
WingedPanther ........ 761.06
Brandon W ........ 684.87
chili5 ........ 294.12
Steve.L ........ 216.18
dargueta ........ 192.86

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 81%

Ads