AS3 / PHP / MySQL - login form

Hello,
I'm trying to create the most basic example I can of an AS3/PHP/MySQL interaction.  I want a Flash movie to check a user's login/pass against a DB.  I've tested the PHP code and know it's correct.  The problem must lie in the AS.  I've traced everything to make sure it goes out correctly, but it comes back as the variable names $user, $pass...and some other garbage... not the variable values I am expecting... see below.
The PHP code correctly returns the following when tested in browser:  user=dan&pass=danpass&err=Success!
The traced variables $user, $pass, $err return the following in Flash:
undefined
$pass
$err";
    echo $returnString;
?>
Here's the ActionScript:
import flash.events.*;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLVariables;
import flash.net.URLRequestMethod;
logbtn.addEventListener(MouseEvent.CLICK, login)
function login($e:MouseEvent){
  var myVariables:URLVariables = new URLVariables();
  var myRequest:URLRequest = new URLRequest("login.php");
  myRequest.method = URLRequestMethod.POST;
  myRequest.data = myVariables;
  var myLoader:URLLoader = new URLLoader;
  myLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
  myLoader.addEventListener(Event.COMPLETE, completeHandler);
  myVariables.user = loguser.text;
  myVariables.pass = logpass.text;
  myLoader.load(myRequest);
  function completeHandler(event:Event):void{
    trace(event.target.data.user);
    trace(event.target.data.pass);
    trace(event.target.data.err);
And here's the PHP:
<?php
  include_once "dbconnect.php";
  $user = $_POST['user'];
  $pass = $_POST['pass'];
  $sql = mysql_query("SELECT * FROM users WHERE user = '$user' AND pass = '$pass'");
  $check = mysql_num_rows($sql);
  if($check > 0){
    $row = mysql_fetch_array($sql);
    $user = $row["user"];
    $pass = $row["pass"];
    $err = "Success!";
    $returnString = "user=$user&pass=$pass&err=$err";
    echo $returnString;
?>
Does anything stand out as being wrong?  I've gone over this for probably 10-15 hours trying different variations, tweaks, and reducing it in complexity.  I will really appreciate any help you can offer!  Thank you.
-Eric

Thanks Birnerseff! 
I've been running the SWF from the same directory as the PHP script.  I just tried viewing it through my localhost and it worked!  I guess I'll have to do all my testing that way, but that's fine.
Thank you very much.  I probably wouldn't have messed around with that for a long time otherwise.
-Eric

Similar Messages

  • Php mysql login behavior

    Hi the list,
    I have a php/mysql site -, very simple. it's using the
    built-in user authentication behavior. this is fine, checks the
    database and either opens the correct page with a valid user/login
    or opens an error page, if there's no valid login and password set.
    what I need to do is to display a field based on the user and
    password on the receiving page, but I can't seem to get that to
    work. If I get rid of the built-in user authentication and just
    send the login and password to the receiving page as form
    variables, it works fine but then I don't have the error page
    behavior. I'm not a database guy, just kind of floundering here.Any
    help gratefully accepted.

    On Thu, 11 Oct 2007 20:47:04 +0000 (UTC), "paulelwood"
    <[email protected]> wrote:
    > what I need to do is to display a field based on the
    user and password on the
    >receiving page, but I can't seem to get that to work. If
    I get rid of the
    >built-in user authentication and just send the login and
    password to the
    >receiving page as form variables, it works fine but then
    I don't have the error
    >page behavior. I'm not a database guy, just kind of
    floundering here.Any help
    >gratefully accepted.
    Not quite sure what you mean ("display a field") but it
    sounds like
    you want the receiving page to display some information about
    the
    person who has logged in?
    In that case, in the code on your login page, after login has
    been
    verified but before the redirection to the receiving page,
    you should
    set a session variable to be the id of the person logging in.
    Then on
    your receiving page query the database for the person with
    that id and
    retrieve whatever you want. For example, get their given name
    and
    display a personalised welcome to them.
    Hope this is what you meant?
    Steve Fleischer
    steve at flyingtigerwebdesign dot com
    Hong Kong

  • Login failure (cannot modify header) PHP/MySQL

    I have a login form 100% Dreamweaver8 built using PHP/MySQL.
    After logging in it fails to goto the $MM_redirectLoginSuccess page
    (index.php). I did not have this issue prior to the 8.02 update. I
    designed it the same way as I had before the 8.02 update. I have
    checked multiple times for whitespace before and after the PHP open
    and close tags in Dreamweaver and other text editors.
    Below is what info is needed I hope.
    Error
    PHP Warning: Cannot modify header information - headers
    already sent by (output started at /var/www/web4/web/login.php:4)
    in /var/www/web4/web/login.php on line 72, referer:
    Code (All Dreamweaver 8 Generated)
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
    session_start();
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
    $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    if (isset($_POST['username'])) {
    $loginUsername=$_POST['username'];
    $password=$_POST['password'];
    $MM_fldUserAuthorization = "Account_Type";
    $MM_redirectLoginSuccess = "index.php";
    $MM_redirectLoginFailed = "loginfailed.php";
    $MM_redirecttoReferrer = false;
    mysql_select_db($database_dnsturtle, $dnsturtle);
    $LoginRS__query=sprintf("SELECT Email, Password,
    Account_Type FROM accounts WHERE Email=%s AND Password=%s",
    GetSQLValueString($loginUsername, "text"),
    GetSQLValueString($password, "text"));
    $LoginRS = mysql_query($LoginRS__query, $dnsturtle) or
    die(mysql_error());
    $loginFoundUser = mysql_num_rows($LoginRS);
    if ($loginFoundUser) {
    $loginStrGroup = mysql_result($LoginRS,0,'Account_Type');
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;
    if (isset($_SESSION['PrevUrl']) && false) {
    $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
    header("Location: " . $MM_redirectLoginSuccess );
    --------------------Line 72
    else {
    header("Location: ". $MM_redirectLoginFailed );
    ?>

    I take it you have an include file as well on the page, to
    reference the
    database? Check in there for whitespace.
    Gareth
    http://www.phploginsuite.co.uk/
    PHP Login Suite V2 - 34 Server Behaviors to build a complete
    Login system.

  • Query MySQL table from login form.

    Probably a simple question, but I can't seem to get it. Here my
    my table on MySQL
    ID        Username        UFN           ULN             Password
    1         joSmith            John           Smith           encrypted
    2         jaSmith            Jane           Smith           encrypted
    3         jDoe                 John           Doe             encrypted
    When I login using username and password, I want to display the first name and last name for the user and display it on the next page. I can usually echo a _POST, but when it comes to sessions, this doesn't seem to work properly, as the next page doesn't know the variable.

    Sorry here is the code, its generated from the login user wizard from dreamweaver. It doesn't matter what code is on the second page as the session and post variables are "gone", I can't call on it. This code of course will successfully login to the restricted pages without issues.
    <?php require_once('Connections/UserAcc_mySQL.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;
    ?>
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
      session_start();
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
      $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    if (isset($_POST['username'])) {
      $loginUsername=$_POST['username'];
      $password=md5($_POST['password']);
      $UN=$_POST['usern'];
      $MM_fldUserAuthorization = "";
      $MM_redirectLoginSuccess = "loginredirect.php";
      $MM_redirectLoginFailed = "adminlogin.php";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_UserAcc_mySQL, $UserAcc_mySQL);
      $LoginRS__query=sprintf("SELECT `User`, Password, UFN, ULN FROM username WHERE `User`=%s AND Password=%s",
        GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
      $LoginRS = mysql_query($LoginRS__query, $UserAcc_mySQL) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
         $loginStrGroup = "";
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;     
        if (isset($_SESSION['PrevUrl']) && false) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
        header("Location: " . $MM_redirectLoginSuccess );
      else {
        header("Location: ". $MM_redirectLoginFailed );
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style>
    .Login
    position:absolute;
    vertical-align:middle;
    margin-left: 40%;
    margin-right: 40%;
    top: 153px;
    </style>
    </head>
    <body>
    <div class="Login">
    <form ACTION="<?php echo $loginFormAction; ?>" method="POST" name="LogMeIn">
    <label>Username:</label> <input type="text" name="username" id="username" /><br />
    <label>Password: </label><input type="password" name="password" /><br />
    <input type="hidden" name="user" />
        <input type="submit" value="Login" />
    </form>
    </div>
    </body>
    </html>

  • Login form using JSC n MySql

    please send me full code for a simple login page using my jsc n mysql

    here i hav got code for a simple login form usin
    JAVA and MySQl
    public String button1_action() {
    String Username = (String) this.textField1.getValue();
    String pwd = (String) this.passwordField1.getValue();
    boolean isValidUser=false;
    com.sun.sql.rowset.CachedRowSetXImpl loginRowSet=new com.sun.sql.rowset.CachedRowSetXImpl();
    try {
    loginRowSet.setDataSourceName("java:comp/env/jdbc/sms");
    loginRowSet.setCommand("SELECT * FROM login");
    loginRowSet.setTableName("login");
    loginRowSet.execute();
    loginRowSet.beforeFirst();
    while(loginRowSet.next()){
    String Username1 = loginRowSet.getString("name");
    String Password1 = loginRowSet.getString("password");
    if(Username.equals(Username1) && pwd.equals(Password1)){
    return "case1";
    if (!isValidUser){
    staticText1.setValue( " logon failed");
    catch (Exception e) {
    error("Login Failed : " + e.getMessage());
    throw new FacesException(e);
    } finally {
    loginRowSet.close();
    return null;
    Make some changes in session bean also
    protected ApplicationBean1 getApplicationBean1() {
    return (ApplicationBean1)getBean("ApplicationBean1");
    plz add this also
    public boolean do_rand() {
    boolean do_rand = true;
    try{
    loginRowSet.setCommand("SELECT * FROM login ");
    }catch(SQLException ex) {
    if(ex != null ){
    ex.printStackTrace();
    errorRand = "error do random";
    do_rand = false;
    return do_rand;
    } catch(Exception e) {
    e.printStackTrace();
    return false;
    return true;
    }

  • How to Connect login form to MySql Db connectin Pls..tellme

    How to Connect login form to Mysql Db connection Pls..tell me

    Specify variables for username and password and connect with the MySQL database using the mysql_connect() function. The username “root” does not require a password by default.
    Specify the server parameter of the mysql_connect() method as localhost:3306.
    $username='root';
    $password='';
    $connection = mysql_connect('localhost:3306', $username, $password);
    If a connection does not get established output the error message using the mysql_error() function.
    if (!$connection) {
    $e = mysql_error($connection);
    echo "Error in connecting to MySQL Database.".$e;
    }

  • PHP/mySQL Insert/Update Problems

    I hope someone can help because I can't find anything online
    that is helping me with this problem. I can't get the Dreamweaver
    controls to work when coding a PHP insert or update record page. It
    looks like it creates the code correctly but when I put them out on
    my webserver and then fill out the form and click submit the page
    submits and tries to use a URL string of (null)/admin/index.php
    where index.php is the form page not the page I told it to redirect
    to. I don't know why the (null) value keeps getting inserted into
    the string either. The browser obviously can't find this URL so
    gives a page cannot be displayed screen and nothing get's inserted
    or updated in the mySQL database.
    Any help would be greatly appreciated. This problem is
    driving me crazy because I want to save time not having to hand
    code things. Below is a User Authentication page using the
    Dreamweaver controls that does the same thing when I try to
    login.

    tobyd wrote:
    > the page submits and tries to use a URL string of
    (null)/admin/index.php
    > where index.php is the form page not the page I told it
    to redirect to. I don't
    > know why the (null) value keeps getting inserted into
    the string either.
    The following two lines set the URL for login success and
    failure.
    > $MM_redirectLoginSuccess = "../admin_index.php";
    > $MM_redirectLoginFailed = "../admin/index.php";
    As you can see, they are relative paths, suggesting that the
    login form
    is in a different subfolder, but at the same level as
    admin_index.php
    and the admin folder. The (null) almost certainly comes from
    the fact
    that your login page is in the site root. If you're typing in
    the
    redirect filenames manually, use the Browse button instead.
    Dreamweaver
    should set the correct path for you.
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • PHP MySQL - Numbers in Password

    I am creating a basic web app and I am restricting access.  I have created a login form and used MySQL and Dreamweaver's PHP code for User Authentication.  It worked fine until I added a user with a password containing letters and numbers.  I have tried on my webserver and localhost.  It works on my local host and i have php3.  I believe on my webserver it is the newest release of PHP.  PHP5 i believe.  Does anyone know why this is happening?  Thanks for your help.

    Word to iPHP.
    But maybe this will inspire you. A Better Login System.
    Good luck.

  • Login Form Renie Garcia

    I am creating my first PHP site using Apache and MySQL. I am
    having problems creating a login form for customers.
    Can anyo give me a brief walkthrough.
    Rennie Garcia

    >I am creating my first PHP site using Apache and MySQL. I
    am having
    >problems creating a login form for customers.
    >
    > Can anyo give me a brief walkthrough.
    Google is your friend:
    http://www.plus2net.com/php_tutorial/php_login_script.php

  • OT: Login Form Advice

    I found a really cool registration form plugin @ http://jqueryvalidation.org/files/demo/milk/ and figured out how to connect it to a database. Then I started searching for a login form tutorial. It was kind of tricky because most tutorials are pre-PDO; in other words, they only work with MySQL queries that have been upgraded to PDO.
    But I finally found a good example at Basic Login Authentication with PHP and MySQL
    I got it up and running, but there's a catch - it won't work with my registration form. If I type in my_username, my_password in my registration form, those two values are published to the database. But the login form apparently works only with values that have been added via an attached add_user page. If you type in those same values, my_username is published to the database table, but my_password is replaced by some insanely long code, like this: 5c4ed510fef54a63a2211ca47d5c82736de69418
    You can then login by typing in my_username and my_password, even though my_password isn't stored in the database table. I think this code at the head of one of my files explains it all:
    session_start();
    /*** set a form token ***/
    $form_token = md5( uniqid('auth', true) );
    /*** set the session form token ***/
    $_SESSION['form_token'] = $form_token;
    So here's my question: Should I try to figure out how to delete all this $form_token/md5 stuff so it will work with my jQuery registration form, or should I try to modify my cool registration form so it replaces passwords with form_token's? To put it another way, is this a standard security feature I should hang on to?
    One problem is that, if a user loses their username, I won't be able to send them a reminder if no usernames are stored in the database table. All I do is send them some insanely long code and tell them to figure it out.
    Thanks.

    I haven't gone through the whole article, but enough to know that a human readable password gets coded using md5 coding as in
    $form_token = md5( uniqid('auth', true) );
    This provides extra security in case someone manages to get into the database to retrieve the usernames and related passwords.
    The idea is that a user enters his/her credentials and the coded version of the password is compared to the database entry. If they match, then bingo! There is no way of deciphering the code to extract the human version; if the coded version is entered, it will not match the database entry.
    It is up to you if you want to delete the md5 coding.

  • PHP/Mysql issue

    I use Dreamweaver CS3 to create my sites on a Windows/Apache
    Server with PHP5 and Mysql 5. The site works perfectly on my
    testing server at home. On the Web server I'm getting the following
    error which causes the page to not load:
    PHP Warning: mysql_query(): supplied argument is not a valid
    MySQL-Link resource in
    /hermes/bosweb/web248/b2488/ipw.horsehelp/public_html/residents/residents.php
    on line 63
    PHP Warning: mysql_select_db(): supplied argument is not a
    valid MySQL-Link resource in
    /hermes/bosweb/web248/b2488/ipw.horsehelp/public_html/residents/residents.php
    on line 61
    The lines in question are:
    Line 61 - mysql_select_db($database_conn_phh, $conn_phh);
    $query_getSuccess = "SELECT * FROM horses WHERE status =
    'Success Story' ORDER BY horse_barn ASC";
    $getSuccess = mysql_query($query_getSuccess, $conn_phh) or
    die(mysql_error());
    $row_getSuccess = mysql_fetch_assoc($getSuccess);
    $totalRows_getSuccess = mysql_num_rows($getSuccess);
    All of the code is supplied by Dreamweaver. I did not tweak
    the code. I'm not a web developer and what I have found out there
    is still reading greek to me. My connection file is working and
    connecting the database that I have tested.
    Since the above code is throughout the site in one form or
    another it's causing me major headaches. Any help would be
    appreciated.

    This is the first time I've used Adobe products so if the
    following is in the wrong forum (It's the closest one I found so
    far) or the format is incorrect please forgive me.
    I'm new to Dreamweaver CS3 and as I was reading the "first
    steps" it mentions to set up a Dreamweaver site right away. I got
    as far as completing "Site Definition" page under the basic side of
    the setup screen.
    The next screen is "Do you want to work with server
    Technology?"
    There are 2 options - Yes or No. If you select yes a
    drop-down menu appears with several options (but you can only
    select one)...
    Asp Javascript
    Asp VbScript
    Asp.net#
    Asp.net Vb
    Cold Fusion
    JSP
    Php MySql.
    I know nothing about these format and brand new to web design
    so I thought it best to contact GoDaddy (my hosting account) to
    find out what their servers would support. I spoke to a tech rep
    but she wasn't sure.
    She did mention that I have a windows hosting account and Php
    MySql would not work unless I changed to their Linux platform at no
    additional charge.
    The site I have in mind will design with CSS, Liquid layout,
    have some flash, widgets, an inquiry form that clients complete and
    results e-mailed to me, auto-responder, Paypal link and whatever
    else I can discover from Dreamweaver.
    My question being:
    I haven't even begun designing my site because I do not know
    what weather I should select the Yes option and select one of the
    formats mentioned above (if so which one) - or select the No
    option. If I do select the No option at the very beginning, will I
    have problems with my site uploading and working correctly?
    Thank you
    Travis

  • Command in php / mysql

    Hello,
    I used to program a lot in ASP, and loved the command
    function.
    However, now that I'm programming in PHP I do not have this
    at my disposal unfortunately.
    How does everyone perform certain actions on forms right
    now?, for example I'm performing an update on a record, but want to
    update all records in the table first by setting a certain field to
    0.
    Any thoughts and ideas / samples are greatly
    appreciated!

    Jasmine2002 wrote:
    > Correct, in ASP however I had the command so I can later
    on easily call up the
    > box and change / add / update my SQL.
    >
    > Do you just write the appropriate PHP for it?, I don't
    really know how to
    > properly write this in conjuction with Dreamweaver.
    I suspect that command is probably a stored procedure.
    Unfortunately,
    stored procedures were added to MySQL only in version 5.0,
    and
    Dreamweaver doesn't support stored procedures in the PHP
    MySQL server
    model. (I've lobbied for support, but it hasn't happened
    yet.)
    Your update is rather unusual, but you should be able to get
    Dreamweaver
    to generate the code for you using the Update Record server
    behavior.
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • I need help with DW, PHP & MySQL please.

    Hello, I am new to website development and am trying to set up a form for collecting data on my website and have a question that I can’t find an answer to anywhere else. I was wandering if someone there would be kind enough to help?  I am using Dreamweaver in CS4 and my host already has PHP & MySQL installed on the server that I can use.  My question is: Do I need to download XAMP or WAMP on my computer before trying to connect my form to the server?  Also, do I need to change the page I am putting the form on to .PHP extension or can I just embed the PHP form into an existing HTML page?
    Most of the training tutorials I’ve read don’t start at the most basic beginning but rather expect people to already have a basic knowledge of the topics they are trying to learn.  If anyone knows the best place to get answers to the most basic questions like this one or a beginners guide to working with DW, PHP & MySQL I will gladly go there rather than waste your time on questions you’ve probably already answered a bezillion times.
    Thank you for the help.

    Strictly speaking, you don't need XAMPP or WAMP on your local computer. But if you're serious about getting involved with PHP/MySQL, you should definitely set up a local testing environment with one or the other. It's safer and more efficient. Don't expose all your errors on a live server. You can find instructions on  how to set up a testing environment here: http://www.adobe.com/devnet/dreamweaver/articles/setting_up_php.html.
    To develop with PHP, you should always use a .php file name extension. Any other choice is very rare.
    There's a tutorial on building your first dynamic website with DW here: http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt1.html.
    For more in-depth help, you might want to consider grabbing hold of a copy of "The Essential Guide to Dreamweaver CS4 with CSS, Ajax, and PHP". (Yes, I wrote it, so it's a bit of shameless self-promotion, but you'll find it answers many of your questions - and probably a lot you hadn't even thought of.)

  • Apache2, PHP, MySQL Help

    Hi,
    Sorry if this is a bit of a newbie thing todo but I am not too good with solaris configuration yet.
    Can anyone supply a decent step by step and easy tutorial/how-to on how to set up Apache, PHP, MySQL and PHPmyadmin on a SPARC solaris 10 box please...
    Thanks Rob

    Can anyone supply a decent step by step and easy
    tutorial/how-to on how to set up Apache, PHP, MySQL
    and PHPmyadmin on a SPARC solaris 10 box please...Setting up Apache is very easy since all it takes is setting it up. Its installed by default, you can check /etc/apache for an example configuration file. Next to that www.apache.org/docs/ is also a very valuable read.
    <blunt SPAM>
    You could also consider looking into the Java webserver (formely SunONE). Its currently being made available for free with the Java Enterprise System and compares very well to Apache. If you'll also be doing some Java it would be a better choice (IMO its a better choice than Tomcat) and it can also do PHP.
    http://www.sun.com/software/products/web_srvr/home_web_srvr.xml
    http://www.zend.com/sun/?article=/sun/index.php&kind=&id=6179&open=1&anc=0&view=1
    http://www.php.net/
    </SPAM>
    As you'll note I included the PHP website because with the above setup you'd also need to manually setup PHP. If you have the companion CD present you can install the PHP module which will end up on /opt/sfw/apache. This directory will also present you a php.ini example which will need to be placed in /etc/apache as well. Setting it up is basicly following the documentation in the ini file, and the Apache documentation on adding an extra module (/opt/sfw/apache/libexec/libphp4.so).
    MySQL. Also very easy since its shipped with Solaris as well. Look into /etc/sfw/mysql for a README which covers the most essential steps to set it up. In short you'll need to setup a few directories for MySQL to work and optionally (but recommended) copy the default config file to /etc (/etc/my.cnf) which will define certain basic settings. The readme explains. Next you're likely to need the MySQL guide (if you're new with MySQL) which can be located at http://dev.mysql.com/doc/refman/4.1/en/index.html.
    This applies to the version (close enough anyway) which is shipped with Solaris. From personal experience I can say that MySQL 5 will also run very well on Solaris 10.
    Finally the PHPMyadmin... That really is an RTFM issue, once you have your environment setup (Apache and the likes) its likely you only need to copy it to your document root and point your browser to it.
    Hopes this helps somewhat.

  • PHP/MySql Error Message

    I've posted this before and didn't get the answer that I need, probably because I didn't post all of my codes. I am using PHP/MySql.  I created a website that has several forms.  When I process three of the forms, I get the error messages below:
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Condition, Length, Color, City, `State`, Email, Photo) VALUES ('29', '4', 'Used'' at line 1.
    Below I am posting the codes.  Hopefully, this time I posted everything that I should have so that I can get assistance.   
    FORM
    <form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="individual" class="individual" id="individual">
      <table width="594" border="0" class="test">
      <tr></tr>
      <tr>
        <td width="166" class="td">Posting Title</td>
        <td colspan="3"><span id="sprytextfield1">
          <label>
            <input name="Posting Title" type="text" class="test" id="Posting Title" size="35" />
            </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">Price</td>
        <td colspan="3"><span id="sprytextfield2">
          <label>
            <input name="price" type="text" class="test" id="price" size="35" />
          </label>
          <span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
      </tr>
      <tr>
        <td class="td">Size(s)</td>
        <td colspan="3"><label>
          <select name="size" size="1" multiple="multiple" class="test" id="size">
    <option>0</option>
            <option>2</option>
            <option>4</option>
            <option>6</option>
            <option>8</option>
            <option>10</option>
            <option>12</option>
            <option>14</option>
            <option>16</option>
            <option>18</option>
            <option>20</option>
            <option>22</option>
            <option>24</option>
            <option>26</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Condition</td>
        <td colspan="3"><label>
          <select name="Condition" class="test" id="Condition">
    <option>New</option>
            <option>Used</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Length</td>
        <td colspan="3"><label>
          <select name="Length" class="test" id="Length">
    <option>Long</option>
    <option>Short</option>
    <option>Mid-Length</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Color</td>
        <td colspan="3" class="td"><span id="sprytextfield5">
          <label>
            <input name="Color" type="text" class="test" id="Color" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">City</td>
        <td class="td"><span id="sprytextfield4">
          <label>
            <input name="City" type="text" class="test" id="City" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
        <td class="td"> </td>
        <td class="td"> </td>
      </tr>
      <tr>
        <td class="td">State</td>
        <td colspan="3"><label>
          <select name="State" class="test" id="State">
            <option>AL</option>
            <option>AK</option>
            <option>AZ</option>
            <option>AR</option>
            <option>CA</option>
            <option>CO</option>
            <option>CT</option>
            <option>DE</option>
            <option>DC</option>
            <option>FL</option>
            <option>GA</option>
            <option>HI</option>
            <option>ID</option>
            <option>IL</option>
            <option>IN</option>
            <option>IA</option>
            <option>KS</option>
            <option>KY</option>
            <option>LA</option>
            <option>ME</option>
            <option>MD</option>
            <option>MA</option>
            <option>MI</option>
            <option>MN</option>
            <option>MS</option>
            <option>MO</option>
            <option>MT</option>
            <option>NE</option>
            <option>NV</option>
            <option>NH</option>
            <option>NJ</option>
            <option>NM</option>
            <option>NY</option>
            <option>NC</option>
            <option>ND</option>
            <option>OH</option>
            <option>OK</option>
            <option>OR</option>
            <option>PA</option>
            <option>RI</option>
            <option>SC</option>
            <option>SD</option>
            <option>TN</option>
            <option>TX</option>
            <option>UT</option>
            <option>VT</option>
            <option>VA</option>
            <option>WA</option>
            <option>WV</option>
            <option>WI</option>
            <option>WY</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Email</td>
        <td colspan="3"><span id="sprytextfield3">
          <label>
            <input name="Email" type="text" class="test" id="Email" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
      </tr>
      <tr>
        <td height="26" class="td">Confirm Email</td>
        <td colspan="3"><span id="spryconfirm1">
          <label>
            <input name="Confirm Email2" type="text" class="test" id="Confirm Email2" size="35" />
          </label>
          <span class="confirmRequiredMsg">Required</span><span class="confirmInvalidMsg">The values don't match.</span></span></td>
      </tr>
      <tr>
        <td height="26" class="td">Photo(s)</td>
        <td colspan="3"><label>
          <input name="Photo" type="file" class="test" id="Photo" size="35" />
        </label></td>
      </tr>
      <tr>
        <td height="131" class="td">Additional Details</td>
        <td colspan="3"><label>
          <textarea name="Additional Details" cols="40" rows="6" class="test" id="Additional Details"></textarea>
        </label></td>
      </tr>
      </table>
      <p>
        <label>
          <input name="Submit" type="submit" class="test" id="Submit" value="Post" />
        </label>
      </p>
      <input type="hidden" name="MM_insert" value="individual" />
    </form>
    SERVER BEHAVIOR
    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;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "individual")) {
      $insertSQL = sprintf("INSERT INTO donations (postingTitle, `size`, condition, length, color, city, `state`, email, photo) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['Posting Title'], "text"),
                           GetSQLValueString($_POST['size'], "text"),
                           GetSQLValueString($_POST['Condition'], "text"),
                           GetSQLValueString($_POST['Length'], "text"),
                           GetSQLValueString($_POST['Color'], "text"),
                           GetSQLValueString($_POST['City'], "text"),
                           GetSQLValueString($_POST['State'], "text"),
                           GetSQLValueString($_POST['Email'], "text"),
                           GetSQLValueString($_POST['Photo'], "text"));
      mysql_select_db($database_bridesmaidsrack_db, $bridesmaidsrack_db);
      $Result1 = mysql_query($insertSQL, $bridesmaidsrack_db) or die(mysql_error());
      $insertGoTo = "donations.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    DATABASE CONNECTION
    # FileName="Connection_php_mysql.htm"
    # Type="MYSQL"
    # HTTP="true"
    $hostname_bridesmaidsrack_db = "localhost";
    $database_bridesmaidsrack_db = "bridesmaidsrack";
    $username_bridesmaidsrack_db = "";
    $password_bridesmaidsrack_db = "";
    $bridesmaidsrack_db = mysql_pconnect($hostname_bridesmaidsrack_db, $username_bridesmaidsrack_db, $password_bridesmaidsrack_db) or trigger_error(mysql_error(),E_USER_ERROR);

    Hi David,
    I did as you recommended. For good measure, I even changed the case of the letters to make sure that they coincide with exactly what's in the database.  I still kept getting the same error message.  So I deleted the recordset and attempted to recreate it.  When I attempted to recreate the record set, I got the following error message: "RangeError: invalid array length".  My codes are listed below:
    Form:
    <form method="POST" enctype="multipart/form-data" name="individual" class="individual" id="individual">
      <table width="594" border="0" class="test">
      <tr></tr>
      <tr>
        <td width="166" class="td">Posting Title</td>
        <td colspan="3"><span id="sprytextfield1">
          <label>
            <input name="posting_title" type="text" class="test" id="posting_title" size="35" />
            </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">Size(s)</td>
        <td colspan="3"><label>
          <select name="size" size="1" multiple="multiple" class="test" id="size">
      <option>0</option>
            <option>2</option>
            <option>4</option>
            <option>6</option>
            <option>8</option>
            <option>10</option>
            <option>12</option>
            <option>14</option>
            <option>16</option>
            <option>18</option>
            <option>20</option>
            <option>22</option>
            <option>24</option>
            <option>26</option>
            </select>
          <span class="Text">To select multiple sizes, hold ctrl and select each size.</span></label></td>
      </tr>
      <tr>
        <td class="td">Condition</td>
        <td colspan="3"><label>
          <select name="condition" class="test" id="condition">
    <option>New</option>
            <option>Used</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Length</td>
        <td colspan="3"><label>
          <select name="length" class="test" id="length">
    <option>Long</option>
    <option>Short</option>
    <option>Mid-Length</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Color(s)</td>
        <td colspan="3" class="td"><span id="sprytextfield5">
          <label>
            <input name="color" type="text" class="test" id="color" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">City</td>
        <td class="td"><span id="sprytextfield4">
          <label>
            <input name="city" type="text" class="test" id="city" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
        <td class="td"> </td>
        <td class="td"> </td>
      </tr>
      <tr>
        <td class="td">State</td>
        <td colspan="3"><label>
          <select name="state" class="test" id="state">
            <option>AL</option>
            <option>AK</option>
            <option>AZ</option>
            <option>AR</option>
            <option>CA</option>
            <option>CO</option>
            <option>CT</option>
            <option>DE</option>
            <option>DC</option>
            <option>FL</option>
            <option>GA</option>
            <option>HI</option>
            <option>ID</option>
            <option>IL</option>
            <option>IN</option>
            <option>IA</option>
            <option>KS</option>
            <option>KY</option>
            <option>LA</option>
            <option>ME</option>
            <option>MD</option>
            <option>MA</option>
            <option>MI</option>
            <option>MN</option>
            <option>MS</option>
            <option>MO</option>
            <option>MT</option>
            <option>NE</option>
            <option>NV</option>
            <option>NH</option>
            <option>NJ</option>
            <option>NM</option>
            <option>NY</option>
            <option>NC</option>
            <option>ND</option>
            <option>OH</option>
            <option>OK</option>
            <option>OR</option>
            <option>PA</option>
            <option>RI</option>
            <option>SC</option>
            <option>SD</option>
            <option>TN</option>
            <option>TX</option>
            <option>UT</option>
            <option>VT</option>
            <option>VA</option>
            <option>WA</option>
            <option>WV</option>
            <option>WI</option>
            <option>WY</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Email</td>
        <td colspan="3"><span id="sprytextfield3">
          <label>
            <input name="email" type="text" class="test" id="email" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
      </tr>
      <tr>
        <td height="26" class="td">Confirm Email</td>
        <td colspan="3"><span id="spryconfirm1">
          <label>
            <input name="confirm_email2" type="text" class="test" id="confirm_email2" size="35" />
          </label>
          <span class="confirmRequiredMsg">Required</span><span class="confirmInvalidMsg">The values don't match.</span></span></td>
      </tr>
      <tr>
        <td height="26" class="td">Photo(s)</td>
        <td colspan="3"><label>
          <input name="Photo" type="file" class="test" id="Photo" size="35" />
        </label></td>
      </tr>
      <tr>
        <td height="131" class="td">Additional Details</td>
        <td colspan="3"><label>
          <textarea name="Additional Details" cols="40" rows="6" class="test" id="Additional Details"></textarea>
          <input name="hiddenField" type="hidden" id="hiddenField" value="Date" />
        </label></td>
      </tr>
      </table>
      <p>
        <label>
          <input name="Submit" type="submit" class="test" id="Submit" value="Post" />
        </label>
      </p>
    </form>
    Server Behavior
    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;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "individual")) {
      $insertSQL = sprintf("INSERT INTO donations (posting_title, `size`, condition, length, color, city, `state`, email, photo) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['posting_title'], "text"),
                           GetSQLValueString($_POST['size'], "text"),
                           GetSQLValueString($_POST['condition'], "text"),
                           GetSQLValueString($_POST['length'], "text"),
                           GetSQLValueString($_POST['color'], "text"),
                           GetSQLValueString($_POST['city'], "text"),
                           GetSQLValueString($_POST['state'], "text"),
                           GetSQLValueString($_POST['email'], "text"),
                           GetSQLValueString($_POST['Photo'], "text"));
      mysql_select_db($database_bridesmaidsrack_db, $bridesmaidsrack_db);
      $Result1 = mysql_query($insertSQL, $bridesmaidsrack_db) or die(mysql_error());
      $insertGoTo = "donations.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));

Maybe you are looking for

  • Graphic Anomalies, Freezing Yosemite

    Hello This issue presented it self some time ago prior to yosemite, Maybe Maverics but lots of people had issues with MT Lion. I recall an update at some point and the issue was gone.. Since Yosemite it has been Back.. Typically I'm just browsing wit

  • Problem with reports...

    Hi all, 1) How to handle double click event in interactive report ?    and when we double click on field which event will call?    and we have emp id in basic list then how to pass that into secondary list? Thanks in advance.. sudharsan.

  • Using an IN predicate in a PreparedStatement

    Is there a clean way to handle the IN predicate in Oracle's PreparedStatement. I guess the obvious way to do it would be thus: ps = SELECT * FROM someTable WHERE id IN (?, ?, ?) But this means that every time you use a different number of IDs, you wo

  • Rule in ATP for allocating stock

    Hi Team, Where can we check the rule in ATP ,,ie, the percentage specified for allocating the stock to the customers. Thanks for the help. Thanks,   Vijesh

  • Help with 10.4.5 VPN connection using PPTP to Windows 2003 Server

    Hi, I've looked on the discussions for an answer to this but have had no luck so far, can anyone help? I'm trying to connect my 10.4.5 PB to my Wn2k3 server (with RRAS) using PPTP VPN, however I keep getting stuck at the Negotiating phase of the conn