[PHP] PHP connetion of mySQL
Keep getting this error, anyone know why .. Using dreamweaver and Phakt plugin for PHP and everytime I connect inside dreamweaver it works fine, but once posted to the web I get an error. Warning: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) in /home/sites/site2/web/atkins/adodb/adodb-mysql.inc.php on line 113 Thnaks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Query Database and list in Columns
What I am doing is using Macromedia Ultradev 4 and querying a mySQL database and using Phakt (PHP) to code the website. Everything is working as far as pulling the database info and repeating it down the page but it looks as if it is one column. This is how I have the table TABLE | COLUMN | COLUMN | COLUMN | - | ROW 1| | | This is how the data shows TABLE | DATA | BLANK COLUMN | BLANK COLUMN --- | DATA | BLANK COLUMN | BLANK COLUMN --- | DATA| BLANK COLUMN | BLANK COLUMN This is how I want the data to show TABLE | DATA | DATA | DATA | --- | DATA | DATA | DATA| --- | DATA| DATA | DATA | Hope this makes sense. I need some help! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Query Database and list in Columns
This is the repeat code using Dreamweaver and not understand PHP to much but I think this is what you asked for ?php while (($Repeat1__numRows-- != 0) (!$specials-EOF)) { ? font face=Verdana, Arial, Helvetica, sans-serif font size=2 font color=#99 b ?php echo $specials-Fields(itm_title)? /b/fontbr img src=?php echo $specials-Fields(url_pic)? width=60 height=90 br Only font color=#CC$ ?php echo $specials-Fields(itm_price)? /font /eachbr font color=#009900 ?php echo $specials-Fields(itm_quant)? /font left in stockbr /font/fontbr ?php $Repeat1__index++; $specials-MoveNext(); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Adv Paypal Shopping Cart
This is a difficult one, What I am doing is designing a website to sell DVD's well what I am running into is that when a Person buys the DVD they are getting charged 2.35 for shipping an additional 1.00 for purchasing 2 .. Well that works fine if they buy the same DVD, but when they buy 2 different DVD's they are getting charged 2.35 twice. What I was wondering if I can munipulate the code below to solve this problem using PHP, I have a mySQL database that I pull from and below you can see I am pulling the Shipping from ITM_SHIP field and ITM_ASHIP is for the additional movie they put in there cart. So can I do a math eccuasion so that it does WIEGTH say 1 lb and multiply that by $1 and then put that code in my link below.. Anyone done anything like this, I would love to learn something to this effect! https://www.paypal.com/cart/add=1business=MYACCOUNTitem_name=?php echo $products-Fields(itm_title)?item_number=?php echo $products-Fields(itm_num)?amount=?php echo $products-Fields(itm_price)?shipping=?php echo $products-Fields(itm_ship)?shipping2=?php echo $products-Fields(itm_aship)?image_url=https%3A//www.citystoked.com/logo .jpgreturn=http%3A//www.p-traders.com/success.phpcancel_return=http%3A//ww w.p-traders.com/index.php sincerely Kacey A. Murphy netBuilder's, Inc. You can see what I mean by going to http://www.p-traders.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Math Script
Is this possible what I want this to do is take a price say 10.00 in a field in the mySQL databse and do a math set such as -0.5 * 1 This is in a link and I was echoing the field in the database but how do I put a math thingy in there. ?php echo $products-Fields(itm_aship)? Could I do this ?php echo $products-Fields(itm_aship)-0.5*1? or am I thinking all wrong... Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Questions per installing on linux (Php 4)
This is what I did when I installed PHP and I already had mySQL on my RAQ3i and it worked like a charm, I hope this helps you, -- you can skip by the mySQL install and move on the PHP install below. Since mySQL for the RAQ3i (especially if you used the BIN from Cobalt) doesn't have a directory complete with the source so I just used --with-mysql (without a path) been working awesome. E-mail if you need anything ICQ# 16976549 *** ** INSTALLING MySQL on RAQ3i ** *** [1] login as root [2] mkdir usr/local/download [3] cd /usr/local/downoad [4] wget http://www.mysql.com/Downloads/MySQL-3.23/mysql-3.23.32.tar.gz [5] echo mysql:x:101:103:MySql User:/usr/local/mysql:/etc/passwd [6] echo mysql:x:103:/etc/group [7] tar zxvf mysql-3.23.32.tar.gz [8] cd mysql-3.23.32 [9] ./configure --prefix=/usr/local/mysql --with-unix-socket-path=/tmp/mysql.soc k --with-mysqld-user=mysql [10] make [11] make install [12] chown mysql.mysql /usr/local/mysql [13] scripts/mysql_install_db [14] chown -R mysql.mysql /usr/local/mysql/var [15] mkdir /var/lib/mysql [16] ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock [17] rm -f /usr/bin/mysql [18] ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql [19] chmod 755 /usr/local/mysql/var [20] /usr/local/mysql/bin/safe_mysqld [21] /usr/local/mysql/bin/mysqladmin -u root password 'YOURPASSWORDHERE' [22] cp support-files/mysql.server /etc/rc.d/init.d/mysql [23] chmod 755 /etc/rc.d/init.d/mysql [24] echo /etc/rc.d/init.d/mysql start/etc/rc.d/rc.sysinit *** ** INSTALLING PHP4 on RAQ3i ** *** [1] login as Root [2] cd /usr/local/download [3] wget http://php.net/distributions/php-4.0.6.tar.gz [4] tar -xvzf php-4.0.4pl1.tar.gz [5] cd php-4.0.4pl1 [6] mkdir /usr/local/php [7] mv * /usr/local/php [8] cd /usr/local/php [9] rmdir /usr/local/download/php-4.0.4pl1 [10] ./configure --with-mysql --with-apxs --enable-track-vars [11] make [12] make install [13] cp php.ini-dist /usr/local/lib/php.ini [14] pico -w /etc/httpd/conf/httpd.conf (Change the line:) LoadModulephp4_modulelib/apache/libphp4.so to LoadModulephp4_module/usr/lib/apache/libphp4.so) [15] pico -w /etc/httpd/conf/srm.conf Find the following line in srm.conf #AddType application/x-httpd-php .phtml After this line, add the line AddType application/x-httpd-php .php .php4 .phtml This associates the .php file extension with PHP4 (If you want index.php to be served by default you need also to add this as well in the section UserDir web of the same file) # DirectoryIndex: Name of the file or files to use as a pre-written HTML # directory index. Separate multiple entries with spaces. DirectoryIndex index.html index.htm index.shtml home.html home.htm index.php index.php4 index.p$ *** ** FINISHING NOTES ** *** Still logged in as 'root' perform the following commands to stop and restart the HTTP server /etc/rc.d/init.d/httpd stop /etc/rc.d/init.d/httpd start -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Questions per installing on linux (Php 4)
This is what I did when I installed PHP and I already had mySQL on my RAQ3i and it worked like a charm, I hope this helps you, -- you can skip by the mySQL install and move on the PHP install below. Since mySQL for the RAQ3i (especially if you used the BIN from Cobalt) doesn't have a directory complete with the source so I just used --with-mysql (without a path) been working awesome. E-mail if you need anything ICQ# 16976549 *** ** INSTALLING MySQL on RAQ3i ** *** [1] login as root [2] mkdir usr/local/download [3] cd /usr/local/downoad [4] wget http://www.mysql.com/Downloads/MySQL-3.23/mysql-3.23.32.tar.gz [5] echo mysql:x:101:103:MySql User:/usr/local/mysql:/etc/passwd [6] echo mysql:x:103:/etc/group [7] tar zxvf mysql-3.23.32.tar.gz [8] cd mysql-3.23.32 [9] ./configure --prefix=/usr/local/mysql --with-unix-socket-path=/tmp/mysql.soc k --with-mysqld-user=mysql [10] make [11] make install [12] chown mysql.mysql /usr/local/mysql [13] scripts/mysql_install_db [14] chown -R mysql.mysql /usr/local/mysql/var [15] mkdir /var/lib/mysql [16] ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock [17] rm -f /usr/bin/mysql [18] ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql [19] chmod 755 /usr/local/mysql/var [20] /usr/local/mysql/bin/safe_mysqld [21] /usr/local/mysql/bin/mysqladmin -u root password 'YOURPASSWORDHERE' [22] cp support-files/mysql.server /etc/rc.d/init.d/mysql [23] chmod 755 /etc/rc.d/init.d/mysql [24] echo /etc/rc.d/init.d/mysql start/etc/rc.d/rc.sysinit *** ** INSTALLING PHP4 on RAQ3i ** *** [1] login as Root [2] cd /usr/local/download [3] wget http://php.net/distributions/php-4.0.6.tar.gz [4] tar -xvzf php-4.0.4pl1.tar.gz [5] cd php-4.0.4pl1 [6] mkdir /usr/local/php [7] mv * /usr/local/php [8] cd /usr/local/php [9] rmdir /usr/local/download/php-4.0.4pl1 [10] ./configure --with-mysql --with-apxs --enable-track-vars [11] make [12] make install [13] cp php.ini-dist /usr/local/lib/php.ini [14] pico -w /etc/httpd/conf/httpd.conf (Change the line:) LoadModulephp4_modulelib/apache/libphp4.so to LoadModulephp4_module/usr/lib/apache/libphp4.so) [15] pico -w /etc/httpd/conf/srm.conf Find the following line in srm.conf #AddType application/x-httpd-php .phtml After this line, add the line AddType application/x-httpd-php .php .php4 .phtml This associates the .php file extension with PHP4 (If you want index.php to be served by default you need also to add this as well in the section UserDir web of the same file) # DirectoryIndex: Name of the file or files to use as a pre-written HTML # directory index. Separate multiple entries with spaces. DirectoryIndex index.html index.htm index.shtml home.html home.htm index.php index.php4 index.p$ *** ** FINISHING NOTES ** *** Still logged in as 'root' perform the following commands to stop and restart the HTTP server /etc/rc.d/init.d/httpd stop /etc/rc.d/init.d/httpd start -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Forms, ListBoxes, Validating Errors.
What I have is an issue with posting forms with Dynamic ListBoxes. What happens is when you fill the form out, and hit submit, it validates the form .. if there is a required field not filled out, it comes back and gives an error. All the textfields have all the information and the Static ListBoxes have all the information they filled out... But if the user selected a STATE (which is pulled dynamically) it will reset this box to the default setting. The dynamic listboxes are pulling great just not grabbing what user selected on post if an error occurs. Hope that makes sense. The File that makes the list boxes Listboxes.php *** function build_states_tree($output, $preselected) { $qid = db_query(SELECT id, name FROM states ORDER BY name ASC); while ($man = db_fetch_object($qid)) { $selected = in_array($man-id, $preselected) ? selected : ; $output .= option value=\ . ov($man-id) . \ $selected . ov($man-name) . /option; } } * I have a script SIGNUP.PHP -- Notice I have shortened a lot of this. * /* form has been submitted, try to create the new user account */ if (match_referer() isset($HTTP_POST_VARS)) { $frm = $HTTP_POST_VARS; $errormsg = validate_form($frm, $errors); if (empty($errormsg)) { adduser_info($frm); adduser_ins($file, $frm); $DOC_TITLE = Webspyder's Signup Successful; include($CFG-templatedir/signup_header.php); include($CFG-templatedir/signup_success.php); include($CFG-templatedir/signup_footer.php); die; } } $DOC_TITLE = Webspyder's Signup Page; include($CFG-templatedir/signup_header.php); /* build array for each seperate listbox */ $frm[states] = array(); $frm[services] = array(); $frm[phonenumbers] = array(); $frm[payments] = array(); $frm[hear] = array(); /* build the categories listbox options, preselect the top item */ build_states_tree($states_options, $frm[states]); build_services_tree($services_options, $frm[services]); build_phonenumbers_tree($phonenumbers_options, $frm[phonenumbers]); build_payments_tree($payments_options, $frm[payments]); build_hear_tree($hear_options, $frm[hear]); include(templates/signup_form.php); include($CFG-templatedir/signup_footer.php); /*** *** * FUNCTIONS */ function validate_form($frm, $errors) { /* validate the signup form, and return the error messages in a string. if * the string is empty, then there are no errors */ $errors = new Object; $msg = ; if (username_exists($frm[username])) { $errors-username = true; $msg .= liThe username b . ov($frm[username]) ./b is already in use. Please select another username and try again.; } for ($i = 0; $i count($frm[states]); $i++) { if (empty($frm[states][$i])) { $errors-state = true; $msg .= liYou must select your state!; } } } return $msg; } function adduser_info($frm) { // Information added by user inserted into the Customer Database ETCETC... ETC. * And a templates SIGNUP_FORM.PHP *** FORM CODE form name=signupform method=post action=https://***.com/signup.php SELECT STATE BOX select name=states[] option value= selectedPlease Select State/option ?=$states_options? /select ?err($errors-state)? -- Kacey A. Murphy Digitalicom Technologies Office: 864.582.5269 Cell: 864.266.7701 Email: [EMAIL PROTECTED] Web: http://www.digitalicom.com This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure. Digitalicom and/or Kacey A. Murphy does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. -Original Message- From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 4:47 AM To: 'Luke'; [EMAIL PROTECTED] Subject: RE: [PHP] Re: PHP Includes and Echoes in Head Sections and Search Engines On 15 January
[PHP] RE:AGAIN [PHP] Forms, ListBoxes, Validating Errors.
-Original Message- From: Richard Davey [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 6:43 AM To: Kacey A. Murphy Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Forms, ListBoxes, Validating Errors. Hello Kacey, Friday, January 16, 2004, 11:33:22 AM, you wrote: KAM What I have is an issue with posting forms with Dynamic ListBoxes. KAM What happens is when you fill the form out, and hit submit, it KAM validates the form .. if there is a required field not filled out, it KAM comes back and gives an error. All the textfields have all the KAM information and the Static ListBoxes have all the information they KAM filled out... But if the user KAM selected a STATE (which is pulled dynamically) it will reset this box KAM to the default setting. RD It will reset it when the page reloads with the error message, yes? KAM function build_states_tree($output, $preselected) { RD You already have the preselected variable in your function, so why not RD just pass in whatever the user previously selected back to it again? RD (i.e. over-ride whatever the initial preselected was?) I think that makes sense I will tweak the code for a little bit to see what comes of it. Just wasn't quite sure how to make the code correctly and efficiently. Thanks so much for the quick respons. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php