Email $header problem - need help

I have designed a mail processing script to send POST data
captured by a form to an email address specified by $to. It has a
subject line ($subject). Now I want to add a ‘from’
line which is to contain the email address submitted as one of the
POST form fields (volunteerEmailaddress). This is all done in PHP.
I took a crack at it (see below). The $to line and the
$subject lines work just fine. The $header displays fine in the
email but only the first piece (From: Volunteer Applicant), not the
second piece (volunteerEmailaddress).
Can anyone see what I have coded incorrectly and suggest the
correct code to do this?
Thanks!
Carver
//mail processing script
$to = '[email protected]';// use your own email address
$subject = 'Volunteer Application';
// create additional headers
$headers = 'From: Volunteer Applicant';
if (!empty($email)) {
$headers .= '\r\nReply-To: $volunteerEmailaddress';

CarverW wrote:
> Regarding email header injection attacks -- I have
followed the tutorials in
> your book and have in the include file what you have in
your book in the file
> process_mail.inc.php
That should be fine. A lot of people just pick up scripts
from outdated
books or websites. So I wanted to make sure you were aware of
the
potential danger. You obviously are. ;-)
> Your book has been excellent for my "learing curve" The
'agony' of Chapter 10
> was well worth it. I DO have a basic understanding,
pretty much of each code
> line but do get caught up in the syntax when I
customize!
Thanks for the feedback. I promise, the agony does eventually
turn into
pleasure - at least it does for most people.
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Similar Messages

  • C6-00 email account problems, need help please..

    Hi all. First of all, I don't experience any issues with the email accounts as referred to in other posts here. I do however have one problem and would appreciate if someone could explain a work-around for the issue. I'm desperately trying to set up a Gmail account using IMAP protocol but that allows me to access all advanced settings and not the ones pre-defined by the Nokia software. I'm basically wanting to have the same control I have over non pre-configured email provider accounts, download limits in KB, constantly connected when i have the mailbox open, choosing what folders to sync or not, etc.
    I did manage to have a Gmail account configured this way by mistake. When i set up the account it gave an error informing me of that i could try to continue with "alternative settings without the Nokia personalization" sort of (don't remember really the message) and after accepting to continue the account was created with "standard IMAP" settings.
    I'm however unable to re-create the event and simply cannot create a Gmail account with those settings. Even tried to set up another existing account and then edit definitions to Gmail but the personalized settings are always taking priority.
    Any advises please? Thanks alot in advance and best regards!
    Fredrik
    P.s. Sorry for double post. Mozilla Firefox messed up my 1st post

    Same problem here, but with error -2096. Can connect fine on same network with an iPod Touch and a Macbbook, but the Mac Mini that normally connects to iTunes just won't connect. Not using multiple accounts, uninstalled iTunes 8, reinstalled 7 - no joy. Uninstalled 7 reinstalled 8, no joy. Updated 8 to 8.01, no joy. Tried putting the Mini into a DMZ on the router, still no good. Sent an email to Apple support who will needless to say tell me to reinstall iTunes 8......
    Not working for me as of 10/10/08.

  • Zen Vision:M problem, NEED HELP!

    My zen vision:m is starting to run slowly. It started right after my player froze and i reset it.Now its really slow and barely even switches screens sometimes.Right now its just a black screen with the keypad lit up.Whats wrong with it'sI NEED HELP!

    johnnnyp wrote:
    hi, i have a problem with my creative vision m. i wanted to watch a movie and it froze. i tried to shut it down but it wouldnt respond, and now is frozen. please help me if you can!
    You know its kinda rude to derail XBenzinoFla thread with your own problems, make your own thread next time.
    But to the both of you especially XBenzinoFla, try putting your ZVM in rescue mode and run scan disk to see if it hel
    ps.

  • Zen Micro problem need help

    Today i was listening to music and my zen micro just froze while playing and no buttons could be pressed and the lock button wasnt on. So i took the battery out and rebooted the player but it froze at the creative screen. I went home and i went to recovery mode and tried to reload the firmware but it said erasing firmware for more than 2 hours. So then i tried a format but it said formating for the same amount of time. I need help please. Also, recently i've had problems witht the headphone jack. When ever i would stick it in it would sound distorted and i would have to move it around until i got it to a certain spot to hear it good again. If anyone else has this problem please tell me. One more thing i had returned my other micro zen in for hard dri've probems and this was my new one do u think if i have to return in (hopefully not) that they would accept it.

    If the functions in Rescue Mode aren't working properly then you need to contact Creative Support.

  • Still stuck with the same old producer consumer weight problem need help

    Hello All,
    This is the problem I am stuck with right now.
    I have two array lists one producer array list and one consumer array list denoted by a and b
    P1 P2 P3 P4 P5
    5 6 7 8 9
    C1 C2 C3 C4 C5
    2 3 4 5 6
    Now we find all those producer consumer pairs which satisfy the criteria Pi>=Ci
    We have the following sets
    (5,2)(6,2)(7,2),(8,2),(9,2)
    (5,3)(6,3)(7,3),(8,3),(9,3)
    (5,4)(6,4)(7,4),(8,4),(9,4)
    (5,5)(6,5)(7,5),(8,5),(9,5)
    (6,6)(7,6)(8,6),(9,6)
    Let us done each of them with Si
    so we have S1,S2,S3,S4,S5
    we assign a third parameter called weight to each element in Si which has satisfied the condition Pi>=Ci;
    so we we will have
    (5,2,ai),(6,2,bi),(7,2,ci)....etc for S1
    similarly for S2 and so on.
    We need to find in each set Si the the pair which has the smallest weight.
    if we have (5,2,3) and (6,2,4) then 5,2,3 should be chosen.We should make sure that there is only one pair in every set which is finally chosen on the basis of weight.
    Suppose we get a pair (5,2,3) in S1 and (5,2,3) in S2 we should see that (5,2,3) is not used to compare to compare with any other elements in the same set S2,
    Finally we should arrive at the best element pair in each set.They should be non repeating in other sets.
    Given a problem
    P0 P1 P2 P3 P4
    9 5 2 2 8
    6 5 4 5 3
    C0 C1 C2 C3 C4
    we have So as (P0,C0) and (P4,C0)
    assuming that the one with the smaller index has lesser weight PO is selected.In the program I have used random weights.from set S1 we select the pair PO,CO
    S1 =(P0,C1),(P1,C1) and (P4,C1)
    since P0 and P4 are already used in previous set we dont use them for checking in S1 so we have (P1,C1) as best.
    S2=(P0,C2),(P1,C2) and (P4,C2) so we dont use P0,C2 and P1 and C2 because PO and P1 are already used in S1.
    So we choose P4,C2
    in S3 and S4 ae have (P0,C3),(P1,C3),(P4,C3) so we dont choose anything
    and same in S4 also.
    So answer is
    (P0,C0),(P1,C1) and (P4,C2).
    My program is trying to assign weights and I am trying to print the weights along with the sets.It doesnt work fine.I need help to write this program to do this.
    Thanks.
    Regards.
    NP
    What I have tried till now.
    I have one more question could you help me with this.
    I have an array list of this form.
    package mypackage1;
    import java.util.*;
    public class DD
    private  int P;
    private  int C;
    private int weight;
    public void set_p(int P1)
    P=P1;
    public void set_c(int C1)
    C=C1;
    public void set_weight(int W1)
    weight=W1;
    public int get_p()
    return P;
    public int get_c()
    return C;
    public int get_x()
    return weight;
    public static void main(String args[])
    ArrayList a=new ArrayList();
    ArrayList min_weights_int=new ArrayList();
    ArrayList rows=new ArrayList();
    ArrayList temp=new ArrayList();
    Hashtable h=new Hashtable();
    String v;
    int o=0;
    DD[] d=new DD[5];
    for(int i=0;i<4;i++)
    d=new DD();
    for(int i=0;i<4;i++)
    d[i].set_p(((int)(StrictMath.random()*10 + 1)));
    d[i].set_c((int)(StrictMath.random()*10 + 1));
    d[i].set_weight(0);
    System.out.println("Producers");
    for(int i=0;i<4;i++)
    System.out.println(d[i].get_p());
    System.out.println("Consumers");
    for(int i=0;i<4;i++)
    System.out.println(d[i].get_c());
    System.out.println("Weights");
    for(int i=0;i<4;i++)
    System.out.println(d[i].get_x());
    for(int i=0;i<4;i++ )
    int bi =d[i].get_c();
    ArrayList row=new ArrayList();
    for(int j=0;j<4;j++)
    if( d[j].get_p() >=bi)
    d[j].set_weight((int)(StrictMath.random()*10 + 1));
    row.add("(" + bi + "," + d[j].get_p() + "," +d[j].get_x() + ")");
    else
    d[j].set_weight(0);
    row.add("null");
    rows.add(row);
    System.out.println(rows);
    int f=0;
    for(Iterator p=rows.iterator();p.hasNext();)
    temp=(ArrayList)p.next();
    String S="S" +f;
    h.put(S,temp);
    String tt=new String();
    for(int j=0;j<4;j++)
    if(temp.get(j).toString() !="null")
    // System.out.println("In if loop");
    //System.out.println(temp.get(j).toString());
    String l=temp.get(j).toString();
    System.out.println(l);
    //System.out.println("Comma matches" + l.lastIndexOf(","));
    //System.out.println(min_weights);
    f++;
    for(Enumeration e=h.keys();e.hasMoreElements();)
    //System.out.println("I am here");
    int ii=0;
    int smallest=0;
    String key=(String)e.nextElement();
    System.out.println("key=" + key);
    temp=(ArrayList)h.get(key);
    System.out.println("Array List" + temp);
    for( int j=0;j<4;j++)
    String l=(temp.get(j).toString());
    if(l!="null")
    System.out.println("l=" +l);
    [\code]

    In your example you selected the pair with the greatest
    distance from the first set, and the pair with the least
    distance from the second. I don't see how the distance
    function was used.
    Also it's not clear to me that there is always a solution,
    and, if there is, whether consistently choosing the
    furthest or the closest pairs will always work.
    The most obvious approach is to systematically try
    all possibilities until the answer is reached, or there
    are no possibilities left. This means backtracking whenever
    a point is reached where you cannot continue. In this case
    backtrack one step and try another possibility at this
    step. After all possible choices of the previous step,
    backtrack one more step and so on.
    This seems rather involved, and it probably is.
    Interestingly, if you know Prolog, it is ridiculously
    easy because Prolog does all the backtracking for you.
    In Java, you can implement the algorithm in much the same
    way as Prolog implementations do it--keep a list of all the
    choice points and work through them until success or there
    are none left.
    If you do know Prolog, you could generate lots of random
    problems and see if there is always a solution.

  • Ipod problem NEED HELP ASAP

    Hello guys,my ipod touch has battery problems and internal speaker are not working and will apple replace me a new one,i even have 1 year warranty and i want a new ipod touch white instead of black<<<plz plz plz reply ASAP plz really need HELP!THANK YOU

    If you iPod is defective, in warranty and not abused Apple will replace it with a refurbished one.  They may or may not replace it with the white one.  You will have to ask.
    Other users have asked the same question but I hav never heard them come back with whether or not they go the color changed.

  • Another Infinite Login Loop Problem - need help badly

    Hello. I need help.
    When I start up my iMac (24 inch last generation model) I can't log into the OS. When I enter my password I see the default OS wallpaper (nothing else) then it kicks me to a blue screen then right back to the login. Same thing over and over. I've already ran disk utility off of the install CD to repair permissions, etc... but no luck. This even happens when I enter into safe mode. I'm running the latest version of the OS.
    Can anyone help me?

    Restore the bootable backup/clone or Time Machine backup. Without one, you have a difficult situation. First thing to try is boot with your install disc, run Disk Utility, and repair the disk.

  • Ipod nano Problems need help fast!!!!!!

    I got my nano in october everything was working fine.Until 2 weeks ago my ipod wasnt getting reconized by itunes.Im really getting frustrated and i need help.

    Welcome to Apple Discussions!
    Read through this...
    http://docs.info.apple.com/article.html?artnum=61711
    btabz

  • Urgent Problem, need help asap.

    Hello everyone,
    I'm sorry for the alarmist title, but I need help and I need it badly. Just last night, my macbook froze with nothing working. The mouse froze, the interrupt keys didn't work, nothing. I shut down the laptop, and tried to restart. I noticed a clicking sound coming from the lower left hand corner of the macbook. I'm assuming this is the hard drive.
    What happens is that there will be two clicks happening in a rythmic fashion, and after 15 second of booting up, a folder will appear with a question mark on the screen. The only thing I can do is power it down. Can someone please describe what is happening and make suggestions?
    The kicker is that I'm a college student studying in Denmark for the semester. The laptop is my only lifeline to back home. Please, any help is greatly appreciated.
    Matt

    You may have a disk failure or simply corrupted files. If you have a bootable backup that is working, then you can boot from it, erase your hard drive, then restore your backup. If not then do this:
    Repairing the Hard Drive and Permissions
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger and Leopard.) After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer. Now restart normally.
    If DU reports errors it cannot fix, then you will need Disk Warrior (4.0 for Tiger, and 4.1 for Leopard) and/or TechTool Pro (4.6.1 for Leopard) to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    If the drive is OK then you can reinstall OS X:
    How to Perform an Archive and Install
    An Archive and Install will NOT erase your hard drive, but you must have sufficient free space for a second OS X installation which could be from 3-9 GBs depending upon the version of OS X and selected installation options. The free space requirement is over and above normal free space requirements which should be at least 6-10 GBs. Read all the linked references carefully before proceeding.
    1. Be sure to use Disk Utility first to repair the disk before performing the Archive and Install.
    Repairing the Hard Drive and Permissions
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger.) After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior (4.0 for Tiger) and/or TechTool Pro (4.5.2 for Tiger) to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    2. Do not proceed with an Archive and Install if DU reports errors it cannot fix. In that case use Disk Warrior and/or TechTool Pro to repair the hard drive. If neither can repair the drive, then you will have to erase the drive and reinstall from scratch.
    3. Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When you reach the screen to select a destination drive click once on the destination drive then click on the Option button. Select the Archive and Install option. You have an option to preserve users and network preferences. Only select this option if you are sure you have no corrupted files in your user accounts. Otherwise leave this option unchecked. Click on the OK button and continue with the OS X Installation.
    4. Upon completion of the Archive and Install you will have a Previous System Folder in the root directory. You should retain the PSF until you are sure you do not need to manually transfer any items from the PSF to your newly installed system.
    5. After moving any items you want to keep from the PSF you should delete it. You can back it up if you prefer, but you must delete it from the hard drive.
    6. You can now download a Combo Updater directly from Apple's download site to update your new system to the desired version as well as install any security or other updates. You can also do this using Software Update.

  • Big email problems- need help asap

    I really hope someone out there can help me. I posted this same problem last night but I'm dying for some help. I 'm new to BB and can't set up my email account. We are a small company using Microsoft Exchange and access our email away from the office using Outlook web access. I'm going step by step doing everything it asks and when I'm done I get a message saying connection could not be established and to check that the server name is correct and that the server is available. I know the server name is correct because I use it on my laptop all the time to access my emails. Does anyone know how to check if the server is available? do I need some software I don't have? can I use the BIS to create an account and sync with my work outlook without having to change my email address. I'm very computer unsavoy and could use someone's knowledge. PLEASE HELP!!!!!!!!!!!

    chk these three knowledge base articles about typical OWA setup issues:
    http://www.blackberry.com/btsc/search.do?cmd=displayKC&docType=kc&externalId=KB03133&sliceId=SAL_Pub...
    http://www.blackberry.com/btsc/search.do?cmd=displayKC&docType=kc&externalId=KB04804&sliceId=SAL_Pub...
    http://www.blackberry.com/btsc/search.do?cmd=displayKC&docType=kc&externalId=KB02858&sliceId=SAL_Pub...
    Message Edited by BBsingh on 09-24-2008 01:23 PM
    Click on KUDOS to appreciate our efforts and mark the thread RESOLVED if your issue is resolved.

  • Email Problem, Need Help

    Hoping someone can help. Have a HTC Droid DNA for a couple months and love it. No problems. About a week ago I took two pictures and was forwarding them to my gmail account([email protected] I accidentally sent them to [email protected] which is an account that does not exist. I received a notice "could not deliver mail" and two consecutive "droid" sound notifications. No problem I thought, just go into sent mail and delete but they are not there. I guess because they were not actually sent. Now for the past week, EVERY HOUR (that is the time I set for notifications-syncing) i get two consecutive droid sound notices. Extremely annoying.
    All mail functions for my gmail and aol accounts work fine before this happened and other than the annoying droid reminder every hour work fine after.
    I was hoping someone could help me solve this in some way. I am not very phone, tech literate so please explain any possible fix carefully.
    It was suggested that I clear the cache, that might fix the problem. I did that but unfortunately the problem remains. I would have thought this would (could) be a common problem (accidentally sending an email and attachment to a wrong non existent address).
    Many thanks in advance for any help.

    When the domains mail exchanger has a delivery problem it normally send that message to the sender alerting you to the problem.
    In the body of the message will be something like [email protected] could not be delivered, normally it will say the email address does not exist or will give a message of "we will attempt to deliver this message for 5,7, or 10 days"
    The domain if after these attempts will send you a final message of "Delivery to [email protected] has fail, we are sorry but we have gave up"  that will be the last message you should receive.
    I would send an email to [email protected] tell them to please stop the mx from sending you repeated bounce messages.
    takes them secounds to comply once they see your message.
    Of course that was in the old days, hopefully it has not changed.
    Good Luck

  • Sedn email problem-----need help

    Why this is not working
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class Mailklasa {
    public static void main (String args[]) throws Exception {
    String host = "out.mail.bih.net.ba";
    String from = "[email protected]";
    String to = "[email protected]";
    // Get system properties
    Properties props = System.getProperties();
    // Setup mail server
    props.put("out.mail.bih.net.ba", host);
    // Get session
    Session session = Session.getDefaultInstance(props, null);
    // Define message
    MimeMessage message = new MimeMessage(session);
    // Set the from address
    message.setFrom(new InternetAddress(from));
    // Set the to address
    message.addRecipient(Message.RecipientType.TO,
    new InternetAddress(to));
    // Set the subject
    message.setSubject("Hello JavaMail");
    // Set the content
    message.setText("Welcome to JavaMail");
    // Send message
    Transport.send(message);

    Hi!
    I've found the following error:
    // Setup mail server
    props.put("out.mail.bih.net.ba", host);it should be:
    // Setup mail server
    props.put("mail.smtp.host", host);Hope this helps.
    Bye.

  • HELP - email address problem - need to reset a variable

    I created a form that will be submitted to certain different email addresses based on an option selected from a drop-down list (named Customer).
    I tried another script posted here, but that was based on the assumption that there was only one choice per email address in the list.
    I wrote this on the change event of my list. I want the variable "emailAddress" to adopt the correct email address, based on the value of the option selected from the list:
    var emailAddress = "[email protected]";
    if (Customer.rawValue = "3"|"4"|"7") {
    emailAddress = "[email protected]";
    else if (Customer.rawValue = "5"|"8"|"15"|"20"|"21"|"26") {
    emailAddress = "[email protected]";
    else if (Customer.rawValue = "9"|"10"|"13") {
    emailAddress = "[email protected]";
    else {
    emailAddress = "[email protected]";
    Then I copied this (from the other topic), on the click event of a regular button ,which calls for a second, hidden button:
    EmailSubmitButton1.resolveNode("#event").submit.target = "mailto:"+ emailAddress;
    EmailSubmitButton1.execEvent("click");
    The form worked fine the first time, but after that, all submissions are going to [email protected] I'm thinkking that the variable emailAddress has now a fixed value, and does not change.
    I am new to Javascript, so I might have not written the code properly, any help will be greatyl appreciated!
    Thank you.

    Daeveed:
    I think your javascript syntax is problematic. Instead of the syntax
    if (Customer.rawValue = "3"|"4"|"7")
    try
    if (Customer.rawValue == "3"|"4"|"7")
    Note the double equals sign. That's the equality comparison operator in javascript. The single equals is assignment.
    if that still doesn't work, try
    if ((Customer.rawValue == "3") || (Customer.rawValue == "4") || (Customer.rawValue == "7"))
    Hope this helps.

  • G5 DVI to VGA Dell Monitor Connection problems, need help!!!!!!!!!!!!!!!!!!

    hello,
    I'm running two dell monitors both of which were connected via DVI to my g5 quad dual dvi. My tv broke and I'm using one of my monitors to connect the cable boxes HDMI input to the dells DVI input, it works great.
    My problem is that i still want to run two monitors from my mac and still be able to switch channel sources from the Dells source button allowing me to switch from TV to Mac. Since I took up the dvi port on one of my monitors to connect to the cable box via HDMI, I have a free DVI cable. I purchased a tiny converter that allowed to change one end of the free DVI cable to VGA. I used this method to connect the cable to my g5's dvi port and the configured end to the VGA port on the monitor with no luck.
    The Dell monitor does not pick up any signal and just goes to sleep as if my computer does not exist. The TV works fine and I'm able to switch sources. Please note that I'm not using the DVI-VGA adaptor that came with my g5 and don't know if this would make a difference. If it does, how do i set this up because this adaptor is like 5 inches long.
    Does the adaptors DVI end need to be connected to the back of the g5 or does the VGA end need to be connected to the monitor or does it not matter. I need a longer dvi-vga cable as well, do they make them. This all depends if the problem actually is that that I'm not using the DVI-VGA cable that came with my mac to connect to the monitor in the first place.
    Can anyone help me out here. I'm using the Dell 2208WFP Ultra Sharp.

    Bad adapter?
    The G5 ports are DVI-I. Any good DVI-I to VGA adapter should be fine.

  • I am having a big problem need help

    I can't set up my email in my mac mail... I posted my question here.. https://discussions.apple.com/message/21560797#21560797
    And by mistake clicked on my own reply that it solved my problem and it did not, how do I undo it.. please help!

    You cannot change points awarded in error.   But don't be too concerned, if you explain as you have most people will know the intention was there.   In any event most of us are just happy to help.

Maybe you are looking for