[PHP] PHP graphs
Hi guys, I would like to read the IP address from a PC that connects to my web site. Any function does that in PHP? Secondly, I'd like to trace a basic X/Y graph with data provided from a DB, any PHP help? Thx. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] JP Graph
Hi all, I'm using JPGraph on a localhost for a website opened via a host redirect. My problem is that nobody can see the graphs but me ('cause I'm on localhost). Any clues? Thx. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] about socket_set_timeout
I have windows 98 sr 2 and php 4.1.1 installed. When i call the function socket_set_timeout, i got a socket_set_timeout supported in this php build". What am i supposed to do ? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] deleting $_SESSION
--- AndreaD <[EMAIL PROTECTED]> wrote: > I have a session variable called > > $_SESSION['total'] the problem is I can't > delete/reset it. I have tried Try unset. unset($_SESSION['total']); http://us4.php.net/manual/en/function.unset.php -k. __ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Image and PHP
--- Mario de Frutos Dieguez <[EMAIL PROTECTED]> wrote: > I have a page where i place an image but i want when > i show the image delete it. How can i do this? Some good suggestions so far but to be a little more explicit this is how you would do it. Essentially you want to have your image tag point to a script, have that script pass the image to the browser then delete the image. Please note, this example code, for simplicity sake, leaves out any security precautions. On you main page you'll have an image tag like: Then show_image.php will look something like this: Remember though, as written you need to do some validation on $filepath, because as is, this script will pass anything to the user that is contained in $_GET['image_name'] then delete it, so be careful. -k. __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php defense
As i recall Yahoo uses PHP. Quick Google turned up: http://public.yahoo.com/~radwin/talks/yahoo-phpcon2002.htm Also i remember it was a pretty big deal when Friendster switched to PHP. And the resulting improvement in performance was pretty dramatic. O'Reilly has a good article. http://www.oreillynet.com/pub/wlg/5155 Google around some, especially on the Friendster switch, which as I recall caused quite a stir, for more information. -k. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [NOVICE] SSL use
> > from my php script, do i need to make a special > > connection to the database > > or is the same e.g pg_connect(host= localhost > >dbname=test user=p > > password=p)? > > You could add "sslmode=require" to attempt only an > SSL connection. I have couple related questions: Is this necessary if the database is running on the same machine (as implied by "host= localhost")? If so why? Is it possible to make an SSL connection between Apache and Postgres using Unix-domain sockets? -k. __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Restricting browser's a password manager pop-up
> The yes part is that it only appears based on the > browsers "intelligence" in scanning the name of your > form fields. Change "username" and "password" to > something, well.. more obtuse, and it often gets rid of > the problem. Give it a shot and see which combination > works for you. You may also try adding autocomplete="Off" in your password input tag. -k. __ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySql injections (related question)
I have a related question, many of you have suggested using addslashes on your variables to prevent SQL injections, but is it safer to use mysql_real_escape_string (or mysql_escape_string)? What is the benefit / cost of using mysql_real_escape_string rather than addslashes? When using Postgres i always use pg_escape_string on anything i send the DB's way. In fact the manual says specifically to use pg_escape_string rather than addslashes (however it doesnt give that advice in mysql_real_escape_string )... http://us3.php.net/manual/en/function.pg-escape-string.php Not being familiar with the internals of any of these functions, i'm wondering which are safer or do they do approximately the same thing? Is there any difference in performance? Which method do you use and why? -k. __ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP error on form
--- Bruce Gilbert <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to get a form to work integrating html > with PHP. I see a couple problems... This line: > if ($POST['sender_email'] =="") { Should probably be: if ($_POST['sender_email'] =="") { Note the underscore in $_POST Same thing here: > if ($POST['message'] =="") { Should probably be: > if ($_POST['message'] =="") { You are getting errors here: $msg .="Senders Name: $_POST['senders_name']\n"; $msg .="Senders E-MAIL: $_POST['senders_email']\n"; $msg .="Senders Name: $_POST['message']\n\n"; $to ="[EMAIL PROTECTED]"; $subject = "There has been a disturbance in the Force"; $mailheaders .="Reply-To: $_POST['sender_email']\n"; You can't echo out the post vars like that these lines need to look like: $msg .="Senders Name: ".$_POST['senders_name']."\n"; $msg .="Senders E-MAIL: ".$_POST['senders_email']."\n"; $msg .="Senders Name: ".$_POST['message']."\n\n"; $to ="[EMAIL PROTECTED]"; $subject = "There has been a disturbance in the Force"; $mailheaders .="Reply-To: ".$_POST['sender_email']."\n"; It sounds like the error on line 58 (whatever that is) is probably something similar to the last problem. -k. Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Job for SQL or PHP?
Just for the sake of example let's say i keep track of all of a customers previous orders in a table like this: Last_Order -- Cust_ID Item_No No_ordered When a customer places an order i put the order details in an a table like this: Orders --- Order_ID Cust_ID Item_No No_ordered Let's say when my customer returns he decides he wants everything he ordered previously plus some other stuff. Assuming this customer has unique customer ID of 345 and his current new order id is 678. Can i copy his last order into the orders table with just a SQL statement like: INSERT INTO Orders VALUES ('678',(SELECT * FROM Last_Order WHERE Cust_ID = '678')) What i want to do is grab all the data from Last_Order associated with cust_id 345 (or whatever) and insert it into the Orders table with a Order_ID in this case 678. Let me know if this isnt clear. This SQL obviously doesn't work, however, my question is there a way to do this with SQL alone? Or do i need to grab all the records from the Last_Order table loop through the record set and insert each new row into Orders individually? -k. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Job for SQL or PHP?
--- "Kristen G. Thorson" <[EMAIL PROTECTED]> wrote: > Try > > INSERT INTO Orders (SELECT '678',Cust_ID,Item_No,No_ordered FROM > Last_Order WHERE Cust_ID = '678') Thanks that nailed it. You rock. -k. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular expressions book
Has anyone here tried to learn Regular expressions with RegexBuddy? http://www.regular-expressions.info/regexbuddy.html It looks pretty cool, and even has some PHP specific stuff, but you have to pay to play. -k. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with PEAR:SOAP
I just installed the SOAP Pear package (version 0.9.1) when i try and: require_once('SOAP/Client.php'); i get the following errors: Warning: main(HTTP/Request.php): failed to open stream: No such file or directory in /usr/local/lib/php/SOAP/WSDL.php on line 27 Fatal error: main(): Failed opening required 'HTTP/Request.php' (include_path='.:/usr/local/lib/php') in /usr/local/lib/php/SOAP/WSDL.php on line 27 Line 27 in WSDL.php is, as you might guess, require_once 'HTTP/Request.php'; I looked in /usr/local/lib/php/ and there is no HTTP directory (much less a Request.php). I have the HTTP PEAR package installed (Version 1.3.6 ). My question is should installing the HTTP package put these files in /usr/local/lib/php ? If not what are these files? And where do i get them? Am i missing a dependency or something? Did i install HTTP incorrectly? -k. __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with PEAR:SOAP [solved]
--- Jasper Bryant-Greene <[EMAIL PROTECTED]> wrote: > Install the HTTP_Request package. That did it. Anyone know why the SOAP package didn't complain about this when i installed it? -k. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Webservices and PHP?
You may also check out SOAP. There is a SOAP PEAR package... http://pear.php.net/package/SOAP With PHP 5 you can compile in a SOAP extension. http://www.php.net/SOAP I know you said you were running PHP 4.3.11 so the SOAP extension may not be an option. I think a little googling with PHP and SOAP should turn up some pretty good results for you. -k. __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Curl problems
Here is my problem. I need to post an XML file to someone else's server. I'm trying to do this with the curl package. Once I post the XML file to the other server one of two things will happen. The server will either take the info in the XML file and forward the user along to some other page or the page will return some errors, if for example there is something wrong with the XML i send. What I would like to do is post the data to the other server and if everything is OK just allow the user to be forwarded along, otherwise Id like to catch whatever errors the server spits back. Setting this up on two of my development boxes seems to work fine. However when I try to send this to the other server (which i have no control over) it doesnt work. It's seems like it is having trouble redirecting my request. When I send the request I get a Server Error in '/' Application which looks to be like a generic ASP error( I guess). If I comment out the FOLLOWLOCATION curl_setopt line all I get in response, other than headers, is "Object moved" message with a link, the link however seems like a relative link because if i click on it tries to find the linked page on my server. I'm wondering if something in my request is breaking whatever forwarding goes on internally. Stiped to the basics this is my script: https://somebody.else.com/this/some_script.aspx";; $postfields = array(); $postfields['some_xml'] = urlencode($some_xml_ive_generated); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); $output = curl_exec($ch); curl_close($ch); print $output; ?> A couple of things: -I'm pretty new to curl so i could easily be overlooking something. -The https:// doesn't seem to be the problem -Generating a form that submits itself with javascript when loaded seems to work fine. -The url in my location bar never seems to change even when i post between my two development boxes and my simple response test script works. -I have no idea what happens nor any control over the other box. I've e-mailed my contact there with no response. -The other box is running IIS6 with ASP (or at least that is what headers from it claim). -The https://somebody.else.com/this/some_script.aspx link (the actual one not the one used here is definitely correct). -Am i screwing up the headers or something? -Is what Im doing even possible? Any suggestions for things to try? Or simple things Ive overlooked? Ive googled around and read a few basic curl tutorials but they havent helped me sort this out. -k. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SOAP problem, (related to gethostbyname?)
I'm using the PEAR Soap package and having problem accessing another sites's webservices. When i do something like this: getProxy(); $web_service_result = $client -> some_web_service($param1,$param2,$param3,$param4); ?> $web_service_result returns the soap_fault Object. The message portion contains the line "curl_exec error 6 Couldn't resolve host 'secure.example.com' " Also if i try to grab the WSDL file from the remote server the script doesn't seem to grab the WSDL ( i get a bunch of "Passed variable is not an array or object" errors ). I think the problem is curl can't resolve the hostname. Also if i run http://bugs.php.net'); ?> It echos "http://bugs.php.net";, no good. When i try something like https://secure.example.com/index.html'; $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER,TRUE); $result = curl_exec($ch); $cur_error = curl_error($ch); curl_close($ch); echo $result; echo " Error: ".$cur_error; ?> It doesn't echo out anything, however if run "curl https://secure.example.com/index.html"; from the command line i get back the page found at that address. I'm running PHP Version 4.3.4 with CURL support enabled (CURL Information: libcurl 7.9.8 (OpenSSL 0.9.7c) (ipv6 enabled) ) on Red Had. If i ping 'secure.example.com' the address resolves properly. Any tips on things to try? Should i reinstall curl? SSL? Anything else i should investigate? -k. __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Trouble moving directory
I'm having trouble moving some directories. My script works fine on some directories but doesn't move others. It seems to have trouble with directories with non alphanumeric charters. I'm running Red Hat FC2. I'm trying to move the directory basically like this... Is there some way to escape the characters in the directories? For example if i put a "\" in front of blank spaces it takes care of those (same for "'","(" etc.) but that obviously doesn't take care of everything. I'm hoping there is something easy i'm overlooking here that will escape all the characters. -k. __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trouble moving directory
--- Jasper Bryant-Greene <[EMAIL PROTECTED]> wrote: > $source_dir = escapeshellarg( '/some/dir/Dir That Won't Move/' ); Unfortunately escapeshellarg doesn't work for all cases, it will escape the " ' " in that example but it doesn't escape other characters such as " ) ". So... $source_dir = escapeshellarg( '/some/dir/Dir That (Won't Move)/' ); ...fails as well. Any other ideas? -k. __ Yahoo! Music Unlimited Access over 1 million songs. Try it free. http://music.yahoo.com/unlimited/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange pg_escape_string behavior
While using pg_escape_string to clean data being placed in a query sent to me by the user i get the following error after submitting the query with pg_execute: pg_exec(): Query failed: ERROR: invalid regular expression: invalid escape \ sequence . It seems to happen when using just a "\" or text ending with a "\" but not if a "\" is in the middle of a string of text. Why doesn't pg_escape_string catch this? To restate it maybe a little more clearly, the error occurs when i do something like: (Pretend $_POST['user_item'] has the value "car\" in it ) I'm running PHP Version 4.3.4, and Apache 1.3.29. -k. __ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Uploading more than one file
If you named the fields like this: Then did something like (or whatever): $error) { echo $key.""; echo $_FILES["files"]["tmp_name"][$key].""; echo $_FILES["files"]["name"][$key].""; } ?> Would that do what you need to get done? -k. __ Start your day with Yahoo! - Make it your home page! http://www.yahoo.com/r/hs -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php.ini ignored! Re: [PHP] PHP 4.3.0 released
redhat, apache2.0.43 (as dso). compiles and runs without a problem php4.3.0release fails to utilize php.ini settings. ignores changes to the ini file. ./configure --with-config-file-path=/usr/local/apache2/conf/php.ini --with-a pxs2=/usr/local/apache2/bin/apxs --with-mysql (got no errors) this was not an issue when i had 4.3.0RC2 installed in the exact same manner! ive tried this twice, reinstalling apache as well with not difference and since php otherwise works with its defaults i have a feeling this might be a bug with the release!? any help appreciated, omer. "The Doctor" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Sat, Dec 28, 2002 at 04:04:14AM -0700, Rick Widmer wrote: > > At 08:40 PM 12/27/02 -0700, The Doctor wrote: > > > > > > >Is it just my or are there problems with static Aapche 1.3.27 compiles? > > > > I don't know if it is _just_ you, but my static install compiled and is > > running just fine. > > > > SuSE 8.0 > > > > php 4.3.0 > > > > Apache 1.3.27 > > > > Mod_SSL 2.8.12-1.3.27 > > > > OpenSSL 0.9.6h > > > > ming 0.2a > > > > pdflib 4.0.3 > > > > ./configure --with-apache=../apache --with-mysql --with-pgsql=/usr > > --enable-cli --enable-calendar --enable-debug=no > > --with-config-file=/web/conf --with-PEAR --with-jpeg-dir=/usr/local > > --with-phg-dir=/usr/local --with-zlib-dir=/usr/local --with-gd=/usr > > --enable-gd-native-ttf --with-freetype=/usr/include/freetype2 > > --with-pdflib=/usr/local --with-ming --enable-magic-quotes --with-mm=../mm > > --with-pspell > > > > > > > > > > > >Script started on Fri Dec 27 20:34:45 2002 > > >nl2k.ca//usr/source/php-4.3.0$ cat configphp > > > > > >configure --prefix=/usr/contrib --localstatedir=/var > > >--infodir=/usr/share/info --mandir=/usr/share/man --with-low-memory > > >--with-elf --with-x --with-mysql --with-zlib --enable-track-vars > > >--enable-debug --enable-versioning --with-config-file-path=/usr/local/lib > > >--with-iconv=/usr --with-openssl=/usr/contrib --enable-ftp --with-gd=/usr > > >--enable-imap --with-bz2 > > >--with-apache=/usr/source/apache_1.3.27_nonSSL/ > > >--with-pgsql=/usr/contrib/pgsql --enable-gd-native-ttf > > >--with-jpeg-dir=/usr --with-png-dir=/usr > > >--with-freetype-dir=/usr --with-xpm-dir=/usr/X11/lib > > > > Same result adding in --enable-cli and --with-PEAR . > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > Member - Liberal International On 11 Sept 2001 the WORLD was violated. > This is [EMAIL PROTECTED] Ici [EMAIL PROTECTED] > Society MUST be saved! Extremists must dissolve. > Merry Christmas 2002 and Happy 2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imagecreatefromjpeg() problems
Hi! I've made a little script to make thumbnails which worked before the summer, but now I get this errormessage: Fatal error: Call to undefined function: imagecreatefromjpeg() in /usr/local/others/www.stud.users/mark/gfx/create_tn.php on line 15 First I thought they had done something with the servers, because I haven't touched the code. But I checked the GD-version and got this: GD Version: bundled (2.0.12 compatible) Shouldn't version 2.0.12 support imagecreatefromjpeg()? Is there any way I can get around this? In advance thanks! Best regards Jan-Kristian Markiewicz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreatefromjpeg() problems
Hi Jaap! Thanks for your answer, but I checked phpinfo() and it says: JPG Support Enabled Any ideas? The images are photo-like so png would make them too big. Best regards Jan-Kristian Markiewicz "Jaap Van Ganswijk" <[EMAIL PROTECTED]> skrev i melding news:[EMAIL PROTECTED] > At 2003-08-16 14:35 +0200, J-K wrote: > >I've made a little script to make thumbnails which worked before the > >summer, but now I get this errormessage: > > > >Fatal error: Call to undefined function: > >imagecreatefromjpeg() in > >/usr/local/others/www.stud.users/mark/gfx/create_tn.php on line > >15 > > > >First I thought they had done something with the servers, because I > >haven't touched the code. But I checked the GD-version and got this: > > GD Version: bundled (2.0.12 compatible) > > > > Shouldn't version 2.0.12 support imagecreatefromjpeg()? > > Only when jpeg support has been compiled into > the PHP version that is running on your system. > It doesn't seem to be. > > >Is there any way I can get around this? > > Try if png support is enabled. But you'd have > to convert your jpeg's I guess and png's are > probably much bigger because they are > non-lossy (?). But it depends on your images > being photo-like and not drawing-like. > > Otherwise you'll have to ask your system > manager to fix the problem. > > BTW. you shouldn't indent paragraphs in emails, > because it makes quoting them very messy, or > the person answering your mail has to edit out > the indentations (as I have done above). > > Greetings, > Jaap > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Are sessions affected by Unix user changes?
Are sessions in PHP somehow affected by changes in Unix users? I know that the only recent changes to the server have been the addition of a few Unix users and the changing of some older passwords, but now sessions do not work within PHP. Is a session related to a web (default?) user? K. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Zero-length files for PHP sessions??
My PHP session files are being created in the specified directory (/tmp) by the specified user (apache), but always have a file-length of zero, so no data is being stored. Anyone know what may cause this or how to correct? K. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upgrade from 4.0.6 to 4.1.1
To upgrade from 4.0.6 to 4.1.1, do I have to fix any code? I think session code has to change but is there anything else? Thanks K. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file upload problem
Hey I have a prob with my php file upload. i am using windows my html file looks like Upload the datafile here my php file looks like "; echo $file.""; @copy($file, $newfile) or $endresult = "Couldn't Copy File To Server"; echo $endresult; ?> when i run i get an error \\php2 c:\upload\a.gif cannot upload file any ideas why?? also i am not clear as to where the \\php2 comes from thanks in advance regards ram __ Give your Company an email address like ravi @ ravi-exports.com. Sign up for Rediffmail Pro today! Know more. http://www.rediffmailpro.com/signup/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strore Data in File
Hi I want to store the data of a table in a file and read that file just as one would read a table. For e.g. I have a table t_data with cols name,number,cost and my data file data.txt would have the following data: --- john,1,100 mark,2,200 spencer,3,200 --- Now on the web page when the visitor clicks on a link on "john" then this file (data.txt) must be read and the data should be displayed for "john" i.e. name = john number = 1 cost = 100 must be displayed Can anyone please give me the code to parse this file and read the data for john and get all the data for that row. Please see that "john" functions as the primary key in the table Regards Ram __ Give your Company an email address like ravi @ ravi-exports.com. Sign up for Rediffmail Pro today! Know more. http://www.rediffmailpro.com/signup/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Need an array parser
I am looking for somthing that will parse a multidimentional array of any size, and return a key / value listing for debugging Example: if I have an array such as... $arr[name] = dallas $arr[address][city] = austin $arr[address][state] = Texas $arr[somthing][somthing_else][blah1]= some_value1 $arr[somthing][somthing_else][blah2]= some_value2 $arr[somthing][somthing_else][blah3]= some_value3 I would want the result to be displaied as: -- 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] Need an array parser(CONT)
I am looking for somthing that will parse a multidimentional array of any size, and return a key / value listing for debugging Example: if I have an array such as... $arr[name] = dallas $arr[address][city] = austin $arr[address][state] = Texas $arr[somthing][somthing_else][blah1]= some_value1 $arr[somthing][somthing_else][blah2]= some_value2 $arr[somthing][somthing_else][blah3]= some_value3 I would want the result to be displaied as: ARR name --- dallas address --- city --- austin address --- state --- Texas somthing --- somthing_else --- blah1 --- some_value1 somthing --- somthing_else --- blah1 --- some_value1
[PHP] Problem getting PostgreSQL to compile
Hello, I'm running RH 7 and Apache. I have the latest version of PostgreSQL and it is installed and running correctly. I have installed PHP with the --with-pgsql and it seems to install everything needed, but when I try to use pg_connect() it fails to connect. Any ideas what I can do? Thanks, Kevin [EMAIL PROTECTED] _ Get your FREE download of MSN Explorer at http://explorer.msn.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]
Re: [PHP] Problem getting PostgreSQL to compile
Yes, I've checked phpinfo() and not it is not compiled in. That is the problem. I have recompiled PHP with pgsql support and there is some problem. I'm not sure why it isn't compiling it in. I've tried everything I knowthe installation goes fine...no error messages, everything seems ok. Any ideas? >From: The Hermit Hacker <[EMAIL PROTECTED]> >To: K Old <[EMAIL PROTECTED]> >CC: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> >Subject: Re: [PHP] Problem getting PostgreSQL to compile >Date: Fri, 2 Mar 2001 22:30:11 -0400 (AST) > > >have you checked phpinfo() to make sure that pgsql support is actually >compiled in? if so, any errors on connection, or just silently fails? > >On Fri, 2 Mar 2001, K Old wrote: > > > Hello, > > > > I'm running RH 7 and Apache. I have the latest version of PostgreSQL >and it > > is installed and running correctly. I have installed PHP with the > > --with-pgsql and it seems to install everything needed, but when I try >to > > use pg_connect() it fails to connect. Any ideas what I can do? > > > > Thanks, > > Kevin > > [EMAIL PROTECTED] > > _ > > Get your FREE download of MSN Explorer at http://explorer.msn.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] > > > > > >Marc G. Fournier ICQ#7615664 IRC Nick: >Scrappy >Systems Administrator @ hub.org >primary: [EMAIL PROTECTED] secondary: >scrappy@{freebsd|postgresql}.org > > >-- >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] > _ Get your FREE download of MSN Explorer at http://explorer.msn.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] resource id #2
I am trying to run a query and in my log I am getting a message the message resource id #2. $query=mysql_query("Select pass from members where uname='$username'"); $result = mysql_query($query) or die("You are not authorized to be here."); Can someone tell me what I am doing wrong and guide me in the right direction -- 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] Easiest Way to Upgrade PHP
Hello all, Quick question. I'm wondering what the easiest way to upgrade PHP is? For instance, right now I have PHP 3 installed on a RH6.1 box and would like to upgrade to the latest version. Even though it was installed using RPMs can I use the tar.gz and build it to apply the upgrade? And then for each release after that just build it manually (I assume it will overwrite whatever needs to be "upgraded")? Red Hat is very slow about getting RPMs out and I wanted to stay on top of everything. Thanks Kevin _ Get your FREE download of MSN Explorer at http://explorer.msn.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] function login
I am creating a function called login, I have a main file called index.php .. which has my login form , it calls a login.php file, and in that login.php there is file include statement which calls config.php and that is where the function lie. This is my function , now if i don't set this as a function and just put it my login.php it works fine. But when I name the function in put it in my config.php no matter what I do all ways giving me the error You have entered an invalid username or password. I dont know if this has to do with passing of variables.. or what is going on but if something can please help me I would appreciate it .. Thank You function login() { $query="Select uname from members where pass='$pass'and uname='$username'"; $result=mysql_query($query) or die("You are not authorized to be here."); $array= @mysql_fetch_array($result); $uname = $array[0]; if($uname=="") { echo "You have entered an invalid username or password"; } else { echo "You are logged in"; $remote_address = getenv("REMOTE_ADDR"); echo "Your IP address is $remote_address."; } } -- 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] Parse error..help!
Also take off the semicolon of the closing of the function } ""Taline Makssabo"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Here is another error i keep on getting, this is suppose to send me an email > each time someone enters in my website but i keep on gettong this error > message: > > > > Parse error: parse error in > /home/virtual/ppcu/home/httpd/html/php2/login.php on line 8 > I don't see anything wrong, please help. > > > > > SetLogging(1); > > Function AccessHit > ( > > $NL = (\n); > > > $H = getLastHost(); > > > $R = getLastRef(); > > $To = "[EMAIL PROTECTED]"; > > > $Sub = "Page Accessed"; > > > $D = Date("D d M y h:ia",time()); > > $Msg = $H + $NL + $R + $NL + $D; > > mail($To,$Sub,$Msg); > ); > AccessHit(); > > ?> > > > > > -- > 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] newbie bigtime
Just opened a "How to" book today on PHP. Already having problems and wouldn't mind an extra set of eyes. My basic form does not produce results.Any thoughts on this one? http://www.hermengoode.com/php/form.html Thanks! spellman __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie bigtime
The code for form.html is HTML Form First Name Last Name E-mail Address Comments and the code for the HandleForm.php is Form Results \n"; print "Your last name is $LastName.\n"; print "Your E-mail Address is $Email.\n"; print "This is what you had to say:\n $Comments\n"; ?> And the book suggested POST instead of GET because it is stated that Post is secure and GET is not. Thanks, spellman --- Miguel Cruz <[EMAIL PROTECTED]> wrote: > On Wed, 15 May 2002, k spellman wrote: > > Just opened a "How to" book today on PHP. Already > > having problems and wouldn't mind an extra set of > > eyes. My basic form does not produce results.Any > > thoughts on this one? > > > > http://www.hermengoode.com/php/form.html > > Well, you don't show your source code, but if I had > to guess I'd say you > have a newish install of PHP and an oldish book, and > you're trying to get > the value of $LastName rather than > $_GET['LastName']. > > miguel > __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie bigtime
The code for form.html is HTML Form First Name Last Name E-mail Address Comments and the code for the HandleForm.php is Form Results \n"; print "Your last name is $LastName.\n"; print "Your E-mail Address is $Email.\n"; print "This is what you had to say:\n $Comments\n"; ?> And the book suggested POST instead of GET because it is stated that Post is secure and GET is not. Thanks, spellman --- Justin French <[EMAIL PROTECTED]> wrote: > Show us the code for processing the form! > > My guess is your book uses code with $firstname > rather than > $_POST['firstname']... given that your version of > PHP is probably new > (4.2.x), register_globals is prolly OFF in your > php.ini config file. > > Justin > > > > on 16/05/02 12:13 PM, k spellman > ([EMAIL PROTECTED]) wrote: > > > Just opened a "How to" book today on PHP. Already > > having problems and wouldn't mind an extra set of > > eyes. My basic form does not produce results.Any > > thoughts on this one? > > > > http://www.hermengoode.com/php/form.html > > > > Thanks! > > spellman > > > > __ > > Do You Yahoo!? > > LAUNCH - Your Yahoo! Music Experience > > http://launch.yahoo.com > __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.0.6 and xsl-transformation
Hey PHP-gurus! How do I run and invoke PHP XSL-parsing and transformation using PHP version 4.0.6.? Here is the sample code I want to run. files included: PHP-script XML-file and XSL-file:They are formatted nicely client-side by IE6.0. (Please disregard the stupid text in the XML-file, it is an extract from a database with a lot of test postings) When I run the script (post.php) I get an 'empty' XHTML-document, which is probably the result of applying the XSL-stylesheet(standard.xsl) on the XML-document (writeout.xml), and getting nothing -> a 'bad' transformation. The script doen't display any errors, and the logging does not seem to work. Please help. PS : I didn't do the server setup myself, how can I check if the XSL-parser is configured correctly? YT Karsten Pihl, denmark __ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ '); define(XMLHEAD, ''."\n".XMLLINK); define(XMLFILE, "writeout.xml"); define(LOG, 'transform.log'); // ## executing transform(); // functions function load($fromFile){ //returns file $fromFile as string $str $fh = fopen($fromFile, "r") or die("Can't open file ".$fromFile); $str = fread($fh, filesize($fromFile)); fclose($fh); return $str; }//load function save($str, $toFile){ // writes string $str to file $toFile, returns boolean for succes $fh = fopen($toFile, "wb") or die("Can't open file ".$toFile); $bf = fwrite($fh, $str); fclose($fh); // if ($bf == -1) return false; else return true; }//save function transform(){ // echo 'valid: ', $valid_user; // almindelige brugere må gerne se nyheder // filtrerer(parser) xml dokumentet igennem stylesheet'et. $myxml = load(XMLFILE); $mystyle = load(XSL1); $handle = @xslt_create() or die("Can't create XSLT handle!"); xslt_set_log($handle, true); xslt_set_log($handle, getcwd().LOG); // $xsltproc = xslt_create(); // create processer handle echo $handle; // do transformation $result = xslt_process($handle, $myxml, $myxsl); // echo $out; // echo 'res', $result; if ($result){ echo $result; // pre($result); $res = $result; } else{ $res = "error occurred during transformation : ".xslt_error($handle); $res.= " with error code: ".xslt_errorno($handle); } // Free ressources @xslt_free($handle); return $res; } // transform; ?> 7/4/2002 22:48 Sunday comment Sunday evening is quit 30/3/2002 13:47 Sunday weather The weather is beutifull today 4/4/2002 18:45 Thursday comment Databasesystems 4/4/2002 18:46 Monday comment Advanced Object-oriented programming. A very interesting subject 4/4/2002 18:46 Thuesday calender At tuesdays: webprogramming 30/3/2002 13:52 Saturday comment I am happy today. 4/4/2002 20:25 Sunday comment Sunday evening is quit yes yes yes yes http://www.w3.org/1999/XSL/Transform"; xmlns="http://www.w3.org/1999/xhtml";> My news -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PostgreSQL query taking a long time
Hello all, I have a PostgreSQL database that is storing The Bible. It has 31,103 records in it and I have a PHP page executing this query: SELECT books.book_name, bible.chapter, bible.verse, bible.versetext FROM asv_bible bible, book_bible books WHERE bible.book = books.id ORDER BY random() LIMIT 1 The database schema is: /* Sequences */ CREATE SEQUENCE "book_bible_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1; /* Table structure for table "asv_bible" */ CREATE TABLE "asv_bible" ( "id" int8 NOT NULL, "book" int8, "chapter" int8, "verse" int8, "versetext" text, CONSTRAINT "asv_bible_pkey" PRIMARY KEY ("id") ); /* Table structure for table "book_bible" */ CREATE TABLE "book_bible" ( "id" int4 DEFAULT nextval('book_bible_seq'::text) NOT NULL, "book_name" varchar(20), CONSTRAINT "book_bible_pkey" PRIMARY KEY ("id") ); Right now it takes 9 seconds to return the results. I was wondering if anyone could offer any help with lowering the time it takes to run? Or if this is the normal runtime for a database of this size, I'd just like confirmation. Thanks, Kevin _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- 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] Storing data from several forms of the same type in an array
I would like to store data from several forms (same form, different data) so that the info can be written to a database all at once. The reason being is that I would like to have all this information tied to information from a general form. eg. I have a general information form in one frame on my page, and then in another frame below a form for a specific item purchased. You can purchase several items, therefore several forms filled out. I want to tie all these items to the info in the general form, so I want to be able to send all the data to the database at once. Now I'm wondering if I can store the data in an arrray in the HTTP body and post data from each form to it, etc. I don't think its possible but .can anyone help?? regards -- 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] Storing data from several forms of the same type in an array
Yeah, I thought about that. But then I'm not sure how to get the data from a javascript array back to php to then send to the database I have just been messing around with using arrays as session variables and it seems to work. thanks anyway. ""Yasuo Ohgaki"" <[EMAIL PROTECTED]> wrote in message 99ujc9$nvb$[EMAIL PROTECTED]">news:99ujc9$nvb$[EMAIL PROTECTED]... > How about use JavaScript to do that. > You should be able to access all forms, frames in browser. > > -- > Yasuo Ohgaki > > > ""cam k"" <[EMAIL PROTECTED]> wrote in message > 99uart$a48$[EMAIL PROTECTED]">news:99uart$a48$[EMAIL PROTECTED]... > > I would like to store data from several forms (same form, different data) so > > that the info can be written to a database all at once. The reason being is > > that I would like to have all this information tied to information from a > > general form. eg. I have a general information form in one frame on my > > page, and then in another frame below a form for a specific item purchased. > > You can purchase several items, therefore several forms filled out. I want > > to tie all these items to the info in the general form, so I want to be able > > to send all the data to the database at once. Now I'm wondering if I can > > store the data in an arrray in the HTTP body and post data from each form to > > it, etc. I don't think its possible but .can anyone help?? > > > > regards > > > > > > > > > > -- > > 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 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] javascript to php
does anyone know how to pass values in javascript variables to php variables?? Or a workaround if no direct solution... -- 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:javascript to php
what exactly are you trying to do? pass variables to a php script? then use a form with POST or GET...not that simple? describe better what you're doing then... -jack cam k wrote: ok, I'll explain this a little better, bear with me. I have several forms in different frames and one particular form being filled out many times. I want to be able to submit all the data at once to the database to tie it to a unique invoice number generated only on submission. So I need to somehow store the data until ready to submit. I was thinking of using javascript or arrays as session variables... not sure though -- 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] Re:javascript to php
thanks, I found the discussions. How do I pass one large array?? As a hidden input type on a form? "Jack Dempsey" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > You could use sessions with arrays...there's been a discussion recently > about arrays in sessions, and some good sample code...checkout the list > archives... > if you didn't want to use sessions you could just keep passing one large > array to your different php scripts and then passing that into your > database at the end when you're done... > > -jack > > cam k wrote: > > > > what exactly are you trying to do? pass variables to a php script? then > > use a form with POST or GET...not that simple? describe better what > > you're doing then... > > > > -jack > > > > cam k wrote: > > > > ok, I'll explain this a little better, bear with me. I have several forms > > in different frames and one particular form being filled out many times. I > > want to be able to submit all the data at once to the database to tie it to > > a unique invoice number generated only on submission. So I need to somehow > > store the data until ready to submit. I was thinking of using javascript or > > arrays as session variables... > > > > not sure though > > > > -- > > 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 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] registering an array into a session (?)
No idea if this will help, but not sure why you are serializing the array... // sessionarray.php4 session_cache_limiter(""); session_start(); session_register('name'); session_register('city'); session_register('state'); session_register('postcode'); session_register('pagecount'); if (pagecount != "") { $name[] = $newName; $city[] = $newCity; $state[] = $newState; $postcode[] = $newPostcode; } ?> Enter a name: Enter a city: Enter a state: Enter a postcode: $name[$i] $city[$i] $state[$i] $postcode[$i] "; } $pagecount++; ?> "Christian Dechery" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Can somebody please help me out?? > I'm going nuts... > what's wrong with this piece of code? > > > if(!isset($script_total_time)) > { > // register the session variables to keep track of > step times > $script_total_time=(float)$total_time; > session_register("script_total_time"); > $step_times_array[$step]=$total_time; > $step_times=serialize($step_times_array); > //echo "step_times=\"$step_times\""; <- this > echoes perfeclty > session_register("step_times"); > } > else > { > // update session variables > $script_total_time+=(float)$total_time; > $step_times_array=unserialize($step_times); > $step_times_array[$step]=$total_time; > $step_times=serialize($step_times_array); > } > > > why doesn't $step_times gets registered correctly? it always register an > empty var... > > . Christian Dechery (lemming) > . http://www.tanamesa.com.br > . Gaita-L Owner / Web Developer > -- 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] Hosting for FREE??
Hi, I am just learning PHP (I was a ASP developer but I switched over) and I need a host that is free and lets me use PHP4 and MySQL? Does anyone know of such a host? If you do please tell me! Thanks, -Frank
[PHP] Script Encodeing??? other than Zend.
I need a way to encode my scripts so that others can not read them. But I dont want to use the zend encoder? Is there anything else out there that can do what I need?
Re: [PHP] Sneaky solution
If you want to check where your submit is comming from, then you need to check the REFERER url. do so by useing the global $HTTP_REFERER variable. global $HTTP_REFERER; if($HTTP_REFERER == "YOUR_FORM_PAGE_HERE") { //PROCESS CODE. } else { echo"Your a hacker, so BITE ME!!!"; } - Original Message - From: "Plutarck" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, April 03, 2001 7:58 PM Subject: [PHP] Sneaky solution > > How do you check to make sure that any > > form submissions originate from your site? > > You basically can't. > > ...well that was easy ;) > > > All you can do is assume that every single piece of data sent from the > client is an attempt to screw up your application. After stripping non-valid > characters and using strlen to ensure the data is of a valid size, there > isn't much you can do. But if you know ahead of time that the date should > _NOT_ be 1998, just encode such a validator. > > > But if you want to be really sneaky, make something like this: > > value1=vally|val2=vooly > > Then run it through some encryption feature or a home-brewed scrambler, and > make the whole thing one single "hidden" value. > > In your script you decode it, split it apart into proper variables, and > continue along as normal. > > > Still not fool proof, but I use it when I have no other better method. And > it basically thwarts 99% of casual tinkerers, and an equal amount of script > kiddies, and it allows you to be really creative in your data validation, > plus you can screw with people's heads...which of course is the most > important function ;) > > > > -- > Plutarck > Should be working on something... > ...but forgot what it was. > > > > -- > 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] 1 MySQL Database??
Hi, The host that I am currently at only gives me 1 MySQL Database and I was wondering if I create lots of table will it slow it down at all? I will only be selecting data from 1 or 2 tables on a page...do you think it would slow it down at all? Thanks, -Frank
[PHP] PHP with Win2k or Linux
Does anyone know is there are advantages to running linux while developing php? I just would like to know if there is anything special to installing and developing on linux before I move from Win2k?? Thanks, -Frank
[PHP] HELP...Installation of PHP on Debian Linux!
I am having trouble installing PHP4 on my linux machine. I downloaded to source and i did a ./configure then a make then a make install. That all went good. Now i am trying to find the libphp4.so file. I did a couple search commands but it could not find it. Can anyone help me with finding this file...like where it was installed on your machine. I uncompressed it in my home directory /home/username Thanks, -Frank -- 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] WHAT IF I DONT WANT TO USE ZEND......(help)
But I still want to encode my scripts AND have them run on all differant platforms AND run with little or no setup by the user??? What other alternatives are out there? I know about APC but it only seems to run on windows. I need somthing that I can show my client here soon. so what could I use to encode my scripts, on differant server platforms, with little help from the user.?? Thanks,
Re: [PHP] WebMail client
Try squirremail at http://www.squirrelmail.org ""Rosen"" <[EMAIL PROTECTED]> wrote in message 9gnf7f$dsk$[EMAIL PROTECTED]">news:9gnf7f$dsk$[EMAIL PROTECTED]... > Hi, > I want to find some Web Mail script in PHP with possibilities to > create mail accounts directly on Linux Mail server. > > Thanks > Rosen Marinov >
Re: [PHP] List of included file names.
Try using $PHP_SELF to get the name of the PHP script. - Original Message - From: "Tim McGuire" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 19, 2001 11:30 AM Subject: [PHP] List of included file names. Hi, I searched the archives for this. For debugging purposes, I want to see a list of the included files on a page in HTML comments. PHP_SELF and HTTP_SERVER_VARS["SCRIPT FILENAME"] only returns the name + path of the file calling the included files. I want each included file to contribute its name to the page. Is there any way to do that so that the HTML source looks like this:
Re: [PHP] bad form...
On a previous shopping cart, some of our "fantastically complex" scripts got so big that WE couldn't follow the logic too many conditional test, things started to conflict it was hell... so we found that it was better to break the processing code apart from the html. but build one file that includes all needed files into one to simulate the "One-file-one-form" approach. this made all our lives easier. JMT. - Original Message - From: "Tom Carter" <[EMAIL PROTECTED]> To: "motorpsychkill" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, June 20, 2001 3:39 AM Subject: Re: [PHP] bad form... > generally. no its not.. IMHO its a good thing it can help make data > validation easier, as in people can't "fake" variables by passing them in > the URL to the processing script. > It also helps keeps thing tidy... so providing that the processing isn't > fantastically complex (in which case the complexity of the processing may > make the physical file cumbersome) > > HTH, > Tom > > > > hello everyone, is it 'bad form' (no pun intended) to have a form point to > > itself for processing, rather than forward the form variables to another > > page? Anybody have any input on this? I try to have 1 page that is the > > form and handles all the processing as well in order to keep the page > count > > on my site low and for easier editing, blah blah blah > > > > thank you for you 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]
Re: [PHP] Which DB abstraction ?
Check out the ADODB.. They support 9 (maybe 11) different db's the code is easy and it works http://php.weblogs.com/ADODB We use their script .works well. - Original Message - From: "Andrew Hill" <[EMAIL PROTECTED]> To: "Robert Mena" <[EMAIL PROTECTED]>; "php mailing list" <[EMAIL PROTECTED]> Sent: Friday, September 21, 2001 7:08 AM Subject: RE: [PHP] Which DB abstraction ? > Robert, > > Whichever you choose, using ODBC will further insulate you from the 'pain' > of adopting other databases. Also, ODBC by itself will give you a great > deal of db abstraction. > > There are HOWTO's on setting up PHP with the iODBC Driver Manager (needed to > use ODBC drivers) at www.iodbc.org > > Best regards, > Andrew Hill > Director of Technology Evangelism > OpenLink Software http://www.openlinksw.com > Universal Data Access & Data Integration Technology Providers > > > -Original Message- > > From: Robert Mena [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, June 20, 2001 11:47 PM > > To: php mailing list > > Subject: [PHP] Which DB abstraction ? > > > > > > Hi, > > > > I am in a middle of the process of chosing which DB > > will be used for future projects. I've been using > > Mysql for almost 5 years (coupled with php of course) > > but it seems to have reached it's limits (actually the > > lack of some features). > > > > The other options include some traditional comercial > > dbs and postgresql. I am about to choose postgresql > > because it seems to support the features I need > > (foreign key, transaction, triggers, stored > > procedures) and is open source with active > > development. > > > > Even tough I'd like to receive (perhaps in private) > > personal thought about this decision I would not like > > to start a war...so my focus here is : which db > > abstraction layer is ready for use ? disavantages ? > > > > I am considering : Manuel Lemos' Metabase, Phplib and > > Pear. > > > > So far I've played a little bit with pear, and read > > about metabase and phplib with no real experience in > > both. > > > > The ideia is to start using it right away so the > > adption of other DB would be painless (almost). > > > > Thanks, > > RT > > > > __ > > Do You Yahoo!? > > Get personalized email addresses from Yahoo! Mail > > http://personal.mail.yahoo.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 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] Name of an array???
I need to echo the NAME of an array to the browser. when I try this all I get is "Array". when I try to : echo $$array_name; I get nothing. How can I get the NAME of an array to the browser? Thanks.
Re: [PHP] Variables
don't use the quotes if($test1 == $test2) {echo "True"; } else {echo "False"; } - Original Message - From: "James Bartlett" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 10, 2001 7:21 PM Subject: Re: [PHP] Variables No it doesn't seem to like that either... The weird thing is that if I used <> instead of = it's fine...although that is not the result I want... - Original Message - From: Tyler Longren To: James Bartlett Cc: [EMAIL PROTECTED] Sent: Wednesday, July 11, 2001 3:21 AM Subject: Re: [PHP] Variables Try if($text1 == "$text2") { echo "The variables are equal"; } else { echo "The variables are not equal"; } notice the change in the if() Tyler On Wed, 11 Jul 2001 03:12:56 +0100 "James Bartlett" <[EMAIL PROTECTED]> wrote: > Hi, > > This might sound really simple but plz humour me :) > > How can I tell if two text variables are equal to one another? > > If I use.. > > if($text1 = $text2) > { > echo "The variables are equal"; > } > else > { > echo "The variables are not equal"; > } > > then the code in the else state is always printed even if I know for a fact that the variables are equal... > > Any suggestions? > > James > -- Tyler Longren [EMAIL PROTECTED] Currently Unemployed www.noworkfortyler.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 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 inside code problem
hi there - if ($act = "add") //Add the message... { if (!empty($user_name) && !empty($user_ip) && !empty($user_message) && !empty($user_sex)) { if (!($html_support)) { $user_message = htmlspecialchars("$user_message"); } $user_message = ereg_replace("\n","","$user_message"); $userinfo = "$user_name¡±¡±$user_sex¡±¡±$user_ip¡±¡±$user_message¡±¡±$user_date"."\n"; $fp = fopen("$filename",'a'); flock($fp,2); fwrite($fp, $userinfo); flock($fp,1); fclose($fp); header("Location: index.php"); setcookie("cuser",$user_name,time()+(3600*24*365),"/","$SERVER_NAME"); exit; } } - The code above is what I use for processing messages Everytime when I'm trying to use the function, htmlspecialchars(), it'll replace " with " . After that, I save the data and print out again, the result will add "\" after the data... ( I don't want the extra "\") There is an example. When I try to type in ^^" to be my new message, it suppose to show the same thing. However, in the saved data, it shows ¡±¡±^^\" (¡±¡± is what I use to different from different filez) I don't want the extra "\" however, I tried the way in below: I use $user_message = eregi_replace("<","<","$user_message"); $user_message = eregi_replace(">",">","$user_message"); instead of the original one which is $user_message = htmlspecialchars("$user_message"); however, when I check the saved file, it still have and extra \ before the characters " . god damn it I run this code in windows98SR2, maybe it's micro$oft's problem, is it? plz help me.thx dudes nick
Re: [PHP] Directory Listing in an Array
This is what I use file://DIR to start looking in $basedir = "C:/Inetpub/wwwroot/_ActiveClientFiles/GLS/portfolio/"; file://working DIR or the dir to change to. $wdir = "web/"; // list of DIRs var $dirlist; $filelist; $add_dir ; /*** *** // Load Online Directorys **/ chdir($basedir . $wdir.'online/'); file://open the dir $online=opendir("."); while ($files = readdir($online)) { if(is_dir($files) && ( $files !== "." && $files !== ".." ) ) { $online_dir[$files] = $files; file://add files } } if(count($online_dir)) file://sort { asort($online_dir); } rewinddir($online); closedir($online); ?> - Original Message - From: "Chris Aitken" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, August 20, 2001 8:05 PM Subject: [PHP] Directory Listing in an Array > Hey all, > > Just something I havent been able to sort out in the archives, but what im > wanting to do it this. Do a listing of all files in a directory, and load > up an array with each returned filename. > > Am I pissing into a windy pipe dream or is there a simple solution for this ? > > > > Cheers > > > Chris > > > -- > Chris Aitken - Administration/Database Designer - IDEAL Internet > email: [EMAIL PROTECTED] phone: +61 2 4628 fax: +61 2 4628 8890 > __-__ >*** Big Brother *** > It just shows that the dull will rule the world. And we will be watching it. > > > -- > 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]
Re: [PHP] Newbie Question: Forcing a page load with no click
use require_once(""); to include the page or use header("Location: "); to redirect to a different page - Original Message - From: "LB" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, August 21, 2001 10:58 AM Subject: [PHP] Newbie Question: Forcing a page load with no click > I've built a small login script (code fragment below), and want to force a > page load depending on if the login was valid or not. How do I make PHP > redirection to a new page? Ideally, I want the equivalent of building an > query string such as "goodpage.php?Username=" and forcing > it to load. > > if (trim($CheckPW) == $Password) { > echo ("Good Login!"); > } > else { > echo ("Bad Login"); > } > > Thanks in advance > > > > -- > 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] Trunkated zeros..... how to fix?
I am having the problem that Mysql is truncating the zeros from both the int and char fields when I try to insert How can I fix this. example: 0123 in PHP = 123 in mysql 3210 in PHP = 321 in mysql but I need that zero how do I keep mysql from doing this?
[PHP] Fw: Show of American Solidarity - Read & pass on
- Original Message - From: "Steve Walker" <[EMAIL PROTECTED]> To: "Info" <[EMAIL PROTECTED]> Sent: Thursday, September 13, 2001 11:09 AM Subject: Show of American Solidarity - Read & pass on > > Tomorrow is U.S. Color day. Red, White & Blue should be worn in honor of our > fellow Americans that died. The goal is to get the whole nation to > participate. Send this to 10 other people. > > In memory of all those who perished; the passengers and the pilots on the > United Air and AA flights, the workers in the World Trade Center and the > Pentagon, and all the innocent bystanders. Our love goes out to the friends > and families of the deceased. Send this to at least 10 people to show your > support. DONT BREAK IT!! GOD BLESS AMERICA and the freedom it > represents. > > Try to be wearing as much red white and blue as you can. (jeans are blue, > everyone owns a white t-shirt, etc.) Send this message to as many other > people you know. Lets get the whole country into it. And remember to be kind > to our fellow Arab-American citizens, who are as American as we. > > > > -- 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] Time.com Interactive Memorial for the WTC Attack
http://www.time.com/time/nation/article/0,8599,174659,00.html
[PHP] Worth reading
Worth reading Written by Leonard Pitts, a writer for the Miami Herald. Published Wednesday, September 12, 2001 We'll go forward from this moment. It's my job to have something to say. They pay me to provide words that help make sense of that which troubles the American soul. But in this moment of airless shock when hot tears sting disbelieving eyes, the only thing I can find to say, the only words that seem to fit, must be addressed to the unknown author of this suffering. You monster. You beast. You unspeakable bastard. What lesson did you hope to teach us by your coward's attack on our World Trade Center, our Pentagon, us? What was it you hoped we would learn? Whatever it was, please know that you failed. Did you want us to respect your cause? You just damned your cause. Did you want to make us fear? You just steeled our resolve. Did you want to tear us apart? You just brought us together. Let me tell you about my people. We are a vast and quarrelsome family, a family rent by racial, social, political and class division, but a family nonetheless. We're frivolous, yes, capable of expending tremendous emotional energy on pop cultural minutiae -- a singer's revealing dress, a ball team's misfortune, a cartoon mouse. We're wealthy, too, spoiled by the ready availability of trinkets and material goods, and maybe because of that, we walk through life with a certain sense of blithe entitlement. We are fundamentally decent, though -- peace-loving and compassionate. We struggle to know the right thing and to do it. And we are, the overwhelming majority of us, people of faith, believers in a just and loving God. Some people -- you, perhaps -- think that any or all of this makes us weak. You're mistaken. We are not weak. Indeed, we are strong in ways that cannot be measured by arsenals. IN PAIN Yes, we're in pain now. We are in mourning and we are in shock. We're still grappling with the unreality of the awful thing you did, still working to make ourselves understand that this isn't a special effect from some Hollywood blockbuster, isn't the plot development from a Tom Clancy novel. Both in terms of the awful scope of their ambition and the probable final death toll, your attacks are likely to go down as the worst acts of terrorism in the history of the United States and, probably, the history of the world. You've bloodied us as we have never been bloodied before. But there's a gulf of difference between making us bloody and making us fall. This is the lesson Japan was taught to its bitter sorrow the last time anyone hit us this hard, the last time anyone brought us such abrupt and monumental pain. When roused, we are righteous in our outrage, terrible in our force. When provoked by this level of barbarism, we will bear any suffering, pay any cost, go to any length, in the pursuit of justice. I tell you this without fear of contradiction. I know my people, as you, I think, do not. What I know reassures me. It also causes me to tremble with dread of the future. In the days to come, there will be recrimination and accusation, fingers pointing to determine whose failure allowed this to happen and what can be done to prevent it from happening again. There will be heightened security, misguided talk of revoking basic freedoms. We'll go forward from this moment sobered, chastened, sad. But determined, too. Unimaginably determined. THE STEEL IN US You see, the steel in us is not always readily apparent. That aspect of our character is seldom understood by people who don't know us well. On this day, the family's bickering is put on hold. As Americans we will weep, as Americans we will mourn, and as Americans, we will rise in defense of all that we cherish. So I ask again: What was it you hoped to teach us? It occurs to me that maybe you just wanted us to know the depths of your hatred. If that's the case, consider the message received. And take this message in exchange: You don't know my people. You don't know what we're capable of. You don't know what you just started. But you're about to learn.
[PHP] text editing (parsing)
I need some help with parsing text. very simple. I have a text string like "News, Bla, Blabla" and i want to get the single words out of the string. -- 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] Wow
thx alot :) -- 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] Can someone explain this????
try this when u get a sec. >its weird... > >In Microsoft Word, start with a blank page and type the letters NYC > > >in all caps. Highlight the letters and change to the largest font size, > >72 points. > > > >Now change the font itself to Webdings . > > > >that's not all. > > > >Now change the font again, to Wingdings. (use the first version of Wingdings) If you ask me that's just weird.
[PHP] ReflectionMethod::invokeArgs
Hi! Please, tell me what's ReflectionMethod::invokeArgs first param for? Since method always know it's class and it can only be invoked on it's own class. Regards, K.L. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] help me
can u help me to use $_SERVER['remote_addr'] to find the IP address ? i am new to php. i also want to find what page of my site he is viewing ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [php] -help me
i have got string as "/home/karthik/welcome.php/view.php" i just need "view.php" how shall i remove rest of the string. please do help me.i am new to php. -thanks, karthik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] help me
i am so surprised for the immediate reply.thank you so much. i'll be thank ful again if you could help me finding the current date and time using php. thanks, karthik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] help me
dear sir, i'd like to get a date from my database(mysql).and then show a combobox of calendar(date-month-year) with the retrieved data selected. can you help me doing this?? am new to php. thanks, karthikeyan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php-help
dear friends, can u help me to find the current directory where my php files are.. using php. thanks, karthik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php-help
sir, iam new to php i'll explain my problem .if u could help i'll be very thankful... in my mysql database i have two tables i.e., table1 and table2. i have an array of result from one query "select feild1 from table1 " i have to use this result in another query. "select field2 from table 2 where field1 = (array of first query iterated)" can u help me doing this in php. thanks, karthik
[PHP] php-help
hello sir, i am so happy about the immiediate response for any of my question. i would like to create a static html page. using cronjob regenerate it every 24 hours. how can i do it using php. thanks, kkarthik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php-help
sir, i'll explain my problem.and if anyone could help me i'll be thankful. i am displaying a content read from a file into a text area of a form. when i make changes andretrieve back in the text area, i encounter a problem.. i.e., when i enter text="please enter" i have an outputas text= /" please enter/" thanks, kkarthik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Fwd: db to xml using php]
--- Begin Message --- can anyone help me to write from db to xml using php. if there is any site please do refer me. thanks, karthik --- End Message --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] db to xml using php
can anyone help me to write from db to xml using php. if there is any site please do refer me. thanks, karthik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] db to xml using php
sir, i downloaded the zip from http://php.chregu.tv/sql2xml/. and then i couldnt know what i am suppose to do.. when i tried running the file am getting error Fatal error: main() [function.require]: Failed opening required 'XML/sql2xml.php' (include_path='.:/usr/local/lib/php') in /home/kkarthik/web/XML_sql2xml-0.3.2/sql2xml_ext.php on line 20 what shd i do.. thanks, karthik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cant set info in DB...HELP
What "lists" are you referring to? Also this is how the examples show I've seen. I know this is basic general stuff but I try many times before posting, and I have followed all directions given. So this is what I did, and nothing is set DB still :-( ===NEW CODE= $regName = trim(strip_tags($_POST['conName'])); $regAddress = trim(strip_tags($_POST['conAddress'])); $regCity = trim(strip_tags($_POST['conCity'])); $regState = trim(strip_tags($_POST['conState'])); $regZip = trim(strip_tags($_POST['conZip'])); $regPhone = trim(strip_tags($_POST['conPhone'])); $sclName = trim(strip_tags($_POST['schName'])); $sclAddress = trim(strip_tags($_POST['schAddress'])); $sclCity = trim(strip_tags($_POST['schCity'])); $sclState = trim(strip_tags($_POST['schState'])); $sclZip = trim(strip_tags($_POST['schZip'])); $stoName = trim(strip_tags($_POST['strName'])); $stoCity = trim(strip_tags($_POST['strCity'])); $stoState = trim(strip_tags($_POST['strState'])); //==Begin dbPopulation of Form info=== $dbserver = "localhost"; // This will be where server name goes $dbuser = "root"; // This will be where username goes $dbpassword = ""; // This will be where password goes $dbname = "theDB"; // This will be where database name goes $connection = mysqli_connect($dbserver, $dbuser, $dbpassword, $dbname) or die (mysqli_error($connection)); $regName = mysqli_real_escape_string($connection, $regName); $regAddress = mysqli_real_escape_string($connection, $regAddress); $regCity = mysqli_real_escape_string($connection, $regCity); $regState = mysqli_real_escape_string($connection, $regState); $regZip = mysqli_real_escape_string($connection, $regZip); $regPhone = mysqli_real_escape_string($connection, $regPhone); $sclName = mysqli_real_escape_string($connection, $sclName); $sclAddress = mysqli_real_escape_string($connection, $sclAddress); $sclCity = mysqli_real_escape_string($connection, $sclCity); $sclState = mysqli_real_escape_string($connection, $sclState); $sclZip = mysqli_real_escape_string($connection, $sclZip); $stoName = mysqli_real_escape_string($connection, $stoName); $stoCity = mysqli_real_escape_string($connection, $stoCity); $stoState = mysqli_real_escape_string($connection, $stoState); $sql_query = "INSERT INTO contestants (conName, conAddress, conCity, conState, conZip, conPhone, schName, schAddress, schCity, schState, schZip, strName, strCity, strState) VALUES('$regName', '$regAddress', '$regCity', '$regState', '$regZip', '$regPhone', '$sclName', '$sclAddress', '$sclCity', '$sclState', '$sclZip', '$stoName', '$stoCity', '$stoState')"; mysqli_query($connection,$sql_query); ?> ===END NEW CODE= - Original Message - From: "Stut" <[EMAIL PROTECTED]> To: "K.Hayes" <[EMAIL PROTECTED]> Cc: "php-general" Sent: Saturday, June 02, 2007 9:52 PM Subject: Re: [PHP] Cant set info in DB...HELP Please include the list on all replies. K.Hayes wrote: I don't know if I'm escaping the 'vars correctly'. If I'm wrong can you give me an example? $sql_query = "INSERT INTO contestants (conName, conAddress, conCity, conState, conZip, conPhone, schName, schAddress, schCity, schState, schZip, strName, strCity, strState) VALUES('$regName', '$regAddress', '$regCity', '$regState', '$regZip', '$regPhone', '$sclName', '$sclName', '$sclCity', 'sclState', '$sclZip', '$stoName', '$stoCity', '$stoState')"; $insert_query = mysqli_real_escape_string($connection, $sql_query); mysqli_query($connection,$insert_query); ?> No, this is not the right way. I suggest you read the manual page on mysqli_real_escape_string (http://php.net/mysqli_real_escape_string). You need to run it on every variable you are using *in* the SQL query, not on the SQL query itself. Google for a php mysqli tutorial - all this stuff is very basic and should be covered by most tutorials you'll find. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Install question
I have just started with a clean install on a Windows XP Pro system, Apache 2.24 and PHP 5.2.3 Apache Monitor reports Apache/2.24(Win32)PHP/5.2.3. I can access html files just fine but I can't even run a test program Nothing displays. Where do I look to see whats wrong? Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Data Filtering
if(@sizeof($profanity) > 0) { echo "Please REMOVE the profanity in the following fields. Immediately!"; foreach($profanity as $field => $value) { echo " {$label_array[$field]}"; //line 114 } } - Original Message - From: "Stut" <[EMAIL PROTECTED]> To: "kvigor" <[EMAIL PROTECTED]> Cc: Sent: Saturday, June 16, 2007 9:40 AM Subject: Re: [PHP] Form Data Filtering kvigor wrote: if (in_array(strtolower($value), $profanity)) { $profanity[$field] = "bad"; } on php.net I haven't seen any example on using strtolower w/ arrays. I tried this an I get the following output: Please REMOVE the profanity in the following fields. Immediately! Notice: Undefined offset: 0 in C:\htdocs\Sweepstakes\sosValidate.php on line 114 Notice: Undefined offset: 1 in C:\htdocs\Sweepstakes\sosValidate.php on line 114 Notice: Undefined offset: 2 in C:\htdocs\Sweepstakes\sosValidate.php on line 114 Notice: Undefined offset: 3 in C:\htdocs\Sweepstakes\sosValidate.php on line 114 ...etc. I also tried (in_array(strtolower($_POST[$value]), $profanity)) same result. Which line is 114? I'm betting it's not the in_array line. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Selecting Rows Based on Row Values Being in Array
Will do. Thanks. - Original Message - From: "Jim Lucas" <[EMAIL PROTECTED]> To: "kvigor" <[EMAIL PROTECTED]> Cc: Sent: Saturday, June 30, 2007 1:46 AM Subject: Re: [PHP] Selecting Rows Based on Row Values Being in Array kvigor wrote: Hello All, I'm attempting to return rows from a mysql DB based on this criteria: I have a list, in the form of an array that I need to compare against each row in the table. Where theres a match I need that entire row returned. e.g.$varListof 3outOf_10Fields = array(6blue40lbs, 7orange50lbs, 8orange60lbs, 9purple70lbs); The array contains 3 of the db row fields in 1 value. However there are 10 fields/columns in the table. === what table looks like | === size colorweight ROW 1| value1 | value1 | value1 | value1 | value1 | value1 | So how could I set up a query that would SELECT the entire row, if the row contained $varListof 3outOf_10Fields[1]. Open to any suggestions or work arounds. I'm playing with extract() but code is too crude to even post. I would suggest approaching the problem with a slightly different thought. just have the sql concat() the columns together and then compare. something like this should do the trick $list = array( '6blue40lbs', '7orange50lbs', '8orange60lbs', '9purple70lbs', ); $SQL = " SELECT * FROM my_Table WHERE CONCAT(value1, value2, value3) IN ('".join("','", $list)."') "; mysql_query($SQL); this should take, for each row in the DB, value1 + value2 + value3 and create one string from them, then it will compare each string in the IN (...) portion to each entry in the $list array(). Let me know if you need any further help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Selecting Rows Based on Row Values Being in Array
No not trying to trick you at all. It's just that because of an incident I had on a previous site with giving actual table names etc. I had another one helping me through forums. I actually share too much info. as a result my DB was ruined... At any rate had no clue about combined_string it showed me the error of my ways. I am reading a file into an array using file( ). So "SELECT CONCAT(strName,strCity,strState) AS combined_string FROM central" helped me to see error of my way so I changed the statement to. SELECT * FROM central WHERE CONCAT(strName,' ',strCity,' ',strState) it worked. So what do I owe you? - Original Message - From: "Jim Lucas" <[EMAIL PROTECTED]> To: "kvigor" <[EMAIL PROTECTED]> Cc: Sent: Thursday, July 05, 2007 10:10 AM Subject: Re: [PHP] Selecting Rows Based on Row Values Being in Array kvigor wrote: Sorry, That was a typo there's on one IN clause. here is how it reads: SELECT * FROM central WHERE CONCAT(strName,strCity,strState) IN('7orange50lbs','8purple60lbs'). So in my table I have 8 in size column, purple in color column, and 60lbs in weight column. Since the concatenated value will be 8purple60lbs, shouldn't MySQL return that row? Thanks for your patience. Ok, well, here is what I would do now. Just to make sure things are as we are assuming they are. SELECT CONCAT(strName,strCity,strState) AS combined_string FROM central print the results of that sql and see if combined_string looks like what we think it should be. This you can do in phpmyadmin. oh, what is up with the naming conventions? Trying to trick us? To me it would not be obvious that you are storing colors in column for what looks like a city name. Just wondering... -- Jim Lucas "Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them." Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php code in html buttons
I'm trying to make a button execute some php code when the button is clicked. I'm not sure if it is the button i'm coding wrong or the php code. Here is the code I am using. 'Click"; ?> I've got all my variables stored in the php page, and I know they are all correct. But when I push the button it does nothing. I'm not quite sure what I am doing wrong. I have also tried and Obviously i'm a complete newbie. I'd appreciate any help. Thanks.
[PHP] ��Ң�¶١ Licensed Windows XP Pro, win 98, 98 se, Office XP Small, Office
à ÃâÃöá Licensed Windows XP Pro, win 98, 98 se, Office XP Small, Office XP Professional, Office Pro 2003 ¶Ã¡Ãá ¢Ã§á·éá¹è¹Ã¹ 100 % µÃ´µèà Paisarn 06-5881135 - Windows 95 ẺÃà CD ¤ÃºªÃ´ 200 bath - Windows 98 book+COA only 800 bath - Windows 98 book+COA+CD 1,000 bath - Windows 98 SE book + COA + CD ÃâÃÃãÃÃè 1,500 bath - Windows 2000 Professional + CD 2,700 bath - Windows ME ¤ÃèÃÃà + COA + CD 1,800 bath - Windows XP Home Edition ¤ÃèÃÃà + COA 2,000 bath - Windows XP Home Edition ¤ÃèÃÃà + COA + CD 2,700 bath - Windows XP Professional ¤ÃèÃÃà + COA 2,400 bath - Windows XP Professional ¤ÃèÃÃà + COA+CD 3,500bath - Microsoft Office Pro 2003 7,500 bath - Microsoft Office Basic 5500 µÃ´µèà ä¾ÃÃà 06-5881135 [EMAIL PROTECTED] «ÃéÃÃà ÃêôÃèÃ¹à ´ÃÃè§à ¾ÃèäÃú ºÃáÃÃÃ觶ç·Ãè ¡·Ã.-µ¨Ã.¾ÃéÃÃãºà ÃÃç¨ãÃé -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] �Թ����ʹ͡����µ��-����Ѻ����ӧҹ��Ш��������Ңͧ�Ԩ������ͼ�������ҡ�����˹���ѵ���ôԵ�����Թ��������Ҵ͡ᾧ
 ..1 »Ã. 2 »Ã.  .3 »Ã.  .4 »Ã.  .5 »Ã. ..30,000.. ..2,780 .1,530 ..1,120 .. 920 .. 800 ..75,000.. ..6,920 .3,790 ..2,750 ..2,250 ..1,950 100,000....9,170 .5,000 ..3,620 ..2,940 ..2,540 200,000.. .18,250.9,890 .7,140 ..5,780 ..4,980 300,000.. .27,220 14,690 10,550 .8,510 ..7,300 500,000.. .45,130 24,250 17,340 13,920 11,900 700,000.. .63,190 33,950 24,270 19,490 16,660 1,000,000 .90,260 48,490 34,670 27,840 23,790 1,500,000 135,39072,730 52,000 41,750 35,690 ÃÃÃÃà õà : ºÃáÃÃà ¡çºà áÃÃöç·Ãèºéùáà ÷Ãè·Ã§Ã¹ã¹à ¢µ¡ÃÃ§à ·¾ áà ûÃÃó±à µèç¨Ã§ÃÃôÃè§à áÃÃ֍ä»ÃóÃÃì µÃ´µèÃÃú¶ÃÃä´é·Ãè k. chin 06-7815050, 03-7797261 [EMAIL PROTECTED] ¢ÃÃÃÃÃà »ç¹ÃÃèçÃç ¶éÃÃáà Ãà ì¹Ãéú¡Ã¹·èù -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Check if var content was exceeded (float).
-- Powered by Outblaze -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Floats and avoid exponential notation - How?
Hi, From http://www.php.net/manual/en/language.types.float.php (second comment in that page, from "kjohnson at zootweb dot com"): "PHP switches from the standard decimal notation to exponential notation for certain "special" floats. You can see a partial list of such "special" values with this:" Then he goes on about it and finishes with: " I have to be honest: this is one of the strangest things I have seen in any language in over 20 years of coding, and it is a colossal pain to work around." I have the same problem. I have a big number I have to represent, it's usually "1" followed by 10 "zeros", the biggest value I'll have for it is 199, never more than this. I only make one operation with it, (+), most of the time I need that number as a string, and never need it's float representation, only the absolute value (in fact, it's never going to have a fractional part). I cannot use integers because it's bigger than the integer range. If it goes to it's exponential representation, breaks my code. Users are identified by that number. I wrote a small function, but cannot be sure if it's going to work (report error when the exponential notation is used by php), mostly because on my tests, I can't precise when and to which of these numbers php chooses to use the exponential notation: --- code function checkFloat($float_var) { $ar_empty = ""; $string_var = (string)$float_var; $pattern = '/[0-9]|\./'; // From zero to nine and "dots" $match_found = preg_match_all($pattern, $string_var, $ar_empty); unset($ar_empty); if ($match_found != strlen($string_var)) { return false; } else { return true; } } --- code So, any suggestions/thoughts? Is there a way to prevent php from using the exponential notation for a float? thanks = -- Powered by Outblaze -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Floats and avoid exponential notation - How?
Hi, I'm working with floats because I have a big number to identify users, and the only operation I make with this number is to add something less than 100 with 100 (one and ten zeros). Besides that I just need to use the number to search ("=" comparison). I never need the fractional part of the number. As I said, I only use float and not int because of the size of the number. I noticed PHP uses the number in exponential notation sometimes, this happened with both: 410 + 100 and 4153154 + 100. I'm using ctype_digit() to check when this happens. Is there a way to avoid that so that PHP always uses the decimal notation? (The focus on my code is not to generate the new user id, I just need to generate it to do other things. Almost all my functions need to generate the new user id, as we cannot map the old user ids to the new user ids. I'm putting two systems together, at least for now, I need to use the old user id from 1 external source and generate the new user id to operate user records on another external db.) - code -- (receives "old" user id, and changes to the new format) $_SESSION['some_array']['old_user_id'] = $userinfo[0]; // I got the number from DB. Say. 4153154.. $checking_old_user_id = (string)$_SESSION['some_array']['old_user_id']; // So I can use ctype_digit() $_SESSION['some_array']['new_user_id'] = (float)100 + $userinfo[0]; $checking_new_user_id = (string)$_SESSION['some_array']['new_user_id']; $_SESSION['some_array']['foo'] = $userinfo[1]; // Other data if( ctype_digit($checking_old_user_id) == false ) { // Exponential notation detected echo 'some message'; return false; // Script stops! } if( ctype_digit($checking_new_user_id) == false ) { // Exponential notation detected echo 'some message'; return false; } if($_SESSION['some_array']['old_user_id'] < 0) { // Filter input echo 'some message'; return false; } if($_SESSION['some_array']['new_user_id'] < 0) { // Filter input echo 'some message'; return false; } - code Any ideas, suggestions? I would like to make php stop using the exponential notation so I don't need to bother with these checkings. thanks. = -- Powered by Outblaze -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Secure way to handle pw on session.
Hi, I noticed session files are kept on /tmp for a while, and even if they were immediately deleted, well, someone could use one of my php scripts to inject code and read them, since they belong to the httpd user. What's the best way to receive passwords thru a form and store them in the $_SESSION while I process other information to decide whether or not that user is able to proceed and login (check to see if user is also allowed to use that service, not just validate user/pw)? I use https, always, no plain http is used. Thanks = -- Powered by Outblaze -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Secure way to handle pw on session.
> - Original Message - > From: "Dan Joseph" <[EMAIL PROTECTED]> > To: php-general@lists.php.net > Subject: Re: [PHP] Secure way to handle pw on session. > Date: Tue, 2 Sep 2008 15:35:26 -0400 > > > On Tue, Sep 2, 2008 at 3:27 PM, k bah <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > I noticed session files are kept on /tmp for a while, and even if they > > were immediately deleted, well, someone could use one of my php scripts to > > inject code and read them, since they belong to the httpd user. > > What's the best way to receive passwords thru a form and store them in the > > $_SESSION while I process other information to decide whether or not that > > user is able to proceed and login (check to see if user is also allowed to > > use that service, not just validate user/pw)? I use https, always, no plain > > http is used. > > > > Thanks > > > > > I personally would recommend you never store passwords in $_SESSION. > > I don't know how your auth code works, but the way I've always done it would > be to process everything when you his submit, with the password being in > $_POST or $_GET, then after you authenticate the user, drop it and don't > store it with sessions. If you find you need it to be stored for other > things, I'd suggest rethinking the design/checking you're doing. > > -- > -Dan Joseph > You're right, and thanks to all replies, they were all helpful. I rechecked and, really, there's no reason to store password values anywhere, the only 2 places in my code where I use passwords I use it "straight out from the POST". First I filter the content, only allowing to continue if preg_match_all() gives me a "continue" (I compare the return of preg_match_all() with strlen(), and if they are not the same, it means that the received POST value has at least 1 character that is not allowed), I was storing the value on the session, now I simply store it on a script variable (it will be unset once the script ends), and after that I pass it to another function (present on an included php file which actually communicates with the backend where hashed passwords are kept). As you said, after the input cleanup, I unset password on $_POST. Now it only stays on the script local variable, and the called function which does the real auth, once that function ends and the script (a form action url) ends, there's no password. Since I always use https, there's no reason to worry with the path between the user browser and the php script on the server that receives the POST. If there were no https, I would use javascript to not pass the password in plain text to the server. thanks again = -- Powered by Outblaze -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What is wrong here?
Are you using a relative url for the redirection? Cesar Aracena wrote: Hi all, I'm making a site which will reside in a remote server and had several problems... most of them where solved once I saw that register_globals are OFF, but now I dont know which other settings are affecting my scripts. I have trouble with header("Location... because the browser is NOT redirected. If I set an echo statement after I detected that the username and password using $_POST[""], the echo goes OK but if I comment the echo and un-comment the header("Location: http://www.domainname.com";); exit; nothing happens... and no, there isn't anything before that... what can be wrong? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Browser going to page twice?
I'm having a weird problem. When I submit a form on my site, it often sends twice. I'm not sure if this is a client-side or server-side problem, but it doesn't happen on other sites. Is this a common problem, or am I making some dumb mistake? -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] BBCode?
I'm working on adding simple BBCode to my site. I'm currently using the [i] tag for testing, with the following code: function bbcode($text){ $text = ereg_replace('\\[i\\](.{1,})\\[/i\\]','\\1',$text); return $text; } print bbcode('[i]This[/i] is a [i]test[/i].'); ?> But it prints "This[/i] is a [i]test". Is there a better way to do this? -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php