Using php-mysql module and Apache2.2 provided with FMS4.5

Hi,
we've recently downloaded and upgraded FMS from 3 to 4.5 on a server that has this configuration (before upgrading):
- Centos 5.5
- Apache 2.2.3
- mysql 5.0.77
- php 5.3.3
- perl 5.8.8
Everything was fined before upgrading since 3 years.
We decided to upgrade FMS to provide HLS to our customers.
Once we upgraded FMS and installed Apache that comes with the installer, we encountered lots of errors.
- no more php, all scripts were visible, so we had to reinstall php module; and by the way, how can't we have the logical directories for apache (like /etc/httpd/,...) instead of /opt/adobe/fms/Apache...
- no more perl, cgi script are also visible...
- and now, we are unable to connect to mysql database. Whatever we do, the following message appears:
Fatal error:  Call to undefined function mysql_connect()
modules are in the right folders but no way....
If someone can help us,
regards,
Tony

i answer to myself:
I finally managed to do it.
The best way was this:
- backup the Apache folders from fms
- reinstall fms w/o apache
- reinstall properly the standard httpd ( i launched yum remove httpd before)
- copy modules from fms backup to /etc/httpd/modules  so i havve specific modules
- update httpd.conf with adobe version (easy with Kompare)
restart httpd and fms
Now everything works well: php, mysql, cgi, ...

