A Flash Developer Resource Site

Page 6 of 7 FirstFirst ... 234567 LastLast
Results 101 to 120 of 126

Thread: PHP not working?

  1. #101
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    having a closer look, I see
    Code:
    <html xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:w="urn:schemas-microsoft-com:office:word"
    xmlns="http://www.w3.org/TR/REC-html40">
    
    <head>
    <meta name=Title content="&lt;">
    <meta name=Keywords content="">
    <meta http-equiv=Content-Type content="text/html; charset=macintosh">
    <meta name=ProgId content=Word.Document>
    <meta name=Generator content="Microsoft Word 11">
    <meta name=Originator content="Microsoft Word 11">
    <link rel=File-List href="mail_files/filelist.xml">
    It seems you are on a macintosh. Dont you have simpletext or something else that allows you to write a text of, say 100 characters and results in a file no larger than 100 bytes?


    Musicman
    Last edited by Musicman; 02-18-2008 at 03:37 AM.

  2. #102
    Junior Member
    Join Date
    Jul 2006
    Posts
    29
    Quote Originally Posted by Musicman
    Hi,

    having a closer look, I see
    Code:
    <html xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:w="urn:schemas-microsoft-com:office:word"
    xmlns="http://www.w3.org/TR/REC-html40">
    
    <head>
    <meta name=Title content="&lt;">
    <meta name=Keywords content="">
    <meta http-equiv=Content-Type content="text/html; charset=macintosh">
    <meta name=ProgId content=Word.Document>
    <meta name=Generator content="Microsoft Word 11">
    <meta name=Originator content="Microsoft Word 11">
    <link rel=File-List href="mail_files/filelist.xml">
    It seems you are on a macintosh. Dont you have simpletext or something else that allows you to write a text of, say 100 characters and results in a file no larger than 100 bytes?


    Musicman
    Yea I do, should I try that and see if that simplifies things at all?

  3. #103
    Junior Member
    Join Date
    Jul 2006
    Posts
    29
    Alright, here is the updated file:
    http://www.tomartin.net/Email.html

  4. #104
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    this is your text file now
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta http-equiv="Content-Style-Type" content="text/css">
      <title></title>
      <meta name="Generator" content="Cocoa HTML Writer">
      <meta name="CocoaVersion" content="949">
      <style type="text/css">
        p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
      </style>
    </head>
    <body>
    <p class="p1">&lt;?</p>
    <p class="p1">mail("tom@tomartin.net", "test message", "just a test", "From: webserver@tomartin.com");</p>
    <p class="p1">echo "mail sent...";</p>
    <p class="p1">?&gt;<span class="Apple-converted-space">Â </span></p>
    </body>
    </html>
    This is what it should read (and how it looks in the browser)
    Code:
    <?
    mail("tom@tomartin.net", "test message", "just a test", "From: webserver@tomartin.com");
    echo "mail sent...";
    ?>
    Maybe you should try to write a "text" rather than "html" file in the first place, to keep software from doing things that hinder rather than help

    Musicman

  5. #105
    Junior Member
    Join Date
    Jul 2006
    Posts
    29
    Quote Originally Posted by Musicman
    Hi,

    this is your text file now
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta http-equiv="Content-Style-Type" content="text/css">
      <title></title>
      <meta name="Generator" content="Cocoa HTML Writer">
      <meta name="CocoaVersion" content="949">
      <style type="text/css">
        p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
      </style>
    </head>
    <body>
    <p class="p1">&lt;?</p>
    <p class="p1">mail("tom@tomartin.net", "test message", "just a test", "From: webserver@tomartin.com");</p>
    <p class="p1">echo "mail sent...";</p>
    <p class="p1">?&gt;<span class="Apple-converted-space">Â </span></p>
    </body>
    </html>
    This is what it should read (and how it looks in the browser)
    Code:
    <?
    mail("tom@tomartin.net", "test message", "just a test", "From: webserver@tomartin.com");
    echo "mail sent...";
    ?>
    Maybe you should try to write a "text" rather than "html" file in the first place, to keep software from doing things that hinder rather than help

    Musicman
    Are you saying I need to make it as a rtf or .txt file and upload it? Cuz if I do that, it just downloads when I click on it. As evidenced here:
    http://tomartin.net/mail.rtf

  6. #106
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    make it a txt (rtf also adds stuff to the file that you would not want, just different stuff), upload it, and rename it to php on the server

    Musicman

  7. #107
    Junior Member
    Join Date
    Jul 2006
    Posts
    29
    Quote Originally Posted by Musicman
    Hi,

    make it a txt (rtf also adds stuff to the file that you would not want, just different stuff), upload it, and rename it to php on the server

    Musicman
    I don't think I quite understand. I did what you said (Changed the rtf format to a txt format, then uploaded the txt file, and changed the extension to a php file).
    http://www.tomartin.net/mail.php
    That is what shows up though. What did I do wrong? Haha, this is more complicated than I was thinking it would be

  8. #108
    Junior Member
    Join Date
    Jul 2006
    Posts
    29
    Quote Originally Posted by momtartin
    I don't think I quite understand. I did what you said (Changed the rtf format to a txt format, then uploaded the txt file, and changed the extension to a php file).
    http://www.tomartin.net/mail.php
    That is what shows up though. What did I do wrong? Haha, this is more complicated than I was thinking it would be
    Edit, nevermind, that works now when I click on that. So should I just try retyping all the original PHP script into a txt document and then try sending an e-mail from my contact form? Or is there another step I need to take?

  9. #109
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    strange... it complains about stuff in lines 7 through 9 although the entire file should be exactly 4 lines long

    I still believe the best program to write php text is one that does not even know about documents, html, rtf or anything like that - just plain text

    Musicman

  10. #110
    Junior Member
    Join Date
    Jul 2006
    Posts
    29
    Quote Originally Posted by Musicman
    Hi,

    strange... it complains about stuff in lines 7 through 9 although the entire file should be exactly 4 lines long

    I still believe the best program to write php text is one that does not even know about documents, html, rtf or anything like that - just plain text

    Musicman
    I wrote that in Text Edit on my mac. What program do you recommend? And what should I do now? I mean it works if I click on it, and it sends me an e-mail, but when I tried to upload my Flash file and change that txt file to a PHP file, no message was sent.

  11. #111
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    that mail.php on your server still seems to contain rtf. I am not used with a mac at all, but I recall a friend mentioning simpletext. I will ask her
    Where did you put your flash form (the swf, not the fla)?

    Musicman

  12. #112
    Junior Member
    Join Date
    Jul 2006
    Posts
    29
    Quote Originally Posted by Musicman
    Hi,

    that mail.php on your server still seems to contain rtf. I am not used with a mac at all, but I recall a friend mentioning simpletext. I will ask her
    Where did you put your flash form (the swf, not the fla)?

    Musicman
    Simpletext was replaced with Text Edit on macs. Though I'm wondering, should I have placed my php file in the same folder as my swf file? The way I have it set up is as follows (this is the local file setup, I'll show the remote site later, I have to go to work now):



    Should I put that mail.txt in the same folder as my SWF?

  13. #113
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    it is usually good practice to put the swf and the php into the same folder and just refer to it by "mail.php" (not http://www.yourserver.com/mail.php - this causes problems when people visit yourserver.com instead of www.yourserver.com)
    In your particular case you might have
    <embed src="folder/movie.swf" ....>
    in your index.html file. In that situation the plain "mail.php" in your movie refers to the folder with the index file, not the one with the swf

    Musicman

  14. #114
    Junior Member
    Join Date
    Jul 2006
    Posts
    29
    Quote Originally Posted by Musicman
    Hi,

    it is usually good practice to put the swf and the php into the same folder and just refer to it by "mail.php" (not http://www.yourserver.com/mail.php - this causes problems when people visit yourserver.com instead of www.yourserver.com)
    In your particular case you might have
    <embed src="folder/movie.swf" ....>
    in your index.html file. In that situation the plain "mail.php" in your movie refers to the folder with the index file, not the one with the swf

    Musicman
    So I ended up just calling the customer service line, and apparently they had my domain on a server which didn't like PHP, and only used SMPT. So once they switched it over, I got it working, so we're all good. Thanks for your assistance though, I appreciate it.

  15. #115
    Junior Member
    Join Date
    Mar 2008
    Posts
    2

    Grrrrr

    Sorry if this has already been covered but theres alot of posts to go through.

    ok so actionscript 2 flash CS3

    Code:
    var senderLoad:LoadVars = new LoadVars();
    var recieveLoad:LoadVars = new LoadVars();
    
    Sender.onRelease = function() {
    	senderLoad.theName = theName.text;
    	senderLoad.theGladiatusName = theGladiatusName.text;
    	senderLoad.theEmail = theEmail.text;
    	senderLoad.theSubject = theSubject.text;
    	senderLoad.theMessage = theMessage.text;
    	senderLoad.sendAndLoad("http://ultimate-signatures.com/form.php", recieveLoad);
    }
    
    recieveLoad.onLoad = function(){
    	if(this.sentOK) {
    		_root.gotoAndStop(300);
    	}
    	else{
    		_root.gotoAndStop(305);
    	}
    }
    Returns - Error opening URL 'http://ultimate-signatures.com/form.php'

    the url is correct i have also tried putting within a subfolder and targeting that too.

    PHP
    Code:
    <?PHP 
    
    $to = "thelegion@ultimate-signatures.com";
    $subject = "The Legion Contact Forum";
    $message = "Name: " . $theName; 
    $message .= "\nGladiatusName: " . $theGladiatusName;
    $message .= "\nEmail: " . $theEmail;
    $message .= "\n\nSubject: " . $theSubject;
    $message .= "\nMessage: " . $theMessage;
    $headers = "From: $theEmail";
    $headers .= "\nReply-To: $theEmail";
    
    sentOK = mail($to,$subject,$message,$headers);
    
    echo "sentOK=" . $sentOK;
    
    ?>
    Please can somebody help me ;

    Thanks in advance.

    Andy

  16. #116
    Junior Member
    Join Date
    Apr 2008
    Posts
    9
    HI, If i send to flash vars this way, i have no problem seeing them in a dynamic text box :
    PHP Code:
    $myTotal=45;
    echo 
    "&myTotal=$myTotal&"
    But actually i get the $myTotal value from a POST:
    PHP Code:
    PHP Code:
    $myTotal=$_POST['total'];
    echo 
    "&myTotal=$myTotal&"
    And this way i get no value in my dynamic text box

    Any ideas?

    I´ve already search the forum ,with no clues.

  17. #117
    Perverse Futurist villain2's Avatar
    Join Date
    Sep 2002
    Location
    Baltimore, MD
    Posts
    891
    Quote Originally Posted by BADGROOVY
    HI, If i send to flash vars this way, i have no problem seeing them in a dynamic text box :
    PHP Code:
    $myTotal=45;
    echo 
    "&myTotal=$myTotal&"
    But actually i get the $myTotal value from a POST:
    PHP Code:
    PHP Code:
    $myTotal=$_POST['total'];
    echo 
    "&myTotal=$myTotal&"
    And this way i get no value in my dynamic text box

    Any ideas?

    I´ve already search the forum ,with no clues.
    Shouldn't you be getting your variable from $_REQUEST['total']?
    Did you check the php file on it's own to see if it output $myTotal as the value in the name/value pair string?

  18. #118
    Junior Member
    Join Date
    Apr 2008
    Posts
    9

    Wink

    Quote Originally Posted by villain2
    Shouldn't you be getting your variable from $_REQUEST['total']?
    Yes, i use $_REQUEST.


    Quote Originally Posted by villain2
    Did you check the php file on it's own to see if it output $myTotal as the value in the name/value pair string?
    Yes, its echo´s fine.

    But it doesnt appear in Flash.

    But actually Musicman gave me a nice tip that works , i already have the values in my php, and with flash i was trying to call them again to the server, so instead of that i use FLASH VARS.

    THKS ANYWAY.

  19. #119
    Junior Member
    Join Date
    Nov 2008
    Posts
    2

    Unhappy Help!

    Hey Guys and Girls,

    Im new to all this forum discussion thing so go easy on me please :P

    anywhos, im currently studying IT and our brief wants us to design and create a website, me being good with site design i found it easy, until my online php application failed to work, keep getting an blank screen when i load it up:

    (Asterix's are hiding my email from spambots just so you know)

    <?php
    function clean($data) {
    $data = trim(stripslashes(strip_tags($data)));
    return $data;
    }
    $exploits = "/(content-type|bcc:|cc:|document.cookie|onclick|onload)/i";
    foreach ($_POST as $key => $val) {
    $c[$key] = clean($val);

    if (preg_match($exploits, $val)) {
    exit("<p>No exploits, please!</p>");
    }
    }

    $show_form = true;
    $error_msg = NULL;

    if (isset($c['submit'])) {
    if (empty($c['name']) || empty($c['email']) || empty($c['comments'])) {
    $error_msg .= "Name, e-mail and comments are required fields. \n";
    } elseif (strlen($c['name']) > 50) {
    $error_msg .= "The name field is limited at 15 characters. Your first name will do! \n";
    } elseif (!ereg("^[A-Za-z' -]", $c['name'])) {
    $error_msg .= "The name field must not contain special characters. \n";
    } elseif (!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})$",strtolower($c['email']))) {
    $error_msg .= "That is not a valid e-mail address. \n";
    }

    if ($error_msg == NULL) {
    $show_form = false;

    if (!empty($c['Other Contact']) && !ereg("^(http|https)", $c['Other Contact'])) {
    $c['url'] = "Other Contact:" . $c['Other Contact'];
    }

    $subject = "Online Application";

    $message = "Online Application Form:";
    foreach ($c as $key => $val) {
    $message .= ucwords($key) . ": $val \n";
    }
    $message .= "IP: {$_SERVER['REMOTE_ADDR']} \n";
    $message .= "Browser: {$_SERVER['HTTP_USER_AGENT']}";

    if (strstr($_SERVER['SERVER_SOFTWARE'], "Win")) {
    $headers = "From: chris@5*******";
    $headers .= "Reply-To: {$c['email']}";
    } else {
    $headers = "From: Online Application Form <chris@************> \n";
    $headers .= "Reply-To: {$c['email']}";
    }

    $recipient = "chris@***********";

    if (mail($recipient,$subject,$message,$headers)) {
    echo "<p>Your mail was successfully sent.</p>";
    } else {
    echo "<p>Your mail could not be sent this time.</p>";
    }
    }
    }
    if (!isset($c['submit']) || $show_form == true) {
    function get_data($var) {
    global $c;
    if (isset($c[$var])) {
    echo $c[$var];
    }
    }

    if ($error_msg != NULL) {
    echo "<p><strong style='color: red;'>ERROR:</strong><br />";
    echo nl2br($error_msg) . "</p>";
    }
    ?> <p>Online Application TEST FOR CHRIS'S IT WORK!</p>
    <p>*Indicates Mandatory Field</p>
    <form action="" method="post">
    <p>FULL Name
    <label>
    <input type="text" name="name" id="name" value="<?php get_data("name"); ?>" />
    </label>
    </p>
    <p>Email Address
    <label><input type="text" name="email" id="email" value="<?php get_data("email"); ?> donthaveemail@dont_have_email.com" />
    </label>
    </p>
    <p>Telephone Number
    <label>
    <input type="text" name="telephoneNumber" id="Other Contact" value="<?php get_data("telephoneNumber"); ?>" />
    </label>
    </p>
    <p>Where did you hear about the election?
    <label><input type="text" name="reasonForapplication" id="subject" value="<?php get_data("reasonForapplication"); ?>" />
    </label>
    </p>
    <p>Referance No.1
    <textarea name="References" id="references"><?php get_data("references"):?>
    </textarea>
    </p>
    <p>Why You Think You Should Be Elected:

    <label>
    <textarea name="Manifesto" cols="70" rows="20" id="manifesto"><?php get_data("manifesto"); ?>
    </textarea>
    </label>
    <br />
    <input type="submit" name="submit" id="submit" value="Send" />
    </p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    </form> <p>
    <?php
    }
    ?>

  20. #120
    Senior Member unicycle's Avatar
    Join Date
    Mar 2000
    Posts
    254
    Quote Originally Posted by 55chris2303
    Hey Guys and Girls, Im new to all this forum discussion thing so go easy on me please :P
    Hi, I'm old but back after a long time.
    I'm not going to be hard on you, but also I'm not going to find where your poroblem is. But try:
    PHP Code:
    error_reporting(E_ALL); 
    at the very first line of your script.
    it should prevent
    Quote Originally Posted by 55chris2303
    getting an blank screen
    Or -if your HTTP-server is Apache- you can also put this debug switch in a .htaccess file
    Code:
    # php_value display_errors Off
    php_value display_errors On
    just some other tips:
    PHP Code:
    <?php
    $recipient 
    "chris@asteriskguru*com";
    // and
    if (mail($recipient,$subject,$message,$headers)) { }
    // In case you use variables only once...
    // then I would put those field as hard as possible, so:
    if (mail("chris@dom.tld"$subject$message$headers)) { }
    // but also counts for $subject and especially $headers
    ?>

    // Lack of an defined action parameter will usually default on the script itself.
    <form action="" method="post">
    // But with "" as value, I would not rely on that. so maybe:
    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center