[PHP] Problem in mysql connection
Hello, I have installed php4 rpm in my machine.while connecting php with mysql it is giving fatal error.I have given like this mysql_connect("$servername","$username","$password"); Why it is so .. Is there any other files i have to install to access the database?? Regards, Uma -- 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: Encryption
As far as I'm aware, as long as you use the same seed or salt value, encrypting material will always yield the same results. However, remember that not all servers have support for mcrypt... You may find it better to use something simpler like md5($seed . $data), where $seed is a unique (and hireable) value that you have created. Anas Mughal <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am totally new to encryption. > My question is very simple. > If I use the mcrypt module to encrypt and decrypt some > data, would it guarantee to work consistently with > future versions of the mcryp module (or PHP versions). > > (i.e. Would decription always give me the same > result?) > > Thanks. > > > = > Anas Mughal > [EMAIL PROTECTED] > [EMAIL PROTECTED] > Tel: 973-249-6665 > > __ > Do You Yahoo!? > Great stuff seeking new owners in Yahoo! Auctions! > http://auctions.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] regex
Hi I like to ask something say i got this line b = bla.net a = blabla.com (a and b NOT a variable) i want to use php to take the second line and want to grep the blabla.com how can i do that Yamin Prabudy -- 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] I'm not sure how to do some simple code...
Whoops, that should be: $mystring = "This is a string with the word script in it"; if(eregi("script",$mystring)){ //do something here } - Original Message - From: "Mike Maltese" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 25, 2002 8:41 PM Subject: Re: [PHP] I'm not sure how to do some simple code... > > } > > > - Original Message - > From: "Leif K-Brooks" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, January 25, 2002 8:12 PM > Subject: [PHP] I'm not sure how to do some simple code... > > > > I know this is probably a stupid question, but how do I make it so that if > a > > string contains the word "script" (I'm banning javascript) it does > > something? > > > > -- > > 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] I'm not sure how to do some simple code...
$mystring = "This is a string with the word script in it"; if(eregi("script",$mystring){ //do something here } - Original Message - From: "Leif K-Brooks" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 25, 2002 8:12 PM Subject: [PHP] I'm not sure how to do some simple code... > I know this is probably a stupid question, but how do I make it so that if a > string contains the word "script" (I'm banning javascript) it does > something? > > -- > 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] Passing objects
Well, PHP has 'sessions' which allow you to do just what you are asking, pass variables between multiple pages. Sessions are somewhat like cookies, but all data is stored on the server instead of the client, so you don't have to rely on the user to accept your cookie. Here's a short intro/tutorial that may help you out: http://www.devshed.com/Server_Side/PHP/Sessions/page1.html Jeff > I'm pretty new to PHP. If anyone can elaborate a little on this I would > appreciate it greatly. > > Thanks > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Passing objects
I'm pretty new to PHP. If anyone can elaborate a little on this I would appreciate it greatly. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strings and \n
On Saturday 26 January 2002 04:48, Greg Sidelinger wrote: > Ok I'm having a problem with the new line char \n in strings. I'm > trying to contrast an email that gets sent with the mail() function. > Here is what I'm doing. > > $message = "line1\n"; > $message .= "line2\n\n"; > $message .= "line3\n"; > ... > $message = "lne99"; Is this a typo in your message or in your code? Shouldn't it be: $message .= "lne99"; > > mail ("email", "subject", $message); > > > but when the email is received not all the new lines r taken. Can anyone > help me. Also where can I get a list of all the special chars like \n > and what they meain. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* Biggest security gap -- an open mouth. */ -- 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] move_uploaded_file() query
On Saturday 26 January 2002 05:45, will hives wrote: > No I don't have a procedure to retrieve the new file name that's what I am > looking to do. I don't know how to write that new name into the database. You really need to learn to read the fine manual - chapter on "Handling file uploads". "Give a man a fish and you feed him for a day. Teach a man to fish and he feeds himself for the rest of his life. Or something like that." -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* "Everyone's head is a cheap movie show." -- Jeff G. Bone */ -- 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] I'm not sure how to do some simple code...
I know this is probably a stupid question, but how do I make it so that if a string contains the word "script" (I'm banning javascript) it does something? -- 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] Passing objects
On Saturday 26 January 2002 11:51, Dean Householder wrote: > How can you pass an object from one page to another? Is there any > convenient way to do it with PHP? Yes, use sessions. See chapter on "Session handling functions". -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* Mum's the word. -- Miguel de Cervantes */ -- 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] Passing objects
How can you pass an object from one page to another? Is there any convenient way to do it with PHP? Dean
Re: [PHP] Problem in mysql connection
What was the error message given? Are you sure that mysql is running and working properly? Jeff > Hello, > > I have installed php4 rpm in my machine.while connecting php with > mysql it is giving fatal error.I have given like this > > mysql_connect("$servername","$username","$password"); > > Why it is so .. > > Is there any other files i have to install to access the database?? -- 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] Problem in mysql connection
Hello, I have installed php4 rpm in my machine.while connecting php with mysql it is giving fatal error.I have given like this mysql_connect("$servername","$username","$password"); Why it is so .. Is there any other files i have to install to access the database?? Regards, Uma -- 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] Encryption
I am totally new to encryption. My question is very simple. If I use the mcrypt module to encrypt and decrypt some data, would it guarantee to work consistently with future versions of the mcryp module (or PHP versions). (i.e. Would decription always give me the same result?) Thanks. = Anas Mughal [EMAIL PROTECTED] [EMAIL PROTECTED] Tel: 973-249-6665 __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.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]
Re: [PHP] PHP IDE
I'm probably not objective, but the upcoming (Feb 4) Zend Studio is pretty darned good, and it works perfectly under Linux. You can try the beta (even though final release will have much more impressive/intelligent code completion) at zend.com/store/beta.php Zeev On Fri, 25 Jan 2002, Rafael Perazzo B Mota wrote: > Who knows a good Php IDE for linux, like PHP Code ? > > Rafael Perazzo > > > > _ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com > > > -- Zeev Suraski <[EMAIL PROTECTED]> http://www.zend.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] Re: Printing JPEG images generated with ImageJPEG with IE/WIN
>To: [EMAIL PROTECTED] >Message-ID: <[EMAIL PROTECTED]> >Date: Fri, 25 Jan 2002 16:20:57 +0100 >From: Martin Thoma <[EMAIL PROTECTED]> >MIME-Version: 1.0 >Content-Type: text/plain; charset=us-ascii >Content-Transfer-Encoding: 7bit >Subject: Re: Printing JPEG images generated with ImageJPEG with IE/WIN > >Hm, it could be that IE tries to reload the picture (which isn't there >anymore because the form-data has been expired). Perhaps saving the >picture temporarly on the server will prevent the problem. > That could be what is happening. I'm generating data for students to analyze on one page with the hidden form and generating a graph of the data with the next page. The only thing generated is the image. If I date/time stamp the image file I could serve that up on the next page...it would be good to get the right graph to the right student. Might be worth a try. Curious that it works with Mac IE and Win Netscape but not Win IE. David -- David Bourne OUHSC College of Pharmacy [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] Re: HELP! with PHP extension <
Make sure you've copied the contents of the c:\php\dlls folder to your system directory (\windows\system, \winnt\system32, not sure 'bout 2K). Your extension_dir setting in php.ini should be extension_dir = c:/php/extensions/ And make sure you've copied your php.ini to your windows directory (\windows, \winnt, again not sure 'bout 2K) Andre Amaral <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi all, > > Here is the situation. > > I have Windows 2000 SP2, IIS5 running PHP 4.1.1 using CGI. > > My PHP folder is C:\php > Extension Folder is: C:\php\extension > PHP.INI file: extention_dir = "C:\php\extension\" > > First problem that I have is loading extensions. Every time I try to > uncomment an extension on PHP.INI I get the following message after restart > IIS. > > [Unable to load dynamic library 'C:\php\extension\php_db.dll' - The > specified procedure could not be found] > > I also want to mention that I tried the follwing in PHP.INI... > > extention_dir = ".;C:\php\extension\" > extention_dir = ",;C:\php\extension\" > extention_dir = "C:/php/extension/" > > Obs.: All DLL's the came with the original package are there. > > Second problem is that every single script I execute in my server it gives > me the following error... > > [PHP Warning: Undefined property: blabla in c:\blabla\blabla] > > Obs.: The 'blablabla' is representing the propperty and the folder > > Thank you guys. I hope I get some good help. I need it really bad. I've been > burning my brain on this for the past 2 weeks. > > > > > > > > -- 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: upgrade problem
It sounds like an inconsisteny in the library versions. Try and get the latetst version of the GD library, (source if necessary), or if you have a tool that is capable of analyzing .so/.dll dependancies, use that. Chuck Barnett <[EMAIL PROTECTED]> wrote in message 002301c1a607$c3dff1e0$[EMAIL PROTECTED]">news:002301c1a607$c3dff1e0$[EMAIL PROTECTED]... > Hi, I have been running 4.0.3 or so and I was upgrading to 4.1.1. > > I also upgraded gdlib to 1.8.4. I compiled php with jpeg support and gd > support > > everything made and compiled ok. > > when I restart apache I get this: > > Setting up Web Service: Syntax error on line 58 of > /etc/httpd/conf/httpd.conf: > Cannot load /etc/httpd/modules/libphp4.so into server: > /etc/httpd/modules/libphp4.so: undefined symbol: gdImageCreateFromGif > > to get apache running again I have to copy my backup libphp4.so. > > I know it probably has something to do with an older version of gdlib but > I'm not sure. > > My box is a Cobalt RAQ4. If anyone has any ideas please help :) > > Thanks, > Chuck > > > > -- 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] upgrade problem
Hi, I have been running 4.0.3 or so and I was upgrading to 4.1.1. I also upgraded gdlib to 1.8.4. I compiled php with jpeg support and gd support everything made and compiled ok. when I restart apache I get this: Setting up Web Service: Syntax error on line 58 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/libphp4.so into server: /etc/httpd/modules/libphp4.so: undefined symbol: gdImageCreateFromGif to get apache running again I have to copy my backup libphp4.so. I know it probably has something to do with an older version of gdlib but I'm not sure. My box is a Cobalt RAQ4. If anyone has any ideas please help :) Thanks, Chuck -- 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] HELP! with PHP extension <
Hi all, Here is the situation. I have Windows 2000 SP2, IIS5 running PHP 4.1.1 using CGI. My PHP folder is C:\php Extension Folder is: C:\php\extension PHP.INI file: extention_dir = "C:\php\extension\" First problem that I have is loading extensions. Every time I try to uncomment an extension on PHP.INI I get the following message after restart IIS. [Unable to load dynamic library 'C:\php\extension\php_db.dll' - The specified procedure could not be found] I also want to mention that I tried the follwing in PHP.INI... extention_dir = ".;C:\php\extension\" extention_dir = ",;C:\php\extension\" extention_dir = "C:/php/extension/" Obs.: All DLL's the came with the original package are there. Second problem is that every single script I execute in my server it gives me the following error... [PHP Warning: Undefined property: blabla in c:\blabla\blabla] Obs.: The 'blablabla' is representing the propperty and the folder Thank you guys. I hope I get some good help. I need it really bad. I've been burning my brain on this for the past 2 weeks. -- 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] Classes for PUP & MySQL in Southern California
There's a whole section on training in MySQL at their web site. MySQL AB, a company which provides a great deal of support to the MySQL community, offers training and other support for MySQL (it is their only form of revenue, except for commercial Microsoft-based MySQL licensing). The training section is at http://mysql.com/training/index.html . Erik On Friday, January 25, 2002, at 05:36 PM, Ben Clumeck wrote: > Is there any classes that anyone knows of for PHP & MySQL? I am just > learning PHP and have bought a couple of books that have helped. > However, I > need to become proficient quickly. Thanks for your help. > > Ben > > > -- > 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] Classes for PUP & MySQL in Southern California
Ben Clumeck wrote: > Is there any classes that anyone knows of for PHP & MySQL? I am just > learning PHP and have bought a couple of books that have helped. However, I > need to become proficient quickly. Thanks for your help. > > Ben > > Hi Ben - Although we're not in Southern Cal yet, we do have a course in Michigan which you might be interested in. You can call 1-866-745-3660 toll free for more information on it. If you've already been through a couple books, that's plenty to get you started in our course - we spend less than a day on beginning basics and progress quickly after that for an entire week. I can promise you you would get proficient quickly and not be bored. :) Best of luck. Michael Kimsal http://www.tapinternet.com/php/ 734-480-9961 -- 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] Classes for PUP & MySQL in Southern California
Is there any classes that anyone knows of for PHP & MySQL? I am just learning PHP and have bought a couple of books that have helped. However, I need to become proficient quickly. Thanks for your help. Ben -- 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] break statement usage
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Erik Price blurted > On Friday, January 25, 2002, at 04:24 PM, Nick Wilson wrote: > > > >Try to keep your posts a little shorter > >if only for the sake of the dial-up users ;) > > > > Do you suggest this tip whenever someone includes the contents of the > last ten messages of a thread as quoted material below their three lines > of response? Occasionally. The point of threading is /follow/ a conversation not build upon it each time by repeating. Generally accepted net etiquette is to quote only what is necessary for someone picking up a thread in the middle to get the general idea. (and of course to quote the points you are responding to :) > In fact, a couple of times over the course of this week I've opened an > email from Nick Wilson saying "Please post more information about your > problem if you want us to help you." Which I think is appropriate, and Sure, it's always a Q. of balance. > I'm not criticizing you for this. But it takes a few extra seconds out Are you certain? > of everyone's day to read messages like this, even those of us with high > speed access. Don't you agree that if everyone took a few more words to > say what they mean, we'd actually save a bit of bandwidth in the long > run? I just thought your post was a little over detailed for what you were actually asking. I didn't mean to cause offense hence the friendly way of expressing my point as opposed to the 'well I'm not actually swearing so it's OK to flame people right?' approach. - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8UdqNHpvrrTa6L5oRAk+uAJ0SNZlwSwNSZhH1ZS9QY7/SSZeaYQCglGUU 37Ft88fX/JWfm/hs2oaRGP0= =lkSa -END PGP SIGNATURE- -- 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] break statement usage
On Friday, January 25, 2002, at 04:24 PM, Nick Wilson wrote: > > Try to keep your posts a little shorter > if only for the sake of the dialup users ;) > > Thanks for the tip, but I find that a more verbose message makes explicit what I am asking. How many times have you seen "I break my code with this error message: (error message.) Please help meEee!!!" and that's it. Do you suggest this tip whenever someone includes the contents of the last ten messages of a thread as quoted material below their three lines of response? In fact, a couple of times over the course of this week I've opened an email from Nick Wilson saying "Please post more information about your problem if you want us to help you." Which I think is appropriate, and I'm not criticizing you for this. But it takes a few extra seconds out of everyone's day to read messages like this, even those of us with high speed access. Don't you agree that if everyone took a few more words to say what they mean, we'd actually save a bit of bandwidth in the long run? Cheers, Erik -- 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: [PHP-DEV] Re: RFE: $HTTP_POST_VARS =& $_POST;
"Andi Gutmans" <[EMAIL PROTECTED]> wrote > PHP 5 per-class constants can already except static arrays such as > array(1, 2, 3) as their value. I'll put the issue of global constants on > my TODO and believe PHP 5 will also support these for global constants. > However, you won't be able to create a constant with a non-constant value > such as $_GET as this goes against the whole idea of constant :) This is not true to my mind. define ("INC_DIR",$foo); this "Constant" is not predefined by the developer, BUT it is a constant-value for the rest of the script. To my mind such "constants" make sense, because - they are global - they can't change their value while execution - it doesn't matter if the constant-value is set dynamically when defining it So I would be glad to see this feature in PHP5. Christian Dickmann -- 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] move_uploaded_file() query
in article [EMAIL PROTECTED], Jason Wong at [EMAIL PROTECTED] wrote on 25/1/02 3:14 pm: > On Friday 25 January 2002 17:35, Will Hives wrote: > >> Sorry for my past ignorance using this news site forum I can only out this >> down to my lack of knowledge. >> >> I have been work on me first script for some time now and have been making >> good progress up until now. I have a script that adds a author to the >> database, ID, Name, Email, Picture Name. >> >> When a author is added it uploads their details plus it uploads and renames >> the image...that is working fine. It all falls down when I try and call the >> new file name to show the picture. It is uploading the original file name >> to the database and not the renamed version. >> >> I would be very grateful for any pointers on how this small problem can be >> solved. I hope this makes more sense than previous threads I have >> submitted. >> >> Cheers >> Will >> >> Here is the script as it stands: >> >> $sql = "INSERT INTO $table_name (id, name, email, picture_name) >> VALUES ('$id', '$name', '$email', '$picture_name') "; >> >> $result = @mysql_query($sql, $connection) or die ("couldn't execute >> query"); >> >> if ($picture != "") { >> >> $path = "/home/main/main/php/"; >> $datee = date("sdFy"); >> move_uploaded_file($picture,$path . $datee . $picture_name); >> >> } > > Is this the *full* script? I don't see where you are setting $picture_name? > > Also what you are inserting into the database is not the same as what you are > renaming your file to (you're adding a date string to the filename). Do you > have a procedure to resolve the correct filename when retrieving the data > from the db? > No I don't have a procedure to retrieve the new file name that's what I am looking to do. I don't know how to write that new name into the database. Picture name is the file name that is being inserted into the database (THIS IS THE OLD FILE NAME)from the html form. The browse field is named 'picture' (see all code below) the name that the database is capturing is not the new name of the fill ie. not the one that has the date inserted at start. Thank you for your help Cheers Will html form/ my contact management system: add a contact Name & email information name: email: File to Upload: php script/ my contact management system: add a contact Name & email information name: email: File to Upload: http://www.main.net/main/$picture_name";; ?>> -- 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] WinNT extensions
Give me a break, all they have to do is edit the php.ini file. I'd find another provider. - Original Message - From: "Paul Roberts" <[EMAIL PROTECTED]> To: "Malcolm" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, January 25, 2002 1:33 PM Subject: Re: [PHP] WinNT extensions > Don't you pay them for the very difficult stuff! > > > Paul Roberts > [EMAIL PROTECTED] > > - Original Message - > From: "Malcolm" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, January 25, 2002 11:04 AM > Subject: [PHP] WinNT extensions > > > > Hi all > > > > I am building a simple web based mail app. I tried to contact my mail server > > using imap_open() but all I got was this: > > > > Fatal error: Call to undefined function: imap_open() in d:\... on line > > 15 > > > > I got in touch with my provider who replied: > > > > IMAP support was not compiled into the > > Windows version of PHP. Unfortunately, > > compiling it by hand is very difficult. > > It requires having Microsoft Visual C++, along > > with a bunch of other tools. So...it looks like > > you'll need to use another method to view mail. > > Sorry for the bad news. > > > > I thought imap functionality was in a dll which can be loaded dynamically: > > dl("php_imap.dll"); > > imap_open("a","u","p"); > > > > Can anyone please enlighten me? Is it built in? They use PHP 4.1.1. > > > > Malcolm > > > > > > > > -- > > 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] WinNT extensions
Don't you pay them for the very difficult stuff! Paul Roberts [EMAIL PROTECTED] - Original Message - From: "Malcolm" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 25, 2002 11:04 AM Subject: [PHP] WinNT extensions > Hi all > > I am building a simple web based mail app. I tried to contact my mail server > using imap_open() but all I got was this: > > Fatal error: Call to undefined function: imap_open() in d:\... on line > 15 > > I got in touch with my provider who replied: > > IMAP support was not compiled into the > Windows version of PHP. Unfortunately, > compiling it by hand is very difficult. > It requires having Microsoft Visual C++, along > with a bunch of other tools. So...it looks like > you'll need to use another method to view mail. > Sorry for the bad news. > > I thought imap functionality was in a dll which can be loaded dynamically: > dl("php_imap.dll"); > imap_open("a","u","p"); > > Can anyone please enlighten me? Is it built in? They use PHP 4.1.1. > > Malcolm > > > > -- > 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] strings and \n
\r\n or \n\r is not helping. The thing that confuses me is that some of the \n lines work just fine while others do not. So if anyone give give me a hint y it is not working all the time please send me email. Greg -Original Message- From: Nick Wilson [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 3:56 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] strings and \n -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Greg Sidelinger blurted > Ok I'm having a problem with the new line char \n in strings. I'm > trying to contrast an email that gets sent with the mail() function. > Here is what I'm doing. > > $message = "line1\n"; > $message .= "line2\n\n"; > $message .= "line3\n"; > > but when the email is received not all the new lines r taken. Can anyone > help me. Also where can I get a list of all the special chars like \n > and what they meain. I think you need to try \r\n (poss. other way round) That should do it. - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8UcZYHpvrrTa6L5oRAuliAJ4vouXleTkRY6IvSva2xS6BBnJHMgCeKHJW n3BzuUtk5LYJ3gra3SqxnXs= =fgqQ -END PGP SIGNATURE- -- 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] Outreaching (announcement)
That has been reported by someone else earlier today and I really don't know what the problem is - could you please provide some more info? What's your MySQL version? Does it happen on all pages or only on some? What does the error message say (please copy ALL of the data on the page). Thanks! Bogdan Matthew Walker wrote: > I downloaded the current version to test, and I don't know how you call > it stable enough to use. I continually get permission denied errors > accessing the DB. Some of them go away if I refresh, others don't. And > yes, the user has full permissions to the relevant DB. > > Matthew Walker > Ecommerce Project Manager > Mountain Top Herbs > > -Original Message- > From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 24, 2002 8:14 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Outreaching (announcement) > > Hi all! > > As posted some time ago, the company I'm working for developed a GPL > system > for project development (basically keeping in touch with the customers > while > developing a project). I think this project may be of some interest for > some > of you (well, hopefully, for may of you), so here's the manifesto: > __ > > OPT (Outreach Project Tool) is a PHP general-purpose virtual commonplace > for > customers and developers to collaborate in developing projects. The > system > provides documents archive, e-mail archive, request tracker, task > management, > knowledge base, news administration, newsletter support and a lot of > other > features (some project-based, some system-based). > __ > > Hope this may help some of you with your customers! The current version > is > 0.9 (beta - the first public release), but it's stable and comes with a > nice > setup interface (yes, I have been thinking of you guys). This release > has > been tested for more than eight months in a production environment, with > real > customers. > > So, the URL is http://sourceforge.net/projects/outreach - and you know > my > e-mail for complaints :-) > > HTH > > Bogdan > > -- > 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] > > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.317 / Virus Database: 176 - Release Date: 1/21/2002 > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.317 / Virus Database: 176 - Release Date: 1/21/2002 > > > -- > 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] break statement usage
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Erik Price blurted > So what I'm wondering is, > > Is it bad coding practice to make heavy use of "break" statements in > switch() flow control? That's exactly the point of the break statement, it was designed to be used in a switch statement to 'break' from the statement. It replaces the need for complex and untidy 'if else' monsters. Try to keep your posts a little shorter if only for the sake of the dialup users ;) Cheers - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8Uc0PHpvrrTa6L5oRAvcAAJ9Z67PVwgyNN7WFpf/R0wvN97IMkgCgm53O 1TbPTWhwyl8FNEhtLRRYv/c= =UDbQ -END PGP SIGNATURE- -- 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] break statement usage
Good day, Actually, using the "break" statement is the accepted, proper way to break out of a switch statement, just as it is in other programming languages. And yes, the "break" statement can be used to terminate other loops, such as "while" and "for", just like in other languages. Using it there is not considered bad programming practice either, although in the case of the while statement you should try to utilize the loop condition if possible. FYI, the command to break to the next iteration of a loop is "continue". The PHP site has very good documentation on the usage and appropriateness for "switch", "break" and "continue". I would highly recommend you take a look, if you have not already. Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 2:11 PM To: PHP Subject: [PHP] break statement usage Hello, all I have a quick question about using the "break" statement from within a switch() statement. After accepting user input from a form, I want to run this input through some error checking via PHP code (not Javascript error checking). So the first thing is the code puts the input through to a couple of error functions (this is all inside of a switch statement that is determined by a radio button on the previous page). If the error functions show the input as invalid, I echo back a specific error-message telling the user which field needs to be fixed, and then "break" to end the case statement. That way the input never comes near the database functions (mysql_query()) if it is invalid input. Is this a poor way to code -- using the "break" as a shortcut to jump out of the switch statement? Are there other ways that "break" can be used -- such as from loops? I've been learning Python on the side, and in that language, the "break" statement is used often, sometimes in a loop like while 1 do some code if condition is true break This is basically an infinite loop until the condition is true -- though I've never seen a WHILE loop in PHP that is formed this way (using a 1 to make it happen infinitely until a condition is met and then BREAKing out of the loop). Usually, at least from what I've seen, PHP WHILE loops are constructed so that they terminate when a condition is met specified immediately after the WHILE, as in: while (x < $number_of_iterations) { do some code } So what I'm wondering is, Is it bad coding practice to make heavy use of "break" statements in switch() flow control? Thank you for your opinions, Erik -- 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] adding contents to xml file string ways
here is my code, i am trying to acheive this "; $Entry= $openingEntry."$numberAtt"."$myNumber".$nameAtt."$myName".$dateAtt."$myDate" .$messageAtt."$myMessage".$linkAtt."$myLink".$closingEntry; $fileName = "news.xml"; if ($fp = fopen ($fileName, "a+")){ $contents = fread ($fp, filesize ($fileName)); $temp = substr($contents,6); $newContents = "" . $Entry . $temp; print "$newContents"; fwrite($fp,$newContents); fclose($fp); echo "done = true"; } else { echo "done = false"; } ?> i have an xml file with the following, I want to add an entry like this: any ideas? i think i am ont he right track, short of splitting the contents into arrays.Id rather deal with it in strings help? thanx travis -- 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] Uploading a file
Many thanks! I did not read far enough in the docs to note the part about PHP 4.0. That has fixed the problem. Todd -- Todd Cary Ariste Software [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] break statement usage
Hello, all I have a quick question about using the "break" statement from within a switch() statement. After accepting user input from a form, I want to run this input through some error checking via PHP code (not Javascript error checking). So the first thing is the code puts the input through to a couple of error functions (this is all inside of a switch statement that is determined by a radio button on the previous page). If the error functions show the input as invalid, I echo back a specific error-message telling the user which field needs to be fixed, and then "break" to end the case statement. That way the input never comes near the database functions (mysql_query()) if it is invalid input. Is this a poor way to code -- using the "break" as a shortcut to jump out of the switch statement? Are there other ways that "break" can be used -- such as from loops? I've been learning Python on the side, and in that language, the "break" statement is used often, sometimes in a loop like while 1 do some code if condition is true break This is basically an infinite loop until the condition is true -- though I've never seen a WHILE loop in PHP that is formed this way (using a 1 to make it happen infinitely until a condition is met and then BREAKing out of the loop). Usually, at least from what I've seen, PHP WHILE loops are constructed so that they terminate when a condition is met specified immediately after the WHILE, as in: while (x < $number_of_iterations) { do some code } So what I'm wondering is, Is it bad coding practice to make heavy use of "break" statements in switch() flow control? Thank you for your opinions, Erik -- 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: [PEAR-DEV] Re: [binarycloud-dev] Re: [PEAR-DEV] Re: [metabase-dev] RE: [PEAR-DEV] New Metabase Aniversary release
Hello, Björn Schotte wrote: > > * Stig S. Bakken wrote: > > this effort. I don't understand why this is an issue for you, could you > > explain? > > I already explained it several times. I understand your concern of this PEAR-DB x Metabase merger may open a precedent that will motivate others to come along with their components and propose mergers with other PEAR-DB components. I think that is a good precedent because it will let PEAR components implementations evolve, of course by keeping backwards compatibility to not break the applications of people that rely on the current implementation of PEAR components. Of course, like with PEAR-DB x Metabase, no component merger should happen if the interested parties do not agree with the terms of merger. If a favourable decision is made, it should be because the agreed merger terms were beneficial to the interested parties. Here interested parties means, the proposing authors and some PEAR representatives preferrably elected in a democratic process to evaluate proposals and make decisions regarding them. Currently there is nobody elected as PEAR representative but if I got it right it should happen some time soon. Regards, Manuel Lemos -- 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] strings and \n
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Greg Sidelinger blurted > Ok I'm having a problem with the new line char \n in strings. I'm > trying to contrast an email that gets sent with the mail() function. > Here is what I'm doing. > > $message = "line1\n"; > $message .= "line2\n\n"; > $message .= "line3\n"; > > but when the email is received not all the new lines r taken. Can anyone > help me. Also where can I get a list of all the special chars like \n > and what they meain. I think you need to try \r\n (poss. other way round) That should do it. - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8UcZYHpvrrTa6L5oRAuliAJ4vouXleTkRY6IvSva2xS6BBnJHMgCeKHJW n3BzuUtk5LYJ3gra3SqxnXs= =fgqQ -END PGP SIGNATURE- -- 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] Must results from MySQL fetches always be an Array??
try $something=settype(mysql_result($variable,0),"string"); - Original Message - From: "daniel" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 25, 2002 12:25 PM Subject: Re: [PHP] Must results from MySQL fetches always be an Array?? > > This is sort of a "is there an easier/better way" kind of question. No > > error or problem, but I'd like to know how others handle it. > > > > I'm fetching single elements of data from several tables, then piecing > > it together. Here's an example of one element I need to fetch: > > > > $series = mysql_fetch_array(mysql_query("SELECT key2 FROM models WHERE > > lang='$lang' AND recordname='$model'",$db)); > > > > Now I realize that with this function $series will always be an array, > > even if it contains just one element (which it does). What I'd like to > > know is, can I write that statement so that $series is created just as a > > string? (So that I don't have to write "$series = $series[0];" > > immediately afterwards in order to treat $series as a $string.) > > > > ...Rene > > function mysql_get_one_field($stmt,$db) { > $res = mysql_query($stmt,$db); > $series = mysql_fetch_array($res); > mysql_free_result($res); > > return $series[0]; > } > > > > Daniel J. Lashua > > > -- > 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] Re: [binarycloud-dev] Re: [PEAR-DEV] Re: [metabase-dev] RE:[PEAR-DEV] New Metabase Aniversary release
> I'm currently writing "The PEAR Manifest", a document that clearly > defines PEAR once and for all. I'll post the first draft on pear-dev > here when it's done, but to answer your question, there has been talk > about a "core" set of packages for a while. In the manifest these are > called PFC (PHP Foundation Classes), although it will not say which > packages the PFC includes. The manifest also covers PECL, and how PEAR > relates to applications and frameworks. Fantastic. This is all great news and I really do look forward to working with you so we don't duplicate efforts. It's great to hear that you're going to "define" PEAR once and for all. best, _alex -- 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] strings and \n
Ok I'm having a problem with the new line char \n in strings. I'm trying to contrast an email that gets sent with the mail() function. Here is what I'm doing. $message = "line1\n"; $message .= "line2\n\n"; $message .= "line3\n"; ... $message = "lne99"; mail ("email", "subject", $message); but when the email is received not all the new lines r taken. Can anyone help me. Also where can I get a list of all the special chars like \n and what they meain. Greg
Re: [PHP] use linux commands within php
> try this > > > system ("/usr/bin/wc -l $userfile> t.txt"); > > $fd =fopen('t.txt', 'r'); > $buffer=fgets($fd,8); > > echo ($buffer); > fclose($fd); > > ?> Or... if you really just want to count the number of lines in a file... do this: This offers the advantage of having the file loaded into an array, since... chances are you want to do something with it after you spit out how many lines are in it. Daniel J. Lashua -- 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] Must results from MySQL fetches always be an Array??
> This is sort of a "is there an easier/better way" kind of question. No > error or problem, but I'd like to know how others handle it. > > I'm fetching single elements of data from several tables, then piecing > it together. Here's an example of one element I need to fetch: > > $series = mysql_fetch_array(mysql_query("SELECT key2 FROM models WHERE > lang='$lang' AND recordname='$model'",$db)); > > Now I realize that with this function $series will always be an array, > even if it contains just one element (which it does). What I'd like to > know is, can I write that statement so that $series is created just as a > string? (So that I don't have to write "$series = $series[0];" > immediately afterwards in order to treat $series as a $string.) > > ...Rene function mysql_get_one_field($stmt,$db) { $res = mysql_query($stmt,$db); $series = mysql_fetch_array($res); mysql_free_result($res); return $series[0]; } Daniel J. Lashua -- 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] Check browser-type?
http://www.php.net/manual/en/function.get-browser.php -Original Message- From: Mårten Andersson [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 1:47 PM To: [EMAIL PROTECTED] Subject: [PHP] Check browser-type? Hello. I need to check wich browser-type and/or OS an visitor have to a page Im developing. I need to know if the browser /OS is a handheld computer.. Or at least check if its NOT a handheld computer. Is this posible with PHP? I have just started with this programing language and its a bit difficult to search in PHP.net when I dont know exactly what I am looking for.. =) Thanks. //Mårten -- Mårten Andersson Loddbygatan 2 60218 Norrköping Sverige ICQ: 86515830 URL: http://www.vanvett.net/marten -- 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] Check browser-type?
* and then Mårten Andersson blurted > Hello. > > I need to check wich browser-type and/or OS an visitor have to a page > > Is this posible with PHP? > I have just started with this programing language and its a bit > difficult to search in PHP.net when I dont know exactly what I am > looking for.. =) Check out $HTTP_USER_AGENT It contains all you need. There is a good tutorial on this at www.sitepoint,com (you'll have to search) and all the other good sites have covered it. eg, www.phpbuilder.com www.devshed.com Have fun. -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com msg47464/pgp0.pgp Description: PGP signature
Re: [PHP] use linux commands within php
try this t.txt"); $fd =fopen('t.txt', 'r'); $buffer=fgets($fd,8); echo ($buffer); fclose($fd); ?> On Fri, 25 Jan 2002 11:41:44 -0800 (PST) toni baker <[EMAIL PROTECTED]> wrote: > How can I count the number of lines in the uploaded > file. ($userfile) > > What's wrong with the command below. Thanks > > $fp = popen ("usr/bin/wc -l $userfile", "r"); > > __ > Do You Yahoo!? > Great stuff seeking new owners in Yahoo! Auctions! > http://auctions.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] -- +---+ | Pablo Dall'Oglio _ | | Univates - IT Department °v° | | Linux User n. 223253 /(_)\| | The best source is the source code^ ^ | +---+ -- 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] Check browser-type?
Hello. I need to check wich browser-type and/or OS an visitor have to a page Im developing. I need to know if the browser /OS is a handheld computer.. Or at least check if its NOT a handheld computer. Is this posible with PHP? I have just started with this programing language and its a bit difficult to search in PHP.net when I dont know exactly what I am looking for.. =) Thanks. //Mårten -- Mårten Andersson Loddbygatan 2 60218 Norrköping Sverige ICQ: 86515830 URL: http://www.vanvett.net/marten
[PHP] Re: dynamic variables in sq?l
Than you very much for all help! I see that my database design is a little dumb, so I'll just make another one. Best regards Raymond "Raymond Lilleodegard" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi all! > > I have this form with some choices: > > > Enter how many cars you want: > > ford > bmw > mercedes > > > And then I am trying to get the price out of a table in my database with > this code: > > > $sql = mysql_query("SELECT '$car' FROM varetabell where carid='$carid' "); > $myrow= mysql_fetch_array($sql); > $x = $myrow["$car"]; > > $price = $x * $number; > > > Shouldn't this work? Or am I missing something here? > > > > Best regards Raymond > > > > -- 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] use linux commands within php
How can I count the number of lines in the uploaded file. ($userfile) What's wrong with the command below. Thanks $fp = popen ("usr/bin/wc -l $userfile", "r"); __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.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]
Re: [PHP] Install wddx extention for php 4.1.1
Try leaving off the --with-expat-dir switch completely. PHP comes with its own expat. On Fri, 25 Jan 2002, Ziying Sherwin wrote: > > We tried to install php 4.1.1 with wddx support on our Solaris 2.8 with > gcc 3.0. We installed expat library 1.2 (download from > http://www.jclark.com/xml/expat.html) and wddx 1.0a. We also installed > apache 1.3.22 which comes with expat support). > > We configure our php with the following options: > > --with-xml > --enable-wddx > --with-expat-dir=/depot/package/expat_1.2 > > However, we keep getting the following error messages: > >In file included from internal_functions.c:66: > /site4/web_kit_1.0_rodgers/php_4.1.1/ext/wddx/php_wddx.h:26:19: expat.h: > No such file or directory > > There is no header file called "expat.h" in either expat 1.2 package or > apache 1.3.22 package. Did we install the wrong expat package? Which > package do we have to install in order to get wddx compiled in php? > > Thanks, > Ziying Sherwin > > P. S. I am not on this mailing list, please send your response to: > > [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] Install wddx extention for php 4.1.1
We tried to install php 4.1.1 with wddx support on our Solaris 2.8 with gcc 3.0. We installed expat library 1.2 (download from http://www.jclark.com/xml/expat.html) and wddx 1.0a. We also installed apache 1.3.22 which comes with expat support). We configure our php with the following options: --with-xml --enable-wddx --with-expat-dir=/depot/package/expat_1.2 However, we keep getting the following error messages: In file included from internal_functions.c:66: /site4/web_kit_1.0_rodgers/php_4.1.1/ext/wddx/php_wddx.h:26:19: expat.h: No such file or directory There is no header file called "expat.h" in either expat 1.2 package or apache 1.3.22 package. Did we install the wrong expat package? Which package do we have to install in order to get wddx compiled in php? Thanks, Ziying Sherwin P. S. I am not on this mailing list, please send your response to: [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] dynamic variables in sq?l
With my respects to your design may I suggest the following: 1- Table: CARS car_id car_name active_flag price 1 BMWY 100 2 FORD Y 50 etc. Then in your form you can hava a dynamic LOV: $sql = "select car_id, car_name from cars where active_flag = 'Y'"; $result = mysql_query($sql); echo ""; while (list($car_id,$car_name)=mysql_fetch_array($result)) { echo "$carname"; } echo ""; Then when the form is called you will pass the car_id. your sql will be $sql = "select price from cars where car_id = '$car_id'"; $result = mysql_query($sql); $car_price = mysql_result($result,0); //or //$car_price = mysql_fetch_row($result); I hope this helps. --- Raymond_Lilleødegård <[EMAIL PROTECTED]> wrote: > mysql table is set up like this: > > -- > bmw | ford | mercedes | > -- > 100 | 50 | 120 | > > > It is just a very simple one. > > > > - Original Message - > From: "Jeff Sheltren" <[EMAIL PROTECTED]> > To: "Raymond Lilleodegard" <[EMAIL PROTECTED]>; > <[EMAIL PROTECTED]> > Sent: Friday, January 25, 2002 8:00 PM > Subject: Re: [PHP] dynamic variables in sq?l > > > > Can you show how your mysql table is set up? Otherwise > I am not quite > sure > > what you are trying to do with your SQL statement. > > > > Jeff > > > > > And then I am trying to get the price out of a table > in my database with > > > this code: > > > > > > > > > $sql = mysql_query("SELECT '$car' FROM varetabell > where carid='$carid' > "); > > > $myrow= mysql_fetch_array($sql); > > > $x = $myrow["$car"]; > > > > > > $price = $x * $number; > > > > > > > > > > > > -- > 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] > = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.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]
RE: [PHP] Question: $_* etc or $HTTP_*_VARS etc
Hrm. Thanks. Apparently they didn't feel like listing $_FILES here: http://www.php.net/release_4_1_0.php $_GET - contains form variables sent through GET $_POST - contains form variables sent through POST $_COOKIE - contains HTTP cookie variables $_SERVER - contains server variables (e.g., REMOTE_ADDR) $_ENV - contains the environment variables $_REQUEST - a merge of the GET variables, POST variables and Cookie variables. In other words - all the information that is coming from the user, and that from a security point of view, cannot be trusted. $_SESSION - contains HTTP variables registered by the session module (no $_FILES) Ahh well. Now I know. Thanks. -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 1:11 PM To: Gonzalez, Zara E Cc: 'PHP-General' Subject: RE: [PHP] Question: $_* etc or $HTTP_*_VARS etc http://www.php.net/manual/en/features.file-upload.php $HTTP_POST_FILES or $_FILES -Rasmus On Fri, 25 Jan 2002, Gonzalez, Zara E wrote: > To add on to this question, I have an upload script that I use on my > site and now that I have registered globals off, I can't seem to find > where the auto-generated $*_name $*_type $*_size variables are > going... > > Anyone have any insight? I thought they would be in $_POST['$*_name'] > but they aren't showing up there. > > Help is appreciated, > > Zara > > -Original Message- > From: Gonzalez, Zara E > Sent: Friday, January 25, 2002 10:02 AM > To: 'PHP-General' > Subject: [PHP] Question: $_* etc or $HTTP_*_VARS etc > > > I am going through some code that I wrote recently and trying to > change it so that I can turn register globals off in my php.ini. > However, before I do that I want to make sure I am using the right > variables. > > I read in the manual that $HTTP_*_VARS has been 'replaced' by $_* is > this correct? Should I be using $_* syntax then? > > The only reason I am asking instead of trusting the manual is because > I'd hate to have misread something and thought I understood it, > recoded my site, and then realized I used the wrong variables. So if > someone could just tell me one or the other I'd be happy. > > (Oh I'm using php 4.1.1 if that makes a difference since I believe the > manual said the $_* syntax started at 4.1.0?) > > Thanks, > > Zara > > -- > 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] Question: $_* etc or $HTTP_*_VARS etc
http://www.php.net/manual/en/features.file-upload.php $HTTP_POST_FILES or $_FILES -Rasmus On Fri, 25 Jan 2002, Gonzalez, Zara E wrote: > To add on to this question, I have an upload script that I use on my site and > now that I have registered globals off, I can't seem to find where the > auto-generated $*_name $*_type $*_size variables are going... > > Anyone have any insight? I thought they would be in $_POST['$*_name'] but they > aren't showing up there. > > Help is appreciated, > > Zara > > -Original Message- > From: Gonzalez, Zara E > Sent: Friday, January 25, 2002 10:02 AM > To: 'PHP-General' > Subject: [PHP] Question: $_* etc or $HTTP_*_VARS etc > > > I am going through some code that I wrote recently and trying to change it so > that I can turn register globals off in my php.ini. However, before I do that I > want to make sure I am using the right variables. > > I read in the manual that $HTTP_*_VARS has been 'replaced' by $_* is this > correct? Should I be using $_* syntax then? > > The only reason I am asking instead of trusting the manual is because I'd hate > to have misread something and thought I understood it, recoded my site, and then > realized I used the wrong variables. So if someone could just tell me one or the > other I'd be happy. > > (Oh I'm using php 4.1.1 if that makes a difference since I believe the manual > said the $_* syntax started at 4.1.0?) > > Thanks, > > Zara > > -- > 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] Question: $_* etc or $HTTP_*_VARS etc
To add on to this question, I have an upload script that I use on my site and now that I have registered globals off, I can't seem to find where the auto-generated $*_name $*_type $*_size variables are going... Anyone have any insight? I thought they would be in $_POST['$*_name'] but they aren't showing up there. Help is appreciated, Zara -Original Message- From: Gonzalez, Zara E Sent: Friday, January 25, 2002 10:02 AM To: 'PHP-General' Subject: [PHP] Question: $_* etc or $HTTP_*_VARS etc I am going through some code that I wrote recently and trying to change it so that I can turn register globals off in my php.ini. However, before I do that I want to make sure I am using the right variables. I read in the manual that $HTTP_*_VARS has been 'replaced' by $_* is this correct? Should I be using $_* syntax then? The only reason I am asking instead of trusting the manual is because I'd hate to have misread something and thought I understood it, recoded my site, and then realized I used the wrong variables. So if someone could just tell me one or the other I'd be happy. (Oh I'm using php 4.1.1 if that makes a difference since I believe the manual said the $_* syntax started at 4.1.0?) Thanks, Zara -- 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] Outreaching (announcement)
I downloaded the current version to test, and I don't know how you call it stable enough to use. I continually get permission denied errors accessing the DB. Some of them go away if I refresh, others don't. And yes, the user has full permissions to the relevant DB. Matthew Walker Ecommerce Project Manager Mountain Top Herbs -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 8:14 PM To: [EMAIL PROTECTED] Subject: [PHP] Outreaching (announcement) Hi all! As posted some time ago, the company I'm working for developed a GPL system for project development (basically keeping in touch with the customers while developing a project). I think this project may be of some interest for some of you (well, hopefully, for may of you), so here's the manifesto: __ OPT (Outreach Project Tool) is a PHP general-purpose virtual commonplace for customers and developers to collaborate in developing projects. The system provides documents archive, e-mail archive, request tracker, task management, knowledge base, news administration, newsletter support and a lot of other features (some project-based, some system-based). __ Hope this may help some of you with your customers! The current version is 0.9 (beta - the first public release), but it's stable and comes with a nice setup interface (yes, I have been thinking of you guys). This release has been tested for more than eight months in a production environment, with real customers. So, the URL is http://sourceforge.net/projects/outreach - and you know my e-mail for complaints :-) HTH Bogdan -- 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] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.317 / Virus Database: 176 - Release Date: 1/21/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.317 / Virus Database: 176 - Release Date: 1/21/2002 -- 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: Dual Pentium Pro 200 vs. Single Pentium II 450
I've set up a PHP server (using Apache, MySQL and PHP module) successfully on the follwoing systems: Win98, Pentium120, 32MB Ram <-- pretty fast Win95, 486-100Mhz, 16MB Ram <-- Was speedy apart from the dodgy hard disk Win95, 486-25Mhz, 8Mb Ram <-- chugs along quite nicely as a personal web server. I think either of your two configurations would be more than sufficient as Mike has said. I've never had any serious performance problems on any hardware using PHP and Apache. LJ "Phil Schwarzmann" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I have two PCs, one is a Dual Pentium Pro 200Mhz and the other is a > Pentium II 450Mhz (both have 64MB) > > I want to set one of them up using Linux Red Hat 7.2, Apache, MySQL, > and PHP. I only plan to have about 1-3 users accessing it at any one > time. > > Which of those CPUs do you think is better? Will Linux take full > advantage of those Dual Processors? > > Thanks for your advice! > -- 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] dynamic variables in sq?l
mysql table is set up like this: -- bmw | ford | mercedes | -- 100 | 50 | 120 | It is just a very simple one. - Original Message - From: "Jeff Sheltren" <[EMAIL PROTECTED]> To: "Raymond Lilleodegard" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, January 25, 2002 8:00 PM Subject: Re: [PHP] dynamic variables in sq?l > Can you show how your mysql table is set up? Otherwise I am not quite sure > what you are trying to do with your SQL statement. > > Jeff > > > And then I am trying to get the price out of a table in my database with > > this code: > > > > > > $sql = mysql_query("SELECT '$car' FROM varetabell where carid='$carid' "); > > $myrow= mysql_fetch_array($sql); > > $x = $myrow["$car"]; > > > > $price = $x * $number; > > > > > -- 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] Reg Exp Help
YES! I was working that out as well. One correction though, this line should read: $temp_int_id = trim(substr($file_array[$i], 21, 4)); I guess the lesson learned is to use substr() when the length of the $string is fixed. Since I have to use substr() and trim() twice, I wonder if this has more or less overhead than a single regular expression? Thank you. Zach -Original Message- From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 11:36 AM To: Zach Curtis Subject: Re: [PHP] Reg Exp Help You said: > The password and int_id begin and end in fixed positions. > > password begins in position 13 and can occupy up to 8 characters > int_id begins in position 21 and can occupy up to 4 characters > > Sometimes a password (or int_id) may occupy all of those fixed position or > only some of the fixed positions, it's variable. so that would make the code like this: > Here is part of my actual code, if that makes any difference. > > $password // this var was retrieved from db > $int_id // this var was retrieved from db > > $file_array = file("$DOCUMENT_ROOT/dir/file.dat"); > $count = count($file_array); > if ($count == 0) > echo "No records found in .dat file."; > > for ($i = 0; $i < $count; $i++) > { $temp_pass = trim(substr($file_array[$i], 13, 8)); $temp_int_id = trim(substr, $file_array[$i], 21, 4)); if ($temp_pass == $password && $temp_int_id == $int_id) > { > // do stuff > } > } > > > Zach > > -Original Message- > From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 25, 2002 10:29 AM > To: Zach Curtis > Subject: Re: [PHP] Reg Exp Help > > > but if the positions as fixed, why don't you use the substr, and then trim > th result? > > Edward > > - Original Message - > From: "Zach Curtis" <[EMAIL PROTECTED]> > To: "Edward van Bilderbeek - Bean IT" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Friday, January 25, 2002 6:12 PM > Subject: RE: [PHP] Reg Exp Help > > > > The password and int_id begin and end in fixed positions. > > > > password begins in position 13 and can occupy up to 8 characters > > int_id begins in position 21 and can occupy up to 4 characters > > > > Sometimes a password (or int_id) may occupy all of those fixed position or > > only some of the fixed positions, it's variable. > > > > > > Zach > > > > -Original Message- > > From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] > > Sent: Friday, January 25, 2002 9:58 AM > > To: Zach Curtis > > Subject: Re: [PHP] Reg Exp Help > > > > > > how can I see that it isn't a 6 char $password with a 3 char $int_id ?? > > > > > This one has a 8 character $password, followed by zero white spaces, > > > followed by a single character $int_id > > > 7d2ad345b > > > > Edward > > > > > > - Original Message - > > From: "Zach Curtis" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Friday, January 25, 2002 5:51 PM > > Subject: [PHP] Reg Exp Help > > > > > > > I am trying to code a regular expression that will match at the > beginning > > of > > > the string the contents of $password, followed by 0 or more occurrences > of > > > white space, followed by the contents of $int_id. The match should be > case > > > insensitive. > > > > > > Here are some examples of the strings: > > > > > > This one has a 6 character $password, followed by two white spaces, > > followed > > > by a single character $int_id > > > 9a9b9c z > > > > > > This one has a 8 character $password, followed by zero white spaces, > > > followed by a single character $int_id > > > 7d2ad345b > > > > > > This one has a 5 character $password, followed by three white spaces, > > > followed by a four character $int_id > > > d22ad bbaw > > > > > > > > > Here is the regular expression I am trying to use that does not find the > > > match and produces "Warning: REG_BADRPT". > > > > > > (eregi("^\$password+[[:space:]]*+\$int_id", $file_array[$i])) > > > > > > Any corrections? Thanks in advance. > > > > > > > > > Zach Curtis > > > POPULUS > > > > > > > > > -- > > > 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] dynamic variables in sq?l
Can you show how your mysql table is set up? Otherwise I am not quite sure what you are trying to do with your SQL statement. Jeff > And then I am trying to get the price out of a table in my database with > this code: > > > $sql = mysql_query("SELECT '$car' FROM varetabell where carid='$carid' "); > $myrow= mysql_fetch_array($sql); > $x = $myrow["$car"]; > > $price = $x * $number; > -- 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] dynamic variables in sq?l
Hi all! I have this form with some choices: Enter how many cars you want: ford bmw mercedes And then I am trying to get the price out of a table in my database with this code: $sql = mysql_query("SELECT '$car' FROM varetabell where carid='$carid' "); $myrow= mysql_fetch_array($sql); $x = $myrow["$car"]; $price = $x * $number; Shouldn't this work? Or am I missing something here? Best regards Raymond -- 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] Must results from MySQL fetches always be an Array??
On Fri, 25 Jan 2002, [ISO-8859-1] René Fournier wrote: > $series = mysql_fetch_array(mysql_query("SELECT key2 FROM models WHERE > lang='$lang' AND recordname='$model'",$db)); > > Now I realize that with this function $series will always be an array, > even if it contains just one element (which it does). What I'd like to > know is, can I write that statement so that $series is created just as a > string? (So that I don't have to write "$series = $series[0];" > immediately afterwards in order to treat $series as a $string.) If you're sure that mysql_fetch_array is always returning an array with a single element, you could use implode to convert the array to a string... $series = implode('', mysql_fetch_array(mysql_query( ... Check http://www.php.net/manual/en/function.implode.php for details on the implode function. mh -- 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] How to echo the "/n", "/r", etc... to the HTML display?
I suppose "sp" is space? Two suggestions: Why don't you do (print here the string as-is. newlines and spaces will be kept as they are by the browser) Another Possibility: $string = preg_replace("/\\s/", " ", $string); I hope I addressed your problem and didn't miss the point best regards Stefan Rusterholz - Original Message - From: "Scott Fletcher" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 25, 2002 6:31 PM Subject: [PHP] How to echo the "/n", "/r", etc... to the HTML display? > Hi! > > I have been working on this part for a few days now! It had become > appareant that HTML is not able to do this, so I'm trying to get it to work > in PHP but no luck! The string I see like this is when I run the UNIX > command "od -av |more". > > --clip here-- > del cr lf cr lf cr lf cr > 020 lf P A G E sp 1 sp sp sp D A T E sp sp > 0401 - 2 5 - 2 0 0 2 sp sp T I M E sp > 0601 0 : 3 8 : 1 4 sp sp P @ F E P sp > 100 sp V 0 0 1 sp sp T C A 1 cr > --clip end-- > > So, you see, if I use the PHP function, nl2br(), that took care of the > "cr" and the "lf". But it doesn't take care of the "sp" so how do I fix > that? This "sp" when work correctly will be able to justify the text on > each line. Anyone know? > > thanks, > Scott > > > > -- > 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] Reg Exp Help
Here is part of my actual code, if that makes any difference. $password // this var was retrieved from db $int_id // this var was retrieved from db $file_array = file("$DOCUMENT_ROOT/dir/file.dat"); $count = count($file_array); if ($count == 0) echo "No records found in .dat file."; for ($i = 0; $i < $count; $i++) { if (eregi("^\$password+[[:space:]]*+\$int_id", $file_array[$i])) { // do stuff } } Zach -Original Message- From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 10:29 AM To: Zach Curtis Subject: Re: [PHP] Reg Exp Help but if the positions as fixed, why don't you use the substr, and then trim th result? Edward - Original Message - From: "Zach Curtis" <[EMAIL PROTECTED]> To: "Edward van Bilderbeek - Bean IT" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, January 25, 2002 6:12 PM Subject: RE: [PHP] Reg Exp Help > The password and int_id begin and end in fixed positions. > > password begins in position 13 and can occupy up to 8 characters > int_id begins in position 21 and can occupy up to 4 characters > > Sometimes a password (or int_id) may occupy all of those fixed position or > only some of the fixed positions, it's variable. > > > Zach > > -Original Message- > From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 25, 2002 9:58 AM > To: Zach Curtis > Subject: Re: [PHP] Reg Exp Help > > > how can I see that it isn't a 6 char $password with a 3 char $int_id ?? > > > This one has a 8 character $password, followed by zero white spaces, > > followed by a single character $int_id > > 7d2ad345b > > Edward > > > - Original Message - > From: "Zach Curtis" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, January 25, 2002 5:51 PM > Subject: [PHP] Reg Exp Help > > > > I am trying to code a regular expression that will match at the beginning > of > > the string the contents of $password, followed by 0 or more occurrences of > > white space, followed by the contents of $int_id. The match should be case > > insensitive. > > > > Here are some examples of the strings: > > > > This one has a 6 character $password, followed by two white spaces, > followed > > by a single character $int_id > > 9a9b9c z > > > > This one has a 8 character $password, followed by zero white spaces, > > followed by a single character $int_id > > 7d2ad345b > > > > This one has a 5 character $password, followed by three white spaces, > > followed by a four character $int_id > > d22ad bbaw > > > > > > Here is the regular expression I am trying to use that does not find the > > match and produces "Warning: REG_BADRPT". > > > > (eregi("^\$password+[[:space:]]*+\$int_id", $file_array[$i])) > > > > Any corrections? Thanks in advance. > > > > > > Zach Curtis > > POPULUS > > > > > > -- > > 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] Must results from MySQL fetches always be an Array??
This is sort of a "is there an easier/better way" kind of question. No error or problem, but I'd like to know how others handle it. I'm fetching single elements of data from several tables, then piecing it together. Here's an example of one element I need to fetch: $series = mysql_fetch_array(mysql_query("SELECT key2 FROM models WHERE lang='$lang' AND recordname='$model'",$db)); Now I realize that with this function $series will always be an array, even if it contains just one element (which it does). What I'd like to know is, can I write that statement so that $series is created just as a string? (So that I don't have to write "$series = $series[0];" immediately afterwards in order to treat $series as a $string.) ...Rene --- René Fournier [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] Reg Exp Help
Hmmm. I am searching thru a flat file that has been loaded into an array ($file_array[$i]). As each iteration of the array is loaded (each row of the flat file) , I was trying to search for this unique combination. The $password is not unique. And $int_id is not unique enough (e.g., "a", "b", "c", etc.) to be searched for on its own. However, $password and $int_id joined together is unique. Also, the $password and $int_id are in a fixed position in each header row, however, not every row in the flat file is a header row (no...I didn't create a flat file in this way!). I am confident the correct regular expression would resolve this. I will keep thinking about substr() and trim(), but I don't see how to use those to resolve this issue. Zach -Original Message- From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 10:29 AM To: Zach Curtis Subject: Re: [PHP] Reg Exp Help but if the positions as fixed, why don't you use the substr, and then trim th result? Edward - Original Message - From: "Zach Curtis" <[EMAIL PROTECTED]> To: "Edward van Bilderbeek - Bean IT" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, January 25, 2002 6:12 PM Subject: RE: [PHP] Reg Exp Help > The password and int_id begin and end in fixed positions. > > password begins in position 13 and can occupy up to 8 characters > int_id begins in position 21 and can occupy up to 4 characters > > Sometimes a password (or int_id) may occupy all of those fixed position or > only some of the fixed positions, it's variable. > > > Zach > > -Original Message- > From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 25, 2002 9:58 AM > To: Zach Curtis > Subject: Re: [PHP] Reg Exp Help > > > how can I see that it isn't a 6 char $password with a 3 char $int_id ?? > > > This one has a 8 character $password, followed by zero white spaces, > > followed by a single character $int_id > > 7d2ad345b > > Edward > > > - Original Message - > From: "Zach Curtis" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, January 25, 2002 5:51 PM > Subject: [PHP] Reg Exp Help > > > > I am trying to code a regular expression that will match at the beginning > of > > the string the contents of $password, followed by 0 or more occurrences of > > white space, followed by the contents of $int_id. The match should be case > > insensitive. > > > > Here are some examples of the strings: > > > > This one has a 6 character $password, followed by two white spaces, > followed > > by a single character $int_id > > 9a9b9c z > > > > This one has a 8 character $password, followed by zero white spaces, > > followed by a single character $int_id > > 7d2ad345b > > > > This one has a 5 character $password, followed by three white spaces, > > followed by a four character $int_id > > d22ad bbaw > > > > > > Here is the regular expression I am trying to use that does not find the > > match and produces "Warning: REG_BADRPT". > > > > (eregi("^\$password+[[:space:]]*+\$int_id", $file_array[$i])) > > > > Any corrections? Thanks in advance. > > > > > > Zach Curtis > > POPULUS > > > > > > -- > > 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] WinNT extensions
> IMAP support was not compiled into the > Windows version of PHP. Unfortunately, > compiling it by hand is very difficult. > It requires having Microsoft Visual C++, along > with a bunch of other tools. So...it looks like > you'll need to use another method to view mail. > Sorry for the bad news. Yes if you want to compile php_imap.dll yourself than you need all these tools, but luckily kind folks in the PHP community compile it for you. So if you download the full binary from www.php.net (http://www.php.net/do_download.php?download_file=php-4.1.1-Win32.zip) you can simply include it in php.ini. So I do not at all understand the provider's problem. I would not recommend using dl(), because a) I think it has been deprecated more or less and b) it is not so fast. Florian > > I thought imap functionality was in a dll which can be loaded dynamically: > dl("php_imap.dll"); > imap_open("a","u","p"); > > Can anyone please enlighten me? Is it built in? They use PHP 4.1.1. > > Malcolm > > > > -- > 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] > Florian Clever http://fc.clever-soft.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] How to echo the "/n", "/r", etc... to the HTML display?
Hi! I have been working on this part for a few days now! It had become appareant that HTML is not able to do this, so I'm trying to get it to work in PHP but no luck! The string I see like this is when I run the UNIX command "od -av |more". --clip here-- del cr lf cr lf cr lf cr 020 lf P A G E sp 1 sp sp sp D A T E sp sp 0401 - 2 5 - 2 0 0 2 sp sp T I M E sp 0601 0 : 3 8 : 1 4 sp sp P @ F E P sp 100 sp V 0 0 1 sp sp T C A 1 cr --clip end-- So, you see, if I use the PHP function, nl2br(), that took care of the "cr" and the "lf". But it doesn't take care of the "sp" so how do I fix that? This "sp" when work correctly will be able to justify the text on each line. Anyone know? thanks, Scott -- 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] Reg Exp Help
The password and int_id begin and end in fixed positions. password begins in position 13 and can occupy up to 8 characters int_id begins in position 21 and can occupy up to 4 characters Sometimes a password (or int_id) may occupy all of those fixed position or only some of the fixed positions, it's variable. Zach -Original Message- From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 9:58 AM To: Zach Curtis Subject: Re: [PHP] Reg Exp Help how can I see that it isn't a 6 char $password with a 3 char $int_id ?? > This one has a 8 character $password, followed by zero white spaces, > followed by a single character $int_id > 7d2ad345b Edward - Original Message - From: "Zach Curtis" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 25, 2002 5:51 PM Subject: [PHP] Reg Exp Help > I am trying to code a regular expression that will match at the beginning of > the string the contents of $password, followed by 0 or more occurrences of > white space, followed by the contents of $int_id. The match should be case > insensitive. > > Here are some examples of the strings: > > This one has a 6 character $password, followed by two white spaces, followed > by a single character $int_id > 9a9b9c z > > This one has a 8 character $password, followed by zero white spaces, > followed by a single character $int_id > 7d2ad345b > > This one has a 5 character $password, followed by three white spaces, > followed by a four character $int_id > d22ad bbaw > > > Here is the regular expression I am trying to use that does not find the > match and produces "Warning: REG_BADRPT". > > (eregi("^\$password+[[:space:]]*+\$int_id", $file_array[$i])) > > Any corrections? Thanks in advance. > > > Zach Curtis > POPULUS > > > -- > 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] Help with regular expressions
Daniel, > Hi! I´m new to regular expressions, and it seems to be an art to make it > work as expected. > > I´m trying to remove all "single-line" comments from an string - that´s > everything after "//" to the end of a line. I expected that this would do > the job: ereg_replace("//[[:alnum:]]*\n","",$string), but it didn´t work. > > Any tips? RegEx can be expensive. Always ask "do I need one?" In this case, use a string find to locate the // and the following \n (or whatever marks the end of line on your/supported OpSys), then substring or string replace. If would be quite interesting to see a performance comparison on this - if you've got time... =dn PS if you were working with alpha-text and had to consider upper and lower case, then things might sound very different! -- 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] Building my site... again
Andrew- > Note, > > This will not work with PHP as a CGI. I honestly don't know, as I don't run PHP as a CGI. However... if there is a problem with this, I would be inclined to think that it was Apaches fault, and not PHPs. Daniel -- 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] Reg Exp Help
I am trying to code a regular expression that will match at the beginning of the string the contents of $password, followed by 0 or more occurrences of white space, followed by the contents of $int_id. The match should be case insensitive. Here are some examples of the strings: This one has a 6 character $password, followed by two white spaces, followed by a single character $int_id 9a9b9c z This one has a 8 character $password, followed by zero white spaces, followed by a single character $int_id 7d2ad345b This one has a 5 character $password, followed by three white spaces, followed by a four character $int_id d22ad bbaw Here is the regular expression I am trying to use that does not find the match and produces "Warning: REG_BADRPT". (eregi("^\$password+[[:space:]]*+\$int_id", $file_array[$i])) Any corrections? Thanks in advance. Zach Curtis POPULUS -- 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: Uploading a file
Sorry if this is obvious but . . . have you checked whether your server is running in "safe mode"? I had the same problem and finally realized that it would NEVER work cause the webserver was running in safe mode. (Disclaimer here -- I'm no sysadmin and don't know if Linux even has a safemode!) I'm not sure how to get around this. There are certain specific people I'd like to be able to upload PDFs to the webserver. But I don't want them to have full FTP privileges. I guess one solution would be to find/write an FTP program that you can use to give people limited upload privileges -- for example they can only upload into one specific directory and they can only upload pdfs. I haven't found any such program, so I guess I could write one -- if I knew how to write an ftp program :) PHP has an ftp module I believe, though I'm sure my ISP passed on installing that one. Any ideas, no matter how outlandish, are much appreciated. So many cool things to learn, so little time. Rita -Original Message- From: Todd Cary [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 2:12 PM To: [EMAIL PROTECTED] Subject: Uploading a file For some reason, I cannot get the following code to work - the file is not sent to the server. Is there something obviously wrong? I am using Apache on Linux (RH 7.2). Todd Submit this file: -- Todd Cary Ariste Software [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] Building my site... again
Nick- > That will still cause a problem though won't it (i think I wrote my > example URL this way also!) as the index.php gets in the way. Hence the > use of a .htaccess to force php to treat a file called 'index' as a php > file. Like: > > URL= http://you.com/index/cars/ferrari Nah... the search engines don't care at all. However if you're picky, you can rename the file from "index.php" to "index" (or whatever you want) and then add a ForceType via Apache's .htaccess like this: ForceType application/x-httpd-php Put... that step is really for "cleanliness" of the URL, as the spiders don't care at all. Daniel -- 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: getting a LAMP job in this economy
Erik Price wrote: > > > > This is a good point. I'm using the LAMP scheme right now for my > employer (though I haven't yet explained the advantages). I'm hoping > that, when I'm done, I can provide a report explaining how much was > saved by going with open source solutions -- right now the only two > purchases made specifically for my project were > > 1) Mac OS X 10.1 > 2) Extra memory for the Linux server > > (and I'd like them to buy me the full version of BBedit so I don't have > to use the "lite" -- $89 upgrade) > > Is there a resource that helps me weigh the cost-effectiveness of the > choices I made? (Note that the savings aren't as great as you might > think -- we already have Oracle and a hosting service that provides ASP, > but I wonder what the licenses would have cost us.) > > I don't think there are any resources that address that because it's really very broad and to some extent a bit subjective. Your point about your hosting provider already providing ASP is part of that. "It's already provided for free" - well, you're not getting 100% of that machine. There may be 200 other accounts on there, all of which affect your performance. Same is true in shared linux accounts, no doubt, but my experience has been that LAMP is better at resource sharing/balancing without bogging down (anecdotal only - I have no hard proof). But if you're noticing slow downs on your site, especially if you're getting decent traffic, you have to upgrade to a dedicated machine. At that point, the licensing costs come in to play, although MS has extremely competitive ASP (app service provider) plans for hosting SQLserver, ASP, etc to try to minimize the cost for hosting providers doing dedicated machines. Free is still free, and they can't quite beat that yet. :) If you're stuck in 'hosting' environments, you'll be hard pressed to show the cost savings, because it's often $5-$10/month difference for comparable ASP or LAMP setups. The difference comes in, imo, in upgrading to full server(s). You've got the one time hit, plus the cost of PCAnywhere or something (you could live with VNC I guess) to do remote admin, plus the security track record. I'd be happy to discuss more of this with you if you want to take it off list if this is getting too offtopic. Michael Kimsal http://www.tapinternet.com/php PHP Training Courses 734-480-9961 -- 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: What if 1,000 people access the database at one time?
Michael Waples wrote: > > Phil Schwarzmann wrote: > > > > So let's say Bill is accessing a MySQL table and is about to UPDATE some > > information on a particular row. Meanwhile, Al is doing a sort on that > > same table. > > > > Couldn't Al's sorting possibly screw up Bill's updating?? Or does > > MySQL have some built in functions that prevent this? > > > > Thanks! > > Phil snip wrong reply > ah I guess you don't mean a select but table maintenance stuff. Should have read it more carefully. Still you'll be safe -- 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] fopen and sending data to a remote url
hi folks, apart from using fopen, is there another way of just sending data to a remote url on the fly without leaving your current page? thanks dk -- 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: regexp to substitute incremental strings
Hi mweb, try this: blah blah blah some text, html markup... blah blah again"; $string = preg_replace("//i", "", $string); echo nl2br($string); ?> ~James "Mweb" <> wrote in message ... Hello, What is the right regexp to handle this, either in a while loop (how?) or all by itself? The closer I've come to the solution is: -- 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: phpwiki save button
On Thursday 24 January 2002 10:07 am, Tim Ward wrote: > I think you just need to add the timestamp to the start of the story before > you save it, > i.e. > $content = date("d/m/Y H:i:s - ") . $content; > Where do I put this? I'm still floundering. Sorry. btw...Thanks for all your help so far. Tim > or am I missing something? > > > Tim > www.chessish.com --- snip // snip --- -- 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] Building my site... again
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Andrew Hill blurted > Nick, > > Dunno, but in my experience (and that of a few people who also opened bugs > on it) any path info that is not "real" causes the CGI to bomb out with an > "Internal Server Error". Hi Andrew, check out my .htacces, I'm sure this would help you do it :) # .htacces file containing Apache directives # for 'search engine friendly' indexing and # custom error pages # First the 404 ErrorDocument 404 /general/404.php # Now the page handlers ForceType application/x-httpd-php HTH - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8UYSkHpvrrTa6L5oRAuyvAJ45FhFMet/FHetUGaMaBSTrL6oFgwCcD6QD zWXIc3wqOYulBo/pPS0LVGw= =MMsp -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP is a Bloated Kludge, discuss!
Don't feed the troll.. "Php" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On a conceptual level, I for one am a great fan of the kludge. > > Every piece of software is a trade off between performance and speed of > development. > > You can have the fastest app in the world for $1,000,000 in development time > OR > you can write up a in-elegant solution in 5minutes ($50) and if its slow buy > a bigger > server for < $5000. > > You choose. > > Taken in relation to PHP. I would rather have the developers of it release > new code > that is not optimized, then have 1 release every two years, full of very > pretty blocks > of code designed to make the hardcore OOP textbook fanatic orgasm. > > Check out mozilla.org if you want to see what elegant programmers can do. > - 2 years later a web browser intended to be small and fast, can know take > out your trash, > wash your car - and guess what? > no release 1.0 yet. > > > Sean > > > > > > > -- 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] A link
Stupid. Animates a window that says "You should not have come here!" to dance around the screen, then locks up the browser by having two new windows call each other in a loop... gotta love 'Force Quit' on Mac OS X. Or 'kill' in any other Unix. Or 'turn JS off' in your browser. Erik On Friday, January 25, 2002, at 05:13 AM, Nick Wilson wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > * and then Jon Haworth blurted >> Agreed, what a tit. >> >> For anyone vaguely interested, it's a redirect followed by a lame >> javascript. Have a look at the source code, quite safely, at: >> >> http://www.samspade.org/t/safe?u=http://m-net.arbornet.org/~fusion/ > > What does that function do? > What was he trying to achieve? > - -- > > Nick Wilson > > Tel: +45 3325 0688 > Fax: +45 3325 0677 > Web: www.explodingnet.com > > > > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.0.6 (GNU/Linux) > > iD8DBQE8US+0HpvrrTa6L5oRApprAJ0arjxLjhhpBY+cS5c6F3SD8/3NqACgomJ9 > R9UNz7vKVf9kJ4UYL9Ol9Os= > =Z9ep > -END PGP SIGNATURE- > > -- > 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] Building my site... again
Nick, Dunno, but in my experience (and that of a few people who also opened bugs on it) any path info that is not "real" causes the CGI to bomb out with an "Internal Server Error". So while this will work: index.php?foo=bar This will not, since there is no physical directory "foo" and no file "bar": index.php/foo/bar Best regards, Andrew Hill > -Original Message- > From: Nick Wilson [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 25, 2002 11:03 AM > To: PHP-General > Subject: Re: [PHP] Building my site... again > > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > * and then Andrew Hill blurted > > Note, > > > > This will not work with PHP as a CGI. > > How come? > > - -- > > Nick Wilson > > Tel: +45 3325 0688 > Fax: +45 3325 0677 > Web: www.explodingnet.com > > > > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.0.6 (GNU/Linux) > > iD8DBQE8UYGlHpvrrTa6L5oRAiOUAJ4+utKQrhQ2Vy4533lLjriNO8sXmQCfRJrw > cackhuwr2ACMGFu/fbYxfcs= > =3wVL > -END PGP SIGNATURE- > > -- > 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] Building my site... again
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then daniel blurted > To ensure that the search engines like you and your pages, you can > make your URLs appear more normal by doing something like this: > > URL= http://you.com/index.php/cars/ferrari That will still cause a problem though won't it (i think I wrote my example URL this way also!) as the index.php gets in the way. Hence the use of a .htaccess to force php to treat a file called 'index' as a php file. Like: URL= http://you.com/index/cars/ferrari - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8UYKgHpvrrTa6L5oRAoiuAJ4nfc5TD1xjOlOHXZpa/m+lPEIGjQCaArY9 RCJ7Rb7TE8WWDPU3/yFi7hQ= =tJZl -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Question: $_* etc or $HTTP_*_VARS etc
I am going through some code that I wrote recently and trying to change it so that I can turn register globals off in my php.ini. However, before I do that I want to make sure I am using the right variables. I read in the manual that $HTTP_*_VARS has been 'replaced' by $_* is this correct? Should I be using $_* syntax then? The only reason I am asking instead of trusting the manual is because I'd hate to have misread something and thought I understood it, recoded my site, and then realized I used the wrong variables. So if someone could just tell me one or the other I'd be happy. (Oh I'm using php 4.1.1 if that makes a difference since I believe the manual said the $_* syntax started at 4.1.0?) Thanks, Zara -- 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] Building my site... again
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Andrew Hill blurted > Note, > > This will not work with PHP as a CGI. How come? - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8UYGlHpvrrTa6L5oRAiOUAJ4+utKQrhQ2Vy4533lLjriNO8sXmQCfRJrw cackhuwr2ACMGFu/fbYxfcs= =3wVL -END PGP SIGNATURE- -- 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] What if 1,000 people access the database at one time?
Phil, To start with MySQL tables aren't sorted unless some type of maintenance is taking place, and many of those operations can be done on copies of the tables. Check http://www.mysql.com/doc/T/a/Table_maintenance.html for more information. Given that, I would expect the person maintaining the database would take it off line. The "sort" is handled by the way in which you use ORDER BY in your SELECT statement, so it doesn't affect the underlying table structure. MySQL is thread-safe, so different users can execute SELECT and UPDATE's simultaneously. A SELECT wouldn't affect an UPDATE. In terms of timeliness of UPDATEs and SELECTs, that's almost a non-issue as one cannot know in advance what will be updated or inserted. Regards - Miles Thompson At 10:22 AM 1/25/2002 -0500, Phil Schwarzmann wrote: >So let's say Bill is accessing a MySQL table and is about to UPDATE some >information on a particular row. Meanwhile, Al is doing a sort on that >same table. > >Couldn't Al's sorting possibly screw up Bill's updating?? Or does >MySQL have some built in functions that prevent this? > >Thanks! >Phil -- 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] Building my site... again
> Now. I would of course like for my site to be listed in the search engines, > and I wouldn't mind getting search hits on both cars and ferrari. But. Will > the web spiders and web crawlers ever follow a link like > index.php?page=cars&subpage=ferrari and will they ever index what they find > there, and, and, and, and... > > Well... does anyone understand what I'm asking here? WOuld this be a good > way to build my site to ensure getting hits from search engines, or should I > do this some other way? Anyone know? To ensure that the search engines like you and your pages, you can make your URLs appear more normal by doing something like this: URL= http://you.com/index.php/cars/ferrari Then... in your code you can access the additional data by looking at the $PATH_INFO variable: Hope this helps, Daniel J. Lashua -- 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: What if 1,000 people access the database at one time?
Phil Schwarzmann wrote: > > So let's say Bill is accessing a MySQL table and is about to UPDATE some > information on a particular row. Meanwhile, Al is doing a sort on that > same table. > > Couldn't Al's sorting possibly screw up Bill's updating?? Or does > MySQL have some built in functions that prevent this? > > Thanks! > Phil This is really better suited to the mysql list but anyway - In your case If Al started the sort first the update would wait until the select is finished for the update. MYsql has this wonderful feature called table locking - so an update needs to lock the table preventing access to it. So your data wont get stuffed, you'll just get the typical MYsql slowness when you've got a lot of updating and reading going on. You need not suffer this get a database that doesn't block readers (eg Al wanting to read the table while bill updates it) use something like Postgresql (postgresql.org) or Fierbird (firebirdsql.org) both are free. Or you could use INNodb tables in MYsql as they don't block readers either. But MYsql is missing a lot of basic stuff like sub selects so if you have a choice dump MYsql. MYsql is not noted for its performance with a lot of concurrent connections. -- 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] Building my site... again
Note, This will not work with PHP as a CGI. Best regards, Andrew Hill > * and then Torkil Johnsen blurted > > Now. I would of course like for my site to be listed in the > search engines, > > and I wouldn't mind getting search hits on both cars and > ferrari. But. Will > > the web spiders and web crawlers ever follow a link like > > index.php?page=cars&subpage=ferrari and will they ever index > what they find > > there, and, and, and, and... > > Some will, some wont. The trick is to use something like this > index.php/cars/ferrari using Apache's backward searching feature. > Together with a very simple .htaccess you can fool Apache into looking > for the dirctory 'ferrari' and when it doesn't find it look for the dir > cars (php assigns these values to the vars $page and $subpage) and when > it finally finds index.php you can feed it those vars and let it do its > stuff. > -- 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 and NT hashes
I'm looking for a way to have php form NT hashes from passwords for storage in mysql for distribution to samba smbpassword files ... this possible? Thanks! Anthony -- 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] Building my site... again
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Torkil Johnsen blurted > Now. I would of course like for my site to be listed in the search engines, > and I wouldn't mind getting search hits on both cars and ferrari. But. Will > the web spiders and web crawlers ever follow a link like > index.php?page=cars&subpage=ferrari and will they ever index what they find > there, and, and, and, and... Some will, some wont. The trick is to use something like this index.php/cars/ferrari using Apache's backward searching feature. Together with a very simple .htaccess you can fool Apache into looking for the dirctory 'ferrari' and when it doesn't find it look for the dir cars (php assigns these values to the vars $page and $subpage) and when it finally finds index.php you can feed it those vars and let it do its stuff. I can't remember all the details as it was ages ago that I did this on my site but you can find a very good tutorial on www.sitepoint.com you'll have to do a little searching as it was written quite a while ago but it'll be well worth your while. - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8UYBCHpvrrTa6L5oRAuwdAJ9PWgFKOylhOrPz6rv7KBifXcbdjgCfUQax 7csTk0GnAC17z8ie8RGFqYU= =NaWj -END PGP SIGNATURE- -- 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] Connect to Mail-Server
Hello! Somewhere I read something on how to connect to a mail-server with php and to send and receive mails on a very "basic" level (calling "Helo" to the mail-server and so on). Does anybody know, where I can get those information exactly? Martin -- 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 1,000 people access the database at one time?
So let's say Bill is accessing a MySQL table and is about to UPDATE some information on a particular row. Meanwhile, Al is doing a sort on that same table. Couldn't Al's sorting possibly screw up Bill's updating?? Or does MySQL have some built in functions that prevent this? Thanks! Phil
[PHP] Building my site... again
I started my HTML career back in the days when the newest MS Word-version came with a "save as html"-function. I saved as HTML, read the code, and learned by myself bit by bit. By the time I got my hands on HTML for dummies, I realized I was no dummy after all :) But now, asking this, I feel kinda dumb... Its got to do with PHP, search engines, meta-tags and headers. I am building my site like this: - I have an index.php-file, that takes two variables, page and subpage. A link on my site may look like this: (for instance) Now, my index.php-file will do this: (basically) if($page){ include($page . ".inc"); } and my cars.inc will do this: if($subpage){ include($subpage . ".inc"); } Now. I would of course like for my site to be listed in the search engines, and I wouldn't mind getting search hits on both cars and ferrari. But. Will the web spiders and web crawlers ever follow a link like index.php?page=cars&subpage=ferrari and will they ever index what they find there, and, and, and, and... Well... does anyone understand what I'm asking here? WOuld this be a good way to build my site to ensure getting hits from search engines, or should I do this some other way? Anyone know? - Torkil -- 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: getting a LAMP job in this economy
On Thursday, January 24, 2002, at 09:32 PM, Michael Kimsal wrote: > Being able to positively improve an employer's bottom line is always a > plus you can bring to any 'job' - you're there to do work and make them > money too. If you can help by furthering the use of Linux/PHP/etc due > to the licensing cost issues, so much the better. This is a good point. I'm using the LAMP scheme right now for my employer (though I haven't yet explained the advantages). I'm hoping that, when I'm done, I can provide a report explaining how much was saved by going with open source solutions -- right now the only two purchases made specifically for my project were 1) Mac OS X 10.1 2) Extra memory for the Linux server (and I'd like them to buy me the full version of BBedit so I don't have to use the "lite" -- $89 upgrade) Is there a resource that helps me weigh the cost-effectiveness of the choices I made? (Note that the savings aren't as great as you might think -- we already have Oracle and a hosting service that provides ASP, but I wonder what the licenses would have cost us.) Erik -- 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: Printing JPEG images generated with ImageJPEG with IE/WIN
Hm, it could be that IE tries to reload the picture (which isn't there anymore because the form-data has been expired). Perhaps saving the picture temporarly on the server will prevent the problem. Martin -- 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: Resalution Dection
"Jeff Sheltren" <[EMAIL PROTECTED]> wrote in message 006901c1a552$ad42ebf0$0500a8c0@ellaptop">news:006901c1a552$ad42ebf0$0500a8c0@ellaptop... > Yes, you can use javascript to get the user's resolution: > > screen.width > screen.colorDepth You can also use window.innerWidth window.innerHeight (at least in Opera 4.x+ and NN4.x) or use document.body.clientWidth document.body.clientHeight (in IE) or through the DOM (Document Object Model, see http://www.w3c.org): document.body.offsetWidth document.body.offsetHeight This might be helpful for you as well... Christian Blichmann _ don't hesitate - email me with your thoughts: e-mail: [EMAIL PROTECTED] - please remove the ".nospam" from address. _ do you want to know more? web:http://www.blichmann.de -- 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: PHP IDE
"Rafael Perazzo B Mota" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Who knows a good Php IDE for linux, like PHP Code ? Try Macromedia ColdFusion Studio 5.0, it has PHP syntax highlighting and is very customizable (Code Snippets, Code Completion, ...), but it's not primarily focused on PHP... Christian Blichmann _ don't hesitate - email me with your thoughts: e-mail: [EMAIL PROTECTED] - please remove the ".nospam" from address. _ do you want to know more? web:http://www.blichmann.de -- 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]