[PHP] PHP 4.3 JPG Support. Whats needed?
Hello, I'm trying to upgrade to php4.3 on a cobalt raq4 I have 4.1.2 with gd 1.6, but would like to use gd 2.0 Compiled 4.3 from source, everything seems to be fine except the JPG Support. http://www.kende.com/phpinfo.php './configure' '--prefix=/usr' '--with-apxs=/usr/sbin/apxs' '--with-gd' '--with-gettext=/usr' '--enable-safe-mode' '--with-config-file-path=/etc/httpd' '--with-exec-dir=/usr/bin' '--with-zlib' '--with-mysql' '--enable-magic-quotes' '--with-regex=system' '--with-ttf' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-track-vars' '--enable-wddx=shared' '--enable-mm=shared' '--enable-xml' '--enable-ftp' '--disable-debug' '--with-libdir=/usr/lib' '--with-ldap' '--with-imap-ssl' '--with-pdflib=shared' Can you tell me what's required for JPG Support? ./configure ?? Thanks :) Andras Kende -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Maximum execution time exceeded when using dial up
Hello, I have database while query which populates cells in a html table, but noticed if using a slow dial up connection its times out... Fatal error: Maximum execution time of 60 seconds exceeded in D:\website\eis-vieworderlookup.php on line 75 What's the best way to deal with this?? Thanks, Andras Kende -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] beginner: cut text after " "
Hello All, I have a very simple question: Want to remove the string after the first whitespace like: "here is a text what i have" to: "here" Thanks !! Andras Kende -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] beginner: remove the string after the first whitespace
Hello All, I have a very simple question: Want to remove the string after the first whitespace like: "here is a text what i have" to: "here" Thanks !! Andras Kende -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Insert into array...
Hello All, I would like to put 1 new field into this multidimensional array... $orders = 1 => Array (11) Name => JUDY Order => 334455 2 => Array (11) Name => MARY Order => 12590 TO: $orders = 1 => Array (11) Name => JUDY Order => 334455 Newitem => someting 2 => Array (11) Name => MARY Order => 12590 Newitem => something I can do one at the time like: $orders[1]['Newitem'] = "something"; But not for the whole array Thanks, Andras Kende -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Session Variables Not Being Set For Certain Browsers
-Original Message- From: Andy Higgins [mailto:[EMAIL PROTECTED] Sent: Saturday, December 27, 2003 6:04 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP Session Variables Not Being Set For Certain Browsers Hello All, I have been racking my head over a problem where a large percentage of users are unable to log into my php site due to what seems to be a problem with setting php session variables on certain end user browsers (certain versions of AOL seem to be particularly problematic). Below are some snippets of code that are used to do the authentication/ login. Has anyone encountered the same problem and if so do you have a solution? The only solution I can think of is to pass the session using PHPSESSION in the URL however I would like to avoid this if at all possible as it involves a major re-write of the code (as session variables are used elsewhere in the session) and if I am not mistaken if a user accesses a non-php page then the session is lost requiring them to log in again. Currently the following code is used to check whether a user is logged in: And in Login.php after doing a check on the username and password the following session variables are set: session_start(); session_register("authenticatedUser"); $HTTP_SESSION_VARS['authenticatedUser'] = $userId; session_register("loginIpAddress"); $HTTP_SESSION_VARS['loginIpAddress'] = $_SERVER["REMOTE_ADDR"]; It is the setting of the above session variables in Login.php that appears to be failing for some browsers resulting in users using these browsers continually being redirected to the Login page when the above check to see if they are logged in is done. Any help that could be supplied would be greatly appreciated. Thank you. Regards, Andy - Andy, Not sure, but maybe AOL users on proxy and their ip address can change. Andras Kende http://www.kende.com - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] passing variables + if case
Hi All, I new to php trying to do a php page which gets a variables from an html form Somehow this if case not working 100% Is this is a correct format ??? Thanks :) Andrew if ( (($name=="1") and ($passwd=="1") and ($city=="HOU")) or (($name=="2") and ($passwd=="2") and ($city=="LAX")) or (($name=="3") and ($passwd=="3") and ($city=="TAM")) ) { echo "bla bla ..etc."; } else { echo "Access Denied. Please check your password.; } ?> -- 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] if else and or ?
Hello, I started to do a php page with mysql connection.. My problem is: I do query from a mysql, I try to setup usernames + passwords to protect the database They would need to use specific user+password+cities to be able to connect. Bad passwd would just print an access denied messsage.. http://www.cmtsite.com/schedules/ name=1 passwd=1 city=HOU name=2 passwd=2 city=LAX name=3 passwd=3 city=TAM pl: http://www.cmtsite.com/schedules/media.php?city=HOU&name=1&passwd=1 Actually its working ok but i have add more user+pass but then it just goes to the }else statement ?? I really would like to store the usernames, passwords in the php code for simplicity... ATLWL 31128595 ATLSM 31128576 DFWSS 31133977 HOUFA 31146832 HOUBL 31146825 LAXSC 31152972 MIAJJ 31164255 TAMVH 31182684 TAMTK 31182685 Below my php file... Thanks for any help! Andrew > include ('../menu.html'); > > if > ( > (($name=="1") and ($passwd=="1") and ($city=="HOU")) > or > (($name=="2") and ($passwd=="2") and ($city=="LAX")) > or > (($name=="3") and ($passwd=="3") and ($city=="TAM")) > ) > { > > echo ""; > > echo ""; > > if (strstr($city,"HOU")) { > echo "Market: Houston, Texas"; > } > if (strstr($city,"LAX")) { > echo "Market: Los Angeles, California"; > } > if (strstr($city,"ATL")) { > echo "Market: Atlanta, Georgia"; > } > if (strstr($city,"TAM")) { > echo "Market: Tampa, Florida"; > } > if (strstr($city,"ORL")) { > echo "Market: Orlando, Florida"; > } > if (strstr($city,"DFW")) { > echo "Market: Dallas/Fort Worth, Texas"; > } > if (strstr($city,"BIR")) { > echo "Market: Birmingham, Alabama"; > } > if (strstr($city,"MIA")) { > echo "Market: Miami, Florida"; > } > > echo ""; > > $db=mysql_connect("zz.com:3306","zz","zz"); > mysql_select_db("cmt",$db); > > if (strstr($city,"HOU")) { > $aresult=mysql_query("select * from media where d like '%HOU%' or d like '%MCA%' or d like '%BMT%' order by i" ,$db); > } > else { > $aresult=mysql_query("select * from media where d like '$city' order by i" ,$db); > } > > echo " > > > Market > Station > Local Date > TV Date > Log Action > Log Date > "; > > while($amyrow = mysql_fetch_array($aresult)) > { > echo ""; >echo $amyrow["d"]; > echo ""; > echo $amyrow["c"]; > echo ""; > echo $amyrow["i"]; > echo ""; > echo $amyrow["j"]; > echo ""; > echo $amyrow["f"]; > echo ""; > echo $amyrow["k"]; > echo ""; > } > > echo ""; > > echo ""; > > include ('../sql-bottom.html'); > > } else { > > echo "Access Denied. Please check your password."; > > } > > echo ""; > > > ?> -- 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] PHP Mysql query data conversion newbie
Hello, I pull some data from mysql with the php code below. On the date field if there is no date on mysql it displays : -00-00 00:00:00 I would like to change this -00-00 00:00:00 to "no date" for example.. Or if the cel is empty to " " (because otherwise the tableborders are messed up) I tried to put an if statement inside the while {} but i cannot figured out... Thank You, Andras {$aresult=mysql_query("select * from media where d like '$city' order by i" ,$db);} while($amyrow = mysql_fetch_array($aresult)) { echo ""; echo $amyrow["i"]; echo ""; echo $amyrow["j"]; echo ""; echo $amyrow["f"]; echo ""; } -- 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] PHP Mysql query data conversion newbie
Can I set this to check any of the cells ?? if ($amyrow["any cell"] == "-00-00 00:00:00") { echo "no date"; - Original Message - From: "Jon Haworth" <[EMAIL PROTECTED]> To: "'Andras Kende'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, May 09, 2001 9:09 AM Subject: RE: [PHP] PHP Mysql query data conversion newbie > Well, it's not immediately obvious whether your date is in "i", "j", or "f", > so let's pretend it's in "date" :-) > > Try this: > while($amyrow = mysql_fetch_array($aresult)) > { > echo ""; > echo $amyrow["i"]; >echo ""; > echo $amyrow["j"]; >echo ""; > echo $amyrow["f"]; >echo ""; >if ($amyrow["date"] == "-00-00 00:00:00") { > echo "no date"; >} else { > echo $amyrow["date"]; >} >echo ""; > } > } > > HTH > Jon > > > > > -Original Message- > From: Andras Kende [mailto:[EMAIL PROTECTED]] > Sent: 28 April 2001 17:01 > To: [EMAIL PROTECTED] > Subject: [PHP] PHP Mysql query data conversion newbie > > > Hello, > > I pull some data from mysql with the php code below. > On the date field if there is no date on mysql it displays : -00-00 > 00:00:00 > > I would like to change this -00-00 00:00:00 to "no date" for example.. > > Or if the cel is empty to " " (because otherwise the tableborders are messed > up) > > I tried to put an if statement inside the while {} but i cannot figured > out... > > > Thank You, > > Andras > > > > {$aresult=mysql_query("select * from media where d like '$city' order by i" > ,$db);} > > while($amyrow = mysql_fetch_array($aresult)) > { > echo ""; > echo $amyrow["i"]; >echo ""; > echo $amyrow["j"]; >echo ""; > echo $amyrow["f"]; >echo ""; > } > > > -- > 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] > > > > ** > 'The information included in this Email is of a confidential nature and is > intended only for the addressee. If you are not the intended addressee, > any disclosure, copying or distribution by you is prohibited and may be > unlawful. Disclosure to any party other than the addressee, whether > inadvertent or otherwise is not intended to waive privilege or > confidentiality' > > ** > > -- > 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 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] Mysql Curdate problem
Hello, I have a php page which list a table from a mysql database. Dates can be selected like last 7 days, last 14 days .etc It worked perfect till midnight :( The query is something like: $aresult=mysql_query("select * from orders WHERE (a3 >= CURDATE()-$datec)" ,$db); I looking for some advice hos to modify my query or the php code.. Thanks Andras Kende -- 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] str_replace question
Is a nicer way to remove any number 1-0 from a string??? Currently: $metakeywords=str_replace("1",'',strtolower($metakeywords)); $metakeywords=str_replace("2",'',strtolower($metakeywords)); $metakeywords=str_replace("3",'',strtolower($metakeywords)); $metakeywords=str_replace("4",'',strtolower($metakeywords)); $metakeywords=str_replace("5",'',strtolower($metakeywords)); $metakeywords=str_replace("6",'',strtolower($metakeywords)); .. Thanks :) Andras Kende -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ZIP/STORE LOCATOR
Hello All, I looking for a php ZIP/STORE LOCATOR for website.. Anyone knows where to look?? Thanks, Andras Kende -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php zip/store locator code.....
Hello All, I looking for a zip / store locator based with php/mysql I find this 2 similar but no luck yet. http://px.sklar.com/author.html?author_id=296 http://www.sanisoft.com/ziploc/ Any where should I look around... Thank, Andras Kende -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDF creation with PDF-LIB samples?
Hello, Trying to create some pdf documents on the fly with php and mysql.. I search the web but not yet found any easy way to do this... Tried Yaps but it requires ghostscript which didnt install on a cobalt raq4 because it it requires some more programs (glibc...etc..)... Anyone can give some hint where to start? Thanks, Andras Kende -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Got an error reading communication packets
I noticed some of my websites written in php with mysql are freezing looked around the logfiles: MYSQL ERROR LOG 020413 14:38:59 Aborted connection 1 to db: 'riderx' user: 'riderx' host: `localhost' (Got an error reading communication packets) APACHE ERROR LOG: [Sun Apr 14 22:23:32 2002] [notice] child pid 29360 exit signal Segmentation fault (11) Cobalt Raq4i Apache version 1.3.20 PHP 4.1.2 MySQL 3.23.37 Where is the problem ?? Is the apache, php or mysql settings are misconfigured?? Any idea what would be the best way to fix it?? Best regards, Andras Kende -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] meta tags from mysql
Hello All, I looking to to generate different meta tags from mysql for each page on a dynamic site which has about 400 pages from mysql database . Searched around but didnt find anything which will give me some hint whats the best way doing it Any help appreciated :) Thanks, Andras Kende [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] substr trim functions..
I trying to convert some full names to last names only like: -get the subtext from the end until the space "joe blue" -> "blue" "bill western" - "western" Looked around at php.net docs but im not sure... Thanks Andras -- 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] totals from a mysql query
Hello, I have a php page which pull data from myusql database... I'm new to php so I looking for some advice ... I have a field which contains numbers and needed to have them totaled after the query below the table... Database: |text1|text2|total| |some|tfdfd|100| |string|adfa|250| |made|tofd|150| total should be : 100+250+150 Query: {$aresult=mysql_query("select * from testdb ,$db);} while($amyrow = mysql_fetch_array($aresult)) { echo ""; {echo $amyrow["text1"];} echo ""; {echo $amyrow["text2"];} echo ""; } echo ""; echo "all together : total"; total is : 500 Thanks, Andras Kende -- 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] Question about /tmp/php* files
Hello, I noticed there are a lot of php temp files (session files) under /tmp Whats the best way to dealing with this... Thanks Andras -- 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] Alternative to phpMyAdmin
Steph, This one is cgi based and works well too.. http://www.gossamer-threads.com/scripts/mysqlman/index.htm Why phpMyAdmin doesn't work on the new server? maybe you need newer development versions? Andras - Original Message - From: "Steph" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 11, 2001 9:00 PM Subject: [PHP] Alternative to phpMyAdmin Hi all! I love phpMyAdmin, just makes life so easy :) But I just moved my site, and phpMyAdmin isnt working on my server yet, so does any one have any solid alternatives that I can install?? Thanks, Steph -- 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] php authentication system
Hello, I need to password protect some webpages right now its passwords everywhere Probably need some cookie based php authentication system where users login once Where can I find a simple but good script?? Thanks :) Andras -- 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] begginer how to make integer ?
Hello, I have a query but it not creating integer result: $saleprice=$amyrow["saleprice"]+$saleprice; $squarefeet=$amyrow["squarefeet"]+$squarefeet; $dom=$amyrow["dom"]+$dom; result: Total listings: 18 -- Average Price: $339166.6667 Average Square Foot: 1596.61 Average DOM: 52.5556 Average Price Per Square Feet: 212.42910330909 But I need Integer numbers like 339166 , 1596 Thanks :) Andras -- 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] insert hyperlink to mysql query result
Hello, I have a mysql query with addresses , trying to insert a link to a map line 51 echo "http://www.expedia.com/pub/agent.dll?qscr=mcst&strt1=$amyrow["address";] &city1=$amyrow["city"]&stnm1=CA&zipc1=&cnty1=4>Map"; echo ""; Error Message: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/sites/site15/web/salescomps.php on line 51 I think its the " character is the problem like :$amyrow["address"] Any help apprecciated, Thanks Andras -- 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] search engine friendly php + form
Hello, I was successfully created search engine friendly php from a tutorial on zend site.. like: salescomps.php?city=Canada&month=feb&year=2000 to salescomps.php/cityCanada/month/feb/year/2001 Is there any way to modify a submit form to result a page with search engine friendly format without using GET or POST ( / ) ?? Thanks, Andras -- 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] insert space to a string (newbie)
Hi, I have a simple question... How can a space inserted to a string after the 3rd char ?? washington ->> was hington Thanks :) Andras -- 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] string conversion
Hi, I trying to cut the last 4 char of a string but sometimes its cut 3 sometime 4 char $pic1=$amyrow["picture"]; $pic2 = substr("$pic1", 0, -4); Actually I have some pictures where I need to cut off the extensions... amamm.jpg 33.jpg 321.gif to amamm 33 321 Is any other way than substr to do this ?? Thanks Andras -- 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] GIF instead of JPG..
> Hi, > I found this beautiful piece of code on the php site which make a > proportional thumbnail, problem is its only working with JPEG files...and > not with GIFs, can someone please help me convert it to GIF too? > > I tried but got a bit confused as there are no functions that are equal to > "imagecreatetruecolor" that is in the below script. > The below script works perfectly for jpgs: > > > // The file > $filename = 'test.jpg'; > > // Set a maximum height and width > $width = 200; > $height = 200; > > // Content type > header('Content-type: image/jpeg'); > > // Get new dimensions > list($width_orig, $height_orig) = getimagesize($filename); > > if ($width && ($width_orig < $height_orig)) { >$width = ($height / $height_orig) * $width_orig; > } else { >$height = ($width / $width_orig) * $height_orig; > } > > // Resample > $image_p = imagecreatetruecolor($width, $height); > $image = imagecreatefromjpeg($filename); > imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, > $width_orig, $height_orig); > > // Output > imagejpeg($image_p, null, 100); > ?> > > > Beautiful, isnt it? Hats off to whoever wrote it and three cheers for the > online manual! > > Thanks, > Ryan > > > > > > > > -- > No virus found in this outgoing message. > Checked by AVG Anti-Virus. > Version: 7.0.308 / Virus Database: 266.8.0 - Release Date: 3/21/2005 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Hello Ryan, Im using the code below and works fine ... Best regards, Andras Kende http://www.kende.com // // -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fpassthru(); corrupts files on win 5.0.4 ??
Hello, windows 2003 server iis6 with php 5.0.4 isapi... The following code was working perfectly on 5.0.3 since 5.0.4 upgrade dowloaded files gets corrupted.. Any hint where the problem could be? Thanks, Andras Kende http://www.kende.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql regexp select questions
I would like to do the following: mysql db: andrew anthony joe janice john simon sql_query ( select names . I would need only the distinct first character from the query result would be: a,j,s I think maybe its REGEXP but never did it before... Thanks!! Andras Kende -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] crypt salt question
Hello, I'm trying to move some app from postgresql to mysql but unable to find out how to authenticate against the current crypted passwords with php.. insert to database: $cset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; $salt = substr($cset, time() & 63, 1) . substr($cset, time()/64 & 63, 1); $password = crypt($password, $salt); //pass crypted version of password for further processing $result = pg_query ("INSERT INTO users (username, password) VALUES ('$username', '$password')"); I read the crypt is one way encryption but how to compare the password entered with the encrypted version if don't know the salt ?? Thanks, Andras
RE: [PHP] crypt salt question
I figured out finally:) Actually the random salt is always the first 2 character of the encryoted password, so this works fine now : Thanks, Andras -Original Message- From: Satyam [mailto:[EMAIL PROTECTED] Sent: Thursday, August 30, 2007 3:00 PM To: Andras Kende; php-general@lists.php.net Subject: Re: [PHP] crypt salt question No chance. Unless you have the salt stored along each password, your passwords are as good as random texts Satyam - Original Message - From: "Andras Kende" <[EMAIL PROTECTED]> To: Sent: Thursday, August 30, 2007 11:42 PM Subject: [PHP] crypt salt question > Hello, > > > > I'm trying to move some app from postgresql to mysql but unable to find > out > how to authenticate > > against the current crypted passwords with php.. > > > > insert to database: > > > > $cset = > "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; > $salt = substr($cset, time() & 63, 1) . substr($cset, time()/64 & 63, 1); > $password = crypt($password, $salt); //pass crypted version of password > for further processing > > > > $result = pg_query ("INSERT INTO users (username, password) VALUES > ('$username', '$password')"); > > > > I read the crypt is one way encryption but how to compare the password > entered with the encrypted > > version if don't know the salt ?? > > > > > > Thanks, > > > > Andras > > No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.484 / Virus Database: 269.12.12/979 - Release Date: 29/08/2007 20:21 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_fetch_array to associative array
Hello, I use the following GetArray for returning an array from mysql results. But having a hard time modifying it for returning a simple associative array Like: $conn->GetAssoc('SELECT id, name from manufacturers') Array ( [2] => BMW [1] => MAZDA [9] => FORD ) function GetArray($query) { $get = $this->Execute ( $query ); $row_id = 0; while ( $row = mysql_fetch_array($get) ) { foreach ( $row as $key => $value ) $result[$row_id][$key] = $value; $row_id++; } mysql_free_result($get); return $result; } function GetAssoc($query) { $get = $this->Execute ( $query ); $row_id = 0; while ( $row = mysql_fetch_array($get) ) { ? } mysql_free_result($get); return $result; } I searched a lot but didn't find anything. Thanks for any help :) Andras -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql_fetch_array to associative array
-Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Monday, July 16, 2007 7:52 AM To: Andras Kende Cc: php-general@lists.php.net Subject: Re: [PHP] mysql_fetch_array to associative array On Mon, 2007-07-16 at 07:41 -0700, Andras Kende wrote: > Hello, > > I use the following GetArray for returning an array from mysql results. > > But having a hard time modifying it for returning a simple associative array > > Like: > > $conn->GetAssoc('SELECT id, name from manufacturers') > > Array ( [2] => BMW [1] => MAZDA [9] => FORD ) > > > function GetArray($query) { > $get = $this->Execute ( $query ); > $result = array(); > while ( $row = mysql_fetch_array($get) ) { $result[] = $row; > } > mysql_free_result($get); > > return $result; > } > > > function GetAssoc($query) { > $get = $this->Execute ( $query ); > $result = array(); > while ( $row = mysql_fetch_array($get) ) { $result[] = $row; > > } > mysql_free_result($get); > > return $result; > } > > I searched a lot but didn't find anything. > > Thanks for any help :) You're welcome. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... Hi Rob, Thanks for your help, its associative but I forget to mention its needs To be a single dimensional associative array. $result = array(); while ( $row = mysql_fetch_assoc($get) ) { $result[] = $row; } This creates multi dimensional like: Array ( [0] => Array ( [0] => 3 [1] => BMW ) [1] => Array ( [0] => 1 [1] => Mercedes ) ) I tried to play with foreach and array_push but still not perfect Thanks, Andras -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql_fetch_array to associative array
-Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Monday, July 16, 2007 1:46 PM To: Andras Kende Cc: php-general@lists.php.net Subject: RE: [PHP] mysql_fetch_array to associative array On Mon, 2007-07-16 at 13:37 -0700, Andras Kende wrote: > > Hi Rob, > > Thanks for your help, its associative but I forget to mention its needs > To be a single dimensional associative array. > > > $result = array(); > while ( $row = mysql_fetch_assoc($get) ) { > $result[] = $row; > } > > This creates multi dimensional like: > > Array ( [0] => Array ( [0] => 3 [1] => BMW ) [1] => Array ( [0] => 1 [1] => > Mercedes ) ) > > I tried to play with foreach and array_push but still not perfect I'm not sure I understand... you have multiple rows being returned do you not? How to you intend to handle them in a single level array? Let's image the following rows are returned from the database: array ( 'title' => 'The Dragonbone Chair', 'author' => 'Tad Williams', ), array ( 'title' => 'Sword of Shannarah', 'author' => 'Terry Brooks', ), Show me how you would like the final array to look and I can figure out the code you need to organize it the way you want. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... Hi Rob, $conn->getassoc(select id,name from cars) I would need a single array like: (its for used with pear:quickform dropdown) Array ( [2] => BMW [1] => FORD ) Or: Array ( [The Dragonbone Chair] => 'Tad Williams' [Sword of Shannarah] => 'Terry Brooks' ) Thanks a lot, Andras -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql_fetch_array to associative array
-Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Monday, July 16, 2007 6:12 PM To: Andras Kende Cc: php-general@lists.php.net Subject: RE: [PHP] mysql_fetch_array to associative array On Mon, 2007-07-16 at 13:37 -0700, Andras Kende wrote: > > > function GetAssoc($query) { > > $get = $this->Execute ( $query ); > > > $result = array(); > > while ( $row = mysql_fetch_array($get) ) { > $result[] = $row; > > > > } > > mysql_free_result($get); > > > > return $result; > > } I'll focus on the above one since that's probably what's causing your grief... I'm also going to rename it so it's more explanatory: Execute ( $query )) ) { while( ($row = mysql_fetch_assoc( $get )) ) { $pairs[$row[$keyField]] = $row[$valueField]; } mysql_free_result( $get ); } return $pairs; } ?> That's the function... it creates an array of pair mappings based on the table fields $keyField and $valueField. So let's say you have the following table in your database: CREATE TABLE cars ( id int not null auto_increment, namevarchar( 32 ) not null, primary key( id ) ); Then you might issue the following function call: Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Rob, THANKS I also hacked together a version: while ( $row = mysql_fetch_array($get) ) { $result[$row[0]] = $row[1]; } Best regards, Andras -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Add Multiple Items, Qty to Cart from html form
Hello, I trying to add multiple items to a shopping cart with selectable quantity and price form text field like.. apple : qty: [__] price: [__] orange : qty: [__] price: [__] I could add multiple items with checkboxes but without selecting quantity and price.. if (isset($_POST['itemschecked'])) { foreach($_POST['itemschecked'] as $itemschecked => $checkeditems ){ AddItem($checkeditems, 1); } Any help is appreciated.. Thanks, Andras -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Add Multiple Items, Qty to Cart from html form
-Original Message- From: Wolf [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 17, 2006 9:47 PM To: Andras Kende Cc: php-general@lists.php.net Subject: Re: [PHP] Add Multiple Items, Qty to Cart from html form Andras, Apples Will get you where you need to go on the HTML side of things, then on the back end you need to process each array. By setting a default value of 0 for the qty, you force users to change the values, but you also keep your arrays intact and easier (IMHO) to deal with. Wolf Andras Kende wrote: > Hello, > > I trying to add multiple items to a shopping cart with selectable > quantity and price form text field like.. > > apple : qty: [__] price: [__] > orange : qty: [__] price: [__] > > > > I could add multiple items with checkboxes but without selecting > quantity and price.. > > if (isset($_POST['itemschecked'])) { > foreach($_POST['itemschecked'] as $itemschecked => $checkeditems ){ > AddItem($checkeditems, 1); > } > > Any help is appreciated.. > > Thanks, > > Andras Wolf, The tip worked great !! All working as expected now... $listvals=$_POST['item']; $n=count($listvals); $i=0; while ( $i < $n ) { if ($qty[$i] > 0) { AddItem($item[$i], $qty[$i]); UpdatePrice($item[$i], $price[$i]); } $i++; } Thanks, Andras Kende http://www.kende.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] serving video files with php
Hello, Is there any drawback servings video files through php downloader script on high load site? Or just straight link to the videos are more efficient? Thank you, Andras Kende http://www.kende.com
[PHP] newbie web services
Hello, I want to create a simple web service. So far tried NuSoap but don't know how to modify its default xml envelope.. I could create REST for response but not sure about how to process the request, maybe with simplexml ? RAW DATA: Request: 5 Response: Jones Please give any info for an easy implementation.. It will hosted on IIS6 PHP5. Thanks, Andras Kende [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Apache 2.0.52 / PHP 4.3.10 Integration Question...
-Original Message- From: Robin Getz [mailto:[EMAIL PROTECTED] Sent: Friday, December 31, 2004 1:40 PM To: php-general@lists.php.net Subject: [PHP] Apache 2.0.52 / PHP 4.3.10 Integration Question... Hi. I am trying to get Apache 2.0.52 / PHP 4.3.10 working with some scripts I am using. I have a file named /www/projects which is a php script. When I type the url: www.site/projects/variable I want variable passed to the script "projects" I have the the http.conf set up as: SetInputFilter PHP SetOutputFilter PHP AcceptPathInfo On Which used to work with apache 2.0.40 and php 4.2.3 - but what happens now, is I actually get passed the php script back as text to the browser. Any thoughts? I poked around on google, and saw at http://dan.drydog.com/apache2php.html "However, SetOutputFilter / SetInputFilter no longer works for me. It used to work with an earlier PHP 4.x or Apache 2 version, but not with Apache 2.0.47/PHP 4.3.3. I understand this (PHP as an Apache 2 filter) is experimental, so I don't use it anymore" I tried things like: AddType text/html php But I keep getting the same thing in my browser: Any thoughts? Thanks in advanced. -Robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hello, You could also do it like this if don't want to use / .htaccess or httpd.conf RewriteEngine On RewriteRule ^list-(.*) list.php RewriteRule ^design-(.*) design.php http://www.juhaszdesign.com/list-barstools.html http://www.juhaszdesign.com/design-hastings-barstool.html Andras Kende http://www.kende.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 404 Not Found -> refresh to directory
-Original Message- From: Terry Romine [mailto:[EMAIL PROTECTED] Sent: Thursday, July 14, 2005 3:52 PM To: php Subject: [PHP] 404 Not Found -> refresh to directory I have a website that has several hundred agents in a mysql database. The client wants to be able to enter the domain.com/agentname and be redirected to a standard page where we show the agent information. An example would be an agent named John Smith whose agentname would be jsmith. So the user would enter domain.com/jsmith and get the agent's profile. I tried initially to dummy up a 404 page, where if the link was like: domain.com/jsmith that it would parse the agent name and pass it through to domain.com/agent_profile.php?agent=jsmith. It failed to work, ending up with a recursive call to the 404 page and getting hung. Right now, I have directories set up for each agent, with an index.php that does the redirect. It's really getting to be a mess with so many directories. I need to be able to check the mysql database for the agent name, and if found, do a redirect (header("Location: agent_profile.php?agent=agentID") and if not, continue to a standard 404 error page, or a "sorry not found" page. I think my question is: is there an easy way to use a 404 page written in php to capture the parameters from the missing page request and test against a db, resulting in either a valid page redirect or a not found redirect? Terry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php .htaccess: RewriteEngine on RewriteRule ^([\w-]+)$ index.php/$1 index.php: Best regards, Andras Kende http://www.kende.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Large forms to Mysql table...
Hello, I have a html page with 70+ form fields some like 40 fields are only used for entering quantity numbers… Is it a good idea to put this 50 fields of the form fields into a single text mysql field? Somehow process it with php before, put inside of some kind of xml structure? Just don’t want to do Mysql table with 70 fields… Thanks, Andras Kende http://www.kende.com -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 0.0.338 / Virus Database: 267.10.8/71 - Release Date: 8/12/2005
[PHP] build sql query struture and values from form fields
Hello, I would like to create the mysql insert query for my html form fields, I have a small problem it will have an extra , at the end of $sqlstruct And extra "" at $sqldata.. Anyone can give a hint ? foreach ($_POST as $variable=>$value){ $sqlstruct.=$variable","; $sqldata.=$value."\"','\""; } $query="insert into db ($sqlstruct) VALUES ($sqldata)"; Best regards, Andras Kende http://www.kende.com -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.10.13/78 - Release Date: 8/19/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imagestring to picture
Hello, I have a some colorful pictures, Would like to add white text with black background around the white text... I can add the text fine but could figure out how to add black background.. $textcolor = imagecolorallocate($destimg, 255, 255, 255); imagestring($destimg, 3, 10, 10, "test text", $textcolor); imagejpeg($destimg); Best regards, Andras Kende http://www.kende.com -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.10.13/78 - Release Date: 8/19/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php session in ie
- Original Message - From: "sunaram patir" <[EMAIL PROTECTED]> To: Sent: Friday, November 11, 2005 5:31 AM Subject: [PHP] php session in ie Hi, i am having problem with internet explorer. i am working on a project on building a website where i need to keep track of the users i.e. i use a login system in there in short. with the following code i check whether the user is logged in or not. if the user is not logged in, it redirects to the login page login.php as is shown in the above code. now the user is allowed to log in through the following code: header("Location: http://schools.zenrays.com".$_SESSION['myurl']); else header("Location: http://schools.zenrays.com/students";); } } ?> User Authentication LoginID: Password: then the user is redirected back to the page he visited. it workd fine in firefox and msn explorer. in internet explorer, when i visit to a link in any page it asks for the login details again. could anyone please help me out?! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hello, I used this article for sessions with success http://www.sitepoint.com/article/users-php-sessions-mysql Best regards, Andras Kende http://www.kende.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php