Captcha's in PHP to MySQL

I am having troubles creating a php captcha verifaction for a
form I am using.... I am able to create the catpcha fine but need
some help on the INSERT part of the form. This INSERT section
should input a record into a MySQL table providing the catpcha has
passed verification check.
The code I am using has two 'if' statements based on a pass
and fail... question I have is A) Should I use the if statements to
check the captcha and input the record B) How would I include a
INSERT within this function?
Many thanks
Luke

Can you try this in your insert.php (its mysqli rather than mysql)
<?php
$NameofOrganization = $_GET['NameofOrganization'];
$Tickets = $_GET['Tickets'];
$OriginalPrice = $_GET['originalprice'];
$DiscountedPrice = $_GET['DiscountedPrice'];
$Date = $_GET['Date'];
$Time = $_GET['Time'];
$Email = $_GET['Email'];
$Description = $_GET['Description'];
$Event_name = $_GET['event_name'];
$con=mysqli_connect("localhost", "root" , "", "user_registration");
// Check connection
if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
mysqli_query($con,"INSERT INTO events (name_organization, event_name, number_of_tickets, orginal_price, discounted_price, date, time, email,description) VALUES('$NameofOrganization' , '$Event_name', '$Tickets', ' $OriginalPrice', '$DiscountedPrice', '$Date', '$Time', '$Email', '$Description' )");
?>
Below is the mysql version for insert.php:
<?php
$NameofOrganization = $_GET['NameofOrganization'];
$Tickets = $_GET['Tickets'];
$OriginalPrice = $_GET['originalprice'];
$DiscountedPrice = $_GET['DiscountedPrice'];
$Date = $_GET['Date'];
$Time = $_GET['Time'];
$Email = $_GET['Email'];
$Description = $_GET['Description'];
$Event_name = $_GET['event_name'];
?>
<?php
// Make a MySQL Connection
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("user_registration") or die(mysql_error());
// Insert a row of information into the table "events"
mysql_query("INSERT INTO events
(name_organization, event_name, number_of_tickets, orginal_price, discounted_price, date, time, email,description) VALUES('$NameofOrganization' , '$Event_name', '$Tickets', ' $OriginalPrice', '$DiscountedPrice', '$Date', '$Time', '$Email', '$Description') ")
or die(mysql_error()); 
?>

Similar Messages

  • PHP and MySQL Connection problem

    I am trying to make a PHP MySQL on a remote server connection in Dreamwesaver CS3.
    When I enter the information (host, user, password, etc.) and hit TEST, I get the following error message.
    "Access Denied. The file may not exist, or there could be a permission problem. Make sure you have proper authorization on the server and the server is properly configured."
    I know the user, password, etc. work, as I can access the MySQL database with other software.
    I checked with my host and they say there are no permission problems on their end.
    I have checked the settings on the Test Server page in Site Setup and everything looks correct and works there.
    I have not seen this particular problem described in other forum postings (although there are a LOT of postings on this topic!).
    Any help would be appreciated.

    I thought my testing server was the remote server and is always on as far as I know. I don't know how to turn it on or off.
    Is there some other testing server that I should be aware of?
    Frank
    Date: Wed, 3 Jun 2009 15:43:02 -0600
    From: [email protected]
    To: [email protected]
    Subject: PHP and MySQL Connection problem
    I know you are using remote, but is your testing server on? if not turn that on and see if that does it. it just happened to me working on remote server and could not get mysql conn to work, until I turn on my testing (developer server), then I was able to connect to mysql and the tables that I created in phpmyadmin remotly was downloaded.
    >

  • How do I add an already built Shopping Cart  (PHP and MYSQL) application to a page in a Muse site?

    How do I add an already built Shopping Cart  (PHP and MYSQL) (Cartweaver 4) application to a page in a Muse site? Do I have to export the Muse site as Html to dreamweaver and them use the extension to bring the shooping cart in or can I do it directly in Muse?
    Message was edited by: mgv2048

    We have experimented with doing this with some good success. We have been working on adding Cartweaver to a Facebook page by essentially adding a Cartweaver store to Facebook in an iframe.  The "store" would be pages with just your basic product display, cart, and checkout functionality, with none of the "window dressing" - just use CSS to match the color and general look of the design it's being added to.
    The one problem with this for Facebook is when it comes time to check out toy have to leave Facebook and go to your server where an SSL is in place.  Fortunately in this situation this would not be the case, you can have an SSL installed to the root of your site and you'll be okay.
    This is an interesting project.  Give this a try and let me know how it goes and if you run into any snags, please make a post on the Cartweaver forums: http://forums.cartweaver.com - I'm really confident that this can work, and not only work, but work well.
    Looking forward to hearing how this goes, and being of what help we can.
    Lawrence Cramer - *Adobe Community Professional*
    http://www.Cartweaver.com
    PHP & ColdFusion Shopping Cart for Adobe Dreamweaver
    Stay updated:
    http://www.facebook.com/cartweaver
    http://www.twitter.com/cartweaver
    http://blog.cartweaver.com

  • Dreamweaver CS5.5 Mobile Apps with PHP and MYSQL?

    Hello,
    I don't have Dreamweaver CS5.5 yet and I've been trying to search for information on this but I couldn't find any. I've been learning PHP and been developing with MYSQL with Dreamweaver CS5 but I wanted to know if I can use the same tags and everything if I would to build a Mobile App using the new Dreamweaver CS5.5 (http://tv.adobe.com/watch/cs-55-web-premium-feature-tour-/dreamweaver-cs-55-jquery-mobile- pages/). I overlooked at the video and it seems pretty easy building an app. So is PHP and MYSQL easily integratable? Are there any examples that I might be able to check out?
    Thanks!

    No. PHP is a server-side scripting language that requires a server (or server-like environment) to run.
    An iPhone (or Android) application does not allow for a "built-in" server (which is resource intensive and has scary security implications). You just can't build an application with PHP/MySQL for a mobile device. Instead you can build a web service that your HTML/JavaScript mobile application can then communicate with. This is the only supported way you can use PHP/MySQL in a mobile app. Again: the PHP/MySQL should reside on a server and your HTML/JS mobile app can then communicate with that web service. That's what instapaper and other applications do.
    Frankly, just make a web application that's mobile device friendly and you'll:
    1) Avoid all the messiness of the app stores
    2) Have greater control over what your web app can do (don't have to tow the Apple/Google line)
    3) Have a web app that can work across mulitple mobile devices as well as standard web browsers (i.e. more audience = more $).
    4) Future proof your application (pushing updates to your server and everyone using your web app is updated)
    Otherwise, read-up on Adobe AIR and what it supports and remember, the best apps are written natively for the platform (i.e. want to write an app for an iPhone? Learn Objective-C and use xCode on a Mac. Want to write an app for Motorola Xoom? Learn the Android SDK and use inteliJ).

  • How to create php/apache/mysql installer with AIR

    Dear Flexer,
    I'd like to use AIR to create my own web tools installer (like mamp, wammp...).
    But I have no idea how to do that.
    Can you help me?
    Thanks

    There's a tutorial here:
    http://www.php-mysql-tutorial.com/wikis/php-tutorial/installing-php-and-mysql.aspx
    That said, why go through all the trouble? There are a number of applications out there than install and configure Apache, PHP, and MySQL for you.

  • ANN: Setting up PHP and MySQL for newbies!

    We've recently released two new solution recipes to help
    designers make the
    jump to building dynamic sites. Each solution recipe
    describes step by step
    how to set up PHP and MySQL on your XP or Vista systems. You
    can find them
    on the Solution Recipe page:
    Installing PHP and MySQL on Windows Vista
    Installing PHP and MySQL on Windows XP
    http://www.webassist.com/professional/products/solutionrecipes.asp
    Each of these Solution Recipes include PDFs that you can
    print out or read
    on screen.
    We also have steps outlined for the Mac in PDF format, one
    for 10.4.x and
    the other for 10.5.x:
    10.4.x:
    http://www.webassist.com/media/professional/support/PDFs/InstallingPHP-OSX-10-4_PDF.pdf
    10.5.x:
    http://www.webassist.com/media/professional/support/PDFs/InstallingPHP-OSX-10-5_PDF.pdf
    All content is freely available. Go get'em!
    Best - Joe
    Joseph Lowery
    VP of Marketing, WebAssist -
    http://www.webassist.com
    Author, Dreamweaver CS3 Bible -
    http://www.idest.com/dreamweaver/

    Cool. I've bookmarked it for later.
    Thanks!
    --Nancy O.
    Alt-Web Design & Publishing
    www.alt-web.com
    "Joseph Lowery" <[email protected]> wrote in
    message
    news:ftj87l$nem$[email protected]..
    > We've recently released two new solution recipes to help
    designers make
    the
    > jump to building dynamic sites. Each solution recipe
    describes step by
    step
    > how to set up PHP and MySQL on your XP or Vista systems.
    You can find them
    > on the Solution Recipe page:
    >
    > Installing PHP and MySQL on Windows Vista
    > Installing PHP and MySQL on Windows XP
    >
    http://www.webassist.com/professional/products/solutionrecipes.asp
    >
    > Each of these Solution Recipes include PDFs that you can
    print out or read
    > on screen.
    >
    > We also have steps outlined for the Mac in PDF format,
    one for 10.4.x and
    > the other for 10.5.x:
    >
    > 10.4.x:
    >
    http://www.webassist.com/media/professional/support/PDFs/InstallingPHP-OSX-10-4_PDF.pdf
    >
    > 10.5.x:
    >
    http://www.webassist.com/media/professional/support/PDFs/InstallingPHP-OSX-10-5_PDF.pdf
    >
    > All content is freely available. Go get'em!
    >
    > Best - Joe
    >
    > Joseph Lowery
    > VP of Marketing, WebAssist -
    http://www.webassist.com
    > Author, Dreamweaver CS3 Bible -
    http://www.idest.com/dreamweaver/
    >

  • Set a max Upload quantity dreamwaver php and mysql

    The issue,
    using dreamweaver php and mysql I Would like to set a max
    quantity limit on file upload per user. i.e max 5 uploaded images
    allowed per user.
    Here is a basic example of the creation. Just need the
    implementation of how to set a max upoad limit.
    create table authors(
    id int not null auto increment primary key,
    name varchar(10) not null
    image_quantity tinyint(1),
    create table images(
    aid int not null,
    image_filename varchar(50),
    foreign key (aid) references authors(id)
    User id 1 would upload a file into the table images from a
    php or html webpage. i.e set values "thomas.jpeg", "1"
    i want to set a max upload of 5 images per user. (a folder
    for each user id will be created and photos stored in that).
    I could add a field of max_upload tinyint(1) to the table
    users and construct a php script that could add the amount of
    images entered by a user into the images table and add a +1 to each
    added. Problem is i dont know how to create that script or mysql
    querty in order to enter into a recorset for example.
    As anyone have any ideas of the best way to set a max
    quantity limit of uploads.
    Thank you.

    The issue,
    using dreamweaver php and mysql I Would like to set a max
    quantity limit on file upload per user. i.e max 5 uploaded images
    allowed per user.
    Here is a basic example of the creation. Just need the
    implementation of how to set a max upoad limit.
    create table authors(
    id int not null auto increment primary key,
    name varchar(10) not null
    image_quantity tinyint(1),
    create table images(
    aid int not null,
    image_filename varchar(50),
    foreign key (aid) references authors(id)
    User id 1 would upload a file into the table images from a
    php or html webpage. i.e set values "thomas.jpeg", "1"
    i want to set a max upload of 5 images per user. (a folder
    for each user id will be created and photos stored in that).
    I could add a field of max_upload tinyint(1) to the table
    users and construct a php script that could add the amount of
    images entered by a user into the images table and add a +1 to each
    added. Problem is i dont know how to create that script or mysql
    querty in order to enter into a recorset for example.
    As anyone have any ideas of the best way to set a max
    quantity limit of uploads.
    Thank you.

  • CMS for Dreamweaver and PHP with MySQL

    Hello
    I am at a medium level with Dreamweaver MX and 8. I have
    created a dynamic website running PHP and MySQL. The site sells
    luxury yachts (resales). What I need is a simple, not too custom
    code heavy content management system to allow the client to update
    dynamic text areas and upload images via a web browser (IE7 PC).
    The site needs the ability to input new boats, and delete sold
    boats (flush out the database items).
    Has anyone got a recommendation for some CMS software,
    preferably Mac OSX PPC and running on a server under linux.
    I don't mind buying it, in fact rather do that than risk
    shareware going forward.

    I have the exact same need. Looks like nobody had any
    suggestions for the original poster. Perhaps someone can make a
    recommendation this time? I too am looking for a commercial
    product, rather than open-source.

  • Insert not working in php to mysql

    Ive been trying to enter information into mysql for the longerst. My guess is the sql statement. But if anybody can find anything wrong please tell me
    Heres my database
    and heres my code
    please help

    Can you try this in your insert.php (its mysqli rather than mysql)
    <?php
    $NameofOrganization = $_GET['NameofOrganization'];
    $Tickets = $_GET['Tickets'];
    $OriginalPrice = $_GET['originalprice'];
    $DiscountedPrice = $_GET['DiscountedPrice'];
    $Date = $_GET['Date'];
    $Time = $_GET['Time'];
    $Email = $_GET['Email'];
    $Description = $_GET['Description'];
    $Event_name = $_GET['event_name'];
    $con=mysqli_connect("localhost", "root" , "", "user_registration");
    // Check connection
    if (mysqli_connect_errno()) {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
    mysqli_query($con,"INSERT INTO events (name_organization, event_name, number_of_tickets, orginal_price, discounted_price, date, time, email,description) VALUES('$NameofOrganization' , '$Event_name', '$Tickets', ' $OriginalPrice', '$DiscountedPrice', '$Date', '$Time', '$Email', '$Description' )");
    ?>
    Below is the mysql version for insert.php:
    <?php
    $NameofOrganization = $_GET['NameofOrganization'];
    $Tickets = $_GET['Tickets'];
    $OriginalPrice = $_GET['originalprice'];
    $DiscountedPrice = $_GET['DiscountedPrice'];
    $Date = $_GET['Date'];
    $Time = $_GET['Time'];
    $Email = $_GET['Email'];
    $Description = $_GET['Description'];
    $Event_name = $_GET['event_name'];
    ?>
    <?php
    // Make a MySQL Connection
    mysql_connect("localhost", "root", "") or die(mysql_error());
    mysql_select_db("user_registration") or die(mysql_error());
    // Insert a row of information into the table "events"
    mysql_query("INSERT INTO events
    (name_organization, event_name, number_of_tickets, orginal_price, discounted_price, date, time, email,description) VALUES('$NameofOrganization' , '$Event_name', '$Tickets', ' $OriginalPrice', '$DiscountedPrice', '$Date', '$Time', '$Email', '$Description') ")
    or die(mysql_error()); 
    ?>

  • DataGrid to PHP to MySQL?

    I'm working with FlashBuilder 4 b2. It is doing some wonderful things, but I am having trouble getting my app to send data back to the database table. It reads it just fine. I want to update the data in a dataGrid then update the database with the dataGrid contents.  I am using PHP and MySQL on a local server.  Where can I find an example of the Actionscript 3 and PHP code to get it to work? Thanks!

    Hi,
    You have to use <service instance id>.commit() instead of <service class name.>
    For example,
    My generated code looks like this,
    <fx:Declarations>
            <s:CallResponder id="getAllEmployeesResult"/>
            <employeesservice:EmployeesService id="employeesService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
    So in my button click handler function, I have to make a call, "employeesService.commit() "
    Note that i have used the id property of EmployeeService. Let me know if it helps.
    Thanks,
    Radhakrishna

  • I need to know how I will create a dynamic website using php and mysql

    I need to know how will I create a dynamic website using php and mysql that people could have the abilities of registering in the website, and modify their profile where they can add their pictures and everything. apart from that, they should have the ability to search about other member. hope to here more from you.

    If you are a right-brained creative, and have no previous experience or propensity to be able to understand coding and database "stuff", and/or if your time can be better spent on other skills, I recommend you save your sanity and hire a developer... or at least the first time around. I have been attempting to grasp this for years... and have a library of marked up books to prove my efforts, all while trying to keep up with an ongoing client base that is always cramped. It's a wonder I still have my sanity... then again, I might not be the best person to determine that. Others might question it.
    That said, I still plan to master php... one of these days.

  • Trying to get Apache, PHP and MySQL up and running

    I have just bought a new MacBook and I want to set up Apache, PHP and MySQL in order to create a local mirror of a website I have in my 'Sites' folder.
    I fall at the first fence!! To get Apache, I switch web sharing on in System Preferences' and I get the green light. When I click the links for personal website or computer's website I get a "Safari can't connect to the server" message.
    Any ideas what I should do now?

    Stephen Dancer wrote:
    Any ideas what I should do now?
    You will need to make some change to the index file in your Sites directory in order to enable Apache for that directory.
    You will have to enable PHP in the Apache config file at /etc/apache2/httpd.conf
    For MySQL, you will have to install it, and then fix it. You'll want to remove the StartupItem it wants to use and replace it with a launchd file. This discussion has a good roundup of the very latest tricks to get MySQL up and running with the latest security updates.

  • Problems with PHP and MySQLi server behaviors

    Hi,
    I'm a graphic and Web-designer with some knowledge of PHP and MySQL and I've been using Dreaweaver since very early ages in creating dynamic web projects and use the Bindings and Server behaviors quite a lot. But recently PHP has deprecated MySQL_connect since 2012 and it seems Dreamweaver isnt suporting the alternative MYSQLi server behaviors which will be the future of accessing Databases in MySQL along side with other options. Without this feature Dreamweaver is not of any use to us web-designers, since there are many Free great Editing software out there... Is the Dreamweaver team solving this problem? Or are you really planning on dropping this software? I've been using CS5.5 for a while and was planning on updating but this is a key feature and without it its not worth the investment.
    Kind regards.
    Eddy

    heduino wrote:
    Hi,
    I'm a graphic and Web-designer with some knowledge of PHP and MySQL and I've been using Dreaweaver since very early ages in creating dynamic web projects and use the Bindings and Server behaviors quite a lot. But recently PHP has deprecated MySQL_connect since 2012 and it seems Dreamweaver isnt suporting the alternative MYSQLi server behaviors which will be the future of accessing Databases in MySQL along side with other options. Without this feature Dreamweaver is not of any use to us web-designers, since there are many Free great Editing software out there... Is the Dreamweaver team solving this problem? Or are you really planning on dropping this software? I've been using CS5.5 for a while and was planning on updating but this is a key feature and without it its not worth the investment.
    Kind regards.
    Eddy
    There are no plans that I know of to introduce a new set of mysqli server behaviours into DW from Adobe. They have left that to  thrid party developers to bring out extensions which replace them.
    What the server behaviours could do was very limiting anyway so I suspect any replacement mysqli behaviours would also be very limiting. I personally jumped into thre code and started to write my own mysqli connection files and query strings by watching a few simple tutorials on youtube - it isnt that difficult.
    Look for 'php academy' on youtube - they have about 9 simple to follow tutorials on getting started with mysqli.

  • Failing Connecting PHP to MySQL with HTTP 404 NOT FOUND Error

    I'm using Dreamweaver CC to connect php to mySQL, and read both of these articles but still not working!
    1. It keep showing me HTTP 404 NOT FOUND. But I can access MySQL by web browser so I'm sure the address and login info is correct.
    2. There is no MMHTTPDB.php in my project folder.
    MMHTTPDB.php not creating
    http://forums.adobe.com/thread/1238828?tstart=0
    MySQL connection
    http://forums.adobe.com/thread/1239068?tstart=0
    Did I miss something?

    Thanks anyway but it is same as the thread I post below and above.
    MySQL connection

  • Record Set Variables used in PHP and MYSQL model

    PHP MYSQL server model.
    I'e been using dreamweaver for ages and have allways admired
    how well they have kept compatibility between versions. The recent
    8.02 release was a little bit of a shock when I had to start
    rewriting all my PHP MYSQL recordset queries!
    In the bulk of my SQL queries I detect on of two states for a
    query parameter and in some queries the parameters are used more
    then once. By creating a single variable in for the recordset I've
    allways been able to check and recheck the single variable in the
    query using the standard recordset. Now in version 8.02 I am
    getting the error: Missing type for variable:colname
    So where:
    SELECT *
    FROM links
    WHERE LinkID = colname or colname=-1
    ORDER BY `Level` DESC
    used to work it does not work any more!
    I'm being forced to rewrite the query:
    SELECT *
    FROM links
    WHERE colname in (-1,LinkID)
    ORDER BY `Level` DESC
    Simple enough but where the queries get more complex the more
    variables I have to define!
    This is not Cool! Can we get a bug fix for this so that I
    dont have to rewrite all my queries!
    P.S. Since when did anyone say that the Dreamweaver was SQL
    injection safe! This issue should have been resolved back in the
    Ultradev days! I guess Kudos goes to Adobe for finally trying to
    address one of the biggest glaring issues dreamweaver has had since
    it's inception. I was allways kinda upset that I was forced to pass
    variables as text to sprintf when I knew they where numbers!
    If I Look at the resultant code now I'm sure the result
    sprintf will still be using %s instead of optionally specifying one
    of the many diferent types (
    % - a literal percent character. No argument is required.
    b - the argument is treated as an integer, and presented as a
    binary number.
    c - the argument is treated as an integer, and presented as
    the character with that ASCII value.
    d - the argument is treated as an integer, and presented as a
    (signed) decimal number.
    e - the argument is treated as scientific notation (e.g.
    1.2e+2).
    u - the argument is treated as an integer, and presented as
    an unsigned decimal number.
    f - the argument is treated as a float, and presented as a
    floating-point number (locale aware).
    F - the argument is treated as a float, and presented as a
    floating-point number (non-locale aware). Available since PHP
    4.3.10 and PHP 5.0.3.
    o - the argument is treated as an integer, and presented as
    an octal number.
    s - the argument is treated as and presented as a string.
    x - the argument is treated as an integer and presented as a
    hexadecimal number (with lowercase letters).
    X - the argument is treated as an integer and presented as a
    hexadecimal number (with uppercase letters).
    This would further protect a query from being SQL Injected!
    I'd hope that Adobe would enable a Site specfic setting or
    something that would change the behaviour to match the passed
    parameter to sprintf with the specified variable type (I'd guess
    best practice to be Numeric be type f Text be type s and Date as
    type s as well)

    Start by saying bump.
    I've still no word from Adobe if they are doing anything with
    this problem. Any one had any replys from Adobe on it? Any one
    found a work around with recoding queries?

Maybe you are looking for