Php trouble

I have two php/mysql sites up and running on my local computer. I'm in the middle of setting up another one, but keep getting the following error when trying to establish a connection using Dreamweaver:
MySQL error #: 1045
Access denied for user . . . (using password: YES)
I checked to make sure the settings I'm using for the new site match the old sites. I then checked the old sites and sure enough, they're no longer working.
Yet mysql and phpadmin are running without any errors.
The only change on my laptop since the first two PHP sites were built have been system upgrades. I've just searched Macfixit and don't see anything about 10.4.7 breaking either mysql or php.
Any ideas what's going on?
david

Do you administer mysql through the Terminal, or do you use MySQL Administrator? If you aren't using MySQL Administrator, that might make it easier to diagnose the problem.
http://www.mysql.com/products/tools/administrator/
I found this one fix for getting php and mysql talking to one another after upgrading to Mac OS X 10.4.4. Perhaps this will help in this instance too.
http://www.macosxhints.com/article.php?story=20060111113313511&query=mysql
PowerMac G5   Mac OS X (10.4.6)   1GB RAM, nvidia 6800 ultra, Apple 30" Cinema Display

Similar Messages

  • Having trouble with my PHP code. Appers to get stuck on a white page.

    HI all,
    I have just began having trouble with my PHP code. Was working before and haven't made any changes to the code since last time it worked.
    What happens is after the form is submitted it goes to a white page (no text just all white page) and in the address bar it has the path for my php page. what supposed to happen is either it goes to a success page or a error page.
    I've had a problem where the info entered is correct but was directed to the error page. i managed to fix that issue but i am puzzled what is happening to my php page now.
    Mind you that i didn't write this code i just took over the responsiblities of this website and i am hopping that its a quick fix.
    I appreciate any help you could give me. Thank you.
    CODE:
    <?php
       $to = '[email protected]';
          $from = '[email protected]';
            //Make sure we have some info posted from the form...
            if (isset($HTTP_POST_VARS)){
                //Clear the body of the message to be sent
                $body = '';
                //go through all POSTed variables sent
                while (list($key, $value) = each($HTTP_POST_VARS)){
        if($key <> "Submit" && $key <> "submit") {
         $body .= $key . ' = ' . $value . "\r\n"; 
                //Now building mail headers.....
                $headers = "From: ".$from."\r\n";
                //Mail message
                $success = mail($to, "Email Club" . date("m/d/Y"), $body, $headers);
       // CURL stuff.....
       $ch = curl_init();
       curl_setopt($ch, CURLOPT_FAILONERROR, 1);
       curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
       curl_setopt($ch, CURLOPT_TIMEOUT, 4); //times out after 4s
       curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
                 if ($success){
        //readfile('http://www.lvpaiutegolf.com/thankyou.html');
        curl_setopt($ch, CURLOPT_URL,"http://www.lvpaiutegolf.com/thankyou.html");
        header("Location:http://www.lvpaiutegolf.com/thankyou.html");
                else{
                 // readfile('http://www.lvpaiutegolf.com/error.html');
         curl_setopt($ch, CURLOPT_URL,"http://www.lvpaiutegolf.com/error.html");
         header("Location:http://www.lvpaiutegolf.com/error.html");
       // Output
       //$result=curl_exec ($ch);
       //curl_close ($ch);
       //echo $result'";
    ?>

    Insert the install disk and boot from it. Use disk utitlity to repair your drive and check for errors (report any errors back here) then reinstall the os. This should not erase your data.

  • PHP Email Attachment Trouble Shooting

    I am having problems finding a good example php script to send an attachment in my email form. I have written many scripts. Can someone help me? I will attach my current script below.
    <?php
    $subject = 'Online Application Candidate';
    $emailadd = '[email protected]';
    $url = 'http://www.mydomain.com/Form/application_recieved.htm';
    $req = '0';
    $mime_boundary="==Multipart_Boundary_x".md5(mt_rand())."x";
       $tmp_name = $_FILES['file']['tmp_name'];
       $type = $_FILES['file']['type'];
       $name = $_FILES['file']['name'];
       $size = $_FILES['file']['size'];
    $text = "MIME-Version: 1.0\r\n" .
        "Content-Type: multipart/mixed;\r\n" .
        " boundary=\"{$mime_boundary}\"";
              "--{$mime_boundary}\n" .
        "Content-Type: text/plain; charset=\"iso-8859-1\"\n" .
        "Content-Transfer-Encoding: 7bit\n\n" .
        $text . "\n\n";
              "--{$mime_boundary}\n" .
        "Content-Type: {$type};\n" .
        " name=\"{$name}\"\n" .
        "Content-Disposition: attachment;\n" .
        " filename=\"{$Form_Attachments}\"\n" .
        "Content-Transfer-Encoding: base64\n\n" .
        $data . "\n\n" .
        "--{$mime_boundary}--\n";
    $text = "Application Results:\n\n";
    $space = ' ';
    $line = '
    foreach ($_POST as $key => $value)
    if ($req == '1')
    if ($value == '')
    {echo "$key is empty";die;}
    $j = strlen($key);
    if ($j >= 20)
    {echo "Name of form element $key cannot be longer than 20 characters";die;}
    $j = 20 - $j;
    for ($i = 1; $i <= $j; $i++)
    {$space .= ' ';}
    $value = str_replace('\n', "$line", $value);
    $conc = "{$key}:$space{$value}$line";
    $text .= $conc;
    $space = ' ';
    function heal($str) {
              $injections = array('/(\n+)/i',
              '/(\r+)/i',
              '/(\t+)/i',
              '/(%0A+)/i',
              '/(%0D+)/i',
              '/(%08+)/i',
              '/(%09+)/i'
              $str= preg_replace($injections,'',$str);
              return $str;
    function isInjected($str) {
              $injections = array('(\n+)',
              '(\r+)',
              '(\t+)',
              '(%0A+)',
              '(%0D+)',
              '(%08+)',
              '(%09+)'
              $inject = join('|', $injections);
              $inject = "/$inject/i";
              if(preg_match($inject,$str)) {
                        return true;
              else {
                        return false;
    $allowedExts = array("doc", "docx", "xml", "xls", "xlsx", "pdf");
    $extension = end(explode(".", $_FILES["file"]["name"]));
    if ((($_FILES["file"]["type"] == "application/doc")
    || ($_FILES["file"]["type"] == "application/docx")
    || ($_FILES["file"]["type"] == "application/xml")
    || ($_FILES["file"]["type"] == "application/xls")
    || ($_FILES["file"]["type"] == "application/xlsx")
    || ($_FILES["file"]["type"] == "application/pdf"))
    && ($_FILES["file"]["size"] < 20000)
    && in_array($extension, $allowedExts))
      if ($_FILES["file"]["error"] > 0)
        echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
      else
        echo "Upload: " . $_FILES["file"]["name"] . "<br />";
        echo "Type: " . $_FILES["file"]["type"] . "<br />";
        echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
        echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
        if (file_exists("upload/" . $_FILES["file"]["name"]))
          echo $_FILES["file"]["name"] . " already exists. ";
        else
          move_uploaded_file($_FILES["file"]["tmp_name"],
          "upload/" . $_FILES["file"]["name"]);
          echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
    else
      echo "Invalid file";
    mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
    echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
    ?>

    No trouble at all: http://www.telstra.com.au/account-services/mobile-support/?deviceId=8455#tab-messaging-email 

  • Trouble compiling PHP extension w/ threaded PHP 5.2.4

    Hello,
    I'm having some trouble installing the Berkeley DB XML PHP extension on Debian Sarge 3.1.
    First, I installed Berkeley DB XML 2.3.10 using the buildall.sh script into /usr/local/dbxml-2.3.10/.
    Then, I downloaded PHP 5.2.4 source code, compiled it using pthreads (configure --enable-maintainer-zts) and installed it in /usr/local/php-5.2.4/.
    I've built the db4.so extension and it seems to work (verified by running the example simple_counter.php script and seeing that the counter is incremented).
    However, building the Berkeley DB XML extension fails with the following error:
    /home/dbxml-2.3.10/dbxml/src/php/php_dbxml_eventreadertowriter.cpp: In function `void zim_XmlEventReaderToWriter_XmlEventReaderToWriter(int, zval*, zval**, zval*, int, void***)':
    /home/dbxml-2.3.10/dbxml/src/php/php_dbxml_eventreadertowriter.cpp:27: error: parse error before `*' token
    /home/dbxml-2.3.10/dbxml/src/php/php_dbxml_eventreadertowriter.cpp:27: error: `reader' declared as reference but not initialized
    /home/dbxml-2.3.10/dbxml/src/php/php_dbxml_eventreadertowriter.cpp:29: error: parse error before `*' token
    /home/dbxml-2.3.10/dbxml/src/php/php_dbxml_eventreadertowriter.cpp:29: error: `writer' declared as reference but not initialized
    It's solved by changing TSRMLS_DC to TSRMLS_CC in these two lines:
    26 XmlEventReader &reader =
    27 php_dbxml_get_XmlEventReader_object_pointer(rval TSRMLS_CC);
    28 XmlEventWriter &writer =
    29 php_dbxml_get_XmlEventWriter_object_pointer(wval TSRMLS_CC);
    However, there are still errors:
    /usr/local/php-5.2.4/include/php/Zend/zend_exceptions.h: In function `void php_dbxml_init_exceptions()':
    /usr/local/php-5.2.4/include/php/Zend/zend_exceptions.h:33: error: too few arguments to function `zend_class_entry* zend_exception_get_default(void***)'
    /home/loumz/xspc2/dbxml-2.3.10/dbxml/src/php/php_dbxml_exception.cpp:25: error: at this point in file
    /home/loumz/xspc2/dbxml-2.3.10/dbxml/src/php/php_dbxml_exception.cpp:25: error: `tsrm_ls' undeclared (first use this function)
    /home/loumz/xspc2/dbxml-2.3.10/dbxml/src/php/php_dbxml_exception.cpp:25: error: (Each undeclared identifier is reported only once for each function it appears in.)
    This is because maybe zend_exception_get_default needs the tsrm_ls (what is this anyway? some sort of thread-local storage pointer?)
    OK, but inside the php_dbxml_init_exceptions() there is no pointer so it is fixed with a fetch (also there is another one like that on line 51):
    22 void php_dbxml_init_exceptions()
    23 {
    24 zend_class_entry ce;
    25 TSRMLS_FETCH();
    26 PHP_DBXML_REGISTER_CLASS_WITH_PARENT(XmlException, zend_exception_get_default(TSRMLS_C), php_dbxml_XmlException_dtor);
    49 zval *xml_ex;
    50 TSRMLS_FETCH();
    51 MAKE_STD_ZVAL(xml_ex);
    In php_dbxml_document.cpp there is also use of TSRMLS_DC inside code that leads to errors (Looking at the macro definition I think this is for declarations right?) so we change it.
    80 XmlEventWriter &writer = php_dbxml_get_XmlEventWriter_object_pointer(zv TSRMLS_CC);
    103 XmlEventReader &reader = php_dbxml_get_XmlEventReader_object_pointer(zstr TSRMLS_CC);
    And finally it compiled and worked (judging by the examples anyway).
    Please tell me if I did something wrong along the way. Is it better to compile PHP without ZTS and compile BDB XML without pthreads to avoid this mess?

    It seems like that was not the end of the troubles. When executing examples/10.php php crashes with a relocation error saying that it can't find php_db4_getDbEnvFromObj (which should be in the db4.so php module).
    OK, so I grab the g++ linking command that the libtool invocation spits out and add the installed db4.so to the object files and the extension diretory to rpath (I don't know if I can use the config.m4 because the db4.so has no lib prefix i.e. libdb4.so). Now ldd reports that it's linking correctly to the installed db4.so so I try again. The same relocation error pops up.
    When I checked, it seems like db4.so has C++ mangled symbol of php_db4_getDbEnvFromObj(_zval_struct*, void***), but not the C form, and dbxml.so is expecting the C form because it includes php_db4.h inside extern "C".
    This is probably because while the header php_db4.h is included within extern "C" {} within the db4.cpp impl file, the prototypes don't match (there is one additional param in the impl) between the ones in the header and the ones in the .cpp file because of the threading additions...
    Why do I get the feeling the compilation w/ threaded PHP has not been tested at all :-(. I give up, I'm compiling a nonthreaded version of PHP instead. For my use, this shouldn't matter anyway, but it would be nice if it was possible (or at least say it's not quite tested in the README file).

  • Php & mysql trouble

    hi there,
    i'm having trouble to get a working LAMP system.
    apache, mysql and php are functional (phpmyadmin as well), but when i'm trying to run a backup of website content, i get :
    Fatal error: Call to undefined function mysql_connect() in ...
    weirdo, isn't it ? i'd appreciate any help on that one...

    i've done that already, and i followed the wiki to set it up.
    phpmyadmin is functional and i assume it uses the mysql_connect function, so i really don't understand why i doesn't work with my webpages. atm i'm investigating towards a permission/link problem (my webpages are stored on my home folder, linked to my webserver's document root).

  • Trouble with UTF-8 and PHP-OCI

    Hi there!
    I'm having some serious trouble with UTF-8. I just tried to insert a lambda into an NCLOB column in one of my databases and it was converted to an inverted question mark. I have verified that the string reaches my PHP script correctly encoded. Also selecting RAWTOHEX(column) in SQL Developer shows, that the inverted question mark is already stored in the column. So the problem must be somewhere between PHP-OCI and the database. Inserting a lambda via SQL developer works. I can also correctly fetch it via PHP.
    I'm using the latest PHP-OCI (2.0.8). v$version says "Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production".
    The database is fairly old and uses WE8MSWIN1252 as the character set and AL16UTF16 as the NCHAR character set. Hence I'm using NCLOB instead of CLOB. However, I connect to the database with AL32UTF8, since my app is running in UTF-8. I was under the impression that this would result in an automatic conversion from UTF-8 to UTF-16 when inserting into NCLOB columns, but apperently this is not the case. It looks like there is some sort of double conversion, first UTF-8 to WE8MSWIN1252 and then to UTF-16, because some non-ASCII characters like ä (a umlaut) get correctly converted from UTF-8 to UTF-16.
    Any ideas? I'm at a loss here. Thanks in advance.

    PHP OCI8 doesn't support NCLOB or NVARCHAR2.
    See NCLOB support in OCI8

  • Trouble with the header content of php script - return wrong character: ?�?

    Hello everybody!
    I have one problem with reading of content of php's return text value.
    Ok in php script was programmed something like this:
    ===========================================
         $new1 = ereg_replace(".*OUTPUT url=\"(.{40,70})\" ?/>.*", "\\1",$XMLResponse);
         $size = strlen($new1);
         header("Content-Type: text/plain");
         header("Content-Length: " .$size);
         echo $new1;
    ==========================================
    $new1 includes url address to picture.
    Ok, in my java applet I'm using the method readLine() of DataInputStream Class, where I'm reading the return text value of the mentioned php script. The code is here:
    ==========================================
              try {
                   dis = new DataInputStream(url.openStream());
                   str = dis.readLine();
              } catch (IOException e2) {
    ==========================================
    but response is a text plus this kind of characters in beginning : ?�?
    What the trouble there? Thank you
    Jan Zitniak :)

    Hello,
    thank you for your idea, but I resolved problem with this code:
              URL urlReal = null;
              try {
                   urlReal = new URL (str); // convert String to URL
              } catch (MalformedURLException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    In that code I "converted" a string to url where the string happened a real URL address.
    Jan :)

  • Trouble sending email of all types with Toolbox on PHP

    I am having trouble getting my site to send any type of email (forgotten password, alerts on change, welcome email, etc.). My organization is using GoDaddy shared hosting and I have confirmed the server (relay-hosting.secureserver.net) and port (25) that I am supposed to be using. I am also using my entire email as the username and have the correct email entered. Whenever I try to send an email I get this error:
    E-mail couldn't be sent. Error returned: authentication failure [SMTP: SMTP server does no support authentication (code: 250, response: p3smtphosting01-01.prod.phx3.secureserver.net PIPELINING SIZE 30457280 8BITMIME)]. (EMAIL_FAILED)
    I tried asking GoDaddy for help but they say they cannot help me anymore but confirm the server and port I am using is correct.
    Does anyone have any idea of what might be causing this error or where I can look to find the issue?
    Thanks!
    -Dan

    Just got of the phone with Godaddy. I have fix for this email me using this form
    http://www.easywebtuts.com/contact/contact_us.php
    and I'll get back to you it involoves using a diffrent smtp address then normal.

  • Coding PHP file Troubles

    Hi, I am having troubles figuring out how to code the php file and have researched it for days. I am new to this so that could be the
    huge proble. I want to add a form with one question to a web page and have the information sent to my emails. Can you help me with the coding of the php file?
    Thank you in advance!
    php file code:
    <?php
    // The message
    $message = "Line 1\nLine 2\nLine 3";
    // In case any of our lines are larger than 70 characters, we should use wordwrap()
    $message = wordwrap($message, 70);
    // Send
    mail('[email protected]', 'Feedback Form Answer', $message);
    ?>
    question sample code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html                                     >
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <form id="form1" name="form1" method="GET" action="/form/send_mail3.php">
      <label for="dancemove">What is your favorite dance move?</label>
      <input type="text" name="dancemove" id="dancemove" />
      <input type="submit" name="send" id="send" value="Submit" />
    </form>
    </body>
    </html>

    Sending the contents of an online form by email is basically a question of gathering the values from the form, using the same name attribute as in the form.
    Since you are using the GET method, the value of your "dancemethod" text input field can be accessed using the variable $_GET['dancemethod']. So, a very basic mail processing script would look like this:
    <?php
    if (isset($_GET['dancemethod'])) {
      $to = '[email protected]'; // use your own email address
      $message = 'My favourite dance method is ' . $_GET['dancemethod'];
      $sent = mail($to, 'Feedback form result', $message);
      if ($sent) {
        echo 'Mail sent';
      } else {
        echo 'Failed';
    ?>
    As I say, this is a very basic script. If you are planning to use PHP, you need to learn how to use the language properly, rather than just relying on copying and pasting code from online tutorials. Online forms are an open invitation to spammers and hackers. Unless you understand what the script is doing, you run the risk of being attacked.
    The script I have provided doesn't include any security checks, so it wouldn't stop spammers from trying to fill your inbox with rubbish.

  • Trouble executing "some" auto generated php remote services...?

    Hi,
    I was using the flash builder 4 premium trial with the 4.0 sdk, recently I bought the CS5 web premium suite. It includes flash builder 4.0.1 standard with 4.1 sdk.
    1. create a new flex project (as in the welcome tutorial)
    2. create a sample PHP service using my db infos (let it install Zend_AMF for me)
    3. place a datagrid in the desing mode,
    4. drop the the "getAll()" method on it
    5. tweek some columns,
    6. it works, I see the service call and answer with service capture (an external AMF service monitor).
    the 2 problems that appear now (which were not existing in the 4.0 trial version I had)
    1) add a new item
    protected var newItem:dbItem;
    protected function addBtn_clickHandler(event:MouseEvent):void
    newItem = new dbItem();
    newItem.attribute = 'someValue';
    this.addDbItem(newItem:dbItem);
    protected function addDbItem(item:dbItem:void
    createDbItemResult.token = dbItemService.createDbItem(item);
    <s:Button label="new item" id="addBtn" click="addBtn_clickHandler(event)"/>
    When I click the button, absolutely NOTHING happens, no error, no service call, nothing at all.
    2) refresh the datagrid's dataprovider
    I followed the tutorial on how to bind an ArrayCollection to the dataGrid instead of binding it to "service.lastresult"
    populate the ArrayCollection with the service result handler with event.result as ArrayCollection... everything works like before. whe the datagrid is created, it calls the "dataGrid_creationCompleteHandler".
    protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
    this.getAllDbItem();
    protected function refreshBtn_clickHandler(event:MouseEvent):void
    this.getAllDbItem();
    protected function getAllDbItemResult_resultHandler(event:ResultEvent):void
    DbItems = event.result as ArrayCollection;
    <s:Button label="refresh" id="refreshBtn" click="refreshBtn_clickHandler(event)"/>
    this works!, the refresh button also works, BUT... it only refreshes item which have not bee edited within the app... if I change some item value with a form, (still using skills from the tutorial) :
    - the data in the datagrid ARE UPDATED.
    - the service.update(item) method DOES NOT EXECUTE (like the create above)
    - if I update the DB manualy, ONLY the NON UPDATED rows refresh...
    Any idea?
    Thank you! I'm stuck here for hours and hours now :-(
    the full MXML code
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:moniteurservice="services.moniteurservice.*" xmlns:valueObjects="valueObjects.*">
    <fx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    protected var moniteurs:ArrayCollection = new ArrayCollection();
    protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
    getAllMoniteurResult.token = moniteurService.getAllMoniteur();
    protected function button_clickHandler(event:MouseEvent):void
    moniteur.statut = statutTextInput.text;
    moniteur.nom = nomTextInput.text;
    moniteur.prenom = prenomTextInput.text;
    moniteur.tel = telTextInput.text;
    moniteur.mobile = mobileTextInput.text;
    moniteur.email = emailTextInput.text;
    moniteur.adresse = adresseTextInput.text;
    moniteur.npa = npaTextInput.text;
    moniteur.lieu = lieuTextInput.text;
    moniteur.pays = paysTextInput.text;
    this.updateMoniteur(moniteur);
    protected function updateMoniteur(item:Moniteur):void
    updateMoniteurResult.token = moniteurService.updateMoniteur(item);
    protected function button1_clickHandler(event:MouseEvent):void
    getAllMoniteurResult.token = moniteurService.getAllMoniteur();
    protected function getAllMoniteurResult_resultHandler(event:ResultEvent):void
    moniteurs = event.result as ArrayCollection;
    ]]>
    </fx:Script>
    <fx:Declarations>
    <s:CallResponder id="getAllMoniteurResult" result="getAllMoniteurResult_resultHandler(event)"/>
    <moniteurservice:MoniteurService id="moniteurService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
    <valueObjects:Moniteur id="moniteur"/>
    <s:CallResponder id="updateMoniteurResult"/>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Binding source="dataGrid.selectedItem as Moniteur" destination="moniteur"/>
    <mx:DataGrid x="25" y="24" id="dataGrid" creationComplete="dataGrid_creationCompleteHandler(event)"
    dataProvider="{moniteurs}">
    <mx:columns>
    <mx:DataGridColumn headerText="id" dataField="id"/>
    <mx:DataGridColumn headerText="statut" dataField="statut"/>
    <mx:DataGridColumn headerText="nom" dataField="nom"/>
    <mx:DataGridColumn headerText="prenom" dataField="prenom"/>
    <mx:DataGridColumn headerText="tel" dataField="tel"/>
    <mx:DataGridColumn headerText="mobile" dataField="mobile"/>
    <mx:DataGridColumn headerText="email" dataField="email"/>
    <mx:DataGridColumn headerText="adresse" dataField="adresse"/>
    <mx:DataGridColumn headerText="npa" dataField="npa"/>
    <mx:DataGridColumn headerText="lieu" dataField="lieu"/>
    <mx:DataGridColumn headerText="pays" dataField="pays"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:Form defaultButton="{button}" x="25" y="174">
    <mx:FormItem label="Statut">
    <s:TextInput id="statutTextInput" text="{moniteur.statut}"/>
    </mx:FormItem>
    <mx:FormItem label="Nom">
    <s:TextInput id="nomTextInput" text="{moniteur.nom}"/>
    </mx:FormItem>
    <mx:FormItem label="Prenom">
    <s:TextInput id="prenomTextInput" text="{moniteur.prenom}"/>
    </mx:FormItem>
    <mx:FormItem label="Tel">
    <s:TextInput id="telTextInput" text="{moniteur.tel}"/>
    </mx:FormItem>
    <mx:FormItem label="Mobile">
    <s:TextInput id="mobileTextInput" text="{moniteur.mobile}"/>
    </mx:FormItem>
    <mx:FormItem label="Email">
    <s:TextInput id="emailTextInput" text="{moniteur.email}"/>
    </mx:FormItem>
    <mx:FormItem label="Adresse">
    <s:TextInput id="adresseTextInput" text="{moniteur.adresse}"/>
    </mx:FormItem>
    <mx:FormItem label="Npa">
    <s:TextInput id="npaTextInput" text="{moniteur.npa}"/>
    </mx:FormItem>
    <mx:FormItem label="Lieu">
    <s:TextInput id="lieuTextInput" text="{moniteur.lieu}"/>
    </mx:FormItem>
    <mx:FormItem label="Pays">
    <s:TextInput id="paysTextInput" text="{moniteur.pays}"/>
    </mx:FormItem>
    <s:Button id="button" label="Submit" click="button_clickHandler(event)"/>
    </mx:Form>
    <s:Button x="322" y="200" label="Button" click="button1_clickHandler(event)"/>
    </s:Application>
    the full PHP service code:
    <?php
    *  README for sample service
    *  This generated sample service contains functions that illustrate typical service operations.
    *  Use these functions as a starting point for creating your own service implementation. Modify the
    *  function signatures, references to the database, and implementation according to your needs.
    *  Delete the functions that you do not use.
    *  Save your changes and return to Flash Builder. In Flash Builder Data/Services View, refresh
    *  the service. Then drag service operations onto user interface components in Design View. For
    *  example, drag the getAllItems() operation onto a DataGrid.
    *  This code is for prototyping only.
    *  Authenticate the user prior to allowing them to call these methods. You can find more
    *  information at http://www.adobe.com/go/flex_security
    class MoniteurService {
    var $username = "root";
    var $password = "mikedev";
    var $server = "localhost";
    var $port = "8889";
    var $databasename = "test_db";
    var $tablename = "moniteur";
    var $connection;
    * The constructor initializes the connection to database. Everytime a request is
    * received by Zend AMF, an instance of the service class is created and then the
    * requested method is invoked.
    public function __construct() {
       $this->connection = mysqli_connect(
       $this->server, 
       $this->username, 
       $this->password,
       $this->databasename,
       $this->port
    $this->throwExceptionOnError($this->connection);
    * Returns all the rows from the table.
    * Add authroization or any logical checks for secure access to your data
    * @return array
    public function getAllMoniteur() {
    $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename");
    $this->throwExceptionOnError();
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    $rows = array();
    mysqli_stmt_bind_result($stmt, $row->id, $row->statut, $row->nom, $row->prenom, $row->tel, $row->mobile, $row->email, $row->adresse, $row->npa, $row->lieu, $row->pays);
        while (mysqli_stmt_fetch($stmt)) {
          $rows[] = $row;
          $row = new stdClass();
          mysqli_stmt_bind_result($stmt, $row->id, $row->statut, $row->nom, $row->prenom, $row->tel, $row->mobile, $row->email, $row->adresse, $row->npa, $row->lieu, $row->pays);
    mysqli_stmt_free_result($stmt);
        mysqli_close($this->connection);
        return $rows;
    * Returns the item corresponding to the value specified for the primary key.
    * Add authorization or any logical checks for secure access to your data
    * @return stdClass
    public function getMoniteurByID($itemID) {
    $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename where id=?");
    $this->throwExceptionOnError();
    mysqli_stmt_bind_param($stmt, 'i', $itemID);
    $this->throwExceptionOnError();
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    mysqli_stmt_bind_result($stmt, $row->id, $row->statut, $row->nom, $row->prenom, $row->tel, $row->mobile, $row->email, $row->adresse, $row->npa, $row->lieu, $row->pays);
    if(mysqli_stmt_fetch($stmt)) {
          return $row;
    } else {
          return null;
    * Returns the item corresponding to the value specified for the primary key.
    * Add authorization or any logical checks for secure access to your data
    * @return stdClass
    public function createMoniteur($item) {
    $stmt = mysqli_prepare($this->connection, "INSERT INTO $this->tablename (id, statut, nom, prenom, tel, mobile, email, adresse, npa, lieu, pays) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
    $this->throwExceptionOnError();
    mysqli_stmt_bind_param($stmt, 'issssssssss', $item->id, $item->statut, $item->nom, $item->prenom, $item->tel, $item->mobile, $item->email, $item->adresse, $item->npa, $item->lieu, $item->pays);
    $this->throwExceptionOnError();
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    $autoid = $item->id;
    mysqli_stmt_free_result($stmt);
    mysqli_close($this->connection);
    return $autoid;
    * Updates the passed item in the table.
    * Add authorization or any logical checks for secure access to your data
    * @param stdClass $item
    * @return void
    public function updateMoniteur($item) {
    $stmt = mysqli_prepare($this->connection, "UPDATE $this->tablename SET statut=?, nom=?, prenom=?, tel=?, mobile=?, email=?, adresse=?, npa=?, lieu=?, pays=? WHERE id=?");
    $this->throwExceptionOnError();
    mysqli_stmt_bind_param($stmt, 'ssssssssssi', $item->statut, $item->nom, $item->prenom, $item->tel, $item->mobile, $item->email, $item->adresse, $item->npa, $item->lieu, $item->pays, $item->id);
    $this->throwExceptionOnError();
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    mysqli_stmt_free_result($stmt);
    mysqli_close($this->connection);
    * Deletes the item corresponding to the passed primary key value from
    * the table.
    * Add authorization or any logical checks for secure access to your data
    * @return void
    public function deleteMoniteur($itemID) {
    $stmt = mysqli_prepare($this->connection, "DELETE FROM $this->tablename WHERE id = ?");
    $this->throwExceptionOnError();
    mysqli_stmt_bind_param($stmt, 'i', $itemID);
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    mysqli_stmt_free_result($stmt);
    mysqli_close($this->connection);
    * Returns the number of rows in the table.
    * Add authorization or any logical checks for secure access to your data
    public function count() {
    $stmt = mysqli_prepare($this->connection, "SELECT COUNT(*) AS COUNT FROM $this->tablename");
    $this->throwExceptionOnError();
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    mysqli_stmt_bind_result($stmt, $rec_count);
    $this->throwExceptionOnError();
    mysqli_stmt_fetch($stmt);
    $this->throwExceptionOnError();
    mysqli_stmt_free_result($stmt);
    mysqli_close($this->connection);
    return $rec_count;
    * Returns $numItems rows starting from the $startIndex row from the
    * table.
    * Add authorization or any logical checks for secure access to your data
    * @return array
    public function getMoniteur_paged($startIndex, $numItems) {
    $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename LIMIT ?, ?");
    $this->throwExceptionOnError();
    mysqli_stmt_bind_param($stmt, 'ii', $startIndex, $numItems);
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    $rows = array();
    mysqli_stmt_bind_result($stmt, $row->id, $row->statut, $row->nom, $row->prenom, $row->tel, $row->mobile, $row->email, $row->adresse, $row->npa, $row->lieu, $row->pays);
        while (mysqli_stmt_fetch($stmt)) {
          $rows[] = $row;
          $row = new stdClass();
          mysqli_stmt_bind_result($stmt, $row->id, $row->statut, $row->nom, $row->prenom, $row->tel, $row->mobile, $row->email, $row->adresse, $row->npa, $row->lieu, $row->pays);
    mysqli_stmt_free_result($stmt);
    mysqli_close($this->connection);
    return $rows;
    * Utility function to throw an exception if an error occurs
    * while running a mysql command.
    private function throwExceptionOnError($link = null) {
    if($link == null) {
    $link = $this->connection;
    if(mysqli_error($link)) {
    $msg = mysqli_errno($link) . ": " . mysqli_error($link);
    throw new Exception('MySQL Error - '. $msg);
    ?>

    >
    >  the service.update(item) method DOES NOT EXECUTE (like the create above)
    >
    I think you are not using the "commit" on the service. By default the Data services are "managed".
    Data management features allow you to synchronize adding, updating, and deleting of records in a database. Changes you make in the client application are not written to the server until a "commit" method is called. You can call a revert method to roll back changes made in the client application.
    So wherever you update or create add "commit" to the service after adding/updating. for eg.
    protected function addDbItem(item:dbItem:void
         createDbItemResult.token = dbItemService.createDbItem(item);
         dbItemService.commit();
    I think the following article might be of interest to you:
    http://help.adobe.com/en_US/Flex/4.0/FlexTutorials/WSbde04e3d3e6474c4292a0331216558354b-80 00.html#WSbde04e3d3e6474c4-10020e8112165e18e29-8000

  • Trouble viewing php in live view or split screen

    I have installed a testing server to render the php in my dreamweaver site. I have php5.3 on mac os x 10.6. The split view only shows a simple "php" logo or icon. Any idea what is going on? Or how to resolve the php rendering so that it provides a "live view" of the page?

    Thank you for your reply. Apache is running and php is operational in that  a query of http:// localhost  replies with a "2" in response to a simple php script to echo 2.

  • PHP and SQL trouble

    Hi there,
    Im currently creating a login system using php and sql. At the moment i have it that when the user registers their information (i.e username,password) it gets stored in the database. The part that i am having an issue with is that when the user logs in, I want to retrive the relavant data from the database and compare it to what they have entered into the login section. I persume i have to use an sql query something like (SELECT username, password FROM Users) but not sure how to compare it to what the user has entered.
    Any help you be greatly appreciated.
    Thanks,
    Barrie

    Hi,
    does it mean that you´re not using Dreamweaver, which comes with a Login User server behavior which would do all the heavy lifting and generate a correct query ? Just asking, because you posted in the Dreamweaver Application Development forum

  • Troubles using Javascript popoup  inside a PHP file

    I am trying something simple: to open a popup window trough a
    javascript code inside my PHP file and nothing happens: here is the
    code:
    $openwindow =
    "MM_openBrWindow('view.html','','width=300,height=300')";
    echo "<td><a href='#'><img
    src='images/button_blue.jpg' alt='Map' width='97' height='13'
    border='0' onclick=" . $openwindow . "/></a></td>";
    Also I am declaring such Javascript function at the beginning
    of the file... Please help me as soon as you can... it is driving
    me crazy... thanx in advance !

    .oO(David Powers)
    >Michael Fesser wrote:
    >> print "<a
    href='foo?id=$something'>bar</a>";
    >>
    >> Not a single escape character and very readable in
    an editor with proper
    >> syntax highlighting.
    >
    >I agree with Steve that this is a trivial example that
    doesn't really
    >prove anything.
    OK. At least it shows that escaping is not always necessary
    In a more complex example with more variables I would've used
    printf().
    >If $something is the only variable in a long section of
    >HTML, it's much more efficient to do this:
    >
    ><a href="foo?id=<?php echo $something;
    ?>">bar</a>
    I don't think efficieny is really an issue here.
    >Every time that the PHP engine encounters double quotes
    inside a PHP
    >block, the engine has to parse the content to find if any
    variables are
    >interpolated. In your example, there is a variable, so
    the effort isn't
    >wasted, but many developers use double quotes all the
    time, even if no
    >variable are included in strings. Although the difference
    in processing
    >time is only microseconds, it's an inefficient way of
    writing PHP.
    Did you ever encounter any performance issues just because of
    using
    "unneccesary" double quotes? Or by using string concatenation
    instead of
    the slightly faster
    echo $foo, $bar, $somethingElse ?
    I didn't, and I doubt I ever will. It may be not the best
    style and
    usually I use single quotes where possible, but I don't care
    too much,
    because other things are much more important.
    In fact I consider that all rather esoterical. If someone
    tries to
    "optimize" his code by avoiding double quoted strings where
    possible
    then IMHO he doesn't really have understood optimization at
    all. The
    real bottlenecks are not some syntactical sugar provided by
    PHP, but the
    algorithms and I/O operations. That's where optimization has
    to start.
    >However, I've seen a lot of inexperienced people post
    questions about
    >PHP problems, usually caused by the incorrect mixture of
    single and
    >double quotes.
    Agreed, me too. But often it's not just some lack of
    knowledge, but also
    the usage of the wrong tool. Many errors I've seen in
    beginner's code
    (especially the mentioned quoting problems) could've been
    easily spotted
    with proper syntax highlighting.
    >When you ask why they have coded it in such a convoluted
    >way, the answer is invariably "because it's a PHP page".
    Hmm, quite possible.
    >PHP is designed
    >to be embedded in HTML.
    True, but just because PHP is designed for this and that,
    doesn't mean
    that I always have to use it in that way. Remember
    register_globals and
    magic quotes - they were a fundamental part of PHP's design a
    while ago.
    >You can also include HTML in PHP functions.
    Now it gets really nasty. That's even more ugly than heredoc
    syntax. ;)
    With HTML embedded in PHP functions I always had the problem
    how to
    indent the code - either the source code looked bad or the
    final HTML.
    I never did it again.
    >If the HTML block contains a lot of variables or other
    dynamic code, I
    >agree that using print or echo is probably more efficient
    and easier to
    >read. However, when HTML is predominant, embed the
    dynamic stuff.
    As said - I consider it just personal preference. There are
    valid
    reasons for both ways.
    Micha

  • Trouble installing PHP with Windows XO IIS

    I followed the Live Docs instructions to install IIS and
    tested it successfully; then I went to
    http://livedocs.adobe.com/en_US/Dreamweaver/9.0/help.html?content=WS9C4F33E1-12B2-4e40-BD4 0-5D66C1F75EB6.html
    aand followed those steps to download, install and test PHP 5.2.1
    installer. After rebooting I tried to open the PHP test page
    http://localhost/timetest.php
    in Firefox but instead of displaying Windows asked me to select a
    program with which to open it. How can I troubleshoot the PHP
    installation.

    Yes I was able to successfully open
    http://localhost/test.htm in
    Firefox;
    One thing I neglected to mention that when installing
    php-5.2.1-win32-installer.msi, I encountered a message not
    mentioned in the Adobe docs. I was asked to choose a web server to
    install and I chose None, since I had already installed Windows
    IIS.
    I had suspected my problem was with PHP, now what steps
    whould I try?
    thanks,
    Gary G

  • Trouble with php process form

    Everything about my form works fine except for when you hit
    the submit button, it takes you to an error page instead of my
    "thanks for filling out the form" page. This is the link to the
    form:
    http://www.vintagebycrystal.com/Pages/form.htm
    This is my process script (it's very simple because I'm not
    that talented with php):
    <title>Vintage by Crystal</title><?php
    $name = $_POST['name'];
    $address = $_POST['address'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
    $insurance = $_POST['insurance'];
    $payment = $_POST['payment'];
    $comments = $_POST['comments'];
    $recipient = "[email protected]";
    $subject = "westwood inquiry";
    $message = "Name: $name \n";
    $message .= "Address: $address \n";
    $message .= "E-mail: $email \n";
    $message .= "Phone: $phone \n";
    $message .= "Insurance: $insurance \n";
    $message .= "Payment: $payment \n";
    $message .= "Comments: $comments \n\n";
    $headers = "From: My Form \n";
    $headers .= "Reply-To: $email";
    mail($recipient,$subject,$message,$headers);
    header('Location:
    http:vintagebycrystal.com/Pages/thankyou.html');
    exit;
    ?>
    This is the link the submit button is supposed to forward you
    to:
    http://www.vintagebycrystal.com/Pages/thankyou.html
    I am pretty sure the problem lies with line 26, which is:
    header('Location:
    http:vintagebycrystal.com/Pages/thankyou.html');
    Can anyone help me figure out what's wrong?
    -Crystal

    On Tue, 23 Jan 2007 22:37:45 +0000 (UTC), "viperlife2"
    <[email protected]> wrote:
    >funny thing is that that was one of my problems
    previously gary, and nobody was
    >able to figure out what was going on... it took me having
    to contact my server
    >hosting company to figure out what to do.... and that was
    what it was.
    While that may well have been a problem using a file system
    function, it
    was most definitely not the problem with a header() function
    call.
    Headers are sent to the browser. Using the header('Location:
    function sends the specified header to the *browser* telling
    the browser
    to request the file specified. The browser cannot call a file
    based on
    the server's full file system path. It just won't work ...
    ever.
    On the other hand, if you're using something like include,
    require,
    fopen, opendir, etc., those work based on the server's file
    system and
    you will need the full path, or a relative path. In many
    cases, those
    will NOT work with an http address. You can see the full list
    of file
    system functions at
    http://php.net/Filesystem
    Gary

Maybe you are looking for

  • Unable to see Java 5 features from Doclet API

    The Doclet API was extended in Java 5 for getting information in generics, but I have been unable to get it to work. For example, calling ClassDoc.typeParameters and typeParamTags always returns an empty array. * @param <X> The X public class Test<X>

  • Processing msgs one at a time

    Hi, Is there any way in JMS which will help in processing messages received by onMessage() on a one at a time basis. What I mean is, I shud not process the next message till the first one is processed? I am assuming that onMessage() executes as soon

  • Why are't the apple apps free for ipad 2?

    Why are apps from apple like pages, keynote etc. paid for ipad 2 and u can download them for free on ipad 3+?

  • Batch file to amplify audio

    I haave a bunch of mp4's for which the sound is too soft.  I would like to import, normalized, increase db by 12, and save to an mp4 or avi (a file type that Mac and Windows computer users both could view.) Is there a way to do this with a batch file

  • Using JARX API to register a Web service in IBM UDDI Business Registry

    HI. I have a code, which uses the JAXR API to register a web service to the IBM UDDI Business Registry Version 2.0. I compiled the code using the ant tool. When running the code, i get a java.security.PrivilegedActionException exception. i am using a