Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > PHP Forum

PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-04-2008, 01:41 AM
wanako wanako is offline
Newbie
 
Join Date: Feb 2008
Posts: 4
Rep Power: 0
wanako is on a distinguished road
Red face phpmailer and dynamic text

Hi all,

First request for help from a programming newbie.

I want to collect information from a form to be included in a text message and send it with phpmailer. Nevertheless, I canīt figure out how to include dynamic information if a condition has been meet.

In my case, when a user fills the form checkboxes, I want to include inside the standard message a text according to the choices the user has made. How is it possible to use loops such as "foreach" or "if" to create this content to be inserted inside the standard message?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 03-04-2008, 07:58 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 9,203
Last Blog:
Ext JS or Ext GWT
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

Are you using checkboxes for a condition? Users can select multiple checkboxes but here is how to find the value.

HTML Example:
HTML Code:
<input type="radio" value="Female" name="gender">
PHP Reading HTML
PHP Code:
if ($_POST("gender") == "Female")
{  
           
// Your code

__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-04-2008, 10:25 AM
wanako wanako is offline
Newbie
 
Join Date: Feb 2008
Posts: 4
Rep Power: 0
wanako is on a distinguished road
Default

The idea is to create a text according to the chekcboxes checked, not to print their value.

I want to create the text included in the body of the message sent by phpmailer, something like:
$mail->Body = "Thank you. We have received you info Mister".$name." -- here i want to print a message according to the value of one or more checkboxes (conditional loop) --";
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-05-2008, 05:13 AM
wanako wanako is offline
Newbie
 
Join Date: Feb 2008
Posts: 4
Rep Power: 0
wanako is on a distinguished road
Talking

Is incredible what one night sleep helps (and of course some thinking)

My solution was:

$text=$text.$loopresult."\n";
and place the result in the text body.

Why things seems so complicated in the first instance ?

Just some newbie excitment
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
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
Forum Jump


All times are GMT -5. The time now is 05:35 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 97%

Ads