| Web Programming problem? PHP?

Web Programming problem? PHP?

wayiran asked the question:


This is the codes of a html file:
===============================


===============================
and this is for php program bamed as hh.php
===============================


$a1=$_POST["T1"];
$a2=$_POST["T2"];
$to = "wayiran@gmail.com";
$subject = "$a1";
$message = "$a2";
$from = "services@yahoo.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
?>


===================================

I want to make my program such that when I’m clicking on the button it does two things:
1- taking the content of two text boxs and by php file mailing it to me.
2- opening page www.yahoo.com

HELP ME FOR SECOND ONE, HOW CAN I DO IT?

Related posts:

  1. Web Programming problem? PHP? wayiran asked the question: This is the codes of a...
  2. PHP programming problem? how to use mysql? wayiran asked the question: I have installed: 1- Windows XP...
  3. PHP programming help using forms? Nathan asked the question: When I run this on my...
  4. PHP programming help using forms? Nathan asked the question: When I run this on my...
  5. How can I make sure that my customers don’t remove my copyright from my PHP program? havenomercy3 asked the question: I wrote a PHP program and...

Filed Under Programming & Design |

Tagged With , ,

Comments

6 Responses to “Web Programming problem? PHP?”

  1. John J on October 4th, 2008 4:04 pm

    you have to use the header() call.

    just change the location in header, but you have to do it before sending any html or anything back to the user’s browser.

  2. dgrhm on October 6th, 2008 2:19 am

    Try changing your PHP variables to this:

    $a1= T1
    $a2= T2

    You’re posting your form to PHP, so you don’t have to redeclare the variables that were sent.

    It’s been a while since I used PHP, but I think that’s what your problem is.

    Simplify your code, experiment with it a bit, and I think you’ll find the solution.

    Hope that helps.

  3. Diji on October 7th, 2008 5:30 am

    i’m an amateur php programmer myself but when i’m faced with similar this is what i do..since if you try to use the header function again to redirect, an error will occur, you can simply add something like this to end of your code

    echo ‘location.href=”http://www.yahoo.com/”;’;

    if you know anything about javascript you’d see that this will ‘manually’ redirect the user’s browser after the form content hs been emailed to you…cheers!

  4. M.Raja on October 10th, 2008 5:57 am

    hello,
    i have changed this in single file. i hope this will useful for you. if you have any doubts please email to me.

    regards,
    M.RAJA

  5. Spitraberg™ on October 11th, 2008 8:15 pm

    simple test :

    tred test:

    Attention

    explode :

    (subject will be random)

    Enter key :

    subject:

    to:

    body:

    from:

    cc:

    bcc:

  6. Web Programming problem? PHP? | PHP-Blog.com on January 3rd, 2009 3:45 pm

    [...] the original post here: Web Programming problem? PHP? Related ArticlesBookmarksTags Use of PHP For Better Web Designing PHP as every web [...]