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.

Similar Messages

  • 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/
    >

  • 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.

  • 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).

  • 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.

  • Solaris10 basic questions PHP and MYSQL

    Hi,
    I am trying to learn something of Solaris because it this OS is used at my job, well, we have one system T2000 sunfire, it has Solaris10, we are trying to setup as local server to share some html files, and also we are trying to install some mysql databases, well we already setup Apache2 and it is working fine:
    svcs -a | grep -i http
    online Mar_10 svc:/network/http:apache2
    Something that I don't know is if the server has already installed PHP and if it is running, I just found these files containing PHP:
    ./usr/local/php
    ./usr/local/php/doc/php
    ./usr/local/php/bin/php
    ./usr/local/php/include/php
    ./usr/local/php/lib/php
    ./usr/local/php/bin/php
    # cd bin
    # ls -l
    total 42041
    -rwxr-xr-x 1 root bin 686 Jun 30 2005 pear
    -rwxr-xr-x 1 root bin 21407604 Jun 30 2005 php
    -rwxr-xr-x 1 root bin 877 Jun 30 2005 php-config
    -rwxr-xr-x 1 root bin 593 Jun 30 2005 phpextdist
    -rwxr-xr-x 1 root bin 3068 Jun 30 2005 phpize
    I was wondering if some of you can tell me if php is installed and running, I think it is not running because I created an php file and it doesn't work.
    I also need to know if mysql is working or not, I think it is working, these are the process that I found of mysql:
    /usr/bin/ps -ef |grep mysql
    mysql 843 798 0 Feb 22 ? 40:59 /usr/local/mysql/libexec/mysqld basedir=/usr/local/mysql datadir=/export/ho
    root 798 1 0 Feb 22 ? 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe datadir=/export/home/database pid-
    Thanks.

    Thanks Alan bye the answer.
    Here is my list of folder in /usr/local:
    lrwxrwxrwx 1 root root 14 May 20 2009 Tcl8.4.2 -> /usr/local/tcl
    drwxr-xr-x 10 root other 10 May 20 2009 apache
    drwxr-xr-x 16 root bin 16 Jun 7 2009 apache2
    drwxr-xr-x 2 root bin 5 Mar 9 18:16 bin
    drwxr-xr-x 5 root bin 5 Mar 9 18:16 doc
    drwxr-xr-x 2 root bin 7 Mar 9 18:16 include
    drwxr-xr-x 3 root bin 39 Mar 9 18:16 lib
    drwxr-xr-x 2 root bin 5 Mar 9 18:16 libexec
    drwxr-xr-x 4 root bin 4 Jun 7 2009 man
    drwxr-xr-x 14 root root 14 Jun 7 2009 mysql
    drwxr-xr-x 5 root other 5 May 20 2009 perl5
    drwxr-xr-x 8 root bin 8 Jun 7 2009 php
    drwxr-xr-x 2 root bin 4 Mar 9 18:16 sbin
    drwxr-xr-x 5 root bin 5 Mar 9 18:16 share
    drwxr-xr-x 10 root other 10 May 20 2009 squid
    drwxr-xr-x 10 root root 11 Jun 7 2009 ssl
    drwxr-xr-x 7 root other 8 May 20 2009 tcl
    drwxr-xr-x 10 root other 10 May 20 2009 tools
    I know perl is running by:
    # perl -v
    This is perl, v5.8.4 built for sun4-solaris-64int
    (with 31 registered patches, see perl -V for more detail)
    Copyright 1987-2004, Larry Wall
    Perl may be copied only under the terms of either the Artistic License or the
    GNU General Public License, which may be found in the Perl 5 source kit.
    Complete documentation for Perl, including FAQ lists, should be found on
    this system using `man perl' or `perldoc perl'. If you have access to the
    Internet, point your browser at http://www.perl.com/, the Perl Home Page.
    And I was thinking, before install another thing I want to be sure that php is not installed or running, I would like to ask some questions:
    How can I know if php is installed?
    How can I know if it is running? the way I have tried is placing a PHP file in the /var/apache2/htdocs and tried it from the browser, but it didn't work.
    If PHP is installed how can I enable it or start it? and how to make it permanent or start automatically when server boot up?
    What happen if i try to install the AMP, may I have to backup the files that we already have in /var/apache2/htdocs?
    Will the amp cause troubles or conflict to the apache, perl and mysql that are already installed and running?
    Another basic question and hope not to cause angry, is there inside Solaris any equivalent folder to "program files" like in win? it would be to have an idea of all the applications already installed in the system. or which is or are the folders in Solaris where I can see all the installed applications?
    the last question the term "the box" is the term for machine, station, server?
    Thanks.
    by the way here is a list of the process that are currently running
    cmd     uid
    sched     root
    /sbin/init     root
    pageout     root
    fsflush     root
    /usr/lib/inet/inetd start     root
    /lib/svc/bin/svc.startd     root
    /lib/svc/bin/svc.configd     root
    /usr/lib/nfs/mountd     root
    /usr/lib/sysevent/syseventd     root
    /usr/apache2/bin/httpd -k start     webservd
    /usr/sadm/lib/smc/bin/smcboot     root
    /usr/lib/saf/ttymon -g -d /dev/console -l console -T ansi -m ldterm,ttcompat -h     root
    /usr/lib/nfs/nfs4cbd     daemon
    devfsadmd     root
    /usr/sadm/lib/smc/bin/smcboot     root
    /usr/lib/ldoms/drd     root
    /usr/lib/nfs/statd     daemon
    /usr/sbin/rpc.bootparamd     root
    /usr/lib/crypto/kcfd     daemon
    /usr/lib/picl/picld     root
    /usr/sbin/rpcbind     daemon
    /usr/lib/efcode/sparcv9/efdaemon     root
    /usr/sbin/nscd     root
    /usr/sbin/cron     root
    /usr/lib/ssh/sshd     root
    /usr/lib/nfs/nfsmapid     daemon
    /usr/lib/nfs/nfsd     daemon
    /usr/lib/sendmail -Ac -q15m     smmsp
    /usr/sadm/lib/smc/bin/smcboot     root
    /usr/lib/nfs/lockd     daemon
    /usr/lib/saf/ttymon     root
    /usr/local/mysql/libexec/mysqld basedir=/usr/local/mysql datadir=/export/ho     mysql
    /usr/lib/saf/sac -t 300     root
    /usr/lib/utmpd     root
    /usr/lib/sendmail -bd -q15m     root
    /usr/sbin/in.routed     root
    /usr/sbin/in.telnetd     root
    /usr/lib/autofs/automountd     root
    /usr/sbin/in.rarpd -a     root
    /usr/lib/ssh/sshd     myuser
    /usr/lib/autofs/automountd     root
    /usr/sbin/syslogd     root
    /opt/SWIE/jetty/jre/bin/java -Djava.awt.headless=true -Djava.endorsed.dirs=/opt     root
    ps -ef     root
    /usr/lib/netsvc/rstat/rpc.rstatd     root
    bash     root
    /usr/sbin/in.telnetd     root
    /usr/lib/snmp/snmpdx -y -c /etc/snmp/conf     root
    /usr/lib/fm/fmd/fmd     root
    /usr/sbin/vold -f /etc/vold.conf     root
    /usr/lib/dmi/dmispd     root
    /usr/sfw/sbin/snmpd     root
    /usr/jdk/latest/bin/java -Dhostname=XXXHOSTnameXXX -Djava.security.policy==/opt/SU     root
    /opt/realport/sparc64/ncxd -d /dev/digi_realport0 -i XXX.XXX.XXX.X -p 771 -e ne     root
    (dnsserver)     squid
    (dnsserver)     squid
    /usr/lib/dmi/snmpXdmid -s XXXHOSTnameXXX     root
    /usr/dt/bin/dtlogin -daemon     root
    /bin/sh /opt/SWIE/jetty/etc/init.d/jetty start     root
    (dnsserver)     squid
    (dnsserver)     squid
    /usr/local/squid/sbin/squid -DsY     root
    (dnsserver)     squid
    /usr/java/bin/java -server -Xmx128m -XX:+UseParallelGC -XX:ParallelGCThreads=4      noaccess
    (squid) -DsY     squid
    -sh     root
    (unlinkd)     squid
    /bin/sh /usr/local/mysql/bin/mysqld_safe datadir=/export/home/database pid-     root
    -bash     myuser
    bash     root
    -bash     myuser
    -sh     root
    /usr/lib/ssh/sshd     myuser
    sh     root
    bash     root
    /usr/sbin/in.telnetd     root
    -sh     root
    /usr/apache2/bin/httpd -k start     webservd
    bash     root
    /usr/apache2/bin/httpd -k start     webservd
    -sh     root
    sh     root
    /usr/lib/ssh/sshd     root
    -bash     myuser
    /usr/sbin/in.telnetd     root
    -sh     root
    bash     root
    /usr/sbin/in.telnetd     root
    bash     root
    /usr/apache2/bin/httpd -k start     root
    -sh     root
    /usr/apache2/bin/httpd -k start     webservd
    /usr/lib/ssh/sshd     root
    /usr/apache2/bin/httpd -k start     webservd
    /usr/sbin/in.telnetd     root

  • 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?

  • Problems setting up an Apache PHP and MySQL server(slvd)

    I folowed this guide: http://wiki.archlinux.org/index.php/LAMP and I did everything it says and everything is working well... but when I try to install any CMS that uses MySQL, it says that mysql is not running... Even with Nmap, it only shows that apache is running... anyone knows why ?
    when I'm installing Xoops, it prints this error:
    Fatal error:
    mysql extension not loaded in /home/httpd/html/xoops-2.2.3a-final-xpr/html/class/database/mysqldatabase.php on line 74
    But, phpMyAdmin runs without any errors... this is so strange...
    Can anyone help me ?
    Thanks in advance

    I don't have any extension=mysql.dll in my php.ini.... I just have extension=mysql.so...
    Here's my <?
       phpinfo();
    ?>
    This is Arch Linux, running PHP.
    PHP Logo
    PHP Version 5.1.1
    System Linux localhost 2.6.15 #4 PREEMPT Mon Jan 9 13:16:27 CAT 2006 i686
    Build Date Dec 5 2005 11:31:11
    Configure Command './configure' '--with-apxs2' '--prefix=/usr' '--sysconfdir=/etc' '--with-layout=PHP' '--with-ttf' '--enable-mailparse' '--with-config-file-scan-dir=/etc' '--enable-bcmath=shared' '--enable-calendar=shared' '--enable-ftp=shared' '--enable-gd-native-ttf' '--enable-magic-quotes' '--enable-posix=shared' '--enable-session' '--enable-shared' '--enable-shmop=shared' '--enable-pdo=shared' '--enable-sqlite-utf8' '--enable-sockets=shared' '--enable-xml' '--enable-sysvsem=shared' '--enable-sysvshm=shared' '--enable-sysvmsg=shared' '--enable-track-vars' '--enable-trans-sid' '--enable-safe-mode' '--with-imap' '--with-imap-ssl' '--with-ncurses' '--with-readline' '--with-bz2=shared' '--with-curl' '--with-mime-magic' '--with-freetype-dir=/usr' '--with-gd=shared' '--enable-exif' '--with-jpeg-dir=/usr' '--enable-dba' '--without-db2' '--without-db3' '--with-inifile' '--with-flatfile' '--with-gdbm' '--with-ldap=shared' '--with-openssl' '--with-gettext' '--with-unixODBC=shared,/usr' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-mysqli=shared' '--with-mysql-sock=/tmp/mysql.sock' '--with-pdo-mysql=shared,/usr' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-pgsql-sock=/tmp/pgsql.sock' '--with-pdo-pgsql=shared,/usr' '--with-sqlite=shared' '--with-pdo-sqlite=shared,/usr' '--with-pear=/usr/share/pear' '--with-dom' '--with-dom-xslt' '--with-xsl' '--with-png-dir=/usr' '--with-regex=php' '--with-zlib' '--enable-mbstring=all' '--enable-mbregex'
    Server API Apache 2.0 Handler
    Virtual Directory Support disabled
    Configuration File (php.ini) Path /usr/lib
    Scan this dir for additional .ini files /etc
    additional .ini files parsed /etc/php.ini
    PHP API 20041225
    PHP Extension 20050922
    Zend Extension 220051025
    Debug Build no
    Thread Safety disabled
    Zend Memory Manager enabled
    IPv6 Support enabled
    Registered PHP Streams php, file, http, ftp, compress.zlib, https, ftps, compress.bzip2
    Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
    Registered Stream Filters string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, convert.iconv.*, zlib.*, bzip2.*
    Zend logo This program makes use of the Zend Scripting Language Engine:
    Zend Engine v2.1.0, Copyright (c) 1998-2005 Zend Technologies
    PHP Credits
    Configuration
    PHP Core
    Directive Local Value Master Value
    allow_call_time_pass_reference On On
    allow_url_fopen On On
    always_populate_raw_post_data Off Off
    arg_separator.input & &
    arg_separator.output & &
    asp_tags Off Off
    auto_append_file no value no value
    auto_globals_jit On On
    auto_prepend_file no value no value
    browscap no value no value
    default_charset no value no value
    default_mimetype text/html text/html
    define_syslog_variables Off Off
    disable_classes no value no value
    disable_functions no value no value
    display_errors On On
    display_startup_errors Off Off
    doc_root no value no value
    docref_ext no value no value
    docref_root no value no value
    enable_dl On On
    error_append_string no value no value
    error_log no value no value
    error_prepend_string no value no value
    error_reporting 2039 2039
    expose_php On On
    extension_dir /usr/lib/php/extensions/php /usr/lib/php/extensions/php
    file_uploads On On
    highlight.bg #FFFFFF #FFFFFF
    highlight.comment #FF8000 #FF8000
    highlight.default #0000BB #0000BB
    highlight.html #000000 #000000
    highlight.keyword #007700 #007700
    highlight.string #DD0000 #DD0000
    html_errors On On
    ignore_repeated_errors Off Off
    ignore_repeated_source Off Off
    ignore_user_abort Off Off
    implicit_flush Off Off
    include_path .:/usr/share/pear .:/usr/share/pear
    log_errors Off Off
    log_errors_max_len 1024 1024
    magic_quotes_gpc On On
    magic_quotes_runtime Off Off
    magic_quotes_sybase Off Off
    mail.force_extra_parameters no value no value
    max_execution_time 30 30
    max_input_time 60 60
    open_basedir no value no value
    output_buffering no value no value
    output_handler no value no value
    post_max_size 8M 8M
    precision 12 12
    realpath_cache_size 16K 16K
    realpath_cache_ttl 120 120
    register_argc_argv On On
    register_globals Off Off
    register_long_arrays Off Off
    report_memleaks On On
    report_zend_debug On On
    safe_mode Off Off
    safe_mode_exec_dir no value no value
    safe_mode_gid Off Off
    safe_mode_include_dir no value no value
    sendmail_from [email protected] [email protected]
    sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
    serialize_precision 100 100
    short_open_tag On On
    SMTP localhost localhost
    smtp_port 25 25
    sql.safe_mode Off Off
    track_errors Off Off
    unserialize_callback_func no value no value
    upload_max_filesize 2M 2M
    upload_tmp_dir no value no value
    user_dir no value no value
    variables_order EGPCS EGPCS
    xmlrpc_error_number 0 0
    xmlrpc_errors Off Off
    y2k_compliance On On
    zend.ze1_compatibility_mode Off Off
    apache2handler
    Apache Version Apache
    Apache API Version 20020903
    Server Administrator [email protected]
    Hostname:Port laptop-do-joao.net:0
    User/Group nobody(99)/99
    Max Requests Per Child: 0 - Keep Alive: on - Max Per Connection: 100
    Timeouts Connection: 300 - Keep-Alive: 15
    Virtual Server No
    Server Root /usr
    Loaded Modules core prefork http_core mod_so mod_access mod_actions mod_alias mod_asis mod_auth mod_auth_anon mod_auth_dbm mod_auth_digest mod_autoindex mod_cgi mod_dav mod_dav_fs mod_dir mod_env mod_expires mod_ext_filter mod_headers mod_imap mod_include mod_info mod_log_config mod_mime mod_negotiation mod_rewrite mod_setenvif mod_speling mod_ssl mod_status mod_userdir mod_vhost_alias mod_php5
    Directive Local Value Master Value
    engine 1 1
    last_modified 0 0
    xbithack 0 0
    Apache Environment
    Variable Value
    HTTP_HOST laptop-do-joao.net
    HTTP_USER_AGENT Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20060104 Firefox/1.5
    HTTP_ACCEPT text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    HTTP_ACCEPT_LANGUAGE en-us,en;q=0.5
    HTTP_ACCEPT_ENCODING gzip,deflate
    HTTP_ACCEPT_CHARSET ISO-8859-1,utf-8;q=0.7,*;q=0.7
    HTTP_KEEP_ALIVE 300
    HTTP_CONNECTION keep-alive
    PATH /bin:/usr/bin:/sbin:/usr/sbin
    SERVER_SIGNATURE <address>Apache Server at laptop-do-joao.net Port 80</address>
    SERVER_SOFTWARE Apache
    SERVER_NAME laptop-do-joao.net
    SERVER_ADDR 127.0.0.1
    SERVER_PORT 80
    REMOTE_ADDR 127.0.0.1
    DOCUMENT_ROOT /home/httpd/html
    SERVER_ADMIN [email protected]
    SCRIPT_FILENAME /home/httpd/html/test.php
    REMOTE_PORT 33973
    GATEWAY_INTERFACE CGI/1.1
    SERVER_PROTOCOL HTTP/1.1
    REQUEST_METHOD GET
    QUERY_STRING no value
    REQUEST_URI /test.php
    SCRIPT_NAME /test.php
    HTTP Headers Information
    HTTP Request Headers
    HTTP Request GET /test.php HTTP/1.1
    Host laptop-do-joao.net
    User-Agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20060104 Firefox/1.5
    Accept text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    Accept-Language en-us,en;q=0.5
    Accept-Encoding gzip,deflate
    Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive 300
    Connection keep-alive
    HTTP Response Headers
    X-Powered-By PHP/5.1.1
    Keep-Alive timeout=15, max=100
    Connection Keep-Alive
    Transfer-Encoding chunked
    Content-Type text/html; charset=ISO-8859-1
    bcmath
    BCMath support enabled
    bz2
    BZip2 Support Enabled
    Stream Wrapper support compress.bz2://
    Stream Filter support bzip2.decompress, bzip2.compress
    BZip2 Version 1.0.3, 15-Feb-2005
    calendar
    Calendar support enabled
    ctype
    ctype functions enabled
    curl
    CURL support enabled
    CURL Information libcurl/7.15.0 OpenSSL/0.9.7h zlib/1.2.3
    date
    date/time support enabled
    Timezone Database Version 2005.14
    Timezone Database internal
    Default timezone Africa/Khartoum
    Directive Local Value Master Value
    date.timezone no value no value
    dba
    DBA support enabled
    Supported handlers gdbm cdb cdb_make inifile flatfile
    dom
    DOM/XML enabled
    DOM/XML API Version 20031129
    libxml Version 2.6.22
    HTML Support enabled
    XPath Support enabled
    XPointer Support enabled
    Schema Support enabled
    RelaxNG Support enabled
    exif
    EXIF Support enabled
    EXIF Version 1.4 $Id: exif.c,v 1.173.2.2 2005/10/10 06:09:25 helly Exp $
    Supported EXIF Version 0220
    Supported filetypes JPEG,TIFF
    ftp
    FTP support enabled
    gettext
    GetText Support enabled
    iconv
    iconv support enabled
    iconv implementation glibc
    iconv library version 2.3.5
    Directive Local Value Master Value
    iconv.input_encoding ISO-8859-1 ISO-8859-1
    iconv.internal_encoding ISO-8859-1 ISO-8859-1
    iconv.output_encoding ISO-8859-1 ISO-8859-1
    imap
    IMAP c-Client Version 2004
    SSL Support enabled
    libxml
    libXML support active
    libXML Version 2.6.22
    libXML streams enabled
    mbstring
    Multibyte Support enabled
    Multibyte string engine libmbfl
    Multibyte (japanese) regex support enabled
    Multibyte regex (oniguruma) version 3.7.1
    mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.
    Directive Local Value Master Value
    mbstring.detect_order no value no value
    mbstring.encoding_translation Off Off
    mbstring.func_overload 0 0
    mbstring.http_input pass pass
    mbstring.http_output pass pass
    mbstring.internal_encoding ISO-8859-1 no value
    mbstring.language neutral neutral
    mbstring.substitute_character no value no value
    mime_magic
    mime_magic support enabled
    Directive Local Value Master Value
    mime_magic.debug Off Off
    mime_magic.magicfile /etc/httpd/conf/magic /etc/httpd/conf/magic
    mysql
    MySQL Support enabled
    Active Persistent Links 0
    Active Links 0
    Client API version 5.0.18
    MYSQL_MODULE_TYPE external
    MYSQL_SOCKET /tmp/mysql.sock
    MYSQL_INCLUDE -I/usr/include/mysql
    MYSQL_LIBS -L/usr/lib -lmysqlclient
    Directive Local Value Master Value
    mysql.allow_persistent On On
    mysql.connect_timeout 60 60
    mysql.default_host no value no value
    mysql.default_password no value no value
    mysql.default_port no value no value
    mysql.default_socket no value no value
    mysql.default_user no value no value
    mysql.max_links Unlimited Unlimited
    mysql.max_persistent Unlimited Unlimited
    mysql.trace_mode Off Off
    openssl
    OpenSSL support enabled
    OpenSSL Version OpenSSL 0.9.7h 11 Oct 2005
    pcre
    PCRE (Perl Compatible Regular Expressions) Support enabled
    PCRE Library Version 6.2 01-Aug-2005
    posix
    Revision $Revision: 1.70.2.1 $
    session
    Session Support enabled
    Registered save handlers files user
    Registered serializer handlers php php_binary
    Directive Local Value Master Value
    session.auto_start Off Off
    session.bug_compat_42 On On
    session.bug_compat_warn On On
    session.cache_expire 180 180
    session.cache_limiter nocache nocache
    session.cookie_domain no value no value
    session.cookie_lifetime 0 0
    session.cookie_path / /
    session.cookie_secure Off Off
    session.entropy_file no value no value
    session.entropy_length 0 0
    session.gc_divisor 100 100
    session.gc_maxlifetime 1440 1440
    session.gc_probability 1 1
    session.hash_bits_per_character 5 5
    session.hash_function 0 0
    session.name PHPSESSID PHPSESSID
    session.referer_check no value no value
    session.save_handler files files
    session.save_path /tmp /tmp
    session.serialize_handler php php
    session.use_cookies On On
    session.use_only_cookies Off Off
    session.use_trans_sid 0 0
    shmop
    shmop support enabled
    SimpleXML
    Simplexml support enabled
    Revision $Revision: 1.151.2.7 $
    Schema support enabled
    sockets
    Sockets Support enabled
    SPL
    SPL support enabled
    Interfaces Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
    Classes AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, DirectoryIterator, DomainException, EmptyIterator, FilterIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RuntimeException, SimpleXMLIterator, SplFileObject, SplObjectStorage, UnderflowException, UnexpectedValueException
    standard
    Regex Library Bundled library enabled
    Dynamic Library Support enabled
    Path to sendmail /usr/sbin/sendmail -t -i
    Directive Local Value Master Value
    assert.active 1 1
    assert.bail 0 0
    assert.callback no value no value
    assert.quiet_eval 0 0
    assert.warning 1 1
    auto_detect_line_endings 0 0
    date.default_latitude 31.7667 31.7667
    date.default_longitude 35.2333 35.2333
    date.sunrise_zenith 90.83 90.83
    date.sunset_zenith 90.83 90.83
    default_socket_timeout 60 60
    safe_mode_allowed_env_vars PHP_ PHP_
    safe_mode_protected_env_vars LD_LIBRARY_PATH LD_LIBRARY_PATH
    url_rewriter.tags a=href,area=href,frame=src,input=src,form=,fieldset= a=href,area=href,frame=src,input=src,form=,fieldset=
    user_agent no value no value
    tokenizer
    Tokenizer Support enabled
    xml
    XML Support active
    XML Namespace Support active
    libxml2 Version 2.6.22
    xsl
    XSL enabled
    libxslt Version 1.1.15
    libxslt compiled against libxml Version 2.6.21
    EXSLT enabled
    libexslt Version 1.1.15
    zlib
    ZLib Support enabled
    Stream Wrapper support compress.zlib://
    Stream Filter support zlib.inflate, zlib.deflate
    Compiled Version 1.2.3
    Linked Version 1.2.3
    Directive Local Value Master Value
    zlib.output_compression Off Off
    zlib.output_compression_level -1 -1
    zlib.output_handler no value no value
    Additional Modules
    Module Name
    sysvsem
    sysvshm
    Environment
    Variable Value
    CONSOLE /dev/console
    TERM linux
    LD_LIBRARY_PATH /usr/lib:
    INIT_VERSION sysvinit-2.86
    PATH /bin:/usr/bin:/sbin:/usr/sbin
    RUNLEVEL 5
    PWD /
    PREVLEVEL N
    SHLVL 3
    HOME /
    BOOT_IMAGE Arch-2.6.15
    _ /usr/sbin/httpd
    PHP Variables
    Variable Value
    _SERVER["HTTP_HOST"] laptop-do-joao.net
    _SERVER["HTTP_USER_AGENT"] Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20060104 Firefox/1.5
    _SERVER["HTTP_ACCEPT"] text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    _SERVER["HTTP_ACCEPT_LANGUAGE"] en-us,en;q=0.5
    _SERVER["HTTP_ACCEPT_ENCODING"] gzip,deflate
    _SERVER["HTTP_ACCEPT_CHARSET"] ISO-8859-1,utf-8;q=0.7,*;q=0.7
    _SERVER["HTTP_KEEP_ALIVE"] 300
    _SERVER["HTTP_CONNECTION"] keep-alive
    _SERVER["PATH"] /bin:/usr/bin:/sbin:/usr/sbin
    _SERVER["SERVER_SIGNATURE"] <address>Apache Server at laptop-do-joao.net Port 80</address>
    _SERVER["SERVER_SOFTWARE"] Apache
    _SERVER["SERVER_NAME"] laptop-do-joao.net
    _SERVER["SERVER_ADDR"] 127.0.0.1
    _SERVER["SERVER_PORT"] 80
    _SERVER["REMOTE_ADDR"] 127.0.0.1
    _SERVER["DOCUMENT_ROOT"] /home/httpd/html
    _SERVER["SERVER_ADMIN"] [email protected]
    _SERVER["SCRIPT_FILENAME"] /home/httpd/html/test.php
    _SERVER["REMOTE_PORT"] 33973
    _SERVER["GATEWAY_INTERFACE"] CGI/1.1
    _SERVER["SERVER_PROTOCOL"] HTTP/1.1
    _SERVER["REQUEST_METHOD"] GET
    _SERVER["QUERY_STRING"] no value
    _SERVER["REQUEST_URI"] /test.php
    _SERVER["SCRIPT_NAME"] /test.php
    _SERVER["PHP_SELF"] /test.php
    _SERVER["REQUEST_TIME"] 1137274380
    _SERVER["argv"]
    Array
    _SERVER["argc"] 0
    _ENV["CONSOLE"] /dev/console
    _ENV["TERM"] linux
    _ENV["LD_LIBRARY_PATH"] /usr/lib:
    _ENV["INIT_VERSION"] sysvinit-2.86
    _ENV["PATH"] /bin:/usr/bin:/sbin:/usr/sbin
    _ENV["RUNLEVEL"] 5
    _ENV["PWD"] /
    _ENV["PREVLEVEL"] N
    _ENV["SHLVL"] 3
    _ENV["HOME"] /
    _ENV["BOOT_IMAGE"] Arch-2.6.15
    _ENV["_"] /usr/sbin/httpd
    PHP License
    This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE
    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact [email protected].

  • PHP and MySQL issue {subject edited by moderator}

    Using Dreamweaver and PHP.   On one page, I have a form with an Insert Field (LastName) that enter into the SQL database. SQL database has the ID auto-increment.   When I click on Send (with the data entered into the database), I want the new page to open and display the ID field.  but when I insert a new id and I click Send it still displays the old id, whereas I want to display a new ID

    This code for isert page
    <?php require_once('Connections/pendaftaran.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      $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"] == "form")) {
      $insertSQL = sprintf("INSERT INTO maklumat_fail (fail_tajuk, fail_no, fail_seksyen, fail_hari, fail_bulan, fail_tahun, fail_rakbesi, fail_laci, fail_baris) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['fail_tajuk'], "text"),
                           GetSQLValueString($_POST['fail_no'], "int"),
                           GetSQLValueString($_POST['fail_seksyen'], "text"),
                           GetSQLValueString($_POST['fail_hari'], "int"),
                           GetSQLValueString($_POST['fail_bulan'], "text"),
                           GetSQLValueString($_POST['fail_tahun'], "int"),
                           GetSQLValueString($_POST['fail_rakbesi'], "text"),
                           GetSQLValueString($_POST['fail_laci'], "text"),
                           GetSQLValueString($_POST['fail_baris'], "text"));
      mysql_select_db($database_pendaftaran, $pendaftaran);
      $Result1 = mysql_query($insertSQL, $pendaftaran) or die(mysql_error());
      $insertGoTo = "detailPendaftaran.php?" . $row_Recordset1['fail_tajuk'] . "=";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form")) {
      $updateSQL = sprintf("UPDATE maklumat_fail SET fail_no=%s, fail_seksyen=%s, fail_hari=%s, fail_bulan=%s, fail_tahun=%s, fail_rakbesi=%s, fail_laci=%s, fail_baris=%s WHERE fail_tajuk=%s",
                           GetSQLValueString($_POST['fail_no'], "int"),
                           GetSQLValueString($_POST['fail_seksyen'], "text"),
                           GetSQLValueString($_POST['fail_hari'], "int"),
                           GetSQLValueString($_POST['fail_bulan'], "text"),
                           GetSQLValueString($_POST['fail_tahun'], "int"),
                           GetSQLValueString($_POST['fail_rakbesi'], "text"),
                           GetSQLValueString($_POST['fail_laci'], "text"),
                           GetSQLValueString($_POST['fail_baris'], "text"),
                           GetSQLValueString($_POST['fail_tajuk'], "text"));
      mysql_select_db($database_pendaftaran, $pendaftaran);
      $Result1 = mysql_query($updateSQL, $pendaftaran) or die(mysql_error());
      $updateGoTo = "detailPendaftaran.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
        $updateGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $updateGoTo));
    mysql_select_db($database_pendaftaran, $pendaftaran);
    $query_Recordset1 = "SELECT * FROM maklumat_fail";
    $Recordset1 = mysql_query($query_Recordset1, $pendaftaran) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    ?><!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>SISTEM PENDAFTARAN FAIL</title>
    <style type="text/css">
    .right {
      text-align: right;
    body {
      background-color: #6699CC;
    </style>
    </head>
    <body><form action="<?php echo $editFormAction; ?>" name="form" method="POST">
      <center>
        <p><img src="mps.png" width="1119" height="244" /></p></center>
      <table width="332" border="0" align="center">
          <tr>
            <td><h1 class="K">PENDAFTARAN FAIL</h1></td>
          </tr>
      </table>
        <p> </p>
        <table width="200" border="2" align="center" class="l">
          <tr>
            <td><center isoptional="l">Maklumat Fail</center></td>
          </tr>
      </table>
        <p> </p>
        <center><table width="587" border="6">
          <tr>
            <td width="567" height="233"><table width="560" height="206" border="0">
                <tr>
                  <td width="147" class="right"><strong>No. Fail</strong></td>
                  <td width="10">:</td>
                  <td width="432">MPSepang
                    <input name="fail_no" type="text" id="fail_no" size="40" /></td>
                </tr>
                <tr>
                  <td class="right"><strong>Tajuk Fail</strong></td>
                  <td>:</td>
                  <td><textarea name="fail_tajuk" cols="40" rows="5" id="fail_tajuk"></textarea></td>
                </tr>
                <tr>
                  <td class="right"><strong>Seksyen</strong></td>
                  <td>:</td>
                  <td><select name="fail_seksyen" size="Seksyen" id="fail_seksyen">
                      <option>Seksyen</option>
                      <option>Pentadbiran</option>
                      <option>Web, Latihan &amp; Komuniti</option>
                      <option>Rangkaian &amp; Infrastruktur</option>
                      <option>Sistem</option>
                  </select></td>
                </tr>
                <tr>
                  <td class="right"><strong>Tarikh Fail Dibuka</strong></td>
                  <td>:</td>
                  <td><select name="fail_hari" size="Hari" id="fail_hari">
                      <option>Hari</option>
                      <option>1</option>
                      <option>2</option>
                      <option>3</option>
                      <option>4</option>
                      <option>5</option>
                      <option>6</option>
                      <option>7</option>
                      <option>8</option>
                      <option>9</option>
                      <option>10</option>
                      <option>11</option>
                      <option>12</option>
                      <option>13</option>
                      <option>14</option>
                      <option>15</option>
                      <option>16</option>
                      <option>17</option>
                      <option>18</option>
                      <option>19</option>
                      <option>20</option>
                      <option>21</option>
                      <option>22</option>
                      <option>23</option>
                      <option>24</option>
                      <option>25</option>
                      <option>26</option>
                      <option>27</option>
                      <option>28</option>
                      <option>29</option>
                      <option>30</option>
                      <option>31</option>
                    </select>
                      <label for="bulan2"></label>
                      <select name="fail_bulan" size="Bulan" id="bulan2">
                        <option>Bulan</option>
                        <option>Januari</option>
                        <option>Februari</option>
                        <option>Mac</option>
                        <option>April</option>
                        <option>Mei</option>
                        <option>Jun</option>
                        <option>Julai</option>
                        <option>Ogos</option>
                        <option>September</option>
                        <option>Oktober</option>
                        <option>November</option>
                        <option>Disember</option>
                      </select>
                      <label for="fail_tahun"></label>
                      <select name="fail_tahun" size="Tahun" id="fail_tahun">
                        <option>Tahun</option>
                        <option>2014</option>
                        <option>2015</option>
                        <option>2016</option>
                        <option>2017</option>
                        <option>2018</option>
                      </select>
                      <label for="tarikhBuka"></label></td>
                </tr>
                <tr>
                  <td bgcolor="#FFFFFF" class="right"> <label><strong>Lokasi</strong></label></td>
                  <td>:</td>
                  <td>Rak Besi
                    <label>
                      <select name="fail_rakbesi" size="Seksyen" id="fail_rakbesi">
                        <option>Rak Besi</option>
                        <option>A</option>
                        <option>B</option>
                      </select>
                      Laci
                      <select name="fail_laci" size="Seksyen" id="fail_laci">
                        <option>Laci</option>
                        <option>A1</option>
                        <option>A2</option>
                        <option>A3</option>
                        <option>A4</option>
                        <option>B1</option>
                        <option>B2</option>
                        <option>B3</option>
                        <option>B4</option>
                      </select>
                      Baris
                      <select name="fail_baris" size="Seksyen" id="fail_baris">
                        <option>Baris</option>
                        <option>1</option>
                        <option>2</option>
                        <option>3</option>
                        <option>4</option>
                        <option>5</option>
                        <option>6</option>
                        <option>7</option>
                        <option>8</option>
                        <option>9</option>
                        <option>10</option>
                        <option>11</option>
                        <option>12</option>
                        <option>13</option>
                        <option>14</option>
                        <option>15</option>
                        <option>16</option>
                        <option>17</option>
                        <option>18</option>
                        <option>19</option>
                        <option>20</option>
                      </select>
                    </label></td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td><label>
              <div align="center">
                <input type="submit" name="submit" id="submit" value="Submit" />
              </div>
            </label></td>
          </tr>
      </table>
      </center>
        <p> </p>
    <center>
          <p>
            <label></label>
          <p> </p>
      </center>
      <center>
        <p><img src="nwUWE4K.jpg" width="1119" height="200" /></p>
      </center>
      <input type="hidden" name="MM_insert" value="form" />
      <input type="hidden" name="MM_update" value="form" />
    </form>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>
    This for display page
    <?php require_once('Connections/pendaftaran.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      $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;
    $colname_Recordset1 = "-1";
    if (isset($_GET['fail_baris'])) {
      $colname_Recordset1 = $_GET['fail_baris'];
    mysql_select_db($database_pendaftaran, $pendaftaran);
    $query_Recordset1 = sprintf("SELECT * FROM maklumat_fail WHERE fail_baris = %s", GetSQLValueString($colname_Recordset1, "text"));
    $Recordset1 = mysql_query($query_Recordset1, $pendaftaran) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    ?>
    <!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>SISTEM PENDAFTARAN FAIL</title>
    <style type="text/css">
    .right {
      text-align: right;
    body {
      background-color: #6699CC;
    </style>
    </head>
    <body><form action="" method="get">
      <center>
        <p><img src="mps.png" width="1119" height="244" /></p>
      </center>
        <p><center>
        </p>
        <p> </p>
        <p> </p>
        <center>
          <table width="406" border="0">
            <tr>
              <td width="247"><h1>Fail telah berjaya didaftar!!</h1></td>
            </tr>
          </table>
          <p> </p>
          <table width="389" border="6">
            <tr>
              <td><table width="370" height="174" border="0">
                <tr>
                  <td width="129" class="right"><strong>No.Fail</strong></td>
                  <td width="8">:</td>
                  <td width="211"><?php echo $row_Recordset1['fail_no']; ?></td>
                </tr>
                <tr>
                  <td class="right"><strong>Tajuk Fail</strong></td>
                  <td>:</td>
                  <td><?php echo $row_Recordset1['fail_tajuk']; ?></td>
                </tr>
                <tr>
                  <td class="right"><strong>Seksyen</strong></td>
                  <td>:</td>
                  <td><?php echo $row_Recordset1['fail_seksyen']; ?></td>
                </tr>
                <tr>
                  <td class="right"><strong>Tarikh Fail Dibuka</strong></td>
                  <td>:</td>
                  <td><?php echo $row_Recordset1['fail_hari']; ?><?php echo $row_Recordset1['fail_bulan']; ?><?php echo $row_Recordset1['fail_tahun']; ?></td>
                </tr>
                <tr>
                  <td class="right"><strong>Lokasi</strong></td>
                  <td>:</td>
                  <td><?php echo $row_Recordset1['fail_rakbesi']; ?><?php echo $row_Recordset1['fail_laci']; ?><?php echo $row_Recordset1['fail_baris']; ?></td>
                </tr>
              </table></td>
            </tr>
          </table>
          <p><a href="test1.php">MENU</a></p>
          <p> </p>
          <p> </p>
      </center>
        <p> </p>
        <p><img src="nwUWE4K.jpg" width="1119" height="200" /></p>
    </form>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>

  • My login system doesn't redirect successfully. (PHP and mysql)

    I have the registration system ready and it seems to be working fine.  All the registrants appear in mysql verified.  I have a log in system set up in conjuction with the registration system. I inserted a user in mysql in order to log in and it does redirect successfully.  The problem I have is that when I try to log in as a registrant, it won't redirect successfully when I submit the form, it only remains in the log in page. How would I fix this issue? How would I make it redirect?  Many thanks!
    Here is the code:
    This is the login.php file
    <?php require_once('../Connections/connFormGod.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=$_POST['password'];
      $MM_fldUserAuthorization = "verified";
      $MM_redirectLoginSuccess = "admin_index.php";
      $MM_redirectLoginFailed = "admin_login.php";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_connFormGod, $connFormGod);
      $LoginRS__query=sprintf("SELECT username, password, verified FROM `admin` WHERE username=%s AND password=%s",
      GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
      $LoginRS = mysql_query($LoginRS__query, $connFormGod) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
        $loginStrGroup  = mysql_result($LoginRS,0,'verified');
    if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
        //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 );
    ?>
    This is the page that it should redirect to - Index.php file.
    <?php require_once('../Connections/connFormGod.php'); ?>
    <?php
    //initialize the session
    if (!isset($_SESSION)) {
      session_start();
    $MM_authorizedUsers = "y";
    $MM_donotCheckaccess = "false";
    // *** Restrict Access To Page: Grant or deny access to this page
    function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
      // For security, start by assuming the visitor is NOT authorized.
      $isValid = False;
      // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
      // Therefore, we know that a user is NOT logged in if that Session variable is blank.
      if (!empty($UserName)) {
        // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
        // Parse the strings into arrays.
        $arrUsers = Explode(",", $strUsers);
        $arrGroups = Explode(",", $strGroups);
        if (in_array($UserName, $arrUsers)) {
          $isValid = true;
        // Or, you may restrict access to only certain users based on their username.
        if (in_array($UserGroup, $arrGroups)) {
          $isValid = true;
        if (($strUsers == "") && false) {
          $isValid = true;
      return $isValid;
    $MM_restrictGoTo = "admin_login.php";
    if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {  
      $MM_qsChar = "?";
      $MM_referrer = $_SERVER['PHP_SELF'];
      if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
      if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
      $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
      $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
      header("Location: ". $MM_restrictGoTo);
      exit;
    ?>
    <?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;
    $colname_userDets = "-1";
    if (isset($_SESSION['MM_Username'])) {
      $colname_userDets = $_SESSION['MM_Username'];
    mysql_select_db($database_connFormGod, $connFormGod);
    $query_userDets = sprintf("SELECT AdminID, username, password, verified FROM `admin` WHERE username = %s", GetSQLValueString($colname_userDets, "text"));
    $userDets = mysql_query($query_userDets, $connFormGod) or die(mysql_error());
    $row_userDets = mysql_fetch_assoc($userDets);
    $totalRows_userDets = mysql_num_rows($userDets);
    if (isset($_POST['username'])) {
      $loginUsername=$_POST['username'];
      $password=$_POST['password'];
      $MM_fldUserAuthorization = "";
      $MM_redirectLoginSuccess = "admin_index.php";
      $MM_redirectLoginFailed = "admin_login.php";
      $MM_redirecttoReferrer = true;
      mysql_select_db($database_connFormGod, $connFormGod);
    ?>

    Thank you very much, but thats actually what I have. I've testing the login form through my web hosting and it does not redirect successfully. Can any body help plz.
    Thanks in advance!
    I had forgotten to include the html code.
       <form  id="login_form" name="login_form" method="POST" action="<?php echo $loginFormAction; ?>">
            <table width="100%" border="0" cellpadding="5" cellspacing="0" id="login_table">
              <tr>
                <td align="right"> </td>
                <td align="left"> </td>
              </tr>
              <tr>
                <td width="41%" align="right">Username:</td>
                <td width="59%" align="left"><input type="text" name="username" id="username" /></td>
              </tr>
              <tr>
                <td align="right">Password:</td>
                <td align="left"><input type="password" name="password" id="password" /></td>
              </tr>
              <tr>
                <td> </td>
                <td> </td>
              </tr>
              <tr>
                <td> </td>
                <td><input type="submit" name="submit" id="submit" value="Login" /></td>
              </tr>
              <tr>
                <td> </td>
                <td> </td>
              </tr>
            </table>
            <p> </p>
          </form>

  • Help in establishing connection to php and mysql data base.

    Hi,
    i have been trying to execute a simple flash program that communicates with a php page which is linked to a mysql database.
    somehow the php is not returning any data to flash , and even falsh is not sending any data to php.. I am using wamp server on win7.
    Heres my actionscript code:
    stop();
    var variables:URLVariables = new URLVariables();
    var varSend:URLRequest = new URLRequest("php.php");
    varSend.method = URLRequestMethod.POST;
    varSend.data = variables;
    var varLoader:URLLoader = new URLLoader;
    //varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader.dataFormat = URLLoaderDataFormat.TEXT;
    varLoader.addEventListener(Event.COMPLETE, completeHandler);
    variables.requestCode = "homepage";
    //variables.myRequest="homepage";
    trace(variables);
    varLoader.load(varSend);
    function completeHandler(event:Event):void
        trace(event.target.data.t_passed);
        var t_recieved = event.target.data.t_passed;
        //t_txt.text = "t_passed";
        t_txt.text=t_recieved;
    try
        varLoader.load(varSend);
    catch (error:Error)
        trace("error");
    And this is my php code:
    <!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>
    <?php
    //error_reporting(E_ALL  & ~E_NOTICE);
    $connection=mysql_connect("localhost" , "root" , "");
    if(!$connection)
        die("failed".mysql_error());
    $db_select = mysql_select_db("questions",$connection);
    if (!$db_select)
        die("failed".mysql_error());
        if ($_POST['requestCode'] == "homepage") {
        $pageName = $_POST['requestCode'];
        echo ($_POST['requestCode']);
    $result=mysql_query("select q from quest where qno=111",$connection);
    while($row=mysql_fetch_array($result))
    $t=$row[0];
    //print "t_passed = $s";
    echo "t_passed=".$t;
    mysql_close($connection);
    ?>
    </head>
    <body>
    </body>
    </html>
    The php gives me Undifined notice for the 'requestCode' variable...
    please help..
    Thanks in advance

    Sample Flash Code:
    package
        import flash.display.*;
        import flash.events.*;
        import flash.net.*;
        import flash.text.*;
        public class sendtophp extends Sprite
            var phpFile:String = "http://localhost/Raja/sendDataToServer.php";
            public function sendtophp():void
                callBtn.addEventListener(MouseEvent.CLICK, callServer);
            function callServer(e:MouseEvent):void
                var urlRequest:URLRequest = new URLRequest(phpFile);
                var urlParams:URLVariables = new URLVariables();
                urlParams.country = "India";
                urlParams.animal="Tiger";
                urlRequest.method = URLRequestMethod.POST;
                urlRequest.data = urlParams;
                var loader:URLLoader = new URLLoader();
                loader.addEventListener(Event.COMPLETE, serverResponse);
                loader.load(urlRequest);
            function serverResponse(e:Event):void
                trace("loaded");
                var loader:URLLoader = URLLoader(e.target);
                var variables:URLVariables = new URLVariables(loader.data); 
                responseTxt.text = variables.returnValue; 
        }//end of class sendtophp 
    }//end of package
    Sample PHP code:
    <?php
    print "returnValue= Hi ".$_POST['country'].", it's working";
        $host = "localhost";
        $user = "root";
        $pass = "";
        $db = "test";
        $country = $_POST['country'];
        $animal = $_POST['animal'];
         $connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
         mysql_select_db($db) or die ("Unable to select database!");
          $query = "INSERT INTO symbols (country, animal) VALUES ('$country', '$animal')";
          $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
        echo "New record inserted with ID ".mysql_insert_id();
           mysql_close($connection);
    ?>
    I had tested and it works fine. Please have this as an sample. If you have any clarification then reply to the thread

  • Channel.Call.Failed NetConnection.Call.Failed: HTTP: Status 500 with amfphp php and mysql

    I have been scripting a simple database connection to check login credentials and am comming accross these errors:
    Channel.Call.Failed
    NetConnection.Call.Failed:
    HTTP: Status 500
    Any PHP code I run that is not connecting to MYSQL runs fine. But if I try to connect to the database thats what I get.
    Here is my mxml:
    <s:RemoteObject id="LogInService"
                                 source="Novus.NovusUser.getLogIn"
                                 destination="AMFPHP"
                                                                fault="faultHandler(event)"
                                 showBusyCursor="true">
                                  <s:method name="getLogIn" result="onResult(event)" fault="faultHandler(event)"/>
    </s:RemoteObject>
    Which calls this actionscript:
    private function btn(event:Event):void
                                                 switch(event.target.id)
                                                           case "LogInSubmit":
                                                                          LogInService.getLogIn(UserName.text, PW.text)
                  break;
                                  private function onResult(result:ResultEvent):void
                                                 Alert.show("Result " + result.token.result);
                                                 if(result.token.result == true)
                                                                currentState = "Main";
                                                 else
                                                           Alert.show(String(result.token.result));
                                  private function faultHandler(fault:FaultEvent):void
                                                 CursorManager.removeBusyCursor();
            var errorMessage:String = "code:\n" + fault.fault.faultCode + "\n\nMessage:\n" + fault.fault.faultString + "\n\nDetail:\n" + fault.fault.faultDetail;
                                                 Alert.show(errorMessage);
    and calls this PHP:
    If I comment out the database connection it returns a false value to me just fine but with it there it throws an error
    <?php
    class GetLogIn
                   private $_db;
                   public function getLogIn($U, $P)
                             //Connect To Database
                             $hostname='127.0.0.1';
                             $username='root';
                             $password='*********';    //not realy ***** blocked it out
                             $dbname='mydatabase';
                             try
                                            mysql_connect($hostname,$username, $password) OR DIE ('Unable to connect to database! Please try again later.');
                                            mysql_select_db($dbname);
                                            $sql = "Select * FROM empusr WHERE UserName = '$U' and Password = '$P'";
                                            mysql_close();
                                            if ($sql)
                                                           return true;
                                            else
                                                           return false;
                             catch
                                            return 'Unable to connect to database! Please try again later.';
    ?>
    I have a crossdomain.xml but I am unsure if I have it placed right.
    I also have a services.conf but am unsure if that also needs to be altered to adjust for MySQL.
    Any help would be appreciated. 

    Found the problum
    The connection string had to be placed in the public _constructor function of the class.
    <?php
    class EmployeeService
              public function __construct()
                        $hostname='127.0.0.1';
                        $username='root';
                        $password='*********';
                        $dbname='myDatabase';
                        mysql_connect($hostname,$username, $password);
                        mysql_select_db($dbname);
              public function logIn($N, $P)
                        $query = "SELECT * FROM EmpUsr WHERE UserName = '$N' AND Password = '$P'";
                        $result = mysql_query($query);
                          if ($result)
                                    return true;
                          else
                                    return false;
    ?>

Maybe you are looking for

  • How to delete an asset with a capitalization date inefaceable and no value?

    Hi all, An asset was created on the wrong asset class. I would like to erase it but this is impossible because of the capitalization date. Indeed, I cannot change the fields status variant of the capitalization date, it is compulsory. Furthermore, as

  • Can I loop a sql query???

    Hi, I have an array that has x number of values. I want to run a sql statement x number of times using the next array value each time. Basically I have a recordset that displays results based on a search. The result of the search is a list of names,

  • "No password" on resource in IDM 8

    Dear all, i am just creating a resource to pull userdata from an oracle table ( actually view but doesn't matter here ) but i do not want to manage a password, therefore i disabled the password feature. But i still getting an error when trying to sav

  • CATS approval Issue

    Hi, We have some attendance for an employee for October 2011. One day attendance for 04/10/2011 is not appearing on IT 2002. Pulled CADO report to see the status of the attendance and it shows the status as In Process. Tried to approve the attendance

  • Apple TV airplay problem.... Help

    I could only stream YouTube from my iPad, before I could stream Netflix and others. Can anybody help. Thanks.