Very quick PHP question

Hi, on my website I have a form where a user enters into certain details so that a referral email to his friend if the user thinks that his friend will be interested in the site! I have the form working as such, but I want to have a message in the body of the email which is generic, but will change some details depending on the user. Thus, for example, he would say: Hi < friendly name >, < username > friend gave us... and so on. How can I do this?

Thank you, Scott

I pasted in the PHP script, I got so far:

<? PHP
Website Contact form generator
// http://www.tele-pro.co.UK/scripts/Contact_Form/
This script is free to use as long as you
keep the credit link

data published in local variables

$EmailTo = " " [email protected] "; "
$YourName = Trim (stripslashes($_POST['YourName']));
$YourEmail = Trim (stripslashes($_POST['YourEmail']));
$RefName = Trim (stripslashes($_POST['RefName']));
$RefEmail = Trim (stripslashes($_POST['RefEmail']));
$EmailFrom = Trim (stripslashes($_POST['YourName']));
$Subject = Trim (stripslashes($_POST['RefName']));

validation
$validationOK = true;
If (! $validationOK) {}
Print "< meta http-equiv =-"refresh\"content =------"0; " URL = Error.html\ "' >"; "
"exit";
}

prepare the body of the email text
$Body = "";
$Body. = "yourname: «;»»
$Body. = $YourName;
$Body. = « \n » ;
$Body. = "YourEmail: «;»»
$Body. = $YourEmail;
$Body. = « \n » ;
$Body. = "RefName: «;»»
$Body. = $RefName;
$Body. = « \n » ;
$Body. = ' RefEmail: '; "
$Body. = $RefEmail;
$Body. = « \n » ;


send email
$success = mail ($EmailTo, $Subject, $Body, "in: < $EmailFrom >" "");

Redirect to the page of the successful
If {($success)
Print "< meta http-equiv =-"refresh\"content =------"0; " URL = thankyou2.html\ "' >"; "
}
else {}
Print "< meta http-equiv =-"refresh\"content =------"0; " URL = Error.html\ "' >"; "
}
? >

If I understand correctly, change this:

$Body = "";

to do this:

$Body = "Hi $RefName, your friend $YourName gave us..." » ;

Of course, it is is not clear to me which of these variables translate into and , but you get the idea.

You should also look at using a honeypot field to help reduce spam spammers to fill in form.

--
Mark A. Boyd
Keep-on-Learnine :-)
This message was processed and published by Jive.
It will not be considered an accurate representation of my words.

Tags: Dreamweaver

