Re: [PHP] Upload & View Image
On Sunday 20 January 2002 14:42, Thomas Edison Jr. wrote: > Hi, > > I have a penpal system running on a site. I want to > add a feature wherein the person can upload his image > and when somebody views the PenPal list, the uploaded > image is shown next to his ad. > > Can we also control the Image Width & Height? I mean > when the Image is displayed, it should be in a Size i > want, and not any size. Take a look at the "Image Functions" section in the manual. > And also the File Size.. i > dont' want very heavy images uploaded. Can that be > restricted? > Ditto "Handling file uploads" -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* C'est magnifique, mais ce n'est pas l'Informatique. -- Bosquet [on seeing the IBM 4341] */ -- 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] Upload & View Image
I think the PHP image functions aren't what this guy needs... First thing : File Uploads You have to make a form, including an tag, which refers to a php script like... $yourfile_size includes the size of the file in bytes, use an if-statement to check if the picture-size fits your needs... $yourfile_type includes... guess what... the file type.. this should solve the upload problem... To control the size of an image is a matter of your HTML... do something like . Its even possible to insert height and width-values in percent... -- 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 Digest 20 Jan 2002 11:34:06 -0000 Issue 1122
php-general Digest 20 Jan 2002 11:34:06 - Issue 1122 Topics (messages 81252 through 81260): Re: RTFM 81252 by: B. van Ouwerkerk 81254 by: Miles Thompson Re: application variable 81253 by: Joe Van Meer Variable referencing/substitution 81255 by: Gaylen Fraley 81256 by: Fred Upload & View Image 81257 by: Thomas Edison Jr. 81259 by: Jason Wong 81260 by: Malte Fucks imap problems 81258 by: Cary Mathews Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- --- Begin Message --- >Yeah, I've seen (and used) that. But it requires searching. My idea is to >put together a list of the simple questions in one place ... much like the >apache faq ... and also allowing "world input" like the php manual does. Sorry.. can't resist to reply :) From what I've seen it doesn't matter how many faqs minifaqs.. whateverfaqs you create.. Some will never learn cause the don't spend enough time to understand.. There are more then enough tutorials out there for anyone to find. How to learn PHP, or any other language: tutorials, manuals/books online or printed. Spending a LOT of time.. testing.. playing.. Bye, B. --- End Message --- --- Begin Message --- B. Yeah - play. It's the only way -- take a function, use it the right way and the wrong way. Can it be combined with other functions. What quirks of punctuation are there, etc etc. You know, I'd forgotten that too -- piddling about brings returns. Now excuse me, I have to go play with an array. Ah, true geekdom - Miles At 11:38 PM 1/19/2002 +0100, B. van Ouwerkerk wrote: >>Yeah, I've seen (and used) that. But it requires searching. My idea is to >>put together a list of the simple questions in one place ... much like the >>apache faq ... and also allowing "world input" like the php manual does. > >Sorry.. can't resist to reply :) > > From what I've seen it doesn't matter how many faqs minifaqs.. > whateverfaqs you create.. Some will never learn cause the don't spend > enough time to understand.. There are more then enough tutorials out > there for anyone to find. > >How to learn PHP, or any other language: tutorials, manuals/books online >or printed. Spending a LOT of time.. testing.. playing.. > >Bye, > > >B. > > >-- >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] --- End Message --- --- Begin Message --- Hi there, I usually test at the top of the page that does my 'logging-in' to see if the variable I set for each user once they actually login is set. So if I set a variable called '$isloggedin' upon a successful login, I would check at the top of that page to see if it is set or not, if it's already set bypass the login and redirect them to a new page. HTH Joe :) Ye Tun <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Do we have application variable in PHP as in ASP? > > I have a small database running with user name and password kept in MySQL > database. Once user is login, how can I prevent the same user from > logging in again? > > REgards, > > Ye > --- End Message --- --- Begin Message --- How can this be done? If I have the name of a variable that is stored in an array, how do I use the stored value to represent the actual variable? Example: $variable = "old value"; $vNames[1] = '$variable'; //literal $variable I want to say $vNames[1] = "new value"; /and have $variable actually change. How? -- Gaylen [EMAIL PROTECTED] Home http://www.gaylenandmargie.com/ PHP KISGB v3.1 Guest Book http://www.gaylenandmargie.com/phpwebsite/ --- End Message --- --- Begin Message --- See the manual on references: http://php.he.net/manual/en/language.references.php $vNames[1] = &$variable Fred Gaylen Fraley <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > How can this be done? > > If I have the name of a variable that is stored in an array, how do I use > the stored value to represent the actual variable? > > Example: > > $variable = "old value"; > $vNames[1] = '$variable'; //literal $variable > > I want to say $vNames[1] = "new value"; /and have $variable actually > change. > > How? > > -- > Gaylen > [EMAIL PROTECTED] > Home http://www.gaylenandmargie.com/ > PHP KISGB v3.1 Guest Book http://www.gaylenandmargie.com/phpwebsite/ > > > --- End Message --- --- Begin Message --- Hi, I have a penpal system running on a site. I want to add a feature wherein the person can upload his image and when somebody views the PenPal list, the uploaded image is shown next to his ad. Can we also control the Image Width & Hei
Re: [PHP] Upload & View Image
oops... should be if($yourfile) instead of if($file)... sorry -- 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] eval()
Hey Does anybody know if its wise to use eval() ? I know Vbulletin uses it.. but there is something about it I just cant digest.. it seems to be a very powerfull function which can be very easily exploited... anyone else have any thoughts? Regards, Kunal -- 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: eval()
Kunal Jhunjhunwala wrote: > > Hey > Does anybody know if its wise to use eval() ? I know Vbulletin uses it.. but > there is something about it I just cant digest.. it seems to be a very > powerfull function which can be very easily exploited... anyone else have > any thoughts? > Regards, > Kunal Loading your templates into a database, pulling them out on every page load and running eval() to run the code isn't the most efficient way to do it. Then running eval() inside a loop on that code isn't efficient either. I think eval() is used this way by some people because they don't know how to write files using php propely. So instead they just put it in a database. You also completely miss out on getting the benefits of one of the different php caching products. For me a database is for storing data - not php code. Vbulletin as an example of complete overuse of eval(). -- 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: eval()
Hey, I tend to agree with you. But what is the most effiecent way of using php code in template files then? I am not going to move my templates to a dbase.. thats for sure. Regards, Kunal Jhunjhunwala - Original Message - From: "Michael Waples" <[EMAIL PROTECTED]> To: "Kunal Jhunjhunwala" <[EMAIL PROTECTED]> Cc: "php-list" <[EMAIL PROTECTED]> Sent: Sunday, January 20, 2002 5:51 PM Subject: Re: eval() > Kunal Jhunjhunwala wrote: > > > > Hey > > Does anybody know if its wise to use eval() ? I know Vbulletin uses it.. but > > there is something about it I just cant digest.. it seems to be a very > > powerfull function which can be very easily exploited... anyone else have > > any thoughts? > > Regards, > > Kunal > > Loading your templates into a database, pulling them out on every page > load and running eval() to run the code isn't the most efficient way to > do it. > Then running eval() inside a loop on that code isn't efficient either. > > I think eval() is used this way by some people because they don't know > how to write files using php propely. So instead they just put it in a > database. You also completely miss out on getting the benefits of one of > the different php caching products. > For me a database is for storing data - not php code. > Vbulletin as an example of complete overuse of eval(). > > -- 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: eval()
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * On 20-01-02 at 13:26 * Kunal Jhunjhunwala said > Hey, > I tend to agree with you. But what is the most effiecent way of using php > code in template files then? I am not going to move my templates to a > dbase.. thats for sure. The point of templates is to seperate code from presentation and content. Your template should only contain html/js, and your code should be in the script that calls the template. Why not databases? That way you achieve a proper 3 tier structure that's easy to maintain. - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8SrjEHpvrrTa6L5oRAoXnAJ9mq+aZx44O3suRenE035hxFPXscgCgncwt tsmQSf7IkpJ4V9gCqtfepFU= =RBPj -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] Re: eval()
Kunal Jhunjhunwala wrote: > > Hey, > I tend to agree with you. But what is the most effiecent way of using php > code in template files then? I am not going to move my templates to a > dbase.. thats for sure. > Regards, > Kunal Jhunjhunwala well for looping through the results of a sql query where you'd want to print out some html - to do that you could - a include a file inside a loop b run eval on some code from a database c run a function I find c to be the most efficient eg function thread($sql_arra0 { echo 'name - '. $sql_array['name'] .'; } then inside of loop thread($sql_array); works a lot quicker than the other two methods. I don't see how you can avoid putting php code in templates because you need to put $var in there some way so you can print out the variable. So if it's in a database it needs some eval() done on it. I really can't see the point in querying a database to pull out template data. Templates usually don't change very often at all and querying a database to pull out unchanged template data is waste of cpu and memory resources. > > > Kunal Jhunjhunwala wrote: > > > > > > Hey > > > Does anybody know if its wise to use eval() ? I know Vbulletin uses it.. > but > > > there is something about it I just cant digest.. it seems to be a very > > > powerfull function which can be very easily exploited... anyone else > have > > > any thoughts? > > > Regards, > > > Kunal > > > > Loading your templates into a database, pulling them out on every page > > load and running eval() to run the code isn't the most efficient way to > > do it. > > Then running eval() inside a loop on that code isn't efficient either. > > > > I think eval() is used this way by some people because they don't know > > how to write files using php propely. So instead they just put it in a > > database. You also completely miss out on getting the benefits of one of > > the different php caching products. > > For me a database is for storing data - not php code. > > Vbulletin as an example of complete overuse of eval(). > > > > -- 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: eval()
> I don't see how you can avoid putting php code in templates because you > need to put $var in there some way so you can print out the variable. So > if it's in a database it needs some eval() done on it. You could html comment lines?? I tried this.. but it would only consider the first and the last match of the ereg.. not the in-between ones :( > I really can't see the point in querying a database to pull out template > data. Templates usually don't change very often at all and querying a > database to pull out unchanged template data is waste of cpu and memory > resources. Agreed. Regards, Kunal Jhunjhunwala - Original Message - From: "Michael Waples" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, January 20, 2002 6:39 PM Subject: [PHP] Re: eval() > Kunal Jhunjhunwala wrote: > > > > Hey, > > I tend to agree with you. But what is the most effiecent way of using php > > code in template files then? I am not going to move my templates to a > > dbase.. thats for sure. > > Regards, > > Kunal Jhunjhunwala > > well for looping through the results of a sql query where you'd want to > print out some html - > to do that you could - > a include a file inside a loop > b run eval on some code from a database > c run a function > > I find c to be the most efficient > eg > > function thread($sql_arra0 > { > echo 'name - '. $sql_array['name'] .'; > } > > then inside of loop > > thread($sql_array); > > works a lot quicker than the other two methods. > > I don't see how you can avoid putting php code in templates because you > need to put $var in there some way so you can print out the variable. So > if it's in a database it needs some eval() done on it. > I really can't see the point in querying a database to pull out template > data. Templates usually don't change very often at all and querying a > database to pull out unchanged template data is waste of cpu and memory > resources. > > > > > > > > Kunal Jhunjhunwala wrote: > > > > > > > > Hey > > > > Does anybody know if its wise to use eval() ? I know Vbulletin uses it.. > > but > > > > there is something about it I just cant digest.. it seems to be a very > > > > powerfull function which can be very easily exploited... anyone else > > have > > > > any thoughts? > > > > Regards, > > > > Kunal > > > > > > Loading your templates into a database, pulling them out on every page > > > load and running eval() to run the code isn't the most efficient way to > > > do it. > > > Then running eval() inside a loop on that code isn't efficient either. > > > > > > I think eval() is used this way by some people because they don't know > > > how to write files using php propely. So instead they just put it in a > > > database. You also completely miss out on getting the benefits of one of > > > the different php caching products. > > > For me a database is for storing data - not php code. > > > Vbulletin as an example of complete overuse of eval(). > > > > > > > > -- > 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] Php.ini file missing
Hi everybody, I've finally been able to read the e-mails sent by the little script I was using. The problem was the address where the script was trying to send the e-mail. Instead of a *normal* e-mail (i.e. [EMAIL PROTECTED]) like was written in the book I wrote my *local* address (mitch@localhost) and it worked :-) I got the e-mail both in the terminal and using the application "Mail" where I configured an UNIX account. I am still not able to let the script send e-mails to normal e-mail addresses, but I think I will now install "postfix" which, as I read, should be easier to use and configure than "sendmail". Thanks to you all for the tips and resources you gave me. Bye, Michael -- 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] calling cvs checkout from php
I would like to checkout some xml and xsl files from cvs and transform them using php script. The second part seems easy, but how can I checkout cvs module from php script. I tried system("cvs -d /home/cvs checkout myModule") but there was no result. There was no error either. I am shure it is quite easy. Please, give me a hint. Regards, Janez -- 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] agh - what am I doing wrong - regular expressions
Good morning everyone, I'm trying to adapt existing php code that uses a while loop to scan content for a url pattern, take the matches and add link tags () around them so the url with be made into "hot links. Simple enough right? Nevertheless, I seem to be having trouble with urls that have question marks in them. Here is the existing code that works - except with question marks: $content = "http://www.globalhealth.org/text.php3?id=151 adjfladjfajdfkladfjl;kadjf jlkadjflkajdflkj jadklfjalkdjfl;df jalkdfj;ldafj"; $pattern = "http://([\/~_\.0-9A-Za-z#&=-]+)"; while(ereg($pattern, $content, $match)){ $http_old = $match[0]; $http = "dubdubdub" . $match[1] . $match[2]; $url = "$http"; $content = ereg_replace($http_old, $url, $content); }; $content = ereg_replace("dubdubdub", "http://";, $content); print $content; ** Here's the same code with the question mark in the pattern variable. When I add the question mark and test the page, my browsers just "hang". Escaping the question mark doesn't seem to help (and I also read that escapes aren't necessary between square brackets]: $content = "http://www.globalhealth.org/text.php3?id=151 adjfladjfajdfkladfjl;kadjf jlkadjflkajdflkj jadklfjalkdjfl;df jalkdfj;ldafj"; $pattern = "http://([\/~_\.0-9A-Za-z#&=?-]+)"; while(ereg($pattern, $content, $match)){ $http_old = $match[0]; $http = "dubdubdub" . $match[1] . $match[2]; $url = "$http"; $content = ereg_replace($http_old, $url, $content); }; $content = ereg_replace("dubdubdub", "http://";, $content); print $content; * In an attempt to find the problem, I did a test with the following code and received the result I want - which leads me to believe the problem is possibly with the while loop or the ereg_replace?? $content = "http://www.globalhealth.org/text.php3?id=151 adjfladjfajdfkladfjl;kadjf jlkadjflkajdflkj jadklfjalkdjfl;df jalkdfj;ldafj"; $pattern = "http://([/~_.0-9A-Za-z#&=?-]+)"; ereg($pattern, $content, $match); print "$match[0]"; ** I'm completely confused. I have a feeling there is any easy answer and if I wasn't so frustrated I'd be embarrassed to say that I've spent hours on this... Thanks in advance for your help, Shawna -- 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] SendMail Problem
Hi to the list, i´m new... well.. i do a Flash SendMail with variables and HTML format. it works.. but i insert variables in the HTML Message code.. and it don´t works... i don´t know why the code is.. Birthday Reminders for August Sugerencias y Comentarios mandado desde la página de Telén Nombre: name Asunto: e-mail: Comentario/Sugerencia '; ?> The variables don´t work.. Thx if u can answer P.D.: in normal format mail, the variables work.. -- 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 login scripts
hi. im new. i installed a login script on my site and after a few days, it stopped working. i reinstalled it and it still refused to work after a dew days. can anyone send me a good login script preferably with no MySql? im very busy atm with all my school stuff. Thanks aron _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Upload & View Image : Database Thingy!!!!
Malte, Thanks a lot. I was going through the File Upload Functions in the manual and i think that's what they were talking about too. Now there's just one thing. I can run the upload scripts and get the image for display too. But like i mentioned, this is for a PenPal system, a database based PenPal sysem. Basically there has to be some connection between the record entry by the user and the image. Which also be required when this record is displayed, for the corresponding image to be displayed. How migh that work? Thanks again, T. Edison jr. --- Malte Fucks <[EMAIL PROTECTED]> wrote: > I think the PHP image functions aren't what this guy > needs... > > First thing : File Uploads > You have to make a form, including an type="file" name="yourfile"> > tag, which refers to a php script like... > > if($file) > { >if(@copy($yourfile,"./$yourfile_name")) >{ >echo "$yourfile_name was uploaded > succesfully"; >} > else echo "ERROR - UPLOAD ABORTED"; > } > ?> > > $yourfile_size includes the size of the file in > bytes, use an if-statement > to check if the picture-size fits your needs... > $yourfile_type includes... guess what... the file > type.. > this should solve the upload problem... > > To control the size of an image is a matter of your > HTML... do something > like > . > Its even possible to > insert height and width-values in percent... > > > > > -- > 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] > = Rahul S. Johari (Director) ** Abraxas Technologies Inc. Homepage : http://www.abraxastech.com Email : [EMAIL PROTECTED] Tel : 91-4546512/4522124 *** __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- 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] system(), passthru(), exec() not working as from command line
I'm trying to get gnupg (OpenPGP) working on my system, which is Solaris 2.6 on Sparc, with PHP 4.0.6 and Apache/Stronghold. I have the program compiled, as it works at the command line. Here's what works at the command line: /usr/local/bin/gpg --encrypt -ao /usr/local/www/htdocs/777/crypted -r '<[EMAIL PROTECTED]>' /usr/local/etc/www/htdocs/777/plain_text_mesage.txt If I type the above at the command line, when logged in as the user Apache and PHP is running as (nobody), it encrypts the contents of the file /usr/local/etc/www/htdocs/777/plain_text_mesage.txt and writes it to the file /usr/local/www/htdocs/777/crypted, which is what I want. (The directory /usr/local/www/htdocs/777/ is "chmod 777", and PHP can write a file in that directory.) I've tried everything I can think of, but it looks like a command from PHP is not working like it is at the command line. I've tried: system("/usr/local/bin/gpg --encrypt -ao /usr/local/www/htdocs/777/crypted -r '<[EMAIL PROTECTED]>' /usr/local/etc/www/htdocs/777/plain_text_mesage.txt"); passthru("/usr/local/bin/gpg --encrypt -ao /usr/local/www/htdocs/777/crypted -r '<[EMAIL PROTECTED]>' /usr/local/etc/www/htdocs/777/plain_text_mesage.txt"); exec("/usr/local/bin/gpg --encrypt -ao /usr/local/www/htdocs/777/crypted -r '<[EMAIL PROTECTED]>' /usr/local/etc/www/htdocs/777/plain_text_mesage.txt"); $command= `(/usr/local/bin/gpg --encrypt -ao /usr/local/www/htdocs/777/crypted -r '<[EMAIL PROTECTED]>' /usr/local/etc/www/htdocs/777/plain_text_mesage.txt`; (Each of the above 4 lines of code probably word wrapped in this email, and the last line contains backtics, not single quotes.) So, I'm stumped. I was following the basics of the article at: http://hotwired.lycos.com/webmonkey/00/20/index3a.html?tw=programming Thanks, Peter Janett New Media One Web Services New Upgrades Are Now Live!!! Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1 Sun Solaris (UNIX) accounts - PHP 4.0.6, mod_perl/1.25, Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43 PostgreSQL coming soon! http://www.newmediaone.net [EMAIL PROTECTED] (303)828-9882 -- 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] Upload & View Image : Database Thingy!!!!
On Monday 21 January 2002 01:26, Thomas Edison Jr. wrote: > Malte, > > Thanks a lot. I was going through the File Upload > Functions in the manual and i think that's what they > were talking about too. > > Now there's just one thing. I can run the upload > scripts and get the image for display too. But like i > mentioned, this is for a PenPal system, a database > based PenPal sysem. > Basically there has to be some connection between the > record entry by the user and the image. Which also be > required when this record is displayed, for the > corresponding image to be displayed. How migh that > work? The best thing to do would be to store the filename (& path if necessary) of the image in the corresponding record of the database. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* Mandrell: "You know what I think?" Doctor: "Ah, ah that's a catch question. With a brain your size you don't think, right?" -- Dr. Who */ -- 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] Number of rows reurned?
Hi, how can i get the number of rows reuturned by this query? $sql = "select date from statistik where shooter='$shooter_login' group by date"; I want to add a page function and limit the returned rows on each page - but i can´t get the total number of rows. Regards # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # -- 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] Upload & View Image
On Saturday 20 January 2001 19:39, Malte Fucks wrote: > To control the size of an image is a matter of your HTML... do something > like > . Its even possible to > insert height and width-values in percent... This only sets the display size of the image *after* the whole image (whatever size it may be) is downloaded into the browser. The original post mentions limiting the size of the images that will be transferred. The way to do it would be to use either the 'builtin' php image manipulation functions, or to call some command-line program from within php. This would be probably be done at the time of the upload. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* "I have just one word for you, my boy...plastics." - from "The Graduate" */ -- 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] Number of rows reurned?
On Monday 21 January 2002 01:45, Daniel Alsén wrote: > Hi, > > how can i get the number of rows reuturned by this query? > > $sql = "select date from statistik where shooter='$shooter_login' group by > date"; > > I want to add a page function and limit the returned rows on each page - > but i can´t get the total number of rows. Check out the relevant chapter in the manual for the db that you're using. Some dbs have a function returning the number of rows. If you're using MySQL then mysql_num_rows() is what you want. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* If a man has talent and cannot use it, he has failed. -- Thomas Wolfe */ -- 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] Upload & View Image : Database Thingy!!!!
ooh... i dont know if i understood you correctly..but if i did, you simply have to insert the location of the file in the users tupel like.. UserIDNameBlaBlapicture 001 John ... ... ./images/john.jpg preferably i would only store the location when the user did upload an image with an update query, so when fetching the information from your database, you can check for empty location values... if you're working with mysql it would be like... while($my_array = mysql_fetch_array($result)) { echo "Stuff about the User"; if($my_array[location]) { echo ""; } else echo " } but as i said, i dont know if i really understood your question.. (im german, you know *g*) - Original Message - From: "Thomas Edison Jr." <[EMAIL PROTECTED]> To: "Malte Fucks" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, January 20, 2002 6:26 PM Subject: Re: [PHP] Upload & View Image : Database Thingy > Malte, > > Thanks a lot. I was going through the File Upload > Functions in the manual and i think that's what they > were talking about too. > > Now there's just one thing. I can run the upload > scripts and get the image for display too. But like i > mentioned, this is for a PenPal system, a database > based PenPal sysem. > Basically there has to be some connection between the > record entry by the user and the image. Which also be > required when this record is displayed, for the > corresponding image to be displayed. How migh that > work? > > Thanks again, > T. Edison jr. > > --- Malte Fucks <[EMAIL PROTECTED]> wrote: > > I think the PHP image functions aren't what this guy > > needs... > > > > First thing : File Uploads > > You have to make a form, including an > type="file" name="yourfile"> > > tag, which refers to a php script like... > > > > > if($file) > > { > >if(@copy($yourfile,"./$yourfile_name")) > >{ > >echo "$yourfile_name was uploaded > > succesfully"; > >} > > else echo "ERROR - UPLOAD ABORTED"; > > } > > ?> > > > > $yourfile_size includes the size of the file in > > bytes, use an if-statement > > to check if the picture-size fits your needs... > > $yourfile_type includes... guess what... the file > > type.. > > this should solve the upload problem... > > > > To control the size of an image is a matter of your > > HTML... do something > > like > > . > > Its even possible to > > insert height and width-values in percent... > > > > > > > > > > -- > > 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] > > > > > = > Rahul S. Johari (Director) > ** > Abraxas Technologies Inc. > Homepage : http://www.abraxastech.com > Email : [EMAIL PROTECTED] > Tel : 91-4546512/4522124 > *** > > __ > Do You Yahoo!? > Send FREE video emails in Yahoo! Mail! > http://promo.yahoo.com/videomail/ > > -- > 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]
SV: [PHP] Number of rows reurned?
Thanks. I knew that - really. Meltdown upstairs :) - D > -Ursprungligt meddelande- > Från: Jason Wong [mailto:[EMAIL PROTECTED]] > Skickat: den 20 januari 2002 18:53 > Till: Daniel Alsén; PHP List > Ämne: Re: [PHP] Number of rows reurned? > > > On Monday 21 January 2002 01:45, Daniel Alsén wrote: > > Hi, > > > > how can i get the number of rows reuturned by this query? > > > > $sql = "select date from statistik where > shooter='$shooter_login' group by > > date"; > > > > I want to add a page function and limit the returned rows on each page - > > but i can´t get the total number of rows. > > Check out the relevant chapter in the manual for the db that > you're using. > Some dbs have a function returning the number of rows. > > If you're using MySQL then mysql_num_rows() is what you want. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > /* > If a man has talent and cannot use it, he has failed. > -- Thomas Wolfe > */ > > -- > 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] Printing structure and data of array
Hi, i know i have this answered before. But i can´t find that mail in the archive. How do i print an array to see both the structure and the data within? ("test" => "value", "test2" => "value2")... # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # -- 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] open/read file/directory and file test
Hi! You can find the PHP !manual! at http://www.php.net/manual Try searching for open , opendir, readdir .. or whatever other function you're looking for. If that doesn't give you an answer straight away, you could go back to the manual index and find the appropriate category, like Filesystem functions. About question 3, I think it depends on what you want, but it's possible to get the access time of a file; also see chapter Filesystem functions. Also search the manual for preg (if you didn't figure yet) to see how to use perl style regular expressions. bvr. On Sun, 20 Jan 2002 04:39:52 -0500 (EST), Juni Adi wrote: >On Sun, 20 Jan 2002, Juni Adi wrote: > >Hi folks, >After meessing up with installation stuffs, now >it's time for PHP code: > >1. How to tell PHP to open a file like Perl do >through: > > open (FILE, $file); > >2. Same question, this time to open/read a >directory: > > opendir (DIR, $dir); > >and > > readdir DIR; > >3. Do PHP have a file test like -A $file in Perl? -- 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] While on array?
Hi, i am fiddling with a script and need to change a while-loop from running on mysql_fetch_array to a "normal" array? ie - i have: while($myrow=mysql_fetch_array($result)) { etc... But i want the loop to run with an array i created earlier ($anotherarray = [key1] => value1, [key2] => value2). How would i do that? Does the loop behave the same way - running until the array is out of data? Thanks! # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # -- 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: Include inside a function?
try out first before u post... what does work is.. mail(implode(false,file("blah.txt"))); "Kyle Smith" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is it possible to use include inside the mail function? eg mail(include("blah.txt")) ??? -lk6- http://www.StupeedStudios.f2s.com Home of the burning lego man! ICQ: 115852509 MSN: [EMAIL PROTECTED] AIM: legokiller666 -- 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] Having a problem with sessions?
Hey List- Banging my head again the wall with this one. One of our developers was trying to get some session stuff to work and he couldn't and asked me to look into it. I have a script that contains the following (the sessions.php href reference is the same script accept it calls this one): _ session_start(); if (!isset($HTTP_SESSION_VARS[count])) { $HTTP_SESSION_VARS[count] = 0; } else { $HTTP_SESSION_VARS[count]++; } //Print the counter echo "Counter is now: $HTTP_SESSION_VARS[count];\n\n"; echo "Let's go to another page..."; ___ On my box at home running PHP 4.0.6 it works great. On the work server running PHP 4.0.6 it doesn't work. Just keeps setting count to 0. The work box is running Apache 1.3.20 with the following compile options: './configure' '--with-apxs' '--with-config-file-path=/etc/php' '--with-openssl=/usr/local/openssl' '--with-zlib' '--with-bz2' '--with-pspell' '--enable-ftp' '--enable-gd' '--with-imap' '--with-mcrypt' '--with-mhash' '--with-mysql=/usr/local/mysql' The home box is running Apache 1.3.22 with the following compile options: './configure' '--with-apxs' '--with-config-file-path=/etc/php' '--with-openssl=/usr/local/openssl' '--with-zlib' '--with-bz2' '--with-mysql=/usr/local/mysql' '--with-mcrypt' '--with-mhash' '--disable-xml' '--enable-ftp' '--with-gettext' '--with-pspell' '--enable-inline-optimization' The only major difference that I could find in the php.ini file is that at home I have register globals off and at work they are on? Even with register globals on, you can still use the $HTTP_*_VARS, right? The sessionID cookie is getting put into my browser, I checked so the "session" is starting correctly, just not retaining the variable. Any ideas anyone? Thanks list. Henrik -- Henrik Hudson [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP-JavaScript
Is it posible to get values from javascript to PHP? Without having to post the variables.. Thanks //Mårten _ Chatta med vänner online, prova MSN Messenger: http://messenger.msn.se -- 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] Confusing Problem
I am really baffled by this problem. I have tried so many things to get this working but to no avail. Here is the actual code: function verify_user($username, $password){ $conn = mysql_connect($db_host, $db_user, $db_pass) or die("Error while connecting to Database System."); $select_db = mysql_select_db($db_name) or die("Error could not select the database"); $query = "SELECT FROM users WHERE username='$username'"; $result = mysql_query($query) or die("Unable to get query"); $rows = mysql_fetch_array($result); $password = md5($password); if($rows["password"] == $password){ print "You have been verified as $username."; print "Registering your session."; } else{ print "Error: Bad username or password."; print "Please go back"; } } Anyways the problem is I cannot get it to even get to the database. It works when I try to connect in the actual code before I call this function. Like for example in index.php $conn = mysql_connect($db_host, $db_user, $db_pass) or die("Error while connecting to Database System."); $select_db = mysql_select_db($db_name) or die("Error could not select the database"); verify_user($username, $pass); But when I do it that way it won't let me run a query right. I am so baffled. Any input would be appreciated. Thanks. - Tj Corley [EMAIL PROTECTED] The Planet -- 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] Confusing Problem
Tj, > I am really baffled by this problem. I have tried so many things to get > this working but to no avail. Here is the > actual code: > > function verify_user($username, $password){ > $conn = mysql_connect($db_host, $db_user, $db_pass) or ... > Anyways the problem is I cannot get it to even get to the database. It > works when I try to connect in the actual code before I call this function. ... > But when I do it that way it won't let me run a query right. I am so > baffled. Any input would be appreciated. Thanks. Remember the idea of the "scope" of a variable? (if not, please RTFM) Where do the values of $db_host, $db_user, etc come from? They are not in the argument list for verify_user(). Regards, =dn -- 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] Confusing Problem
they are in the same script outside the function. all the admin functions reside in a admin_func.php with the $db_host, etc, etc variables assigned before it. - Original Message - From: "DL Neil" <[EMAIL PROTECTED]> To: "Tj Corley" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, January 20, 2002 4:56 PM Subject: Re: [PHP] Confusing Problem > Tj, > > > > I am really baffled by this problem. I have tried so many things to get > > this working but to no avail. Here is the > > actual code: > > > > function verify_user($username, $password){ > > $conn = mysql_connect($db_host, $db_user, $db_pass) or > ... > > Anyways the problem is I cannot get it to even get to the database. It > > works when I try to connect in the actual code before I call this function. > ... > > But when I do it that way it won't let me run a query right. I am so > > baffled. Any input would be appreciated. Thanks. > > > Remember the idea of the "scope" of a variable? (if not, please RTFM) > Where do the values of $db_host, $db_user, etc come from? > They are not in the argument list for verify_user(). > > Regards, > =dn > > -- 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] Opening more than one database at a time?
I am trying to basically copy data from one database to another and am wondering if it is possible to have more than one database open at a time. So for example, I want to do something like this but am wondering if there is a better way: $dbcon = mysql_connect($db_server, $db_user, $db_passwd); //Make source connection mysql_select_db($db_name); //Select source db $source_result = mysql_query("SELECT * FROM users"); //Select all info from users table while ($row_cat = mysql_fetch_array($result)){ //Loop through and insert into new db //Insert into new database } So where I have "Insert into new database" this is where I want to take some of the information from the source and insert into the new database (which uses a different user name and password as well). Any help would be greatly appreciated :) Jeff -- 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] Confusing Problem
Just as DL Neil implied, your variables are outside the scope of the function. set them global within your function. See: http://www.php.net/manual/en/language.variables.scope.php - Original Message - From: "Tj Corley" <[EMAIL PROTECTED]> To: "DL Neil" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, January 20, 2002 3:08 PM Subject: Re: [PHP] Confusing Problem > they are in the same script outside the function. > > all the admin functions reside in a admin_func.php > with the $db_host, etc, etc variables assigned before it. > > - Original Message - > From: "DL Neil" <[EMAIL PROTECTED]> > To: "Tj Corley" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Sunday, January 20, 2002 4:56 PM > Subject: Re: [PHP] Confusing Problem > > > > Tj, > > > > > > > I am really baffled by this problem. I have tried so many things to get > > > this working but to no avail. Here is the > > > actual code: > > > > > > function verify_user($username, $password){ > > > $conn = mysql_connect($db_host, $db_user, $db_pass) or > > ... > > > Anyways the problem is I cannot get it to even get to the database. It > > > works when I try to connect in the actual code before I call this > function. > > ... > > > But when I do it that way it won't let me run a query right. I am so > > > baffled. Any input would be appreciated. Thanks. > > > > > > Remember the idea of the "scope" of a variable? (if not, please RTFM) > > Where do the values of $db_host, $db_user, etc come from? > > They are not in the argument list for verify_user(). > > > > Regards, > > =dn > > > > > > > -- > 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] Opening more than one database at a time?
It;'s entirely possible. Most database-related functions can take an optional link identifier parameter. You didn't use it, and in that case, database operations default to the last opened database connection. You can however do something like: $dblink1=mysql_connect($server1,$user1,$password1); $dblink2=mysql_connect($server2,$user2,$password2); mysql_select_db($database_1,$dblink1); //for link 1 mysql_select_db($dblink2,$dblink2); //for link 2 $result1=mysql_query("SELECT * from whatever",$dblink1); while ($row=mysql_fetch_array($result1)){ $query2="insert into secondtable values ". $row["id"].",".$row["whatever"]; $result2=mysql_query($query2,$dblink2); //insert on database 2 } -- 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-JavaScript
In a word... No. Well... No. Mårten Andersson wrote: > Is it posible to get values from javascript to PHP? Without having to > post the variables.. > > Thanks //Mårten > > _ > Chatta med vänner online, prova MSN Messenger: http://messenger.msn.se > > -- Sliante, Richard S. Crawford mailto:[EMAIL PROTECTED] http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Yahoo!: rscrawford MSN: [EMAIL PROTECTED] "It is only with the heart that we see rightly; what is essential is invisible to the eye." --Antoine de Saint Exupery "Push the button, Max!" -- 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] Edit program
Dear List member, Plesae forgive me for asking and OT question. Can you please recommend an edit program, (Freely downloadable). Thanks, Erisen Mehmet Erisen http://www.erisen.com - Do You Yahoo!? Send FREE video emails in Yahoo! Mail.
[PHP] manual : Call-time pass-by-reference has been deprecated
Hi, If Call-time pass-by-reference has deprecated so long ago, why are the instructions on how to do it still in the manual? http://www.php.net/manual/en/html/functions.arguments.html#functions.arguments.by-reference At least it should point out that it has been deprecated. Bruce _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- 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 Digest 20 Jan 2002 23:34:28 -0000 Issue 1123
php-general Digest 20 Jan 2002 23:34:28 - Issue 1123 Topics (messages 81261 through 81295): Re: Upload & View Image 81261 by: Malte Fucks 81277 by: Jason Wong eval() 81262 by: Kunal Jhunjhunwala 81263 by: Michael Waples 81264 by: Kunal Jhunjhunwala 81265 by: Nick Wilson 81266 by: Michael Waples 81267 by: Kunal Jhunjhunwala Re: Php.ini file missing 81268 by: Michael Sciascia calling cvs checkout from php 81269 by: Janez agh - what am I doing wrong - regular expressions 81270 by: sgibbs.vt.globalhealth.org SendMail Problem 81271 by: Gimenez Blanco php login scripts 81272 by: xx xx Re: Upload & View Image : Database Thingy 81273 by: Thomas Edison Jr. 81275 by: Jason Wong 81279 by: Malte Fucks system(), passthru(), exec() not working as from command line 81274 by: Peter Janett Number of rows reurned? 81276 by: Daniel Alsén 81278 by: Jason Wong 81280 by: Daniel Alsén Printing structure and data of array 81281 by: Daniel Alsén Re: open/read file/directory and file test 81282 by: bvr While on array? 81283 by: Daniel Alsén Re: Include inside a function? 81284 by: Emile Bosch Having a problem with sessions? 81285 by: Henrik Hudson PHP-JavaScript 81286 by: Mårten Andersson 81293 by: Richard Crawford Confusing Problem 81287 by: Tj Corley 81288 by: DL Neil 81289 by: Tj Corley 81291 by: Jason Bell Opening more than one database at a time? 81290 by: Jeff Lewis 81292 by: Ing. Daniel Manrique Edit program 81294 by: Mehmet Kamil ERISEN manual : Call-time pass-by-reference has been deprecated 81295 by: Bruce BrackBill Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- --- Begin Message --- oops... should be if($yourfile) instead of if($file)... sorry --- End Message --- --- Begin Message --- On Saturday 20 January 2001 19:39, Malte Fucks wrote: > To control the size of an image is a matter of your HTML... do something > like > . Its even possible to > insert height and width-values in percent... This only sets the display size of the image *after* the whole image (whatever size it may be) is downloaded into the browser. The original post mentions limiting the size of the images that will be transferred. The way to do it would be to use either the 'builtin' php image manipulation functions, or to call some command-line program from within php. This would be probably be done at the time of the upload. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* "I have just one word for you, my boy...plastics." - from "The Graduate" */ --- End Message --- --- Begin Message --- Hey Does anybody know if its wise to use eval() ? I know Vbulletin uses it.. but there is something about it I just cant digest.. it seems to be a very powerfull function which can be very easily exploited... anyone else have any thoughts? Regards, Kunal --- End Message --- --- Begin Message --- Kunal Jhunjhunwala wrote: > > Hey > Does anybody know if its wise to use eval() ? I know Vbulletin uses it.. but > there is something about it I just cant digest.. it seems to be a very > powerfull function which can be very easily exploited... anyone else have > any thoughts? > Regards, > Kunal Loading your templates into a database, pulling them out on every page load and running eval() to run the code isn't the most efficient way to do it. Then running eval() inside a loop on that code isn't efficient either. I think eval() is used this way by some people because they don't know how to write files using php propely. So instead they just put it in a database. You also completely miss out on getting the benefits of one of the different php caching products. For me a database is for storing data - not php code. Vbulletin as an example of complete overuse of eval(). --- End Message --- --- Begin Message --- Hey, I tend to agree with you. But what is the most effiecent way of using php code in template files then? I am not going to move my templates to a dbase.. thats for sure. Regards, Kunal Jhunjhunwala - Original Message - From: "Michael Waples" <[EMAIL PROTECTED]> To: "Kunal Jhunjhunwala" <[EMAIL PROTECTED]> Cc: "php-list" <[EMAIL PROTECTED]> Sent: Sunday, January 20, 2002 5:51 PM Subject: Re: eval() > Kunal Jhunjhunwala wrote: > > > > Hey > > Does anybody know if its wise to use eval() ? I know Vbulletin uses it.. but > > there is something about it I just cant digest.. it seems to be a very > > powerfull function which can be very easily exploited... anyone else have > > any thoughts? > > Rega
Re: [PHP] Edit program
> >Plesae forgive me for asking and OT question. Can you please recommend an >edit program, (Freely downloadable). Search the archive.. this really is a FAQ. Bye, B. -- 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] best way to approach dates
Hi all, I'm looking to normalise the way in which I work with dates and times, hopefully saving myself some time and effort along the way. Currently, for, say, a news post, i'm using a MySQL DATE column (-MM-DD), but since this isn't all that good (visually) for use on a site, I find myself converting it back out to something like DD-MM-YY or DD-MM for use on the site. Not exactly hard, but it's gotta be done every time. Now I find myself wanting to sort things by date (where the ID might be in the wrong order... so 2001-12-25 is listed before 2001-12-26, etc), and more importantly, comparing two dates (3 days away, 3 days ago, 3 hours ago, etc etc). Would I be better off using a unix timestamp for everything, then using it to: - convert to different formats - compare - sort in date order - etc etc Also, I've noticed there is a timestamp column type in MySQL... is there a way to cut down on PHP code by using MySQl alone to enter the timestamp (or date) for me? Any other suggestions on a sensible method of implementing dates & times accross many sites and many bits of code? Justin French -- 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] Edit program
Wait.. I thought that was a Frequently Asked Question? *grin* Check out http://marc.theaimsgroup.com/?l=php-general and do a search for editors and you'll find several strings regarding that topic. Cheers! Rick It is very nearly impossible . . . to become an educated person in a country so distrustful of the independent mind. - James Baldwin > From: "B. van Ouwerkerk" <[EMAIL PROTECTED]> > Date: Mon, 21 Jan 2002 00:33:18 +0100 > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Edit program > > >> >> Plesae forgive me for asking and OT question. Can you please recommend an >> edit program, (Freely downloadable). > > Search the archive.. this really is a FAQ. > > Bye, > > > > B. > > > -- > 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] Edit program
Or go to download.com, search for 'PHP' Sort list by 'number of downloads'. bvr. >>> Plesae forgive me for asking and OT question. Can you please recommend an >>> edit program, (Freely downloadable). -- 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] best way to approach dates
Never worked with mysql but I would assume there's something like 'NOW' or now() or something similar, don't know how you'd put a different date in though :( timestamps are handy within php, you can then convert it to whatever format you want with date() or, if you wanted to go even further, create a date class and do all your date manipulation using objects... I've found that easier since I've got a class already written, but don't know where I've put it now :( so I can't send it... Martin -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Monday, January 21, 2002 10:43 AM To: php Subject: [PHP] best way to approach dates Hi all, I'm looking to normalise the way in which I work with dates and times, hopefully saving myself some time and effort along the way. Currently, for, say, a news post, i'm using a MySQL DATE column (-MM-DD), but since this isn't all that good (visually) for use on a site, I find myself converting it back out to something like DD-MM-YY or DD-MM for use on the site. Not exactly hard, but it's gotta be done every time. Now I find myself wanting to sort things by date (where the ID might be in the wrong order... so 2001-12-25 is listed before 2001-12-26, etc), and more importantly, comparing two dates (3 days away, 3 days ago, 3 hours ago, etc etc). Would I be better off using a unix timestamp for everything, then using it to: - convert to different formats - compare - sort in date order - etc etc Also, I've noticed there is a timestamp column type in MySQL... is there a way to cut down on PHP code by using MySQl alone to enter the timestamp (or date) for me? Any other suggestions on a sensible method of implementing dates & times accross many sites and many bits of code? Justin French -- 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-JavaScript
Hi, A little trick I did to get the text from a textbox in a form ( for user comments ) without the user having to submit it was to use javascript to append the textbox contents to a url ( GET METHOD ) when the user clicked on a link, which pointed to a redirect script which extracted the textbox contents then redirected the user to the link requested. Hopefull this will give you some ideas. [page.html] [redirect_script.php] ...and here on the redirect page I would do validation of the variables/form_contents etc., insert it into a db, and then redirect: http://www.site.com/path/to/another_page.html";); //Redirect browser break; case ... } Cheers, Bruce _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Variable referencing/substitution
${$vNames[1]} = "new value"; // look at variable-variables in the manual for more info -Original Message- From: Gaylen Fraley [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 20, 2002 3:44 PM To: [EMAIL PROTECTED] Subject: [PHP] Variable referencing/substitution How can this be done? If I have the name of a variable that is stored in an array, how do I use the stored value to represent the actual variable? Example: $variable = "old value"; $vNames[1] = '$variable'; //literal $variable I want to say $vNames[1] = "new value"; /and have $variable actually change. How? -- Gaylen [EMAIL PROTECTED] Home http://www.gaylenandmargie.com/ PHP KISGB v3.1 Guest Book http://www.gaylenandmargie.com/phpwebsite/ -- 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] Confusing Problem
you'll need to make them global then... that's one thing that kept getting me when I started using php, global vars are only global if you tell them to be sorta like "local to the global scope" or something like that :) -Original Message- From: Tj Corley [mailto:[EMAIL PROTECTED]] Sent: Monday, January 21, 2002 10:09 AM To: DL Neil Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Confusing Problem they are in the same script outside the function. all the admin functions reside in a admin_func.php with the $db_host, etc, etc variables assigned before it. - Original Message - From: "DL Neil" <[EMAIL PROTECTED]> To: "Tj Corley" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, January 20, 2002 4:56 PM Subject: Re: [PHP] Confusing Problem > Tj, > > > > I am really baffled by this problem. I have tried so many things to get > > this working but to no avail. Here is the > > actual code: > > > > function verify_user($username, $password){ > > $conn = mysql_connect($db_host, $db_user, $db_pass) or > ... > > Anyways the problem is I cannot get it to even get to the database. It > > works when I try to connect in the actual code before I call this function. > ... > > But when I do it that way it won't let me run a query right. I am so > > baffled. Any input would be appreciated. Thanks. > > > Remember the idea of the "scope" of a variable? (if not, please RTFM) > Where do the values of $db_host, $db_user, etc come from? > They are not in the argument list for verify_user(). > > Regards, > =dn > > -- 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/XML gap?
Why does it seem that when spoken about XML, PHP is almost always left out? And why does it seem that every XML based CMS is build in a non-php language? Are there any XMLCMS OpenSource Classes/Projects available? Warm regards, Emile Bosch -- 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] 'include' & anchors
I want a script to go to an anchor in an html page This doesn't seem to work include "blah.htm#anchor"; how is this possible Thanks! Phil in baltimore P.S. Pittsburgh sucks Bill Gates' balls.
[PHP] Re: 'include' & anchors
eh.. if i am not mistaken, that's clientside, and that's more of an javascript thing than a php thing "Phil Schwarzmann" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I want a script to go to an anchor in an html page > > This doesn't seem to work > > include "blah.htm#anchor"; > > how is this possible > > Thanks! > Phil in baltimore > > P.S. Pittsburgh sucks Bill Gates' balls. > -- 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] Opening more than one database at a time?
Jeff, Can you let MySQL do the work for you, with INSERT ... SELECT? Here's the URL" http://www.mysql.com/doc/I/N/INSERT_SELECT.html HTH - Miles Thompson At 06:20 PM 1/20/2002 -0500, Jeff Lewis wrote: >I am trying to basically copy data from one database to another and am >wondering if it is possible to have more than one database open at a time. >So for example, I want to do something like this but am wondering if there >is a better way: > >$dbcon = mysql_connect($db_server, $db_user, $db_passwd); //Make source >connection >mysql_select_db($db_name); >//Select source db >$source_result = mysql_query("SELECT * FROM users"); //Select all >info from users table >while ($row_cat = mysql_fetch_array($result)){ >//Loop through and insert into new db > //Insert into new database >} > >So where I have "Insert into new database" this is where I want to take some >of the information from the source and insert into the new database (which >uses a different user name and password as well). > >Any help would be greatly appreciated :) > >Jeff > > > >-- >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] While on array?
You should probably take a look at each() for that... The functionality is not the same but it's the only answer I can think of for your question (i.e. mysql_fetch_row() _returns_ a key-value array while each() _walks_ a key-value array). Bogdan Daniel Alsén wrote: > Hi, > > i am fiddling with a script and need to change a while-loop from running on > mysql_fetch_array to a "normal" array? > > ie - i have: > while($myrow=mysql_fetch_array($result)) { etc... > > But i want the loop to run with an array i created earlier ($anotherarray = > [key1] => value1, [key2] => value2). > > How would i do that? Does the loop behave the same way - running until the > array is out of data? > > Thanks! > # Daniel Alsén| www.mindbash.com # > # [EMAIL PROTECTED] | +46 704 86 14 92 # > # ICQ: 63006462 | +46 8 694 82 22 # > # PGP: http://www.mindbash.com/pgp/ # > > -- > 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] 'include' & anchors
"A script to go to an anchor" - I don't know about that... If you need a _link_ to go to an anchor then you just need to echo the proper link (i.e. echo "blah.htm#anchor";). If you want a script to _redirect_ to an anchor then Emile is right: this is a client-side thing and you either have to go with JavaScript or with a META tag. Anyway, include() is definitely not the way to go. Bogdan Phil Schwarzmann wrote: > I want a script to go to an anchor in an html page > > This doesn't seem to work > > include "blah.htm#anchor"; > > how is this possible > > Thanks! > Phil in baltimore > > P.S. Pittsburgh sucks Bill Gates' balls. -- 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] Opening more than one database at a time?
Not sure, the tables are in different databases with different users and passwords. I will look into it but the answer I got this afternoon satisfied me :) Jeff - Original Message - From: "Miles Thompson" <[EMAIL PROTECTED]> To: "Jeff Lewis" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday, January 20, 2002 8:51 PM Subject: Re: [PHP] Opening more than one database at a time? > Jeff, > > Can you let MySQL do the work for you, with INSERT ... SELECT? Here's the URL" > http://www.mysql.com/doc/I/N/INSERT_SELECT.html > > HTH - Miles Thompson > > > At 06:20 PM 1/20/2002 -0500, Jeff Lewis wrote: > >I am trying to basically copy data from one database to another and am > >wondering if it is possible to have more than one database open at a time. > >So for example, I want to do something like this but am wondering if there > >is a better way: > > > >$dbcon = mysql_connect($db_server, $db_user, $db_passwd); //Make source > >connection > >mysql_select_db($db_name); > >//Select source db > >$source_result = mysql_query("SELECT * FROM users"); //Select all > >info from users table > >while ($row_cat = mysql_fetch_array($result)){ > >//Loop through and insert into new db > > //Insert into new database > >} > > > >So where I have "Insert into new database" this is where I want to take some > >of the information from the source and insert into the new database (which > >uses a different user name and password as well). > > > >Any help would be greatly appreciated :) > > > >Jeff > > > > > > > >-- > >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: mailing list manager
check @ www.hotscripts.com php / scripts and programs / mailing list managers duh :-) "Nu Webmaster" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello, > > i need a mailing list manager in php, with which i can send html email and > store my subscribers in a mysql database > > anyone knows where i can get one? > > thanks, Christophe > > > -- 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-JavaScript
Would it be possible to have javascript insert a hidden input tag in the html and then php could pick it up? Just an idea, Andy Mëòv îçîÎ òsyïn wrote: > Is it posible to get values from javascript to PHP? Without having to post > the variables.. > > Thanks //Mårten > > _ > Chatta med vänner online, prova MSN Messenger: http://messenger.msn.se -- 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 to another language
I was wondering if there are any tools to convert PHP to another scripting language? I have a script that only uses pretty basic functions in PHP (arrays, plain variables, nothing exciting- no dB things or anything like that) and am hoping there are some tools where you can get the majority of the code switched over to a more universal scripting langauge? I designed this 2000 script and then learned that our information systems people would feel a lot more comfortable using a language that they are already familier with. I originally designed it in PHP because for one it is the only scripting language that my university will allow your typical student to write in, and two because I wanted to learn PHP. So in order for my place of employment to actually use this script I made while learning PHP, they would like it if it could be converted to another language. I am still waiting on what languages they would be okay with, but thought I would start to check into the problem here first. Thanks for any information, Andrew V. Romero -- 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] agh - what am I doing wrong - regular expressions
try this... I changed 1. the double quotes in "$pattern = ..." to single quotes 2. escaped the "?" 3. used ereg_replace to do everything, dropping the while loop $content = "http://www.globalhealth.org/text.php3?id=151 adjfladjfajdfkladfjl;kadjf jlkadjflkajdflkj jadklfjalkdjfl;df jalkdfj;ldafj"; $pattern = 'http://([\/~_\.0-9A-Za-z#&=-\?]+)'; $content = ereg_replace($pattern, "\\1", $content); print $content; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, January 21, 2002 2:46 AM To: [EMAIL PROTECTED] Subject: [PHP] agh - what am I doing wrong - regular expressions Good morning everyone, I'm trying to adapt existing php code that uses a while loop to scan content for a url pattern, take the matches and add link tags () around them so the url with be made into "hot links. Simple enough right? Nevertheless, I seem to be having trouble with urls that have question marks in them. Here is the existing code that works - except with question marks: $content = "http://www.globalhealth.org/text.php3?id=151 adjfladjfajdfkladfjl;kadjf jlkadjflkajdflkj jadklfjalkdjfl;df jalkdfj;ldafj"; $pattern = "http://([\/~_\.0-9A-Za-z#&=-]+)"; while(ereg($pattern, $content, $match)){ $http_old = $match[0]; $http = "dubdubdub" . $match[1] . $match[2]; $url = "$http"; $content = ereg_replace($http_old, $url, $content); }; $content = ereg_replace("dubdubdub", "http://";, $content); print $content; ** Here's the same code with the question mark in the pattern variable. When I add the question mark and test the page, my browsers just "hang". Escaping the question mark doesn't seem to help (and I also read that escapes aren't necessary between square brackets]: $content = "http://www.globalhealth.org/text.php3?id=151 adjfladjfajdfkladfjl;kadjf jlkadjflkajdflkj jadklfjalkdjfl;df jalkdfj;ldafj"; $pattern = "http://([\/~_\.0-9A-Za-z#&=?-]+)"; while(ereg($pattern, $content, $match)){ $http_old = $match[0]; $http = "dubdubdub" . $match[1] . $match[2]; $url = "$http"; $content = ereg_replace($http_old, $url, $content); }; $content = ereg_replace("dubdubdub", "http://";, $content); print $content; * In an attempt to find the problem, I did a test with the following code and received the result I want - which leads me to believe the problem is possibly with the while loop or the ereg_replace?? $content = "http://www.globalhealth.org/text.php3?id=151 adjfladjfajdfkladfjl;kadjf jlkadjflkajdflkj jadklfjalkdjfl;df jalkdfj;ldafj"; $pattern = "http://([/~_.0-9A-Za-z#&=?-]+)"; ereg($pattern, $content, $match); print "$match[0]"; ** I'm completely confused. I have a feeling there is any easy answer and if I wasn't so frustrated I'd be embarrassed to say that I've spent hours on this... Thanks in advance for your help, Shawna -- 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.ini and mail()
I've installed php 4.0.6 and sendmail in two different servers. I want to use mail() function to send mails, but as the server with php dosen't have a smtp server it can't be done. Is there a way to point to my other server which has sendmail; through php.ini kancha __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- 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 to another language
On 20 Jan 2002, at 20:15, Andrew V. Romero wrote: > I was wondering if there are any tools to convert PHP to another > scripting language? > scripting langauge? I designed this 2000 script and then learned that > our information systems people would feel a lot more comfortable using > a language that they are already familier with. I originally designed Have they looked at what your wrote? Have they given PHP ANY thought and a little attention to PHP?? I've been a Perl programmer for the last 6 years. Just about a month ago someone asked me to do something for him in PHP. I gave it a shot. A couple of weeks after I took a test at a consulting company and I scored higher on PHP than Perl :( But beyond the above, I would never use Perl for cgi. I still prefer mod_perl for large applications but I'd certainly argue to use PHP for anything involving a few screen shots. If your technical people are worth anything they ought to look at PHP. Even though I did not program in PHP for those 6 years I did encourage a talented html guy to learn PHP and he did a site for us using PHP (he and the designer worked on it without my intervention). I guess because he never knew about cgi programming in Perl he did not argue for all of us to do more in PHP. BTW, if anyone has used the Perl HTML::Template module and knows a PHP templating module that is as good or better, please let me know. I might have missed it but I shudder at most of the PHP template systems I see in comparison. Thanks, Peter --- "Reality is that which, when you stop believing in it, doesn't go away". -- Philip K. Dick -- 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] Cookies w/PHP as CGI Binary, possible?
I don't know if it's possible because as far as I know headers are sent immediately upon execution when PHP is installed as CGI binary. But my question is, if possible, how can I get cookies to work when PHP has been installed as CGI binary. This does NOT work for me: // start of code #!/usr/bin/php // end of code Any ideas? Thanks, - Kurtii -- 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] Give people a break!
Hi list... I'm new here and was reading all these posts on RTFM. Heres how I figure it, there are always going to be lazy people asking advanced (or who they think may be advanced) users of PHP to write out their code. I know, I used to be one of these people when I was trying to figure out *giggle* mIRC script. I would go into #mirc or #mirchelp on IRC and should the slightest problem occur, I would automatically ask someone to figure it out for me. And there are other people who discover PHP by some friend or something and wishes that they could learn the language in 2 hours and become as "cool" as their friend. Also, there are people with absolutely no prior programming experience trying to get into PHP and reading the manual, which IMHO was written to complement past programmers looking for a new language, can be confusing. When I first started PHP, it was my first programming experience before mIRC script HEH. Sad but true. And when I first read the manual, I got confused! The terminology blew over my head and yes, I right away asked for help. And as I asked for help, and people told me the answers I looked back at the manual and the terminology started to make sense. All of you have been through it at one stage in your life or another. A newbie seeking help. So be kind, be fair, ect ect ect. This is my first and last post that will be off topic of the mailing list. Toodles.. 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]
RE: [PHP] Re: eval()
After getting very frustrated with arrays, I ended up using eval() in the following way: function top10() { $i = 0; $res = mysql_query("SELECT orders.pid, products.pid, orders.amount, products.pname FROM orders, products WHERE orders.uid!='' AND orders.pid=products.pid") or die(mysql_error()); while (list($opid, $ppid, $amount, $pname) = mysql_fetch_row($res)) { $eval = '$temp["'.$pname.'"] = $temp["'.$pname.'"] + '.$amount.';'; eval($eval); $i++; } arsort($temp); return $temp; } It works fine for me, though I don't really need to select orders.pid and products.pid since they aren't used. They are there when I was debugging but *shrug*, I'm just too lazy to remove them right now! 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]
RE: [PHP] Re: eval()
> while (list($opid, $ppid, $amount, $pname) = mysql_fetch_row($res)) { > $eval = '$temp["'.$pname.'"] = $temp["'.$pname.'"] + '.$amount.';'; > eval($eval); > $i++; Whoa... Why not simply: $temp[$pname] += $amount; ?? -Rasmus -- 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: eval()
I tried that and strangely it didn't work and using eval() was really my only solution :( People told me to od $foo[$bar], $foo['$bar'], $foo["$bar"], $foo[($bar)], and the manual doesn't seem to mind $foo[$bar], but I dunno. It just wasn't working, and I was angry and depressed that I wasn't getting paid enough for what I was doing so I took the easy way out. It's the only time I ever used eval() in PHP. > -Original Message- > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] > Sent: January 20, 2002 11:22 PM > To: Alex Dowgailenko > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] Re: eval() > > > > while (list($opid, $ppid, $amount, $pname) = > mysql_fetch_row($res)) { > > $eval = '$temp["'.$pname.'"] = $temp["'.$pname.'"] > + '.$amount.';'; > > eval($eval); > > $i++; > > Whoa... Why not simply: > > $temp[$pname] += $amount; > > ?? > > -Rasmus > > -- 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: Edit program
[EMAIL PROTECTED] (Mehmet Kamil Erisen) wrote in [EMAIL PROTECTED]:">news:[EMAIL PROTECTED]: > > Dear List member, > > Plesae forgive me for asking and OT question. Can you please recommend > an edit program, (Freely downloadable). > > Thanks, Search your local PHP mirror for 'editor'; there is a link to a page listing a lot of editors for both Windows and *nix. -- 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] Code logic problem pulling data from a file / for loop / by array_push
If someone can help with this please examine the following problem... - $lefta = array(); $leftid = array(); $top = count($connarray); //connarray is an array of lines from a file with repeating sections that have values in the form value=setting for ($i=0;$i<$top;$i++) { if (preg_match("/\bleft\b/", connarray[$i])) { array_push($lefta, "$connarray[$i]"); } if (preg_match("/\bleftid\b/", connarray[$i])) { array_push($leftida, "$connarray[$i]"); } } In later sequences I remove everything up to and including the "=" sign which leaves the "setting" under a different array. However, $lefta is not modified itself. After a number of cycles I found a problem. In some cases there is a leftid= that has a name, yet in that section there is no left=. When this form displays the data using a for loop and populating the variables with the $lefta and $leftida I found that when there is no left= nothing gets added to the array. How can I force an addition to the array when the value is not found? Also, this is over-simplified. I'm only showing two values out of the actual search having 15 possible and the number of loops can be 5 sections (more or less) with less than or 15 lines each. I've been swimming around in this code for a while and I'm new to this stuff so my apologies if I my description is hard to follow. Larry S. Brown President/CEO Dimension Networks, Inc. Member ICCA (727) 723-8388 -- 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:
[posted and mailed] [EMAIL PROTECTED] (Jtjohnston) wrote in [EMAIL PROTECTED]:">news:[EMAIL PROTECTED]: > This is the input of a . I don't suppose there is an easier > way of doing this? > > $mydata->KW = str_replace("\r", "", $mydata->KW); > $mydata->KW = str_replace("\n", "", $mydata->KW); > $mydata->KW = str_replace("", "", $mydata->KW); > > What does htmlspecialchars do exactly? > Yes I've read the docs, but didn't really follow. > > An email post & reply would be real helpful :) > John > Why not use nl2br() to modify the end of line characters? And there is probably no value, apart from saving characters in your source, to translate a pair of to . In fact, it might have unexpected effects if you hapen to display the output inside of a closed block. So, $mydata->KW = nl2br($mydata->KW); Depending on how this data is being used, you might prefer to do the translation before display rather than storing html in your database. For instance, if the data is to be edited, embedded html may be confusing, depending on the level of knowledge of the person editing. In respect of htmlspecialchars, recall that symbols like < and> have special functions in html - they signal the start and end of html tags. So if you actually want to use a < or > in your text, you should use the special symbol > (note the special use of the ampersand here!) htmlspecialchars will perform the translations for you. -- David Robley Temporary Kiwi -- 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: PHP-JavaScript
the only way php is going to know about a variable is if the server the script is on is sent the variable, the normal way of doing that is through posting/getting a page/script Martin -Original Message- From: Andrew V. Romero [mailto:[EMAIL PROTECTED]] Sent: Monday, January 21, 2002 2:11 PM To: [EMAIL PROTECTED]; =?iso-8859-1?Q?M=EB=F2v=20=EE=89=E7=EE=CE=20=F2sy=EFn?[EMAIL PROTECTED] Subject: [PHP] Re: PHP-JavaScript Would it be possible to have javascript insert a hidden input tag in the html and then php could pick it up? Just an idea, Andy Mëòv î?çîÎ òsyïn wrote: > Is it posible to get values from javascript to PHP? Without having to post > the variables.. > > Thanks //Mårten > > _ > Chatta med vänner online, prova MSN Messenger: http://messenger.msn.se -- 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 to another language
*light hearted reply* blasphemy! sacrilege!! how can you ask a php mail list about converting code to another language?? (paraphase coming...) "php is the one true language and you shall not code any other language before it" :) Martin -Original Message- From: Andrew V. Romero [mailto:[EMAIL PROTECTED]] Sent: Monday, January 21, 2002 2:16 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP to another language I was wondering if there are any tools to convert PHP to another scripting language? I have a script that only uses pretty basic functions in PHP (arrays, plain variables, nothing exciting- no dB things or anything like that) and am hoping there are some tools where you can get the majority of the code switched over to a more universal scripting langauge? I designed this 2000 script and then learned that our information systems people would feel a lot more comfortable using a language that they are already familier with. I originally designed it in PHP because for one it is the only scripting language that my university will allow your typical student to write in, and two because I wanted to learn PHP. So in order for my place of employment to actually use this script I made while learning PHP, they would like it if it could be converted to another language. I am still waiting on what languages they would be okay with, but thought I would start to check into the problem here first. Thanks for any information, Andrew V. Romero -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] insert & select image in mySQL
aloo, sorry if this question was already asked before.. :-( i'm going to insert an image from html form to the mysql when i'm going to insert it's run good, but when i'm going to select it from mysql, i've got nothing.. could someone have an advice?? thank you... Rio Uniwaly www.prio.mysite.de email:[EMAIL PROTECTED]
[PHP] Having a problem with sessions, Part Deux.
Just FYI. I posted the forwarded question earlier, but did some more testing. I was doing some testing tonight when server traffic was low (ie: stop / restart Apache) and I found out that when register_globals is On, the below code doesn't work. Is this something to do with the EGPCS and how variables are inherited? When register_globals is off, the code works great. Could someone explain why that is? That'd be great :) I would have thought that you can still access the HTTP_SESSION_VARS even if globals is on? Thanks. Henrik On Sunday 20 January 2002 15:12, Henrik Hudson wrote: > Hey List- > > Banging my head again the wall with this one. One of our developers was > trying to get some session stuff to work and he couldn't and asked me to > look into it. > > I have a script that contains the following (the sessions.php href > reference is the same script accept it calls this one): > > _ > session_start(); > > if (!isset($HTTP_SESSION_VARS[count])) { > $HTTP_SESSION_VARS[count] = 0; > } > else { > $HTTP_SESSION_VARS[count]++; > } > //Print the counter > > echo "Counter is now: $HTTP_SESSION_VARS[count];\n\n"; > echo "Let's go to another page..."; > ___ > > On my box at home running PHP 4.0.6 it works great. > > On the work server running PHP 4.0.6 it doesn't work. Just keeps setting > count to 0. > > The work box is running Apache 1.3.20 with the following compile options: > > './configure' '--with-apxs' '--with-config-file-path=/etc/php' > '--with-openssl=/usr/local/openssl' '--with-zlib' '--with-bz2' > '--with-pspell' '--enable-ftp' '--enable-gd' '--with-imap' '--with-mcrypt' > '--with-mhash' '--with-mysql=/usr/local/mysql' > > The home box is running Apache 1.3.22 with the following compile options: > > './configure' '--with-apxs' '--with-config-file-path=/etc/php' > '--with-openssl=/usr/local/openssl' '--with-zlib' '--with-bz2' > '--with-mysql=/usr/local/mysql' '--with-mcrypt' '--with-mhash' > '--disable-xml' '--enable-ftp' '--with-gettext' '--with-pspell' > '--enable-inline-optimization' > > The only major difference that I could find in the php.ini file is that at > home I have register globals off and at work they are on? > > Even with register globals on, you can still use the $HTTP_*_VARS, right? > > The sessionID cookie is getting put into my browser, I checked so the > "session" is starting correctly, just not retaining the variable. > > Any ideas anyone? > > > Thanks list. > > Henrik -- Henrik Hudson [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] insert & select image in mySQL
Try this code. It assumes you are already connected to the database. Usually, I put that script in something like database.inc and just do an include. pid is the picture id. I'll assume you'll have an index or something in your database setup. Now, type is based on the extension of the file really. If filename.gif is uploaded, it is assumed that the header type is image/gif. How do you use this? Save this little script as a seperate file. It is now the image file. Observe: Now, assuming that the file you saved it as is foobar.php, the script will fetch the binary data of whatever is at pid 24. > -Original Message- > From: Rio Uniwaly [mailto:[EMAIL PROTECTED]] > Sent: January 21, 2002 12:01 AM > To: [EMAIL PROTECTED] > Subject: [PHP] insert & select image in mySQL > > > aloo, sorry if this question was already asked before.. :-( > i'm going to insert an image from html form to the mysql > when i'm going to insert it's run good, but when i'm going to > select it from mysql, > i've got nothing.. > could someone have an advice?? > thank you... > > Rio Uniwaly > www.prio.mysite.de > email:[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] Just something some people mind find useful
http://www.isi.edu/in-notes/iana/assignments/media-types/media-types has been a great help for me and will probobally be a great help to a bunch of other people designing web applications. It's a fairly long list of content types with their RFC codes and whatnot. Just thought I'd contribute something usefull *shrug*... 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] How to resolve IP with PHP
Hello. Can anyone tell me how to resolve an IP into a hostname? I've tried $REMOTE_HOST but all i get back from it is the ip or blank. Is there another environmental variable i need to use or do i have to do something more complicated? thanks so much! -mark __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- 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 resolve IP with PHP
Did you look at the function list to see if gethostbyname() or something similar exists? On Mon, 2002-01-21 at 01:20, Police Trainee wrote: > Hello. Can anyone tell me how to resolve an IP into a > hostname? I've tried $REMOTE_HOST but all i get back > from it is the ip or blank. Is there another > environmental variable i need to use or do i have to > do something more complicated? > > thanks so much! > -mark > > __ > Do You Yahoo!? > Send FREE video emails in Yahoo! Mail! > http://promo.yahoo.com/videomail/ > > -- > 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] -- Austin Gonyou Systems Architect, CCNA Coremetrics, Inc. Phone: 512-698-7250 email: [EMAIL PROTECTED] "It is the part of a good shepherd to shear his flock, not to skin it." Latin Proverb signature.asc Description: This is a digitally signed message part