Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6357941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:16:19+00:00 2026-05-24T23:16:19+00:00

I’m trying to create a simple message form using navigateToURL() and PHP mail(). But

  • 0

I’m trying to create a simple message form using navigateToURL() and PHP mail(). But I have a problem with this approach it redirects in the php page. I need it not to redirect the page but still send it to the email.

here’s what I did.

AS3

if (e.type == "click")
    {

                navigateToURL(new URLRequest("http://somedomain.com/sendme.php?" + "name=" + e.currentTarget.parent.na_txt.text + "&email=" + e.currentTarget.parent.ma_txt.text + "&contact=" + e.currentTarget.parent.co_txt.text + "&message=" + e.currentTarget.parent.me_txt.text + "&sex=" + e.currentTarget.parent.sex), "_self");


    }

PHP

<?php

$to = "some@email.com";
$subject = "Subject";

$name = $_GET['name']; 
$sex = $_GET['sex'];
$email = $_GET['email']; 
$contact = $_GET['contact']; 
$message = $_GET['message']; 

// create email headers
$headers = 'From: '.$email."\r\n".
'Reply-To: '.email."\r\n" .
'X-Mailer: PHP/' . phpversion();


$body = "From: $name \r\nGender: $sex \r\nE-Mail: $email \r\nContact No.: $contact \r\n\r\nMessage:\n$message";


echo "Thank You $name, Your Feedback and Enquiry has been submitted to <a href='mailto:$to'>$to</a>!";

mail($to, $subject, $body, $headers);


?> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:16:20+00:00Added an answer on May 24, 2026 at 11:16 pm

    I think what you really want is to create a URLLoader object to send your variables though.

    // prepare the vars
    var vars:URLVariables = new URLVariables();
    vars.name = e.currentTarget.parent.na_txt.text;
    vars.email = e.currentTarget.parent.ma_txt.text;
    vars.contact = e.currentTarget.parent.co_txt.text;
    vars.message = e.currentTarget.parent.me_txt.text;
    vars.sex = e.currentTarget.parent.sex;
    
    // prepare the request
    var request:URLRequest = new URLRequest("http://pennfolio.com/goahead/sendme.php");
    request.data = vars;
    request.method = URLRequestMethod.GET;
    
    // prepare loader
    var loader:URLLoader = new URLLoader();
    loader.addEventListener(Event.COMPLETE,onLoadComplete);
    loader.load(request);
    
    // handle the response from PHP
    function onLoadComplete(evt:Event):void
    {
        evt.target.removeEventListener(Event.COMPLETE,onLoadComplete);
        trace(evt.target.data); // the output from PHP
    }
    

    This will run without reloading the page or opening a new window, allowing you to maintain the state of your application. The text that you echo from PHP will be available in the load complete handler function for you to display to the user however you choose.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.