Similar Questions

  • BlackBerry smartphones, I got new BB but its battery drains very quickly, why?

    I have two question for my next Blackberry:

    1. I got new Backberry bold 9700 8 months, but I have been using what it since the last 25 days only open, but its battery drains very quickly even if I use it to 10 candy Mint in just one day, but the battery was evacuated quickly and finished some 24 hrs. I have

    2. What is the new BB battery if it is used for the currencies of 10 to 15 per day? There are daily load?

    3. How can I check my BB speaking time?

    4. where can I get the Moose new battery BB?

    Imtiazshah wrote:

    1. I got new Backberry bold 9700 8 months, but I have been use for the last 25 days only open but its battery drains very quickly although I use it for 10 candy Mint in just one day, but the battery was evacuated of very fast and some ended up 24 hrs.

    24 hours use on charge a battery is not bad. You have probably another unnecessary application running in the background, you are moving in and out of the area of WiFi access and the same area of the network, depending on your location, which drains your battery more quickly.

    Imtiazshah wrote:

    2. What is the new BB battery if it is used for the currencies of 10 to 15 per day? There are daily load?

    While you use only 10 to 25 minutes, the device is on and running, regardless.

    It is recommended that you NOT drain the battery in 5-10%, but top it off when you get a chance during the day.

    Imtiazshah wrote:

    3. How can I check my BB speaking time?

    Talk time of each call, this month? Total for the history of the device BlackBerry itself?

    Imtiazshah wrote:

    4. where can I get the Moose new battery BB?

    Try Amazon.com best prices

  • recharge batteries not beyong 80% and down very quickly. What is the problem?

    Facing a problem with my VAIO laptop battery. The model number is VPCEB12EN. The doe battery charging not more than 80%. The message displayed is "plugged not charging. The battery also seems to flow very quickly. Can someone please?

    Hi Hemant.

    Follow the steps here to disable the battery charge function to resolve the error: https://us.en.kb.sony.com/app/answers/detail/a_id/42181/c/65%2C66/kw/42181

    Then, perform all the steps mentioned here to the problem of battery discharge: https://us.en.kb.sony.com/app/answers/detail/a_id/30506/c/65%2C66/kw/30506

    Then, follow the steps here: https://us.en.kb.sony.com/app/answers/detail/a_id/42608/c/65%2C66/kw/42608

    If the problem persists, contact the Sony support team in your country for help here: http://www.sony.net/SonyInfo/Support/

    Note: If my post answered your question, please mark it as an "accepted Solution".

  • my battery drains very quickly even when not in service, what should I do to fix that?

    my battery drains very quickly even when not in service, what should I do to fix that?

    Hello rabeeha hafeez robi.

    Thank you for using communities of Apple Support. It is my understanding that your iPhone battery has been draining more than expected. I use my iPhone all day, so I know how important the battery life can be. Surely, I understand your concern, as much as it seems as if the phone is not in use.

    First, I recommend that you check your settings to see what is using your battery life. You can do this by going to settings > battery. In some cases substantive activity of the app may affect the battery life. This means that the battery is used by an application while it is in the background. The link below provides additional information and advice to help maximise your battery performance.
    Batteries - maximize Performance

    See you soon.

  • iPhone 5 battery runs very quickly when using mobile data

    When I use mobile data on my iPhone 5, the battery seems to run out quickly. When I say fast, I mean very quickly, it will drop 100% completely dead in 20 minutes. What I do when I use mobile data is send some Snapchats and that's all. I left mobile data on, I have it on when I need to use it. I tried using mobile data for other things, and the same thing happens. Sometimes the phone will completely die to about 40% of the battery being left. I am almost convinced that I need at this point a new battery for my phone. Finally, I want to mention that these problems don't happen when you use mobile data, WiFi. Does anyone have any suggestions?

    iOS: version 9.0.2

    See the following article:

    https://www.Apple.com/support/iPhone5-battery/

    In addition, download the app from the battery life and see what it says about the health of your battery.

  • After updating to the latest computer firefox on the internet running slower, taking more time to go to the links and sites.also if I click on an e-mail link the link keeps refreshing like mailto and custom stop opening new tabs very quickly, having to st

    Since the installation of updated, when you use internet, e-mail all slowed and takes time to go to Web sites to download pictures on email.
    also when I click on an e-mail link to send the emails tab bar refreshing guard and open a new tab very quickly what I can read cos its so fast is mailto this happened several times on various websites, I clicked on an email that we link on grangerhertzog.com yesterday and he did.

    You get this problem if you select the Firefox program to manage a file if you get an 'Open with' dialog box.

  • Satellite Pro A10: battery discharged very quickly

    I had the laptop for about 2 years and it has been very good. But in recent weeks the battery (when not on power) discharge VERY quickly (in a minute or two) as soon as any disk activity takes place. I guess it must be the battery, but I noticed recently that even after being in power for several hours while I had used widely, he showed he was still that 90% of charge.

    I am aware that recharge the battery too frequently can cause the battery be reduced significantly but I made a point to let him unload frequently to try to avoid this.

    This one any sense?

    Thank you
    PEB

    Hello

    The fact is that you can charge and discharge the battery about 500 times. After this period, only the battery loses performance and you need to replace.
    The battery is covering 1 year warranty.
    Increased time battery life it s recommended to remove the battery if the power adapter is plugged.

    In your case, I think the battery is dead, and if you want to use the laptop with the battery you need to replace.

  • Satellite L10-102: screen goes down and then comes very quickly.

    Hi, I have Nooteboom L10-102. Sometimes during work, the screen down abruptly then comes very quickly. Like the natural eye blinking. ? s there a kind of great power problem or comes from the different fault.

    I need advice to fix the problem.

    Thank you...

    Hi, manual

    Believe me, according to your explanation, that it is not easy to say exactly what is happening. In my opinion, just an intensive audit can train with a few explanations.

    Is that your permanent unit connect to the AC adapter when this happens?
    Is the monitor off feature enabled in the power manager?

    On this path, it is not easy to tell what's happening.

  • Re: Satellite A665-11Z - CPU fan becomes audible very quickly

    Hi guys,.

    After having many problems with an A660, I decided to buy a laptop A665-11Z 3D. I had much better and more stable than the A660, but I noticed that the fan noise accumulates very quickly and can be a little annoying.

    The A665-11Z has an I7-740QM processor and a Nvidia GT - 350M 1 GB dedicated graphics card so they can contribute to this, but all four cores temperature exceeds about 52 degrees (which seems normal for me) and yet its still has its fan turns up to be that sound.

    I exchanged the laptop with my retailer twice already as one had a noisy fan and the other a bad hard drive. They had all the noisy fans and the one I have now has been silent so far, but is even harder than normal. I tried to play with the settings "Advanced" options for power management and played a bit with 'High Performance' cooling options to "Battery optimized". It does not constantly on 'Battery optimized' (as it does in High Performance) but when it lights it is even stronger and it takes too long to switch off).

    Is this normal with all A665 and I just have to continue to live with it?

    Thank you

    Hello

    What to say? I use laptops now almost 10 years and have changed several models (not only the portable Toshiba) and I can say that some models have a cooling fan stronger and some are quite calm but none of them was absolutely quiet and silent.

    In General, I had good experience with method option in settings of cooling energy saving and after changing battery optimized mode, I noticed that s laptop cooling fan is much quieter than before. Unfortunately there is not much you can do about it and I'm afraid that you have to live with it.

    I put t know what kind of activities you have every day with your laptop, but if you use it for internet, office, Skype or something similar use with power with lower CPU performance management. Processor is powerful enough and you won't see lower performance than before. Make sure you also cooling fan is not blocked and the laptop can be cooled properly.
    I m afraid you must live with it.

    The thing than an end: you wrote >... I have now has been silent so far, but is even stronger than normal.
    At this point I m wondering what is normal and how is it defined?

  • I dropped my phone from a height accidentally and now its completely broken and destroyed I can't access anything and all my photos are on it and the battery decreases very quickly please how to unlock my password without touching my screen its broken

    I dropped my iPhone 4S height accidentally and now its completely broken and destroyed I can't access anything and all my photos are on it and the battery decreases very quickly please how to unlock my password without touching my screen its broken and I can't touch I have all my studies on this subject two years ago and I still need the documents please someone help Please I need my pictures and documents

    Hello

    You must make an appointment at apple store in for breach of warranty replacement.

    You pay part of the cost of using iCloud upward when you configure new iphone.

    Even apple ID.

    See you soon

    Brian

  • Pavilion g6 HDD space very quickly

    Hi, I bought a laptop Pavilion g6 a month ago. I love this computer and get used to the new system.

    But the only thing that concerns me is that hard drive space is used very quickly. That's scared me, eventhoug I have a 500 GB hard drive, that is 390 GB now. It updates every time feeding on hard disk space.

    Since I am new to this, I don't know what to do to stop this. And also, I'm afraid that if I do not have the regular updates of HP my computer will not run as it should.

    Can someone help me with this 'problem '.

    André

    Hello

    Try all the steps mentioned in the link below... It should help.

    Error: Not enough disk space. You run lack of disk space on recovery (Windows 8)

    Alternatively, you can perform the steps in this link too...

    Resolution (Windows 8) low disk space errors

  • Qosmio F20-137: WLan connection falls very quickly from 54mbs to 1mbs

    I connect to internet using my F20-137 via a linksys g wireless router.

    The router is in another room (25 feet and on two walls) for the laptop computer and the connection very quickly falls to 54mbs to 1mbs.
    Is it possible to maintain the speed of connection or is it because of the distance. An external wireless card help?

    @tleggate

    Please take a look in this thread.
    The user electorchain has provided a very nice description about this behavior WLan:
    http://forums.computers.Toshiba-Europe.com/forums/thread.jspa?threadID=21556

    Throughout the stanislaus735 is right and it confirms the information given by chain ;)

  • Satellite L300 warms up very quickly

    Hello
    My Toshiba satellite L300 warms very quickly, I've had this laptop for about 2 years (2008-05-26). Recently, it's warmer and off, which happened twice.
    I was wondering if it is a danger or anything I should look out for.
    Thanks :)

    Hello

    I'm sure that the cleaning cooling module will solve your problem. Please, read this article:

    http://forums.computers.Toshiba-Europe.com/forums/Ann.jspa?annID=40

  • Xperia Z3 battery runs out very quickly after 6.0.1

    Hello everyone!
    After the last update of my Xperia Z3, the bateery runs out very quickly! Android system takes a 58% power! Now I have to load my camera everyday!

    People please help!

    Hello community!
    before I wrote my first post, I uninstalled Google services play, then I restarted my phone and allowed him the next day. Rates unchanged, but I still have the load every day.

    https://drive.Google.com/file/d/0B2YXCEq3tjruSGtLakZ1Z0lvSk0/view?USP=drivesdk
    https://drive.Google.com/file/d/0B2YXCEq3tjruc21vYkxTSkgzOEE/view?USP=drivesdk
    https://drive.Google.com/file/d/0B2YXCEq3tjruMUY2aTlHcW9OYVU/view?USP=drivesdk
    https://drive.Google.com/file/d/0B2YXCEq3tjrubVd1ek5qTWpiOWc/view?USP=drivesdk
    https://drive.Google.com/file/d/0B2YXCEq3tjruYk5mdENTNk1NTkE/view?USP=drivesdk
    https://drive.Google.com/file/d/0B2YXCEq3tjruVW1zVFRZTlNqRVU/view?USP=drivesdk

  • I downloaded ie9, it does not open. a window opens as it tries to start and then stops (very quickly)

    I downloaded ie9, it does not open. a window opens as it tries and then stops (very quickly) no error messages appear.

    I tried to reinstall, ran a scan for problems, the saved settings. I can still access to safari or chrome.
    I noticed that some other features in windows now do the same thing while trying to open a new window and it does not work. I have vista 32 bit.
    IE9 is showing as a program and all the settings seem ok
    my windows will not install updates?

    Hi Robin,

    Since you are facing problems of opening IE 9 and a few other features in Windows, you can try these steps and see if it helps

    Step 1:

    Check if the problem persists in safe mode with network.

    Start your computer in safe mode

    Step 2:

    If you do not experience the problem in safe mode with networking, you can try to perform a clean boot and see if it helps.

    A clean boot to check if startup item or services to third-party application is causing this issue.

    You can read the following article to put the computer in a clean boot:

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    After the troubleshooting steps, please refer to clean the boot link to put the computer to normal startup mode.

    Hope this information is useful.

Maybe you are looking for

  • My Mac Pro (mid-2012) running SLOW

    I ran EtreCheck and here's the report. Thank you! EtreCheck version: 2.9.3 (253) Report generated 2016-02-13 22:41:02 Download EtreCheck from http://etrecheck.com Time 03:12 Performance: good Click the [Support] links to help with non-Apple products.

  • M277dw: Printing problem

    When I make a copy from the top feeder, the copy comes out with two lines on the left side of the page.  If I make a copy from the glass, this happens.  How can I solve this problem?

  • Pavilion g41125dx notebook pc: System off pop-up

    Hi my laptop comes up a box that says disabled system key: 50802807 what I do

  • Xperia Z5 ring volume

    Updated software 5.1.1 and since then the volume of the ringer goes completely down and will not let me adjust. All other volumes are working properly. After turning on again, works for a little while. Any ideas?

  • Shipping charges on the replacement part

    I ordered a replacement part and told me that the shipping charge should be lifted. because I signed up for a DELL advantage. When I received the email confirmation of the order, they had charged me for the expedition and gave me a slight reduction (