Similar Messages

  • Best way to update images using PHP / MySQL?

    HI
    I want to update images using PHP/MySQL, so users can update their images and maybe some other files but mainly images.
    thanks

    How messed up is this code?!
    <?php
    //connect to database
    $con = mysql_connect("testhost","testuser","pass");
    // file properies
    $file = $_FILES['image']['tmp_name'];
    if (!isset($file))
    echo "please select an image";
    else {
        $id = $_REQUEST['id_display'];
        $image = ($_FILES['image']['tmp_name']) ? file_get_contents ($_FILES['image']['tmp_name']) : '';
        $image_name = ($_FILES['image']['name']) ? addslashes($_FILES['image']['name']): '';
        $image_size = ($_FILES['image']['tmp_name']) ? getimagesize($_FILES['image']['tmp_name']): '';
        if ($image_size == FALSE)
        echo "You have not selected an image.";
        else {
            mysql_select_db("test_display", $con);
            mysql_query("UPDATE testtable SET image = '$image', imagename = '$image_name' WHERE id_display='$id'");
    ?>
    And the upload page....
    /*Update code */ /*End update code */                            

  • CS6 Dreamweaver using PHP & MySQL - Delete Record Server Behavior?

    When I try to insert the Delete Record server behavior. I get an error message about a DeleteRecord.js file, which seems to be missing or defective.  I cannot use the server behavior.  I have a file that I developed using CS5, and it does indeed delete the record, but does not proceed to the destination I want.  I cannot change that except in the server behavior, so I'm stuck.  I have noticed that server behaviors seem to disappear without apparent cause, as it seems to have in this case.  I will appreciate any suggestions!  Is there any way to embed a call to a target page manually?  All is working WITHOUT the server behavior appearing, but I want to go to a confirmation display page that shows the record is indeed deleted, and we just return to the (now blank) delete confirmation page.  That'll drive a user bonkers!
    Thanks!
    Delete Record in CS6 Dreamweaver using PHP & MySQL?

    Well, your error message is self-explanatory.
    DW stores ServerBehaviors in 'Configuration' folder in installation directory. If one of the behavior JS files is missing/ corrupt, you'll see the error message you just did.
    I've uploaded a functional, proper version of DeleteRecord.js onto my site for you to download. Here's the link:
    http://www.sudarshan.me/adobeforum/dw/app/behavior-js/DeleteRecord.zip
    Download this file, extract it and put DeleteRecord.js file in your installation directory as follows. If prompted, 'replace' your local copy:
    Mac: Applications > Adobe Dreamweaver CS6 > Configuration > ServerBehaviors > PHP_MySQL
    Windows: C:\Users\Your User Name\AppData\Roaming\Adobe\Dreamweaver CS6\[language]\Configuration\ServerBehaviors\PHP_MySQL
    It should work as expected.
    If that still doesn't solve the problem, reset your DW preferences and cache and try doing it. Follow the instructions here to reset cache: http://forums.adobe.com/thread/494811
    Let us know how it goes.
    -ST

  • Can I use photoshop text styles and photoshop actions with creative cloud photography?

    I'm really confused by this subscription pricing. If I purchase the $9.99/month, do I get the full desktop app of Photoshop and Lightroom? But I see on this page Products they list something called Photoshop CC that costs twice as much. How is that different from the Creative Cloud Photography?
    My main question is whether I can use photoshop text styles and photoshop actions with Creative Cloud Photography, since I just purchased a bundle that includes these and I want to be able to use them. But I'd also like to understand what comes with all of the various products and how they are different.
    My other question is how is Lightroom different from Photoshop? I have a sense of what you can do in Photoshop but I don't know much about Lightroom at all.
    One more question: the free trial -- is it limited in any way besides the time length? If I do that, will I get a clear idea of all that I will be able to do once I subscribe, or are the functions limited in the trial?
    I tried to just send an email to Adobe to ask these questions but apparently they are not interested in responding to emails from people who are not yet paying customers, so I was directed here. Thanks very much for your help!

    I always like to trot this bit about Bridge once in a while or in the voice of the "Two Bobs" from Office Space,
    "Can you tell us exactly what it is you do around here?"
    What Adobe Bridge does:
    Bridge is the coordinating hub of the Creative Suite. Synchronizing color management settings for all suite programs is done from Bridge, and can only be done from Bridge, to take one important use.
    Bridge displays actual thumbnails of many more file types than Finder or Explorer. It also allows instant play of sound or video files more readily than the native OS file managers.
    Bridge allows direct access to file metadata, to embed copyright information  and keywords where appropriate (e.g., for corporate logo vector and raster files). It also displays the fonts used in an InDesign file, the swatches in an INDD or AI and the output plates (including spot color plates) they use.
    When managing the assets for a design project, Bridge allows quick and simple sorting, rating and custom labeling (with color flash indications) of assets. I can rate images according to whether they are rejects, possibles, for review by client, or approved. The filters built into Bridge allow instant isolation of only the approved images or designs in a folder, only the rejects (for deletion) or only files with certain ratings, no matter how many files it contains. It recognizes aspect ratios, so if I only need a landscape or a 16:9 image in a folder of hundreds of images, I turn off the aspect ratios I don't need.
    Once filtered, the remaining visible files can be selected and copied, moved, or deleted without affecting the rest of the contents of a folder.
    Collections are a massively useful feature. One of my clients is a performing arts center, and in a season we turn out dozens of ads, flyers, brochures, web banners, playbills, billboards and other collateral using the same assets over and over. These assets are organized by artist and/or show on disk, but I set up each season's repeating assets as a Collection in Bridge, so that I just have to open the collection and drag and drop these assets into new INDD, AI, PSD, HTML (in Dreamweaver), FLA or AE projects without having to navigate from folder to folder picking up individual files.
    Bridge's Favorites is another place I stack frequently-accessed folders, such as stock photography, backgrounds, and top-level folders for active projects.
    Assets can be divided into subfolders, but a quick toggle of "Show items from subfolders" exposes all of the assets in a single view while maintaining their organization. I will typically keep AIs, PSDs, EPSs, stock photography and client images in separate subfolders within a project. When I'm ready to start pulling assets into an InDesign layout, I toggle this on and simply drag what I need into the layout.
    Bridge comes with Adobe Camera Raw built in, which is many times faster than using Photoshop to adjust jpegs or tiffs for things like tonal range, white balance, cropping, spotting and sharpening, and is non-destructive.
    One tremendously useful Bridge function for InDesign CS5+ users is the "Show linked files" feature, which opens all the linked files in a layout into a single view, regardless of where they are physically located. I often use this when doing alternative layouts from a client-approved mockup for a campaign, to be certain the same assets are used in each piece, or when creating a motion graphic or interactive piece for the campaign in After Effects or Flash.
    The batch and image processing scripts built into Bridge automate things like creating web-ready small jpegs from multiple images, renaming large numbers of files in place or by copying to an alternative location, creating sets of PSD, png, jpeg or other file types from an assortment of image files, and so on.
    Bridge is so much a part of my daily workflow that on my main workstation I have one monitor dedicated to it almost 100%. Bridge just sits open 24/7, ready for use. I would run at half speed without it, no question.

  • Hi helpers I have very old MacBook 10.5.8 please could you tell me what operating system I should get to be able fully use my laptop as i cant use it properly anymore and doesnt connect with my Iphones etc thanks

    Hi helpers I have very old MacBook Mac OS X 10.5.8 please could you tell me what operating system I should get to be able fully use my laptop as i cant use it properly anymore and doesnt connect with my Iphones etc thanks

    Josejanko,
    You don't supply much info other than your machine is old, so here is some info for you to check thru.
    Before doing anything you should have a back up, preferably 2, in the event something goes wrong.
    You would have to start by upgrading to Snow Leopard, you would need to buy the disk for about $20 here  http://store.apple.com/us/product/MC573Z/A/mac-os-x-106-snow-leopard  
    Check the the requirements to see if your machine meets them.
    You would then need to run the 10.6.8 v1.1 combo update to get it to 10.6.8 Mac OS X 10.6.8 Update Combo v1.1
    You can then access the APP STORE and possibly upgrade to to further OSX.
    You may have applications that will not be compatible with any thing past Snow Leopard, you can check those here Upgrading to 10.7 and above, don't forget Rosetta!
    http://roaringapps.com/apps
    Office 2008 will not work with anything newer than Snow Leopard for an wxample
    You may be able to upgrade to Lion or MT Lion or Yosemite, depending on your machine, from the APP STORE.
    OS X Lion - Technical Specifications Lion
    http://store.apple.com/us/product/D6377Z/A/os-x-mountain-lion Mountain Lion
    http://www.apple.com/osx/how-to-upgrade/ Yosemite
    Hope this helps you

  • Can I use my wireless keyboard and Magic Mouse with my 15 inch MacBook Pro retina display

    Can I use my Magic Mouse and wireless keyboard with my MacBook Pro retina display

    It has bluetooth.  Why not?  Please do so.  (assuming both are functional)
    Ciao.

  • Bought  a used ipod  4 th and it came with a restrictions passcode. What can i do  to either reset or reset and wipe clean all data?

    Bought  a used ipod  4 th and it came with a restrictions passcode. What can i do  to either reset or reset and wipe clean all data?

    Forgotten RESTRICTIONS Passcode
    - Place the iOS device in Recovery Mode and restore via iTunes. For how to restore: iTunes: Restoring iOS software
    Then
    - Restore to factory settings/new iPod

  • Can I use an apple keyboard and track pad with my iPad Air?

    How do I use my apple keyboard and track pad with my iPad Air?

    I did all that you suggest before and it didn't work.  So I waited a bit and tried again and it finally worked.  Not sure what the problem was as I didn't do anything differently.
    Thank you for all your help.

  • Snow Leopard, PHP, MySQL, Apache and Wordpress!

    Hi there,
    It's taken me most of the day to work this out, so I thought I should post about it somewhere and here, on the Apple forum, is the ideal location.
    I'm a web developer and love the fact that my MacBook works out of the box with a Unix webserver and with little effort, I was able to set up PHP and MySQL on it. I was delighted to hear that the new Snow Leopard was shipping with the latest and greatest of both. It wasn't quite that easy when it came down to running my test sites, one of which I'm working on is a Wordpress site. Far from being daunting, the solutions to the problems I had were quite simple. The issues arose from the OS not having much exposure yet and not many people having posted their experiences on the web. It was just time consuming.
    I should mention at this point that this does require some tinkering with Terminal, but not so much as to cause damage if you do something wrong.
    First off Apache. Thankfully this is as stable as it always has been. All this requires to activate it is to visit System Preferences > Sharing and switch on Web sharing. Bish-bosh, job done.
    Next off PHP. If you open a Safari window and run your phpinfo.php file (where ever you have it saved. If you don't, they're out there, it's a tiny piece of code which you can use to find out your current php setup). You'll find that everything is superb! PHP 5.3! Excellent! Hang on, scroll down to the date and time section. Whoa! What's this big fat warning here.
    That warning my friend, has been the bane of my misery all day. Wordpress hates it. HATES IT! It causes no end of grief. So what's the multi step, multi program solution?
    Open your php.ini file and add the line:
    date.timezone=Country/City
    (do a Google search for PHP Timezones and you will get the exact settings. It's not so good that it understands every city in the world. My setting was Europe/Dublin).
    That's all. This will solve your issue of the timezone error everywhere. Stop and start Apache (System Preferences > Sharing, tick off and tick back on Web Sharing) and hey presto, error is gone.
    Wait a minute, where the **** is my php.ini file. Unfortunately this is where you have to get your hands dirty. Your php.ini file is a system file which resides in the /etc/ folder. Open a terminal window and type exactly the following:
    cd /etc/
    cp php.ini.default php.ini
    This makes the php.ini file from the default. This protects the original so if you ever need to create a new copy or if you make a mistake in the next steps, you can start again.
    Next I'm going to tell you how to edit this file. This uses a program called vi (there are GUI editors out there that will save you this heartache, so if anyone knows any, please post in response. I think TextWrangler is one).
    First you need to set the php.ini file so you can edit it. Type in exactly as follows:
    sudo chmod 777 php.ini
    Sudo is the superuser commmand. It may not be needed, but stick it in anyway. If you are asked for a password, put in your normal password (that you would be asked for say if you were installing something you downloaded).
    At the next prompt, type in:
    vi php.ini
    This will open the php.ini file. Using the up and down keys, find a blank line in the file. You will notice that alot of the lines start with ';'. These are commented lines. Once you find a blank line, press 'i' to insert text. Your screen will now say '-- INSERT --' at the bottom in red. Type the following in exactly (you will NOT be able to cut and paste):
    ; Set PHP Default Timezone
    date.timezone=Europe/Dublin
    Substitute "Europ/Dublin" with your own timezone. When you are done, press escape. Now type in the following:
    :wq!
    The colon is important (not a typo on my part) as this tells vi you are going to run a command. You should now be back at your prompt. Now you need to reset the permissions on the file. Type the following:
    sudo chmod 444 php.ini
    And that's it. That's your PHP setup and finished. If you run your phpinfo.php file now, you should see your timezone under the date and time where you were getting the error before.
    Now the MySQL. This is a bit of fun because, even though MySQL ships with the system, it's not exactly set up correctly! So once again into terminal.
    This time go to the local directory:
    cd /usr/local/
    If you type in:
    ls -al
    You'll get a directory listing. This has the MySQL folder listed as mysql-5.0.77-osx10.5-x86 (or something! I did that from memory!). This IS the MySQL folder but if you, like me, had previously set the MySQL Preference Pane in your System Preferences, then it won't be able to access this. Type the following command:
    sudo cp -R /usr/local/mysql* /usr/local/mysql
    This should copy everything into a folder called mysql. It takes a couple of seconds (first time on my machine it was a good 20 seconds) to run so be patient. Now you need to do the following:
    sudo chown mysql:mysql /usr/local/mysql
    This sets the owner and group of the mysql files to 'mysql'. If you go back to your MySQL preference pane in System Preferences, you should now be able to start it (something weird about it makes it require to close and reopen the System Preferences window before it can open the MySQL pref pane. This is normal, just click ok).
    The bit that got me here, is that I thought that my activation of the MySQL was actually a new install. I tried everything to change the root user and password for MySQL but in fact, if you had it installed on Leopard, prior to upgrading to Snow Leopard, all your users and passwords are the same. If you HAVEN'T installed it before, I recommend you read the Post Installation Customisation (section 2.3) on the manual for MySQL 5.1 on http://www.mysql.com
    So that's about it. All that remains is to test Wordpress. I have phpmyadmin installed (I've heard CocoaMySQL is very good, like iTunes for db's so I'm gonna check that out later) and was able to create the new wordpress database. I changed the settings in the wp-configure.php file to match my setup but nothing worked. I changed the host from '127.0.0.1' back to 'localhost' (a common complaint of the wordpress setup) but no joy. Then I changed the host back to '127.0.0.1' and added the port :3306 (so the full host is '127.0.0.1:3306') and bingo, the install worked, my database setup and my test site worked.
    So that's it! Many of you out there will say, why didn't you just use MAMP. I did use MAMP, but I also got the Timezone issues and it took far more tinkering and hacking to make it work. I decided that, as my lovely MacBook now running lovely Snow Leopard had the lovely newest versions of PHP and MySQL installed, I'd rather get them working than use a runaround with MAMP. I'm a happier camper for it.
    I hope this helps some of you out there. I don't personally have a blog yet, but when I do, I'll post this up there for all to access. I may even add screen shots!!! But seriously, I hope this helps you all out with your installs. It's so handy to have all this stuff straightaway with Snow Leopard, it's just a matter of getting it to work.
    All the best now,
    T

    Hmmmm... I did a clean drive install of Snow Leopard because I used to do it once a year with Windows and hadn't done it in 3 with my MBP.
    First, my httpd.conf file had the line enabling PHP commented out, so when I went to see my simple file with phpinfo(), I saw the source. Saw your post, thought it was the timezone, fixed that (which will probably make wordpress happy when I get it running), and it still didn't work. Looked at the httpd.conf file, found that PHP was disabled by default, fixed that line, restarted the server, and my phpinfo() worked like a charm.
    Also if you want to edit config files, I use TextWrangler's "open hidden files" option.
    But... I have no /usr/local directory at all. Doesn't exist on my machine. Checked the options in the base install and MySQL isn't offered as an option. Checked the optional installs and MySQL isn't there. Even letting spotlight search for hidden files, the only files with MySQL in their name were from php scripts in my web folders.
    There's some stuff about installing/compiling from source.
    http://hivelogic.com/articles/compiling-mysql-on-snow-leopard/
    Dunno if I want to go down that road quite yet.

  • PHP, MySQL, Breadcrumbs and URL Parameters

    I'm working with several InterAKT extensions to buid a
    dynamic site. I have everything working except for Breadcrumbs --
    which are actually working except that I need to change the URL
    parameter which they are passing WITHOUT altering the recordset
    (which breaks the functionality).
    The site is constructed to include friendly URLS, so although
    all pages are loaded by PK of their category, I've used CONCAT()
    and REPLACE() along with Server-Side Includes from my Table (SSI
    from InterAKT) to generate my URLS.
    Example:
    category_ctg TABLE
    id_ctg name_ctg
    1 Jelly Beans
    2 Vanilla Nut Crunch Bar
    etc.
    For my dynamic menus and my hyperlinks, I pull from the db
    like this:
    SELECT *, CONCAT(REPLACE(name_ctg, ' ', '-'), '?id_ctg=',
    id_ctg) AS newurl FROM category_ctg
    This gives me a URL of
    index.php/Vanilla-Nut-Crunch-Bar?id_ctg=2
    (I also pull from the name_ctg field for my page titles and menu
    names, etc., without the CONCAT() so they read without the '-')
    But, with MX Breadcrumbs I'm limited to the way the php is
    hard-coded in terms of which fields are included: (id_ctg,
    id_parent_ctg and name_ctg) because the breadcrumbs are generated
    from a recordset.inc.php file.
    I can succesfully use the Breadcrumbs "out-of-the-box" and
    end up with this URL:
    index.php?id_ctg=2
    My code for above looks like this:
    <?php if ($totalRows_Breadcrumbs > 0) { // Show if
    recordset not empty ?>
    &gt; <a href="index.php?id_ctg=<?php echo
    $row_Breadcrumbs['id_ctg']; ?>"><?php echo
    $row_Breadcrumbs['name_ctg']; ?></a>
    <?php } // Show if recordset not empty ?>
    and while it works, it's loading a different URL than all my
    other menus and links.
    Alternatively, I can include the catgeory_ctg.name_ctg
    dynamic binding like this:
    <?php do { ?>
    <?php if ($totalRows_Breadcrumbs > 0) { // Show if
    recordset not empty ?>
    &gt; <a href="<?php echo
    $row_Breadcrumbs['name_ctg']; ?>?id_ctg=<?php echo
    $row_Breadcrumbs['id_ctg']; ?>"><?php echo
    $row_Breadcrumbs['name_ctg']; ?></a>
    <?php } // Show if recordset not empty ?>
    <?php } while ($row_Breadcrumbs =
    mysql_fetch_assoc($Breadcrumbs)); ?>
    which gives me a URL of:
    index.php/Vanilla%20Nut%20Crunch%20Bar?id_ctg=9
    Since I can't use CONCAT() value within my script and I can't
    have "%20" in my URLs, I'm trying to find a way of turning my URL
    into:
    index.php/Vanilla-Nut-Crunch-Bar?id_ctg=2
    Is there a way to include the CONCAT() function in the PHP
    script that's generating the URL?
    I've tried using variables in the header to call for a
    consistent URL, without any luck.
    Please keep in mind that my strong suit is design and that my
    working knowledge of PHP and MySQL are limited to what I can
    understand and re-create. I've been pulling out my hair for days on
    this, so some guidance would be
    greatly appreciated.

    The code generated by the Dreamweaver recordset navigation bar automatically adds any existing variables to the end of the query string. The following code (just above the DOCTYPE) comes from a recordset navigation bar on one of my pages:
    $queryString_listAuthors = "";
    if (!empty($_SERVER['QUERY_STRING'])) {
      $params = explode("&", $_SERVER['QUERY_STRING']);
      $newParams = array();
      foreach ($params as $param) {
        if (stristr($param, "pageNum_listAuthors") == false &&
            stristr($param, "totalRows_listAuthors") == false) {
          array_push($newParams, $param);
      if (count($newParams) != 0) {
        $queryString_listAuthors = "&" . htmlentities(implode("&", $newParams));
    $queryString_listAuthors = sprintf("&totalRows_listAuthors=%d%s", $totalRows_listAuthors, $queryString_listAuthors);
    I haven't tested this, but to eliminate the extra variables in the query string, comment out the whole of the if statement like this:
    $queryString_listAuthors = "";
    if (!empty($_SERVER['QUERY_STRING'])) {
      $params = explode("&", $_SERVER['QUERY_STRING']);
      $newParams = array();
      foreach ($params as $param) {
        if (stristr($param, "pageNum_listAuthors") == false &&
            stristr($param, "totalRows_listAuthors") == false) {
          array_push($newParams, $param);
      if (count($newParams) != 0) {
        $queryString_listAuthors = "&" . htmlentities(implode("&", $newParams));
    $queryString_listAuthors = sprintf("&totalRows_listAuthors=%d%s", $totalRows_listAuthors, $queryString_listAuthors);
    You will need to do that for each of your recordset navigation bars.

  • I use keynote 5.1 and am bombarded with popups asking me to update to KN 6.  I tried 6 after upgrading to Maverick. Do not like it.

    I use keynote 5.1 and love it.  I tried Keynote 6 and do not like it.
    My problem is that I am bombarded by popups asking me to
    update to Keynote 6
    This reduce my work speed to a snails pace.
    Would be most delighted to find a solution to the problem.
    Thanks

    Is there a sim in the iPhone?
    Has the iPhone been jailbroken or modified to work with other
    than the original wireless provider?
    If you can get that far, what does it say when you look at
    Settings=>General=>About=>Carrier?

  • Voting poll using PHP & MySQL TypeError: Error #2007: Parameter text must be non-null.

    I am getting this back:
    TypeError: Error #2007: Parameter text must be non-null.
    at flash.text::TextField/set text()
    at AS3_Flash_Poll_PHP_MySQL_fla::WholePoll_1/completeHandler()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
    PHP code:
    <?php
    // ---------------------------------------- Section 1 -----------------------------------------------
    //  IMPORTANT!!!! Connect to MySQL database here(put your connection data here)
    mysql_connect("ginaty05.fatcowmysql.com","fall2010","@regina") or die (mysql_error());
    mysql_select_db("poll_2010") or die (mysql_error());
    // When Flash requests the totals initially we run this code
    if ($_POST['myRequest'] == "load_numbers") {
    // Query the totals from the database
        $sql1 = mysql_query("SELECT id FROM votingPoll WHERE choice='1'");
        $choice1Count = mysql_num_rows($sql1);
        $sql2 = mysql_query("SELECT id FROM votingPoll WHERE choice='2'");
        $choice2Count = mysql_num_rows($sql2);
        $sql3 = mysql_query("SELECT id FROM votingPoll WHERE choice='3'");
        $choice3Count = mysql_num_rows($sql3);
        echo "choice1Count=$choice1Count";
        echo "&choice2Count=$choice2Count";
        echo "&choice3Count=$choice3Count";
    // ---------------------------------------- Section 2 -----------------------------------------------
    // IF POSTING A USER'S CHOICE
    if ($_POST['myRequest'] == "store_choice") {
        //Obtain user IP address
        $ip = $_SERVER['REMOTE_ADDR'];
        // Create local variable from the Flash ActionScript posted variable
        $userChoice = $_POST['userChoice'];
        $sql = mysql_query("SELECT id FROM votingPoll WHERE ipaddress='$ip'");
        $rowCount = mysql_num_rows($sql);
        if ($rowCount == 1) {
    $my_msg = "You have already voted in this poll.";
    print "return_msg=$my_msg";
        } else {
    $sql_insert = mysql_query("INSERT INTO votingPoll (choice, ipaddress) VALUES('$userChoice','$ip')")  or die (mysql_error());
    $sql1 = mysql_query("SELECT * FROM votingPoll WHERE choice='1'");
    $choice1Count = mysql_num_rows($sql1);
    $sql2 = mysql_query("SELECT * FROM votingPoll WHERE choice='2'");
    $choice2Count = mysql_num_rows($sql2);
    $sql3 = mysql_query("SELECT * FROM votingPoll WHERE choice='3'");
    $choice3Count = mysql_num_rows($sql3);
    $my_msg = "Thanks for voting!";
            echo "return_msg=$my_msg";
            echo "&choice1Count=$choice1Count";
    echo "&choice2Count=$choice2Count";
    echo "&choice3Count=$choice3Count";
    ?>
    AS3 code:
    stop(); // Stop the timeline since it does not need to travel for this to run
    // Assign a variable name for our URLVariables object
    var variables1:URLVariables = new URLVariables();
    //  Build the varSend variable
    var varSend1:URLRequest = new URLRequest("parse_my_poll.php");
    varSend1.method = URLRequestMethod.POST;
    varSend1.data = variables1;
    // Build the varLoader variable
    var varLoader1:URLLoader = new URLLoader;
    varLoader1.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader1.addEventListener(Event.COMPLETE, completeHandler1);
    // Set variable to send to PHP here for the varloader below
    variables1.myRequest = "load_numbers";  
    // Send data to php file now, and wait for response using the COMPLETE event
    varLoader1.load(varSend1);
    function completeHandler1(event:Event):void{
        count1_txt.text = "" + event.target.data.choice1Count;
        count2_txt.text = "" + event.target.data.choice2Count;
        count3_txt.text = "" + event.target.data.choice3Count;
    // hide the little processing movieclip
    processing_mc.visible = false;
    // Initialize the choiceNum variable that we will use below
    var choiceNum:Number = 0;
    // Set text formatting colors for errors and success messages
    var errorsFormat:TextFormat = new TextFormat();
    errorsFormat.color = 0xFF0000; // bright red
    var successFormat:TextFormat = new TextFormat();
    successFormat.color = 0x00FF00; // bright green
    // Button Click Functions
    function btn1Click(event:MouseEvent):void{
        choiceNum = 1;
        choice_txt.text = choice1_txt.text;
    function btn2Click(event:MouseEvent):void{
        choiceNum = 2;
        choice_txt.text = choice2_txt.text;
    function btn3Click(event:MouseEvent):void{
        choiceNum = 3;
        choice_txt.text = choice3_txt.text;
    // Button Click Listeners
    btn1.addEventListener(MouseEvent.CLICK, btn1Click);
    btn2.addEventListener(MouseEvent.CLICK, btn2Click);
    btn3.addEventListener(MouseEvent.CLICK, btn3Click);
    // Assign a variable name for our URLVariables object
    var variables:URLVariables = new URLVariables();
    //  Build the varSend variable
    var varSend:URLRequest = new URLRequest("parse_my_poll.php");
    varSend.method = URLRequestMethod.POST;
    varSend.data = variables;
    // Build the varLoader variable
    var varLoader:URLLoader = new URLLoader;
    varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader.addEventListener(Event.COMPLETE, completeHandler);
    // Handler for PHP script completion and return
    function completeHandler(event:Event):void{
        // remove processing movieclip
        processing_mc.visible = false;
        // Clear the form fields
        choice_txt.text = "";
        choiceNum = 0;
        // Load the response from the PHP file
        status_txt.text = event.target.data.return_msg;
        status_txt.setTextFormat(errorsFormat);
        if (event.target.data.return_msg == "Thanks for voting!") {
            // Reload new values into the count texts only if we get a proper response and new values
            status_txt.setTextFormat(successFormat);
            count1_txt.text = "" + event.target.data.choice1Count;
            count2_txt.text = "" + event.target.data.choice2Count;
            count3_txt.text = "" + event.target.data.choice3Count;
    // Add an event listener for the submit button and what function to run
    vote_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);
    // Validate form fields and send the variables when submit button is clicked
    function ValidateAndSend(event:MouseEvent):void {
        //validate form fields
        if(!choice_txt.length) {  
            // if they forgot to choose before pressing the vote button
            status_txt.text = "Please choose before you press vote.";  
            status_txt.setTextFormat(errorsFormat);
        } else {
            status_txt.text = "Sending...";
            processing_mc.visible = true;
            // Ready the variables for sending
            variables.userChoice = choiceNum;
            variables.myRequest = "store_choice";  
            // Send the data to the php file
            varLoader.load(varSend);
        } // close else after form validation
    } // Close ValidateAndSend function ////////////////////////

    This error means that you are trying to set the text field but there is no data in the variable. As a first step, try to identify where this is happening, eg Is it the first call, or once you have submitted your data or only if you try to submit data second time?
    Trace out the data that is returned for both completeHandlers to see if there is a missing var. Try this for "load_numbers" and "store_choice". Do it twice for "store_choice". Do you get back what you expected?
    You could also try altering the php to return some fixed dummy variables, eg  choice1Count=11&choice2Count=22&choice3Count=33, etc. If this works then you know that the error is in the PHP.
    It looks to me like the issue is when you submit the data a second time and just get back the return_msg - the handler then tries to assign the choice1Count etc but doesn't have any count data back from the poll.php.
    Test that there is data before assigning it, eg
        if(event.target.data.choice1Count){
            count1_txt.text =  event.target.data.choice1Count;
            count2_txt.text =  event.target.data.choice2Count;
            count3_txt.text =  event.target.data.choice3Count;

  • Problems using NSS library as PKCS#11 provider with JAVA 6

    Hi,
    I�m trying to configure JAVA 6 on Solaris 10 SPARC to use Mozilla NSS library as PKCS#11 provider (to achieve FIPS-140 certification for my application). I�m following the guidelines from http://java.sun.com/javase/6/docs/technotes/guides/security/p11guide.html#NSS but unfortunately something doesn�t work for me as expected...
    Let me describe the exact steps that I followed (because devil may be in the small details :-)
    I downloaded NSS 3.11.4 and NSPR 4.6.4 binaries from mozilla.org (32 bit �debug� versions for Solaris 9, because these were the only �binary� versions for SPARC available on Mozilla site and as far as I understand these are the exact versions that passed FIPS-140 certification), unpacked them under the /opt directory and copied both of them into a single /opt/nss tree as follows:
    mkdir /opt/nss
    cp �r /opt/nss-3.11.4/* /opt/nss
    cp �r /opt/nspr-4.6.4/* /opt/nss
    I created a PKCS#11 configuration file /opt/nss/pkcs11.cfg as per JAVA 6 security guide:
    name = NSScrypto
    nssLibraryDirectory = /opt/nss/lib
    nssDbMode = noDb
    attributes = compatibility
    (I know that this configuration is not for FIPS mode � but I thought that I�d better start with a simple NSS configuration)
    Then I modified /usr/jdk/jdk1.6.0_03/jre/lib/security/java.security file and replaced 1st provider with:
    security.provider.1=sun.security.pkcs11.SunPKCS11 /opt/nss/pkcs11.cfg
    Now everything should be in place � so I created a small JAVA program and ran it:
    import javax.crypto.SecretKeyFactory;
    import javax.crypto.spec.DESedeKeySpec;
    import javax.crypto.SecretKey;
    import javax.crypto.Cipher;
    import java.security.*;
    public class Test
    public static void main(String[] args)
    try
    SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DESede");
    DESedeKeySpec keySpec = null;
    keySpec = new DESedeKeySpec(new String("laKuf1Tcc6sOhsdPf49=m4es").getBytes());
    System.out.println("keyFactory provider: " + keyFactory.getProvider().getName());
    SecretKey key = keyFactory.generateSecret(keySpec);
    Cipher decryptCipher = Cipher.getInstance("DESede");
    decryptCipher.init(Cipher.DECRYPT_MODE, key);
    System.out.println("decryptCipher provider: " + decryptCipher.getProvider().getName());
    catch (Exception ex)
    ex.printStackTrace();
    Unfortunately it produced the following output:
    EMS-Server42# java test
    keyFactory provider: SunPKCS11-NSScrypto
    decryptCipher provider: SunJCE
    And when I comment out SunJCE provider in java.security file I get the following exception:
    java.security.NoSuchAlgorithmException: Cannot find any provider supporting DESede
    at javax.crypto.Cipher.getInstance(DashoA13*..)
    at test.main(test.java:38)
    So it looks like something is wrong with my NSS configuration. Because AFAIK DESede (3DES) is supported by the NSS library, but for some reason JAVA doesn�t see this algorithm implemented in NSS PKCS#11 provider.
    Any suggestions on what am I doing wrong?
    Best regards,
    Alex

    Works for me:
    import java.security.Provider;
    import java.security.SecureRandom;
    import java.security.Security;
    import javax.crypto.Cipher;
    import javax.crypto.SecretKey;
    import javax.crypto.SecretKeyFactory;
    import javax.crypto.spec.DESedeKeySpec;
    import javax.crypto.spec.IvParameterSpec;
    public class Test
      public static void main(String[] args)
        try
          String configFileName = "/nss/nss.cfg";
          Provider nss = new sun.security.pkcs11.SunPKCS11(configFileName);
          Security.addProvider(nss);
          SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DESede", nss);
          DESedeKeySpec keySpec = new DESedeKeySpec(new String("laKuf1Tcc6sOhsdPf49=m4es").getBytes("UTF-8"));
          System.out.println("keyFactory provider: " + keyFactory.getProvider().getName());
          SecretKey key = keyFactory.generateSecret(keySpec);
          //iv for CBC mode - note, in practice you don't generate a random iv for decryption :)
          byte[] iv = new byte[8];  //64-bit block size for 3DES
          SecureRandom sr = SecureRandom.getInstance("PKCS11", nss);
          sr.nextBytes(iv);
          IvParameterSpec params = new IvParameterSpec(iv);
          Cipher decryptCipher = Cipher.getInstance("DESede/CBC/NoPadding", nss);
          decryptCipher.init(Cipher.DECRYPT_MODE, key, params);
          System.out.println("decryptCipher provider: " + decryptCipher.getProvider().getName());
        catch (Exception ex)
          ex.printStackTrace();
    }Oh, I wouldn't expect your key loading to work when you switch over to FIPS mode.
    cfg file:
    name = NSScrypto
    nssLibraryDirectory = /nss
    nssSecmodDirectory = /nss
    nssModule = fipsYields the following error:
    java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: Could not create key
    because you can't directly handle keying material in FIPS. You'll have to save the secret key in the NSS certDB or generate a random one each time and send it wrapped to the other side.

  • Using php/mysql for calculations

    Hi guys,
    Im experimenting with calculations on a site but im not sure whats the right way to go about it.
    the result im looking for is this,,
    Im setting up a personality test on the website where the questions he answers should classify him into one of 4 groups.
    my thoughts are to keep it simple, every question he answers should have a +1 effect on the certain group in question and then at the end of all the questions display the result of the group that has the largest count.
    now some told me i should use javascript which im not very familiar with,
    others said i should be able to do the calculations in php before the result is sent to the database
    but i also thought of the possibility to send all into uncalculated to the db and then just retrieve the right result,
    would like to hear your opinions on this,
    or if you think there is a easier way than my "+1 effect"
    thanks in advance!

    One way would be to associate each question with a group.
    Create an array with 4 elements say G(0), G(1), G(2), G(3)  Set it to zero. 
    for question = 1 to number of questions
          Ask a question
              Each time a question is answered correctly,  increment value of the associated array group element (1) to (4) by 1.
               Until you have asked the first round of questions.
                   So now you have a set of values in each element. Problem is how to find the largest. Especially if you have a tie.
              Sort  the array to set them in order ascending- see :http://www.php.net/manual/en/function.asort.php
             set $winner to the first groups reference  ( this will always be 0,1 2 or 3 and should contain the winner unless there is a tie)
              If the lst two elements in the sorted list are not equal
                        set $winner to the 1st elements reference (if its G(3) set it to 3, not the value of G(3))
                   else (you have a tie)
                             repeat
                                  set the other two elements to zero
                                  ask a  question
                                  increment the matching group element
                                   sort the array
                                  compare the values of the two top elements
                              until the values of  two top elements are not equal
                   set the  value of $winner to the 1st elements reference (if its G(4)set it to 4, not the value of G(4))
                         store $winner in your database
    Hope this makes sense - it took a while to work out and it still needs coding.
    The other way is to ask your questions and save them in the database as you go along. At the end of stage one, do a select all from groups, order by group value
    You may then have a tie, so you would need to ask more questions as deciders and do it again.
    Either way, ist an interesting project.
    I'm off to bed!

  • Database Connection using PHP/MySQL on OS X

    I created a database connection originally on my XP machine
    using Dreamweaver CS2 and everything worked as it should. I
    recently switched to a Mac and CS3 and while I can see the
    connection file in the Connections folder, it appears grayed out in
    Dreamweaver. I tried to create a new data connection to see if that
    would solve this problem, but it won't let me. I typed in all the
    information and when I clicked "Test" or to browse for the
    appropriate database it pops up an error message saying "An
    unidentifiable error has occurred". I'm sure I could work around
    this by manually coding everything, but I'm a novice in programming
    and need to be able to use this feature. The worst thing about it,
    is that anytime I have to make a change to the web page, even if
    it's not regarding this section of code, it gets messed up. I have
    made backups, but once they are opened on the Mac they are messed
    up.
    I'm using Dreamweaver CS3, PHP/MySQL on a remote server as I
    still can't get my local web server functioning properly under
    Leopard. Any help would be appreciated because I haven't been able
    to find anything regarding this error online.

    bouldersp wrote:
    > I typed in all the
    > information and when I clicked "Test" or to browse for
    the appropriate database
    > it pops up an error message saying "An unidentifiable
    error has occurred".
    That usually means that something is preventing communication
    between
    Dreamweaver and the testing server. It could be a firewall or
    anti-virus
    software. In the Testing Server section of the Advanced tab
    in Site
    definition, Host directory and URL prefix should both point
    to the same
    place. The first is the physical path to the top level of
    your site, the
    second is the URL you enter into a browser address bar to get
    to the
    same location.
    > I'm using Dreamweaver CS3, PHP/MySQL on a remote server
    as I still can't get
    > my local web server functioning properly under Leopard.
    You might find this tutorial on my website helps:
    http://foundationphp.com/tutorials/php_leopard.php
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

Maybe you are looking for

  • How can I connect HDTV and LCD monitor to PC using both -as a double monitor.

    I recently purchased HP Pavilion PC a6600f with HP w1707 monitor. I also purchased a DVI to HDMI cable to hook PC to Samsung HDTV. I can use the VGA cable to hook to the monitor and the DVI to HDMI cable to hook to the HDTV but have to unplug one to

  • Can´t open files with camera raw

    Hi! I use Adobe Photoshop CS3 and the option to open files with Camera Raw is disabled in Bridge and in PS. Can anyone help?

  • Unique Highlighting Elements in Form Fields

    Hi all My boss is asking me to build an interactive PDf file for in-office use that has some unique highlighting features. She wants the viewer to select an option on the PDF file, and when they make that selection, a box or rectangle outlines the ch

  • Can't load music into iTunes from CD

    Gah!!! How frustrating ! I'm using the latest version of ITunes, WindowsXP. When I pop in a CD, a window comes up in ITunes asking me if I want to import the music, I select "yes", it shows them in a ITunes window, but the songs aren't imported, real

  • Error: "FATAL: Module oracleasm not found" in Red Hat 6

    Hi all:    OS.....: Red Hat 6.5 (64 bits)    I am preparing to install an 12c RAC in a Red Hat 6.5. While configuring the ASMLib, i got the following error while executing "/usr/sbin/oracleasm init":       May  2 18:23:20 oraprd01 modprobe: FATAL: Mo