Unknown actionscript/php problem

I have created a form in a flash as 2 document. After the
user clicks a button it sends 3 variables to PHP, username, email
and passwrd. PHP then creates a text file called (username) that
contains the username, email and password in a layout flash can
read. However, when the button is clicked it does not save the text
file.
I have read through these scripts several times and cannot
see any faults. I have check permissions and every thing i can
think of. Thanks for any help.

your
$fp = fopen(
line contains a stray character after the left paranthesis.
remove that and retest.

Similar Messages

  • Actionscript & PHP HELP!

    I need someone to help me with this.The form information does
    not come into my email. Server accepts PHP files so it has to be
    something in the scripting, either Actionscript or PHP.
    Might be best if you email me so I can send you samples. It
    would be easier to understand. My email is [email protected]
    (adelphia merged with comcast). I really need to solve this. An
    experienced actionscript/php developer should be able to solve the
    problem. Hope I hear from you soon. Put in subject line: HELP PHP
    Actionscript or something like that so I can recognize the message.
    Mary Alice
    [email protected]

    I attached the code to the submit button and on publish it
    returned the following error:
    **Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 1:
    Statement must appear within on handler
    submitBtn.onPress=function(){
    So it says it must appear within an "on handler" so I put all
    your code within an on(Release) handler and republished. It
    returned no errors. However, when tested, I entered the data and
    pressed submit and nothing happened.
    Thank you for your help so far, hopefully we can get this
    figured out.
    I'm using Flash 8, not CS3 if that makes a difference.

  • How can I synch my iTunes?  If often says unknown error or problem with application?

    I have problems synching my iPhones 4s with my MAcbook pro (10.8.2) and iTunes (11.0.1).  I can connect my iphone 4s(6.0.1) directly to my macbook pro or via the same network.  I can start the synch via itunes or my phone.  20% of the time it works.  If often says unknown error or problem with application. The software is up to date. What can I try?  Thank you

    The iphone/ipod is NOT a storage/backup device.  Not maintaining a backup copy is a big mistake.
    You can transfer itunes purchases from your iphone/ipod to your computer:
    Authorize your computer for all accounts and then click  File>Transfer Purchases

  • Actionscript bug problem loading in Firefox

    Please Help.
    I'm working on a page at
    http://localhost/skitterskatter/gerilance/D4D/index4.html
    The page works fine in Internet Explorer on a PC. In Firefox
    and some mac browsers when you click on a thumbnail, the image does
    not display (an image is supposed to expand out from the thumbnail
    into the upper right of the screen). After a page refresh often the
    thumbnail actions work.
    It seems that the image has to load into the cache before it
    can move. I can't figure out how to get this to work. Here is the
    actionscript:
    var finalWidth = 435; // width for furniture piece
    var finalHeight = 295; // height for furniture piece
    var initWidth = 10; // initial width and height for furniture
    piece that explodes from thumbnail
    var initHeight = 10;
    var finalX = 570; // Destination X and Y positions for
    furniture piece
    var finalY = 50;
    var stoploop = 0; // counter to determine when furniture
    piece is in place
    var numberOfCalls = 40; // the number of times a function is
    called to reach the final position
    var intervalID;
    var initX = 0;
    var initY = 0;
    function startLoading(image, button) {
    clearInterval(intervalID);
    _root.infoField._visible = true;
    myData = new LoadVars();
    myData.onLoad = function() {
    _root.descr.text = this.theText;
    myData.load("./descr/"+image+".txt");
    myData = new LoadVars();
    myData.onLoad = function() {
    _root.nameOfPiece.text = this.theText;
    myData.load("./names/n_"+image+".txt");
    _root.perice._width = 10;
    _root.perice._height = 10;
    var whichImage = "./pieces/"+image+".jpg";
    loadMovie(whichImage, "_root.perice");
    _root.onEnterFrame = function() {
    var infoLoaded = _root.perice.getBytesLoaded();
    var infoTotal = _root.perice.getBytesTotal();
    var percentage = Math.floor(infoLoaded/infoTotal*100);
    _root.infoField.text = "loading... "+percentage+"%
    InfoLoaded: "+infoLoaded+" InfoTotal: ";
    if (percentage>=100) {
    var material = "./materials/mat_"+image+".jpg";
    var titleimage = "./titles/title_"+image+".jpg";
    var design = "./designs/design_"+image+".jpg";
    loadMovie(material, "_root.material");
    loadMovie(titleimage, "_root.titleimage");
    loadMovie(design, "_root.design");
    initX = _root._xmouse;
    initY = _root._ymouse;
    stoploop = 0;
    _root.perice._x = initX;
    _root.perice._y = initY;
    intervalID = setInterval( moveperice, 50 );
    delete this.onEnterFrame;
    // gotoAndPlay(1);
    _root.startagain();
    function moveperice() {
    _root.perice._x += (finalX-initX)/numberOfCalls;
    _root.perice._y += (finalY-initY)/numberOfCalls;
    _root.perice._width += (finalWidth-initWidth)/numberOfCalls;
    _root.perice._height +=
    (finalHeight-initHeight)/numberOfCalls;
    stoploop += 1;
    if (stoploop >= numberOfCalls) {
    clearInterval(intervalID);
    slidebar.button1.onRelease = function () {
    startLoading("albert", this, initX, initY);
    slidebar.button2.onRelease = function () {
    startLoading("amy", this, initX, initY);
    slidebar.button3.onRelease = function () {
    startLoading("david", this);
    etc with the rest of the buttons.
    Please help.

    I couldn't see a problem there using firefox... except that
    the size is designed for a higher resolution than what my laptop
    has I'm guessing.
    For MovieClipLoader examples there are quite a few already in
    these forums (you should be able to find them by searching in as1
    & as2 for "MovieClipLoader") or you will find examples in the
    help files for MovieClipLoader, or livedocs online. Or there's a
    simple example here for loading a swf ( a jpg is not much
    different) :
    http://www.flashgods.org/forums/viewtopic.php?f=20&t=70

  • Actionscript 3 problems

    Hi All
    Wondered if someone could help as Im struggling to get my
    head around moving form as2 to as3. At the moment im struggling
    wiht how movieclips are handled. All i want to do currently is
    dynamcially create movieclips to house images, thse then need to be
    clickable to reveal a larger versionof the image in another clip.
    For now the code below is based around doing the first bit,
    namely pulling int he images and displaying them.
    Now what Ims truggling with here is how to dynamically name
    the thumb clip in the loop. as ideally i want it it to go thumb0,
    thumb1...... I have tried numerous ways but none of them seem to
    work, does anyone have any ideas why?
    function xmlLoaded(event:Event) {
    imagesXML = XML(myLoader.data);
    trace(imagesXML);
    var ImageCount:int = imagesXML.image.length();
    trace(imagesXML.image[0].@src);
    for (var i = 0; i < ImageCount; i++) {
    var thumb:MovieClip = new MovieClip();
    var ldr:Loader = new Loader();
    var url:String = "images/thumbs/" + imagesXML.image
    .@src;
    var urlReq:URLRequest = new URLRequest(url);
    ldr.load(urlReq);
    thumb.addChild(ldr);
    addChild(thumb)
    thumb.x = i * preview_spacing;
    thumb.addEventListener(MouseEvent.CLICK, clickHandler);
    thansk in advance
    a

    My problem was thw XAMPP server; it can't run php on the swf file
    I dont know why
    But now I use a remote server.
    If you have the answer for that problem tell me plz!

  • Actionscript v1 problems in v2 or v3

    The following is the code from the first frame of a
    hierarchical menu file (thanks to Ian Kelleigh at
    http://www.freehandsource.com/_test/hierarchical_menus.html)
    written in Actionscript v1.0.
    I'd like to use this in an AS v2.0 or 3.0 project. To do so,
    I know I need to delete all occurrences of "/:" in lines 4-9 and
    15, but once completed, I think there must still be a problem with
    lines 13-16 as the true/false values are not being observed (of
    course, there could be syntax issues deeper in the file, but let's
    start here):
    1 //Sets variables to False for keeping track if submenus
    2 //or menus are left open. Try keeping same naming structure
    3 //for the the setMenuClose function to work properly below.
    4 /:subsub2open = false;
    5 /:subsub4open = false;
    6 /:menuleftopen1 = false;
    7 /:menuleftopen2 = false;
    8 /:menuleftopen3 = false;
    9 /:menuleftopen4 = false;
    10 //Closes menus when another is opened.
    11 //This function checks for a total of 10 menus, you can
    12 //change this value to fit your needs
    13 function setMenuClose() {
    14 for (z=0; z<10; z++) {
    15 if (eval("/:menuleftopen"+z) == true) {
    16 eval("menu.menu"+z).gotoAndPlay("Swoop Up");
    17 }
    18 }
    19 }
    20 stop();

    Hi(Bonjour)!
    You can drag the clip from viewer to V2 in timeline. If you use the canvas edit overlay or Fs keys, you have to select the destination track for audio and video by using the patch panel at the left of timeline.
    See FCE 4.0 user's manual page 117 and from page 361.
    Michel Boissonneault

  • Flash 8 Actionscript Tutorial problem

    I have followed the following instructions to the letter
    (several times) but the button script won't activate a URL and I
    get an error message from Flash 8 which I'll show after this:
    1.Select the invisible button on the Stage.
    Open the Property inspector (Window > Properties), and
    find the Instance Name text box in the Property inspector.
    Type inv_btn into the Instance Name text box.
    Select Insert > Timeline > Layer to insert a new layer,
    and then rename the new layer to actions.
    Open the Actions panel (Window > Actions), and then select
    Frame 1 of the actions layer.
    Type the following ActionScript into the script pane (the
    editable text field) in the Actions panel:
    inv_btn.onRelease = function(){
    getURL("
    http://gnome.deseloper.com",
    "_blank");
    This does not work. Here is the error message:
    **Error** Scene=Scene 1, layer=button, frame=1:Line 1:
    Statement must appear within on handler
    inv_btn.onRelease = function(){
    As this script was copied directly from the tutorial text,
    and I have never scripted anything before, I am at a loss to
    explain this or how to make it work. Can anyone help me?

    I'll approach this from the opposite end... replace the code
    you have with:
    on(release){
    getURL("
    http://gnome.deseloper.com",
    "_blank");
    If that works, then the problem is that you didn't put the
    code where the instructions you show indicated you should. For what
    you did, the code I just showed is appropriate (though not a good
    practice because it is hidden from easy review). It's better to
    keep your code in the timeline where it can be easily found.
    You will have selected the button and then typed the code in
    the actionscript editor. Instead, you need to
    click on the frame in the (separate) actions layer in the
    main timeline that you should have made already, not the button
    layer, and then place that code from the tutorial in the
    actionscript editor window.

  • Help with ActionScript/PHP email form

    Hey guys, hope someone can help me out with this!
    Haven't programmed in a while, but a friend asked me to look
    at this and figure out why it isn't working. It's a simple form,
    with the text boxes labeled inTxt_1, inTxt_2 ..... inTxt_13.
    The ActionScript looks like this ...
    Code:
    submit.onRelease = function () {
    var loadv = new LoadVars();
    loadv._level0.mc1.inTxt_1 = _level0.mc1.inTxt_1.text;
    loadv._level0.mc1.inTxt_2 = _level0.mc1.inTxt_2.text;
    loadv._level0.mc1.inTxt_3 = _level0.mc1.inTxt_3.text;
    loadv._level0.mc1.inTxt_4 = _level0.mc1.inTxt_4.text;
    loadv._level0.mc1.inTxt_5 = _level0.mc1.inTxt_5.text;
    loadv._level0.mc1.inTxt_6 = _level0.mc1.inTxt_6.text;
    loadv._level0.mc1.inTxt_7 = _level0.mc1.inTxt_7.text;
    loadv._level0.mc1.inTxt_8 = _level0.mc1.inTxt_8.text;
    loadv._level0.mc1.inTxt_9 = _level0.mc1.inTxt_9.text;
    loadv._level0.mc1.inTxt_10 = _level0.mc1.inTxt_10.text;
    loadv._level0.mc1.inTxt_11 = _level0.mc1.inTxt_11.text;
    loadv.send("email.php",loadv,"POST");
    (Quick question ... why is the _level0.mc1 part needed? Or is
    it even required?)
    Here's the PHP ...
    Code:
    <?php
    $To = "[email protected]";
    $subject = "site reply";
    $Name = $_POST["inTxt_1"];
    $Email = $_POST["inTxt_2"];
    $Company = $_POST["inTxt_3"];
    $Position = $_POST["inTxt_4"];
    $Address = $_POST["inTxt_5"];
    $Address1 = $_POST["inTxt_6"];
    $Address2 = $_POST["inTxt_7"];
    $ZipCode = $_POST["inTxt_8"];
    $Country = $_POST["inTxt_9"];
    $Tel = $_POST["inTxt_10"];
    $Enquiry = $_POST["enquiry"];
    $Comments = $_POST["inTxt_11"];
    \$headers = "From: " . $_POST["inTxt_1"]. "<" .
    $_POST["inTxt_2"] .">\r\n";
    $headers .= "Reply-To: " . $_POST["inTxt_2"] . "\r\n";
    $headers .= "Return-path: " . $_POST["inTxt_2"];
    $message = "Name: $Name\n";
    $message .= "Position: $Position\n";
    $message .= "Company: $Company\n";
    $message .= "Email: $Email\n";
    $message .= "Address: $Address\n";
    $message .= "Address1: $Address1\n";
    $message .= "Address2: $Address2\n";
    $message .= "Zip Code: $ZipCode\n";
    $message .= "Country: $Country\n";
    $message .= "Enquiry: $Enquiry\n";
    $message .= "Phone: $Tel\n";
    $message .= "Comments: $Comments\n";
    mail($To, $subject, $message, $headers);
    Print "Your mail has been sent";
    ?>
    (Another question - why does the one $headers line have a /
    infront of it? Should it be there?)
    Now when I submit it, "Your mail has been sent" appears on
    the screen, but I don't receive an e-mail. Can anyone help me??
    Thanks so much!!
    ~Ganj

    all those loadv._level0.mc1.whatever variables are incorrect.
    they should be:

  • Object cast - J2EE to ActionScript strange problem

    Hello,
    I am working in a project with multiple layers composed by Flash+Flex; BlazeDS; J2EE+Hibernate.
    I have some services to get all the data from database and I have a strange problem when I try to cast some objects from J2EE to ActionScript via BlazeDS Services. This is the structure that I have in my project:
    Oracle
    Table ServicePetitions (a table with all the data about a service petition)
    J2EE+Hibernate
    ServicePetition object (mapping object generated by hibernate)
    ServicePetitionId object (multiple key object generated by hibernate)
    ServiceServicePetitions object (the service to use in blazeDS)
    Flex 4 (All the objects generated by Flex Builder at the time of map the service)
    _Super_ServiceServicePetitions
    ServiceServicePetitions
    _Super_ServicePetitions
    _Super_ServicePetitionId
    _Super_ServicePetitionEntityMetadata
    _Super_ServicePetitionIdEntityMetadata
    ServicePetition
    ServicePetitionId
    Normally I call the service and later I try to get the data using a CallResponder object to make the assignation lastresult = ServicePetition; except when I use a datagrid that automaticly use the CallResponser.lastresult as dataprovider, without any assignation (important, always work!)
    The fact is that when I try to make the assignation all works alright, I get all the data, I can work with those data, all goes perfect, but...when I make the second call, the assignation (callresponder.lastresult = ServicePetition) does not assign anything.
    This is the code of the assignation:
        private var respPs:CallResponder;
        private var servPs:ServiceServicePetitions;
        private var objPs:ServicePetition;
        // Call
        public function AprobarPS(ter:String,idps:String,sec:int)
          servPs = new ServicioVPeticionesServicio();
          respPs = new CallResponder();
          respPs.addEventListener(ResultEvent.RESULT,getDatosPs);
          respPs.addEventListener(FaultEvent.FAULT,error);
          respPs.token = servPs.getPeticionServicio(ter,idps,sec);
        // Get the data
        private function getDatosPs(resultEvent:ResultEvent):void
          objPs = respPs.lastResult as VPeticionesServicio;
          switch (obj.petitionType) { // Here I have a null exception
    I make the debug with the blazeDS tools and all the responses and call statements is Ok, and the service return the data always, but Flex only works the first time per execution.
    If I assign all the data field by field from lastResult to ServicePetition all works properly always, the first call, the second call, etc., but if I want to make the assignment, object to object, only works 1 time.
    any ideas?
    best regards,
    thx!

    sorry, copy-paste problem...
    switch (objPs.petitionType)
    I have been researching and I think that I know where (maybe...) is the problem.
    The object to serialize have another object inside. Could be this the problem at the time to des-serialize the object? Also, the object is very big, have around 40 fields, could be also a problem ?
    thanks!

  • Big PHP problem (SOLVED)

    Hello. I have a big problem. I installed php. For an example, script <? print "hello"; ?> working good, but script like that:
    <? print "labas"; ?>
    <?php
    session_start();
    include("config.php");
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=windows-1257" />
    <title>4Friends</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <link href="default.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="header">
    <div id="logo">
    <h1><a href="#">Hello</a></h1>
    <h2><a href="?">Bla bla bla </a></h2>
    </div>
    </div>
    <div id="menu">
    <ul>
    <li class="first"><a href="#" title="">News</a></li>
    <li><a href="#" title="">Menu</a></li>
    <li><a href="#" title="">Skyrelis 1 </a></li>
    <li><a href="#" title="">Skyrelis 2 </a></li>
    <li><a href="#" title="">Skyrelis 3 </a></li>
    </ul>
    </div>
    <div id="content">
    <div id="sidebar">
    <div id="login" class="boxed">
    <h2 class="title">Wah</h2>
    <div class="content">
    <? include("nevermind :)"); ?>
    </div>
    </div>
    <div id="updates" class="boxed">
    <h2 class="title">Bla bla bla </h2>
    <div class="content">
    <ul>
    <li>
    <h3>Balandio 20, 2007</h3>
    <p><a href="#">Pew pew</a></p>
    </li>
    </ul>
    </div>
    </div>
    <div id="partners" class="boxed">
    <h2 class="title">Aaa</h2>
    <div class="content"></div>
    </div>
    </div>
    <?
    PHP CODE WITCH DOESNT MATTER HERE
    ?>
    </div>
    <div id="footer"><p>
    <a href="http://validator-test.w3.org/check?uri=referer"><img
    src="http://www.w3.org/Icons/valid-xhtml10-blue"
    alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
    </p>
    <p>
    <a href="http://jigsaw.w3.org/css-validator/">
    <img style="border:0;width:88px;height:31px"
    src="http://jigsaw.w3.org/css-validator/images/vcss"
    alt="Valid CSS!" />
    </a>
    </p>
    </div>
    </body>
    </html>
    <?
    sql_disconn();
    ?>
    Displays only white screen. short_open_tag is on in php.ini. Can anyone say what is the problem? I tryed to run this script on windows WAMP, and this goes good.
    Last edited by neXTPeer (2007-07-28 08:09:09)

    neXTPeer wrote:
    ralvez wrote:
    It's got to be some misconfiguration on  your end. I just put the file in my server and works fine.
    R
    Am. I still don't get it what is the problem.
    The whole extent of your code is 5 php statements and the rest is HTML but you get a blank page ... take the php code out and see if the HTML shows. Make sure you set the permissions of that file to 744, and test. You should be able to see the html document. If you do not see anything then type on a console (as root) "tail -f /var/log/httpd/error_log" so  you can see the errors that the server returns.
    If HTML works, then begin to add the php code one block at a time  (you only have 5 so that should not be too hard) until it fails and then analyze the logs to see what upsets your server.
    Hope this helps.
    R

  • Php problem

    I created this page using Dreamweaver, and following a php tutorial (thanks, David Powers).  I'm not at all experienced with writing php and have run into problems trying to incorporate a recaptcha spam check.  I've used the check successfully with forms which call a separate script, but need to incorporate the code on the actual page in this case and can't get it to work.
    Can anyone help?
    Here's the page:  http://www.ukcountryradio.com/vote_artist2.php
    And here's the php - I've included all of it so there's quite a lot...  The page works correctly apart from the recaptcha check.
    Thanks,
    SW
    <?php require_once('Connections/ukcr.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    mysql_select_db($database_ukcr, $ukcr);
    $today = date('l');
    $query_schedules = "SELECT `day`, `time`, short_title, presenter FROM schedules WHERE day='{$today}' AND time > '0700' ORDER BY time, short_title ASC";
    $schedules = mysql_query($query_schedules, $ukcr) or die(mysql_error());
    $row_schedules = mysql_fetch_assoc($schedules);
    $totalRows_schedules = mysql_num_rows($schedules);
    $errorurl = "http://www.ukcountryradio.com/error.php" ;
    $my_recaptcha_private_key = '6LdAFb0SAAAAAP5qTVqEAfoycaImqp7-koT8tWlK' ;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if (strlen( $my_recaptcha_private_key )) {
                    require_once( 'recaptchalib.php' );
                    $resp = recaptcha_check_answer ( $my_recaptcha_private_key, $_SERVER['REMOTE_ADDR'], $_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field'] );
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "vote_artist")) {
      $insertSQL = sprintf("INSERT INTO vote_artist (`name`, `email`, artist, REMOTE_ADDR) VALUES (%s, %s, %s, %s)",
    GetSQLValueString($_POST['name'], "text"),
    GetSQLValueString($_POST['email'], "text"),
    GetSQLValueString($_POST['artist'], "text"),
                                                                                       GetSQLValueString($_SERVER['REMOTE_ADDR'], "text"));
    mysql_select_db($database_ukcr, $ukcr);
      $Result1 = mysql_query($insertSQL, $ukcr) or die(mysql_error());
      $insertGoTo = "vote_thanks_artist.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
    header(sprintf("Location: %s", $insertGoTo));
    ?>

    Try the below. I've moved the if/else statment further up the php script:
    <?php require_once('Connections/ukcr.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;  
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    if (!empty($_POST['address2'])) {
    exit;
    else {
    mysql_select_db($database_ukcr, $ukcr);
    $today = date('l');
    $query_schedules = "SELECT `day`, `time`, short_title, presenter FROM schedules WHERE day='{$today}' AND time > '0700' ORDER BY time, short_title ASC";
    $schedules = mysql_query($query_schedules, $ukcr) or die(mysql_error());
    $row_schedules = mysql_fetch_assoc($schedules);
    $totalRows_schedules = mysql_num_rows($schedules);
    $errorurl = "http://www.ukcountryradio.com/error.php" ;
    $my_recaptcha_private_key = '6LdAFb0SAAAAAP5qTVqEAfoycaImqp7-koT8tWlK' ;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if (strlen( $my_recaptcha_private_key )) {
                    require_once( 'recaptchalib.php' );
                    $resp = recaptcha_check_answer ( $my_recaptcha_private_key, $_SERVER['REMOTE_ADDR'], $_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field'] );
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "vote_artist")) {
      $insertSQL = sprintf("INSERT INTO vote_artist (`name`, `email`, artist, REMOTE_ADDR) VALUES (%s, %s, %s, %s)",
    GetSQLValueString($_POST['name'], "text"),
    GetSQLValueString($_POST['email'], "text"),
    GetSQLValueString($_POST['artist'], "text"),
                                                                                        GetSQLValueString($_SERVER['REMOTE_ADDR'], "text"));
    mysql_select_db($database_ukcr, $ukcr);
      $Result1 = mysql_query($insertSQL, $ukcr) or die(mysql_error());
      $insertGoTo = "vote_thanks_artist.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
    header(sprintf("Location: %s", $insertGoTo));
    ?>

  • David Powers Lesson08 forgotten.php problem

    I have a strange problem when running forgotten.php. The program works alright initially with the setting of mail_connector.php as below. I managed to send and received email. Everything works fine intially. After sometime, I found problem running the same program again. This time it generates error message of 'Notice: Underfined index: [email protected] in c:\vhosts\phpcs5\lesson8\scripts\request_reset.php on line 25' and also message 'No connection could be made because the target machine actively refused it.'
    Any idea why ?
    Mail_Connector.php
    <?php
    $mailhost = 'mail.agri-organica.com';
    $mailconfig = array('auth'     => 'login',
                        'username' => '[email protected]',
                                                      'password' => 'password');
    $transport = new Zend_Mail_Transport_Smtp($mailhost, $mailconfig);
    Zend_Mail::setDefaultTransport($transport);

    I changed the From header using agri-organica.com address and send to yahoo address. This time it shows:
    'No connection could be made because the target machine actively refused it.'
    Request Received
    An email has been sent to your registered address with instructions for resetting your password.
    Request_reset.php
    <?php
    $errors = FALSE;
    $result = FALSE;
    if ($_POST) {
      require_once('library.php');
      require_once('mail_connector.php');
      try {
              $val = new Zend_Validate_EmailAddress();
              if (!$val->isValid($_POST['email'])) {
                $errors = TRUE;
              if (!$errors) {
                $sql = $dbRead->quoteInto('SELECT user_id, first_name, family_name, email FROM users WHERE email = ?', $_POST['email']);
                $result = $dbRead->fetchRow($sql);
                if (!$result) {
                        $errors = TRUE;
                } else {
            // update database and send mail
                        $token = md5(uniqid(mt_rand(), TRUE));
                        $data = array('token' => $token);
                        $where = $dbWrite->quoteInto('email = ?', $_POST['email']);
                        $dbWrite->update('users', $data, "user_id = {$result['user_id']}");
                $mail = new Zend_Mail('UTF-8');
                $mail->addTo($result['email'], "{$result['first_name']} {$result['family_name']}");
                $mail->setSubject('Instructions for resetting your password');
                $mail->setFrom('[email protected]', 'Calvin');
                $link = "http://phpcs5/lesson8/reset.php?id={$result['user_id']}&token=$token";
                $message = "Use the following link to reset your password. This link can be used once only. $link";
                $mail->setBodyText($message, 'UTF-8');
                $mail->send();
      } catch (Exception $e) {
              echo $e->getMessage();

  • ZendFramework gateway.php problem

    Hej,
    I make a Flex 4 application with database services using zendframework. All is ok on localhost, when I deploy to Hosting Server, the first 3 hours all is ok, I use Flex application and the data is get ok, but 4 or 5 hours later the zendframework service send the following error:
    "Send failed
    Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: 'http://www.sftak.se/gateway.php' "
    My amf_config.ini configuration is:
    [zend]
    ;set the absolute location path of webroot directory, example:
    ;Windows: C:\apache\www
    ;MAC/UNIX: /user/apache/www
    webroot =./
    ;set the absolute location path of zend installation directory, example:
    ;Windows: C:\apache\PHPFrameworks\ZendFramework\library
    ;MAC/UNIX: /user/apache/PHPFrameworks/ZendFramework/library
    zend_path =./ZendFramework
    [zendamf]
    amf.production = false
    amf.directories[]=services
    amf.directories[]=php
    I put ZendFramework in webroot, I can't put outside of webroot, is a hosting server.
    When I work with pure php script, I don't have this problem, never.
    Any idea?????
    Please Help me.
    Thanks in advance.

    Any ideas, this has been a pain in my side all weekend... been moving files and reinstalling things right left and centre!!
    is it a Zend issue or Flash?
    This needs to be resolved as its a key function in their demo!!!

  • Flash cs3 and php problem (system error)

    Hi All,
    Been checking out a free utility, called Tell A Friend - followed the instructions to a t but still getting system error.
    Here is the php code:
    <?php
    $to = ($_POST['friend']);
    $link = ($_POST['link']);
    $subject = "Tell a friend";
    $message = "Your friend ";
    $message .= $_POST['name'] . " wants advice you the following link: ".$link;
    $headers = "My WebSite Name";
    if(@mail($to, $subject, $message, $headers))
    echo "answer=ok";
    else
    echo "answer=error";
    ?>
    The main swf has a main.as attached:
    * Flash Tell A Friend
    * http://www.FlepStudio.org        
    * Author: Filippo Lughi          
    * version 1.0                      
    package
    import flash.display.*;
    import flash.events.*;
    import flash.utils.*;
    import flash.external.*;
    import flash.net.*;
    public class main extends MovieClip
      private const PHP_URL:String="sendMail.php";
      private var checker:CheckEmail;
      private var timer:Timer;
      public function main()
       addEventListener(Event.ADDED_TO_STAGE,init);
      private function init(evt:Event):void
       removeEventListener(Event.ADDED_TO_STAGE,init);
       stage.frameRate=31;
       checker= new CheckEmail();
       addInputListener();
       addSendListener();
      private function addInputListener():void
       clip_mc.name_txt.background=true;
       clip_mc.name_txt.backgroundColor=0x999999;
       clip_mc.name_txt.addEventListener(FocusEvent.FOCUS_IN,onFocusIn);
       clip_mc.name_txt.addEventListener(FocusEvent.FOCUS_OUT,onFocusOut);
       clip_mc.email_txt.background=true;
       clip_mc.email_txt.backgroundColor=0x999999;
       clip_mc.email_txt.addEventListener(FocusEvent.FOCUS_IN,onFocusIn);
       clip_mc.email_txt.addEventListener(FocusEvent.FOCUS_OUT,onFocusOut);
      private function onFocusIn(evt:Event):void
       evt.target.background=true;
       evt.target.backgroundColor=0xFFFFFF;
      private function onFocusOut(evt:Event):void
       evt.target.backgroundColor=0x999999;
      private function addSendListener():void
       clip_mc.send_mc.mouseChildren=false;
       clip_mc.send_mc.buttonMode=true;
       clip_mc.send_mc.addEventListener(MouseEvent.MOUSE_DOWN,onSendDown);
      private function onSendDown(evt:MouseEvent):void
       if(clip_mc.name_txt.text!="")
        if(checker.initCheck(clip_mc.email_txt.text))
         sendEmail();
        else
         displayPhrase("Invalid Email");
       else
        displayPhrase("Invalid name");
      private function sendEmail():void
       clip_mc.send_mc.mouseEnabled=false;
       var variables:URLVariables=new URLVariables();
       variables.name=clip_mc.name_txt.text;
       variables.friend=clip_mc.email_txt.text;
       variables.link=ExternalInterface.call('window.location.href.toString');
       var request:URLRequest=new URLRequest();
       request.url=PHP_URL;
       request.method=URLRequestMethod.POST;
       request.data=variables;
       var loader:URLLoader=new URLLoader();
       loader.dataFormat=URLLoaderDataFormat.VARIABLES;
       loader.addEventListener(Event.COMPLETE,onMessageSent);
       try
        loader.load(request);
       catch (error:Error)
        trace('Unable to load the document.');
      private function onMessageSent(evt:Event):void
       var vars:URLVariables=new URLVariables(evt.target.data);
       if(vars.answer=='ok')
        displayPhrase("Message Sent!");
       else
        displayPhrase("System Error!");
       clip_mc.send_mc.mouseEnabled=true;
       clip_mc.name_txt.text="";
       clip_mc.email_txt.text="";
      private function displayPhrase(s:String):void
       clip_mc.display_txt.text=s;
       resetPhrase();
      private function resetPhrase():void
       timer=new Timer(1500,1);
       timer.addEventListener(TimerEvent.TIMER,hidePhrase);
       timer.start();
      private function hidePhrase(evt:TimerEvent):void
       clip_mc.display_txt.text="";
    Any help appreciated. This is a great viral marketing tool, when it ever works
    Kind Regards,
    Boxing Boom

    Never seen such an error, but if it's in the status bar of the browser then it shouldn't be Flash problem. You can check what's happening in your swf by creating a dynamic text field and setting it's text in every major action, that is: requesting PHP and getting back response, to what's just happened.
    So, on the Flash side you can see whether the browser error stops the PHP script and immobilizes further actions.
    What I'd do is create a new Flash file and PHP file and just send 1 variable to PHP, change it somehow and send it back to Flash and print it in a text field. That way you can check whether it's the method you're using to request PHP or just PHP or something else. Step by step adding complexity and checking on which of these steps the error occurs.
    I wish you good luck.
    Ps. It's probably a very rookie problem, we just don't know the source.

  • Flex/PHP problem lastResult does not work correctly

    hi flex community,
    I am trying to develope a small login but I am still new to flex. It's based a little bit on the tutorial "Flex Test Drive: Build an application in an hour". I have a mysql database where the username and the password are stored in.
    My Flex file looks like this:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                                xmlns:s="library://ns.adobe.com/flex/spark"
                                xmlns:mx="library://ns.adobe.com/flex/mx"
                                xmlns:loginservice="services.loginservice.*"
                                currentState="Login"
                                width.Login="719" height.Login="606"
                                width.Main="975" height.Main="700" xmlns:valueObjects="valueObjects.*">
         <fx:Script>
              <![CDATA[
                   import mx.controls.Alert;
                   import mx.events.FlexEvent;
                   protected function buttonLogin_clickHandler(event:MouseEvent):void
                        loginResult.token = loginService.login(username.text, password.text);
                        trace(vOLogin.username);
                        trace(vOLogin.password);
                        trace(vOLogin.valid)
                        /*if (vOLogin.valid == true) {
                             currentState = "Main";
              ]]>
         </fx:Script>
         <s:states>
              <s:State name="Login"/>
              <s:State name="Main"/>
         </s:states>
         <fx:Declarations>
              <valueObjects:VOLogin id="vOLogin" />
              <s:CallResponder id="loginResult" result="vOLogin = loginResult.lastResult[0] as VOLogin"/>
              <loginservice:LoginService id="loginService"
                                               fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
                                               showBusyCursor="true"/>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <s:TextInput id="username" includeIn="Login" x="118" y="37" width="107"/>
         <s:TextInput id="password" includeIn="Login" x="118" y="88" width="107" displayAsPassword="true"/>
         <s:Label includeIn="Login" x="20" y="38" width="84" height="22" text="Benutzername:"
                    textAlign="right" verticalAlign="middle"/>
         <s:Label includeIn="Login" x="20" y="88" width="84" height="22" text="Passwort:"
                    textAlign="right" verticalAlign="middle"/>
         <s:Button id="buttonLogin" includeIn="Login" x="22" y="143" width="195" label="Login"
                     click="buttonLogin_clickHandler(event)"/>
    </s:WindowedApplication>
    and my 2 php Files look like this:
    VOLogin.php
    <?php
    class VOLogin {
         public $id;
         public $valid;
         public $msg;
          public $username;
          public $password;
         public $versionnumber;
    ?>
    And this is my LoginService.php file:
    <?php
    require_once('VOLogin.php');
    require_once('config.php');
    //$foo = new LoginService();
    //var_dump($foo->login("heinz", "heinz"));
    class LoginService {
    * Retrieve all the records from the table
    * @return an array of VOBenutzer
    * @param string $username
    * @param string $password
    public function login($username, $password) {
        $mysql = mysql_connect(DATABASE_SERVER, DATABASE_USERNAME, DATABASE_PASSWORD);
        mysql_select_db(DATABASE_NAME);
        $SQL = "select * from flex where username='".$username."' and password='".$password."'";
        $r = mysql_query($SQL);
        if(mysql_num_rows($r) == 1) {
            $row = mysql_fetch_object($r);
            $tmp = new StdClass();
            $tmp->id = $row->id;
            $tmp->valid = true;
            $tmp->msg = "Login Ok";
            $tmp->username = $row->username;
            $tmp->password = $row->password;
            $tmp->versionnumber = $row->versionnumber;
            $output[] = $tmp;
        }else {
            $tmp = new StdClass();
            $tmp->id = 0;
            $tmp->valid = false;
            $tmp->msg = "Benutzername oder Passwort falsch";
            $tmp->username = $username;
            $tmp->password= $password;
            $tmp->versionnumber = 0;
            $output[] = $tmp;
        return $output;
    ?>
    My actual problem is that I have to press 2 times on the button to get the correct trace information. With the help of the search function I found this thread:
    http://forums.adobe.com/thread/259280
    I am not sure if I have the same problem. If yes where should I put the eventhandler? I would be very happy for every useful answer.
    Greetings
    flexx0r

    Here is a good article on how the % key works.
    It is working as designed. It just isn't what you are expecting. It just isn't designed for Engineers.
    http://blogs.msdn.com/b/oldnewthing/archive/2008/01/10/7047497.aspx

Maybe you are looking for