Re: [PHP] Re: Redirecting
IOW ?? what's this abbrev? thx.. ::: : Julien Bonastre [The-Spectrum.org CEO] : A.K.A. The_RadiX : [EMAIL PROTECTED] : ABN: 64 235 749 494 : QUT Student :: 04475739 ::: - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, April 27, 2002 3:14 PM Subject: Re: [PHP] Re: Redirecting On Saturday 27 April 2002 12:00, Julio Nobrega wrote: Send head()ers before any html output (including spaces or newlines before ?php) IOW RTFM! -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Love tells us many things that are not so. -- Krainian Proverb */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Apache: SERVER_NAME gone?
Hi Y'all... Ok. I just got Apache 1.3.xx and I have PHP4.1.1 and MySQL 3.23.47 on WinXP Pro... I am currently using IIS5.1 with PHP4 and MySQL but I'd like to move across to Apache.. Catch is? I have hunted through all the FAQ's for Apache and there is no mention of how-to configure Apache to actually execute PHP's... So I went into the PHP doc's and there is a small mention.. So I finally get the php's to run.. BUT.. when I call $SERVER_NAME in my php's like I always have.. The variable seems to no longer exist... what gives?? Thanks all.. I am sure it's just a name change or something that Apache uses.. Or maybe I have to register the PHP global var's somehow through Apache?? don't really know.. Anyway thanks a heap in a advance because I'd really love to start delving into this great subdomaining/.htaccess world :) Thanks again.. Greatly appreciated... ::: : Julien Bonastre [The-Spectrum.org CEO] : A.K.A. The_RadiX : [EMAIL PROTECTED] : ABN: 64 235 749 494 : QUT Student :: 04475739 :::
[PHP] date format
Hi all, I'm trying to query a date field from mySQL and display in a differnet format. the mysql date is in the format -MM-DD and I want to convert it to DD-MM- how do I do that? TIA Ananth = visit www.locustechnologies.com __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date format
On Saturday 27 April 2002 14:43, Ananth Rajaraman wrote: Hi all, I'm trying to query a date field from mySQL and display in a differnet format. the mysql date is in the format -MM-DD and I want to convert it to DD-MM- how do I do that? Use mysql's extensive date formatting functions. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Remember kids, if there's a loaded gun in the room, be sure that you're the one holding it -- Captain Combat */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache: SERVER_NAME gone?
On Monday 22 January 2001 14:36, The_RadiX wrote: Hi Y'all... Ok. I just got Apache 1.3.xx and I have PHP4.1.1 and MySQL 3.23.47 on WinXP Pro... I am currently using IIS5.1 with PHP4 and MySQL but I'd like to move across to Apache.. [snip] BUT.. when I call $SERVER_NAME in my php's like I always have.. The variable seems to no longer exist... what gives?? Use phpinfo() to find out what system/pre-defined variables are available. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Nothing makes a person more productive than the last minute. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Redirecting
On Monday 22 January 2001 14:31, The_RadiX wrote: IOW ?? what's this abbrev? in other words -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I hold it, that a little rebellion, now and then, is a good thing... -- Thomas Jefferson */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Another silly email
Um im trying to take the input from a txt field in an html form (which happens to be a number) and convert it to currency. Anyone know if there is a function in PHP to do this or do i have to convert to a float etc? Cheers From baldey_uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: date format
try ? $date=2002-04-27; echo date(d-m-Y,strtotime($date)); ? -- Best regards, George Nicolae IT Manager ___ PaginiWeb.com - Professional Web Design www.PaginiWeb.com Ananth Rajaraman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi all, I'm trying to query a date field from mySQL and display in a differnet format. the mysql date is in the format -MM-DD and I want to convert it to DD-MM- how do I do that? TIA Ananth = visit www.locustechnologies.com __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date format
On Fri, 26 Apr 2002, Ananth Rajaraman wrote: I'm trying to query a date field from mySQL and display in a differnet format. the mysql date is in the format -MM-DD and I want to convert it to DD-MM- how do I do that? How did you figure out anything else that you've done in MySQL? There's an excellent manual at http://www.mysql.com/ . Please try to at least glance at the documentation before posting here. Some questions are so incredibly basic that it's clear you didn't even try. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Another silly email
On Sat, 27 Apr 2002, baldey_uk wrote: Um im trying to take the input from a txt field in an html form (which happens to be a number) and convert it to currency. Anyone know if there is a function in PHP to do this or do i have to convert to a float etc? What do you mean by a currency? If you mean a number with two decimal places, you can do something like: $currency_val = sprintf('%.2f', floatval($_REQUEST['how_much_money'])); miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Redirecting
RTFM? what's this abbrev? - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, April 27, 2002 4:55 PM Subject: Re: [PHP] Re: Redirecting On Monday 22 January 2001 14:31, The_RadiX wrote: IOW ?? what's this abbrev? in other words -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I hold it, that a little rebellion, now and then, is a good thing... -- Thomas Jefferson */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] POST/GET is not working for PHP 4.2.0 on W2K Advanced Server
Hi there, Anyone else having trouble with vanished form posts/gets with the new PHP 4.2.0 on Windows 2000 Advanced Server? I re-installed 4.1.1 and everything worked again... Regs, Jason __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 1. ImageTTFBox not working and 2. System command
Hi all, I have problem with TTF support on my vhost. PHP says it has no ttf support. The configure command is: './configure' '--prefix=/opt/php' '--enable-exif' '--with-apxs' '--enable-memory-limit=yes' '--enable-track-vars' '--enable-trans-sid' '--enable-wddx' '--enable-ftp' '--with-gd=../gd' '--enable-gd-imgstrttf' '--with-jpeg-dir' '--with-ttf' '--enable-gd-native-ttf' '--with-t1lib=/usr/lib' '--with-mysql=/usr/' '--with-png-dir' '--with-config-file-path=/etc/opt/httpd/' '--with-zlib' '--with-mhash' '--with-pdflib=/usr/lib/' '--enable-sysvsem' '--enable-sysvshm' '--enable-memory-limit' and GD section of PHP Info looks like this: GD Support enabled GD Version 1.6.2 or higher T1Lib Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled anyone could help? Admin says that on their website TTF functions work fine. Additionally, i'm execute a shell command (to create thumbnail with ImageMagick) but it does not do anything. The command is OK as it works by SSH. Remek -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] PHPlib sessions without a DB?
At 9:57 AM -0400 26/4/02, Alan McKay wrote: Session4 without Session4_custom uses native php containers, e.g. files or mm. Where is this session4? I pulled php-lib-stable out of CVS yesterday and do not see this anywhere. Is this part of the bleeding edge in php-lib (without the stable) in CVS? It's in the unsup directory. Maxim's release notes are in there too. I hope to merge this into the mainstream release in a backward compatible manner some time soon. ...Richard. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reg-ex please
Help please from one of the reg-ex experts out there please ! I'm trying to find the pattern #(5 number); example #69880; This works $code[$i] = ereg_replace(#([0-9])+ , replace\\0.bing , $code[$i] ); and I get back replace #69880;.bing but I also want to lose the # and the ; so I get back 69880.bing At the moment I just re search and remove the like this $code[$i] = ereg_replace('#','',$code[$i]); $code[$i] = ereg_replace(';','',$code[$i]); but I'm sure that theortetically I can do it in one step ! Can anyone help ! Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP is making errors for no apparents reason..?
Hi all.. I've been trying to understand actually what is the error in the following code for 2 hours, i played with the code, moved stuff around and the like but nothing worked.. Can someone help me please? The PHP error is as follow: Parse error: parse error in /usr/home/iro/numripps.php on line 13 ? $query = SELECT handle from x; $res = mysql_query($query); while ($row = mysql_fetch_array($res)) { $xquery = SELECT handle from husers WHERE handle like '$row[handle]'; $xres = mysql_query($xquery); $chck = mysql_num_rows($xres); if (!$chck) { $zquery = SELECT name from users WHERE handle like '$row[handle]'; $zres = mysql_query($zquery); $zrow = mysql_fetch_array($zres); $user = $zrow[name]; $query = INSERT into husers values (\'$row[handle]\' , \'$user\'); mysql_query($query); } } ? When i changes the of the line 13 for ' ' there is another error but thise time after the ?.. Where did i go wrong? i see nothing wrong in here. (Btw i know my code is ugly but it's still suposed to work.) Thanks in advance if you help me.
[PHP] Failed to compiled w/ T1lib
To make a long story short: I'm trying to compile PHP 4.2 with Apache, GD, T1lib and more. This is what I'm using: [configuring apache first] ./configure --with-apache=../apache_1.3.24 --enable-ftp --with-mysql=/usr/l ocal/mysql/ --enable-track-vars --enable-inline-optimization --disable-debug --enable-memory-limit --with-xml --enable-t1lib --with-t1lib=/usr/local/lib --with-gd=../gd-2.0.1 --with-freetype-dir=/usr --enable-gd-native-ttf --en able-gd-imgstrttf --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib make make install cd ../apache_1.3.24 ./configure --activate-module=src/modules/php4/libphp4.a --enable-module=rew rite make And this is what I get: /usr/libexec/elf/ld: warning: libpng.so.4, needed by /usr/local/lib/libgd.so, may conflict with libpng.so.5 modules/php4/libphp4.a(gd.o): In function `zif_imagecreatetruecolor': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0xd9e): undefined reference to `gdImageCreateTrueColor' modules/php4/libphp4.a(gd.o): In function `zif_imagetruecolortopalette': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0xf2b): undefined reference to `gdImageTrueColorToPalette' modules/php4/libphp4.a(gd.o): In function `zif_imagesetthickness': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x1032): undefined reference to `gdImageSetThickness' modules/php4/libphp4.a(gd.o): In function `zif_imagefilledellipse': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x136a): undefined reference to `gdImageFilledEllipse' modules/php4/libphp4.a(gd.o): In function `zif_imagefilledarc': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x1836): undefined reference to `gdImageFilledArc' modules/php4/libphp4.a(gd.o): In function `zif_imagealphablending': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x193a): undefined reference to `gdImageAlphaBlending' modules/php4/libphp4.a(gd.o): In function `zif_imagecolorresolvealpha': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x1bd1): undefined reference to `gdImageColorResolveAlpha' modules/php4/libphp4.a(gd.o): In function `zif_imagecolorclosestalpha': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x1e61): undefined reference to `gdImageColorClosestAlpha' modules/php4/libphp4.a(gd.o): In function `zif_imagecolorexactalpha': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x20f1): undefined reference to `gdImageColorExactAlpha' modules/php4/libphp4.a(gd.o): In function `zif_imagecopyresampled': /usr/tmp/www/php-4.2.0/ext/gd/gd.c:882: undefined reference to `gdImageCopyResampled' *** Error code 1 Stop in /usr/tmp/www/apache_1.3.24/src. *** Error code 1 Stop in /usr/tmp/www/apache_1.3.24. *** Error code 1 Stop in /usr/tmp/www/apache_1.3.24. Any ideas? It worked good before I installed t1lib and messed around with it. Thanks in advance, Victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CAllin PHP Gurus-FREE WEBHOSTING
Greetings guys/girls (Like there are many of them around on the list), Special greetings to Steve,Nathon,Michael,John and ANYBODY else who was kind enough to help me.) Anyway, I was not joking when I said free webhosting for you. Little bit of background first. I am in charge of buying webhosting accounts for my company and this time I purchased one extra account, (This happens frequently with us) So now I have a 1 year paid webhosting account with either PHP or CGI installed, 99.3 uptime, a catch all address, your domain, unique ip address etc etc The deal is this, I am overworked with work here and need a small project done, I dont have the time and since nothing is free in this world..you do my project and since i cant pay you i give you the hosting account, you can make your own personal/commercial website WITH OUT ANY BANNERS. you can charge for banners etc thats up to you. Remember though, you have to follow the webhosts rules: No porn, that includes kiddy stuff,gay porn( basically no sick stuff). No racism ...eg Chinks,Niggers, jews etc (basically no making fun of people who have differient eye features than us, differerent skin colour or different race, religon...live and let live ppl.) ok heres the rough project (its for a personals site): 1.Take user details (email,username,password, address date-of-birth etc), preview them, write to database, make a folder with the username of the user,send an email for confirmation. 2.One page for the user to enter the username/password and then when logged in user should be able to upload upto 5 pics each pic not more than 50 k (Admin has to approve each photo first.) 3.User can delete any picture and add more. 4.User can tick which pic they want to display and which not. 5.there should be a quick look where when someone wants to join they click on quick look and they see photo with short description eg |--| -| | | | | Photo| Part of description ...join to see full (Link) | | | | |--- - | | |Photo |Part of description...join to see full (Link) | | | | |--- --- | | | | Photo| Part of description...join to see full (Link) | | | | |--- - | | | | Photo| Part of description...join to see full (Link) | | | | |--- - || etc etc THATS IT! if you feel you can do it, write in with ATTENTION RYAN in the subject line,will respond TOTAL work details,images etc, with my company website URL and my personal phone no if you want to talk about the project. Preference will be given to people who have already helped me in the past but it basically works on a first come first serve basis. Any questions...just ask. Dont bother with the designing part. IMPORTANT: I will need comments everywhere explaining EXACTLY what is being done. Cheers, -Ryan. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
AW: [PHP] reg-ex please
Try it like this : $code[$i] = ereg_replace(#([0-9] {5}); , \\1.bing , $code[$i] ); -Ursprüngliche Nachricht- Von: John Fishworld [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 27. April 2002 1:11 PM An: [EMAIL PROTECTED] Betreff: [PHP] reg-ex please Help please from one of the reg-ex experts out there please ! I'm trying to find the pattern #(5 number); example #69880; This works $code[$i] = ereg_replace(#([0-9])+ , replace\\0.bing , $code[$i] ); and I get back replace #69880;.bing but I also want to lose the # and the ; so I get back 69880.bing At the moment I just re search and remove the like this $code[$i] = ereg_replace('#','',$code[$i]); $code[$i] = ereg_replace(';','',$code[$i]); but I'm sure that theortetically I can do it in one step ! Can anyone help ! Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
AW: [PHP] reg-ex please
Woops , one to many whitespace :) -- Try it like this : $code[$i] = ereg_replace(#([0-9]{5}); , \\1.bing , $code[$i] ); -Ursprüngliche Nachricht- Von: Red Wingate [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 27. April 2002 1:26 PM An: [EMAIL PROTECTED] Betreff: AW: [PHP] reg-ex please Try it like this : $code[$i] = ereg_replace(#([0-9] {5}); , \\1.bing , $code[$i] ); -Ursprüngliche Nachricht- Von: John Fishworld [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 27. April 2002 1:11 PM An: [EMAIL PROTECTED] Betreff: [PHP] reg-ex please Help please from one of the reg-ex experts out there please ! I'm trying to find the pattern #(5 number); example #69880; This works $code[$i] = ereg_replace(#([0-9])+ , replace\\0.bing , $code[$i] ); and I get back replace #69880;.bing but I also want to lose the # and the ; so I get back 69880.bing At the moment I just re search and remove the like this $code[$i] = ereg_replace('#','',$code[$i]); $code[$i] = ereg_replace(';','',$code[$i]); but I'm sure that theortetically I can do it in one step ! Can anyone help ! Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FreeMovie/PHP mailing lists
Hi, I set up two mailing lists for FreeMovie users. You can find links to these lists on the FreeMovie page http://freemovie.sourceforge.net Sorry, if you've seen this message on this list before, I was having some problems with my e-mail setup. Thanks, Jacek -- Encyklopedia multimedialna w prezencie! http://www.e-mail.onet.pl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP is making errors for no apparents reason..?
On Saturday 27 April 2002 22:19, newton wrote: Hi all.. I've been trying to understand actually what is the error in the following code for 2 hours, i played with the code, moved stuff around and the like but nothing worked.. Can someone help me please? The PHP error is as follow: Parse error: parse error in /usr/home/iro/numripps.php on line 13 Instead of making us count (I've only got ten fingers, I'm wearing shoes and I can't see my toes), tell us which is line 13. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* MIT: The Georgia Tech of the North */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reg-ex please
Excellent :-))) Thanks ! Can I trouble you again with one more ! I get an url http://whatever/file.whatever (text/html/chtml) Now trying to do the following get just the http://whatever bit and go through my array and find .gif or .html or .chtml and replace the eg pics/my.gif with http://whatever/pics/my.gif I've only just started with this one so haven't got very far but you were so quick I thought I'd ask ! :-)) This is my start but its definately wrong ! $code[$i] = ereg_replace(^.+.gif, $url_file\\0,$code[$i]); er...thanks ! :-)) Woops , one to many whitespace :) -- Try it like this : $code[$i] = ereg_replace(#([0-9]{5}); , \\1.bing , $code[$i] ); -Ursprüngliche Nachricht- Von: Red Wingate [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 27. April 2002 1:26 PM An: [EMAIL PROTECTED] Betreff: AW: [PHP] reg-ex please Try it like this : $code[$i] = ereg_replace(#([0-9] {5}); , \\1.bing , $code[$i] ); -Ursprüngliche Nachricht- Von: John Fishworld [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 27. April 2002 1:11 PM An: [EMAIL PROTECTED] Betreff: [PHP] reg-ex please Help please from one of the reg-ex experts out there please ! I'm trying to find the pattern #(5 number); example #69880; This works $code[$i] = ereg_replace(#([0-9])+ , replace\\0.bing , $code[$i] ); and I get back replace #69880;.bing but I also want to lose the # and the ; so I get back 69880.bing At the moment I just re search and remove the like this $code[$i] = ereg_replace('#','',$code[$i]); $code[$i] = ereg_replace(';','',$code[$i]); but I'm sure that theortetically I can do it in one step ! Can anyone help ! Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
AW: [PHP] reg-ex please
Sure :) -Ursprüngliche Nachricht- Von: John Fishworld [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 27. April 2002 1:46 PM An: Red Wingate; [EMAIL PROTECTED] Betreff: Re: [PHP] reg-ex please Excellent :-))) Thanks ! Can I trouble you again with one more ! I get an url http://whatever/file.whatever (text/html/chtml) Now trying to do the following get just the http://whatever bit and go through my array and find .gif or .html or .chtml and replace the eg pics/my.gif with http://whatever/pics/my.gif I've only just started with this one so haven't got very far but you were so quick I thought I'd ask ! :-)) This is my start but its definately wrong ! $code[$i] = ereg_replace(^.+.gif, $url_file\\0,$code[$i]); er...thanks ! :-)) Woops , one to many whitespace :) -- Try it like this : $code[$i] = ereg_replace(#([0-9]{5}); , \\1.bing , $code[$i] ); -Ursprüngliche Nachricht- Von: Red Wingate [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 27. April 2002 1:26 PM An: [EMAIL PROTECTED] Betreff: AW: [PHP] reg-ex please Try it like this : $code[$i] = ereg_replace(#([0-9] {5}); , \\1.bing , $code[$i] ); -Ursprüngliche Nachricht- Von: John Fishworld [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 27. April 2002 1:11 PM An: [EMAIL PROTECTED] Betreff: [PHP] reg-ex please Help please from one of the reg-ex experts out there please ! I'm trying to find the pattern #(5 number); example #69880; This works $code[$i] = ereg_replace(#([0-9])+ , replace\\0.bing , $code[$i] ); and I get back replace #69880;.bing but I also want to lose the # and the ; so I get back 69880.bing At the moment I just re search and remove the like this $code[$i] = ereg_replace('#','',$code[$i]); $code[$i] = ereg_replace(';','',$code[$i]); but I'm sure that theortetically I can do it in one step ! Can anyone help ! Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] current date query
Hi, I am a beginning programmer and I am missing my Mysql/php book for some days so I can't look up what i need. i need a query something like this: query= SELECT from calender WHERE ('$day','$month','$year')= current date i need a script that looks in my database for events that are going down the day my visitor visits the page and if there are no parties today it returns something like: sorry no parties today. thanks and let me know -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP is making errors for no apparents reason..?
if (!$chck) { $zquery = SELECT name from users WHERE handle like '$row[handle]'; $zres = mysql_query($zquery); $zrow = mysql_fetch_array($zres); $user = $zrow[name]; $query = INSERT into husers values (\'$row[handle]\' , \'$user\'); mysql_query($query); } The first select line doesn't end its quotes properly. Michael Kimsal http://www.phphelpdesk.com Guanrateed PHP support when you need it 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Directory System Splitter
Hi guys, trying to get my head around possible code for this problem. My website has various sections which have their own directory like below: HOME - Main part of the website CHARTS - Various DJ charts MUSIC - Review, News and other things and so on.. At the top of each page I have a link panel which depending on which section of the site you are in shows the links back down the directory system. For example: http://www.danceportal.co.uk/diary/2002/may/ has this in the panel: Home / Diary / 2002 / May / -- These are links back down the system of directories. http://www.danceportal.co.uk/charts/randumian/mon-22-apr-2002.php has this: Home / Charts / Randum Ian / Monday, April 22, 2002 Is it possible to automate this in a template so that it can work out where it is and create the correct links? If you need an example of how it is now please visit my website http://www.danceportal.co.uk/home/. Regards, Ian. --- Randum Ian DJ / Reviewer / Webmaster, DancePortal (UK) Limited [EMAIL PROTECTED] http://www.danceportal.co.uk DancePortal.co.uk - Global dance music media -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Directory System Splitter
On Saturday 27 April 2002 20:34, Randum Ian wrote: [snip] For example: http://www.danceportal.co.uk/diary/2002/may/ has this in the panel: Home / Diary / 2002 / May / -- These are links back down the system of directories. http://www.danceportal.co.uk/charts/randumian/mon-22-apr-2002.php has this: Home / Charts / Randum Ian / Monday, April 22, 2002 Is it possible to automate this in a template so that it can work out where it is and create the correct links? Yes. http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-no-answers.html Presumably you want to know *how* to do it? Use phpinfo() to see what predefined vars you can use to get your document path. Then probably use explode() to get the individual components of the path. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Are we not men? */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[4]: [PHP] PHPlib sessions without a DB?
Hello Richard, Saturday, April 27, 2002, 2:24:21 PM, you wrote: RA It's in the unsup directory. Maxim's release notes are in there too. No, I meant the file session4.inc in the php-lib/php/session. session4_custom.inc release notes (quite outdated, but still usable) are there too. It's Phplib4 package, which also has session4.inc file, is in the unsup directory, and is a completely different thing (while doing similar work too), made by Barend Scholtus. -- Best regards, Maxim Derkachev mailto:[EMAIL PROTECTED] System administrator programmer, Symbol-Plus Publishing Ltd. phone: +7 (812) 324-53-53 www.books.ru, www.symbol.ru -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 27 Apr 2002 13:25:00 -0000 Issue 1311
php-general Digest 27 Apr 2002 13:25:00 - Issue 1311 Topics (messages 94846 through 94891): Re: Opening manual - .bz2 94846 by: John Holmes Re: good php editor for the mac 94847 by: Miguel Cruz Re: Variables not working 94848 by: Nathan 94850 by: baldey_uk 94851 by: baldey_uk 94852 by: Mike 94853 by: Philip Olson 94854 by: Rasmus Lerdorf Re: BBS system 94849 by: Jeff Lewis Redirecting 94855 by: Liam MacKenzie 94856 by: Julio Nobrega 94857 by: Richard Emery 94860 by: Jason Wong 94863 by: The_RadiX 94868 by: Jason Wong 94873 by: Liam MacKenzie PHP Team: PHP 4.2.0 SSL Support? 94858 by: [-^-!-%- 94859 by: Rasmus Lerdorf mail() through a form 94861 by: Jennifer Downey 94862 by: Rasmus Lerdorf Apache: SERVER_NAME gone? 94864 by: The_RadiX 94867 by: Jason Wong date format 94865 by: Ananth Rajaraman 94866 by: Jason Wong 94870 by: George Nicolae 94871 by: Miguel Cruz Another silly email 94869 by: baldey_uk 94872 by: Miguel Cruz POST/GET is not working for PHP 4.2.0 on W2K Advanced Server 94874 by: JaseyX 1. ImageTTFBox not working and 2. System command 94875 by: Remek Re: PHPlib sessions without a DB? 94876 by: Richard Archer 94891 by: Maxim Derkachev reg-ex please 94877 by: John Fishworld 94881 by: Red Wingate 94882 by: Red Wingate 94885 by: John Fishworld 94886 by: Red Wingate PHP is making errors for no apparents reason..? 94878 by: newton 94884 by: Jason Wong 94888 by: michael kimsal Failed to compiled w/ T1lib 94879 by: Victor Boivie CAllin PHP Gurus-FREE WEBHOSTING 94880 by: r FreeMovie/PHP mailing lists 94883 by: Jacek Artymiak current date query 94887 by: Thomas Goeminne Directory System Splitter 94889 by: Randum Ian 94890 by: Jason Wong 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] -- ---BeginMessage--- Read the download page, it tells you what you need to open it. Also, you're the one with the username 'r'. Now whenever I write a message, every single 'r' in it is underlined with a #$%@#$%@ Smart Tag... :) That's annoying. ---John Holmes... -Original Message- From: r [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 27, 2002 3:17 AM To: [EMAIL PROTECTED] Subject: [PHP] Opening manual - .bz2 Greetings all, Special greetings to: one brainy dude - Steve, and a REALLLY persistive dude-Michael Vernstein,Nathan,Uchendu,John Holmes for all help. This list really has some do gooders who take the time to help others.Thanks again guys. Anyway, This is my problem which will be no big deal to anybody who has read the manual. I dont know how to open the .bz2 file which i downloaded from php.net It does not open with winzip or the tar/rar programs...how do i open it? If i have done something wrong and IT DOES open with one of the above programs kindly tell me what if now would appreciate it if you would write the program name and EXACTLY how to use it, like in baby steps.. Thanks a lot guys, any help appreciated. Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- On Fri, 26 Apr 2002, Tom Beidler wrote: BBedit it is. I've been holding off on switching for awhile but I just started using it today and I'm already kicking myself for not switching earlier. There was no problem/learning curve that I was afraid of and I've found a number of improvements over the workflow from Dreamweaver. Thanks for all the input to all that replied. BBEdit is the sweetest thing going. You won't regret it. If you're using OSX, you can invoke it from the command line, and it's quite scriptable. You can use the same regular expressions in its search-and-replace that you use in PHP's ereg family of functions, saving precious brain cells. It's a beautiful junction between the Mackey and Unixey halves of the machine. miguel ---End Message--- ---BeginMessage--- Before you get carried away with registering globals, try echoing: $_SERVER[HTTP_USER_AGENT]; Or, for versions prior to 4.1.X, change that to: $HTTP_SERVER_VARS[HTTP_USER_AGENT]; Registering globals is insecure unless you are VERY careful about how every variable you have is defined... Cheers, # Nathan - Original Message - From: Rasmus Lerdorf [EMAIL PROTECTED] To: baldey_uk Cc: Sent: Friday, April 26, 2002 6:41 PM Subject: Re: [PHP] Variables not working Turn on
RE: [PHP] Re: date format
No...Do it in your query. Use DATE_FORMAT in your query. ---John Holmes... -Original Message- From: George Nicolae [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 27, 2002 12:43 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: date format try ? $date=2002-04-27; echo date(d-m-Y,strtotime($date)); ? -- Best regards, George Nicolae IT Manager ___ PaginiWeb.com - Professional Web Design www.PaginiWeb.com Ananth Rajaraman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi all, I'm trying to query a date field from mySQL and display in a differnet format. the mysql date is in the format -MM-DD and I want to convert it to DD-MM- how do I do that? TIA Ananth = visit www.locustechnologies.com __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Another silly email
How about number_format www.php.net/number_format ---John Holmes... -Original Message- From: baldey_uk [mailto:[EMAIL PROTECTED]] Sent: Friday, April 26, 2002 10:20 PM To: Php-General Subject: [PHP] Another silly email Um im trying to take the input from a txt field in an html form (which happens to be a number) and convert it to currency. Anyone know if there is a function in PHP to do this or do i have to convert to a float etc? Cheers From baldey_uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP is making errors for no apparents reason..?
$zquery = SELECT name from users WHERE handle like '$row[handle]'; Missing an ending quote here. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] current date query
SELECT * FROM calendar WHERE date_column = CURDATE() ---John Holmes... -Original Message- From: Thomas Goeminne [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 27, 2002 5:25 AM To: [EMAIL PROTECTED] Subject: [PHP] current date query Hi, I am a beginning programmer and I am missing my Mysql/php book for some days so I can't look up what i need. i need a query something like this: query= SELECT from calender WHERE ('$day','$month','$year')= current date i need a script that looks in my database for events that are going down the day my visitor visits the page and if there are no parties today it returns something like: sorry no parties today. thanks and let me know -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] POST/GET is not working for PHP 4.2.0 on W2K Advanced Server
Register_globals is off by default and you have to use the $_GET and $_POST arrays for your data. ---John Holmes... -Original Message- From: JaseyX [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 27, 2002 1:38 AM To: [EMAIL PROTECTED] Subject: [PHP] POST/GET is not working for PHP 4.2.0 on W2K Advanced Server Hi there, Anyone else having trouble with vanished form posts/gets with the new PHP 4.2.0 on Windows 2000 Advanced Server? I re-installed 4.1.1 and everything worked again... Regs, Jason __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Apache: SERVER_NAME gone?
Use $_SERVER[SERVER_NAME] ---John Holmes... -Original Message- From: The_RadiX [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 21, 2001 10:36 PM To: [EMAIL PROTECTED] Subject: [PHP] Apache: SERVER_NAME gone? Hi Y'all... Ok. I just got Apache 1.3.xx and I have PHP4.1.1 and MySQL 3.23.47 on WinXP Pro... I am currently using IIS5.1 with PHP4 and MySQL but I'd like to move across to Apache.. Catch is? I have hunted through all the FAQ's for Apache and there is no mention of how-to configure Apache to actually execute PHP's... So I went into the PHP doc's and there is a small mention.. So I finally get the php's to run.. BUT.. when I call $SERVER_NAME in my php's like I always have.. The variable seems to no longer exist... what gives?? Thanks all.. I am sure it's just a name change or something that Apache uses.. Or maybe I have to register the PHP global var's somehow through Apache?? don't really know.. Anyway thanks a heap in a advance because I'd really love to start delving into this great subdomaining/.htaccess world :) Thanks again.. Greatly appreciated... ::: : Julien Bonastre [The-Spectrum.org CEO] : A.K.A. The_RadiX : [EMAIL PROTECTED] : ABN: 64 235 749 494 : QUT Student :: 04475739 ::: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Stop to fast caching/parsing
Hi List, my Problem is, on the second line of my script I validate a session. If it's false, it dies. But in the first line, I require a header(html,body,title etc.). Now, if a session fails, my die-Message ends in a script-Part, so nobody sees it but gets an error by JS. Is there any way to stop parsing PHP before flushing out required headers? Thanks, Jan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stop to fast caching/parsing
On Saturday 27 April 2002 22:49, Jan Peuker wrote: Hi List, my Problem is, on the second line of my script I validate a session. If it's false, it dies. But in the first line, I require a header(html,body,title etc.). Now, if a session fails, my die-Message ends in a script-Part, so nobody sees it but gets an error by JS. Is there any way to stop parsing PHP before flushing out required headers? Can't you change the order of your code so that it validates the session before doing anything else? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Put a rogue in the limelight and he will act like an honest man. -- Napoleon Bonaparte, Maxims */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Training in NYC
Hi Group, I would like to remind any beginner PHPers that live near (or in) New York City that the next PHP Training will take place on May 8th - 9th. More information at http://www.websapp.com/training.php Best regards, Daniel Kushner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: help needed with headers
Try this: header (Content-type: text/plain); header (Content-disposition: attachment; filename=file.txt); -- Kind regards, Yuri. www.AceHoster.com Quality web hosting Vins [EMAIL PROTECTED] I would like to create a text file that doesn't save to disk but askes me to save the file. like when i click on a zip file from a website, ie asks me to save the file to somewhere. how do i create the file and then tell my browser to ask the user to save the file somewhere ??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: auto_increment
MySQL: create table foo ( id int not null auto_increment primary key, state enum('enabled', 'disabled') ); PostgreSQL: create table foo ( id int not null primary key default nextval('foo_id_seq'), state varchar(8) check (state in ('enabled', 'disabled')) ); create sequence foo_id_seq; select setval('foo_id_seq', (select max(id) from foo)); More: http://www.ca.postgresql.org/docs/faq-english.html#4.15.1 -- Kind regards,Yuri. www.AceHoster.com Quality web hosting Webmaster [EMAIL PROTECTED] I'm using PHP v.4.0.6. and PostgreSQL 7.2. Does any one know the equivilant of auto_increment for postgresSQL? For example when creating a table: $query = CREATE table $tablename (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, firstname TEXT, lastname TEXT, emailaddress TEXT, ); this works fine in MySQL, but I keep getting errors with PostgreSQL. thanks for any help, -Elkan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: BBS system
PHPBB is REALLY best! :-) http://www.phpbb.com/ -- Kind regards, Yuri. www.AceHoster.com Quality web hosting R [EMAIL PROTECTED] Hey all, Just a small q, does anybody know of any particular good BBS system that is free? (I aint rich :-( ) Been to hotscripts.com can you recomend any? (Actually if i were rich I would not care a damn for PHP-MySql-Apache-Java-ASP-JSP hell, i wouldnt even touch a computer, would be happy being computer illiterate, would have been partying with a lot of babes instead...hehhehe maybe thats why i aint rich...have too wicked a mind? ) Ohh well Cheers, -Ryan. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stop to fast caching/parsing
But I WANT to do something else, loading other code! But ok, I will check at first, then include a short header before dying. This runs, but isn't beautiful. Thanks. Jan - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, April 27, 2002 4:56 PM Subject: Re: [PHP] Stop to fast caching/parsing On Saturday 27 April 2002 22:49, Jan Peuker wrote: Hi List, my Problem is, on the second line of my script I validate a session. If it's false, it dies. But in the first line, I require a header(html,body,title etc.). Now, if a session fails, my die-Message ends in a script-Part, so nobody sees it but gets an error by JS. Is there any way to stop parsing PHP before flushing out required headers? Can't you change the order of your code so that it validates the session before doing anything else? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Put a rogue in the limelight and he will act like an honest man. -- Napoleon Bonaparte, Maxims */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Stop to fast caching/parsing
http://www.php.net/manual/en/function.flush.php flush -- Flush the output buffer Flushes the output buffers of PHP and whatever backend PHP is using (CGI, a web server, etc). This effectively tries to push all the output so far to the user's browser. -- Kind regards, Yuri. www.AceHoster.com Quality web hosting Jan Peuker [EMAIL PROTECTED] ???/ ? ?: 001801c1edfa$be7ca050$7164a8c0@toshiba">news:001801c1edfa$be7ca050$7164a8c0@toshiba... Hi List, my Problem is, on the second line of my script I validate a session. If it's false, it dies. But in the first line, I require a header(html,body,title etc.). Now, if a session fails, my die-Message ends in a script-Part, so nobody sees it but gets an error by JS. Is there any way to stop parsing PHP before flushing out required headers? Thanks, Jan
[PHP] Re: Counter ?
http://www.hotscripts.com/PHP/Scripts_and_Programs/Counters/Text_Based/ -- Kind regards, Yuri. www.AceHoster.com Quality web hosting Cms [EMAIL PROTECTED] ???/ ? ?: news:r01050100-0922-9FEB9500593A11D68F37DC65D4C7C8B9@[192.168.0.14]... I am looking for a php counter, that can do this: ___ Total Visits: 8,585,230 Visits Today: 2,521 Today Date: Friday Jan 1, 2002 __ And the kicker, to have the ability to put this counter, on any page, to have it count that page sperate Thanks- Richard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: BBS system
The I like I have try three now is phpnuke it so easy to set up you can have it up and running in 5 mins. YBBSE is another that is good. http://www.phpnuke.org http://www.yabbse.org | Chuck Payne | | Magi Design and Support | | www.magidesign.com | | [EMAIL PROTECTED] | BeOS, Macintosh 68K, Classic, and OS X, Linux Support. Web Design you can afford. Never be bullied into silence. Never allow yourself to be made a victim. Accept no one's definition of your life; define yourself.- Harvey Fierstein on 4/27/02 11:53 AM, Yuri Petro at [EMAIL PROTECTED] wrote: PHPBB is REALLY best! :-) http://www.phpbb.com/ -- Kind regards, Yuri. www.AceHoster.com Quality web hosting R [EMAIL PROTECTED] Hey all, Just a small q, does anybody know of any particular good BBS system that is free? (I aint rich :-( ) Been to hotscripts.com can you recomend any? (Actually if i were rich I would not care a damn for PHP-MySql-Apache-Java-ASP-JSP hell, i wouldnt even touch a computer, would be happy being computer illiterate, would have been partying with a lot of babes instead...hehhehe maybe thats why i aint rich...have too wicked a mind? ) Ohh well Cheers, -Ryan. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PayPal: Instant Payment Notification
Hello there, Has anybody worked with PayPal's Instant Payment Notification? How exactly does it work -- will the payer ever go to PayPal's site itself (and leave my site for a sec) or will all contact with PayPal's servers be handled by my script? I have to write a system that enables payments via this service, but I'm low on documentation and this service is a new one for me. An overview of the process and pointers would be great! Thanks, Lauri -- Tharapita Creations [server-client web applications] [EMAIL PROTECTED] Mobile: +372 53 410 610 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: POST/GET is not working for PHP 4.2.0 on W2K Advanced Server
Just set register_globals to On in php.ini file. -- Kind regards, Yuri. www.AceHoster.com Quality web hosting Jaseyx [EMAIL PROTECTED] ???/ ? ?: [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi there, Anyone else having trouble with vanished form posts/gets with the new PHP 4.2.0 on Windows 2000 Advanced Server? I re-installed 4.1.1 and everything worked again... Regs, Jason __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Producing images in different sizes
This is off-topic, but someone in the group may have a good idea, so I'll ask it here. Please also reply to my email - [EMAIL PROTECTED] -- thanks. I am storing several detailed images at about 400x400 pixels (inventory for an art gallery). I show a page with thumbnails of the images. When a site visitor clicks on a thumbnail, I open a separate window to display the detailed image. Presently I am storing two copies of each image - full size and thumb. My objective is to store only one copy of each image - full size. (The rationale behind this is a complicated story involving old gallery owners, digital cameras, rudimentary image editing skills, etc.) I want the server to read the full size image, but resize it down to the thumbnail size before sending it, thus saving transmission time. Are there any server-side applications that can handle this? Thanks for your suggestions, --- Ray Paseur - www.non-aol.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Producing images in different sizes
On Sat, 27 Apr 2002, Ray Paseur 703.346.0600 wrote: I am storing several detailed images at about 400x400 pixels (inventory for an art gallery). I show a page with thumbnails of the images. When a site visitor clicks on a thumbnail, I open a separate window to display the detailed image. Presently I am storing two copies of each image - full size and thumb. My objective is to store only one copy of each image - full size. (The rationale behind this is a complicated story involving old gallery owners, digital cameras, rudimentary image editing skills, etc.) I want the server to read the full size image, but resize it down to the thumbnail size before sending it, thus saving transmission time. Are there any server-side applications that can handle this? You could use ImageMagick (particularly, the 'convert' program) to do this but decent results are not fast (not that it'll take several seconds or anything, but it does take a certain amount of time, and everything adds up). If you want to do this on the fly, I'd suggest having it save the thumbnails when they're generated so that the next time someone comes, it doesn't have to go through the process again. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] right place to start a session?
Here's my code: html body ?php //trying to start a session right here for the usr and pwd variables session_start(); session_register(usr, pwd); if (isset($login)): ? FORM ACTION='?php echo($PHP_SELF); ? etc., etc where the usr enters their usrname and pwd but I get the following errors: Warning: Cannot send session cookie - headers already sent by (output started at c:\program files\apache group\apache\htdocs\newsadmin\news.php:3) in c:\program files\apache group\apache\htdocs\newsadmin\news.php on line 5 Warning: Cannot send session cache limiter - headers already sent (output started at c:\program files\apache group\apache\htdocs\newsadmin\news.php:3) in c:\program files\apache group\apache\htdocs\newsadmin\news.php on line 5 Have tried moving the session to the next part of the script after the form posts to self with no success. I would like to keep the usr and pwd variables for use later since it involves multiple queries to MySQL, right now I have to have the information entered AGAIN! and I know that is a pain for users. Please help me out - there are several form's in the script using $PHP_SELF and it seems sessions is the way to go. I'm in need of a good samaritan here... Thanks! -Kirk
[PHP] IP and ICMP datagrams
I'm trying to write a trace route program in PHP. The algorithm in itself is not a problem, but i need to know how to set time to live (by number of hops) in an IP datagram and send it. I also need to be able to listen for and recieve ICMP messages and to exctract the IP adress of the sending router from this message. I'm rather new to PHP, and I'm suspecting that I will have to use a language that can manipulate the internet protocol stack at a lower level. But if it is possible with PHP, nothing would be better. Any suggestions? Thanks, Ero Karlsen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] init_set(): auto_append_file doesn't work?
hello, init_set doesn't seem to work for setting auto_append_file, in php 4.1.2. the master setting is NULL, and the local setting is properly set when I do a phpinfo(), but the file never gets appended. Any ideas? thanks -Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: help needed with headers
Hi, I spent ages figuring this one out so it work work on Windoze, Linux, Mac, ... and this *always* works: Create a hyperlink for user to click on: echo ' td class=nbcc ahref='.$PHP_SELF.'?action=*download=txtDownload TXT/a/td'; On click, we come back in to this: if ( $action == '*' ) { if ( isset( $download ) ) { downloadFile( $download ); we have a fn to do the biz: function downloadFile( $type ) { global $PHPSESSID; // is it a .txt file or an .rtf file if ( $type == 'txt' ) { // write the stuff to a text file: /downloads/$PHPSESSID.txt include( '../include/mkcribsheet_txt.inc' ); // download the file if ( file_exists( $txtfile ) ) { $size = filesize( $txtfile ); // this goes all on one line header( Content-Type: text/x-c; charset=\iso-8859-1\; name=\$txtfile\ ); header( Content-Length: $size ); header( Content-Transfer-Encoding: base64 ); header( Accept-Ranges: none ); // You could have filename=$txtfile\ here. I don't becos the user // gets his save as box with $PHPSESSID.txt which is ugly header( Content-Disposition: attachment; filename=\cribsheet.txt\ ); header( Content-Description: PHP Generated Cribsheet ); $fp = fopen( $txtfile, r ); fpassthru( $fp ); // delete the PHPSESSID.txt file unlink( $txtfile ); // delete the PHPSESSID from the cribsheet so user can go again $query = update cribsheet set sess_id='' where sess_id='$PHPSESSID'; dbCribsheetUpdate( $query ); } exit; } good luck Donna -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] right place to start a session?
On Sat, 27 Apr 2002, Kirk Babb wrote: Here's my code: html body ?php //trying to start a session right here for the usr and pwd variables session_start(); session_register(usr, pwd); if (isset($login)): ? FORM ACTION='?php echo($PHP_SELF); ? ? session_start(); other_session_stuff ?html body The session-start call has to be before ANYTHING that generates any HTML output (such as html). miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IP and ICMP datagrams
On Sat, 27 Apr 2002, Ero Stig Karlsen wrote: I'm trying to write a trace route program in PHP. The algorithm in itself is not a problem, but i need to know how to set time to live (by number of hops) in an IP datagram and send it. I also need to be able to listen for and recieve ICMP messages and to exctract the IP adress of the sending router from this message. I'm rather new to PHP, and I'm suspecting that I will have to use a language that can manipulate the internet protocol stack at a lower level. But if it is possible with PHP, nothing would be better. Any suggestions? I don't think this is possible with PHP. Traceroute handcrafts packets with specific TTL values. The PHP socket library doesn't give you this level of control. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Apache: SERVER_NAME gone?
because $SERVER_NAME is created IF the php directive register_globals = on. this setting is off by default as of PHP 4.2.0. all server predefined variables behave this way, such as $PHP_SELF, etc. regards, philip On Sat, 27 Apr 2002, John Holmes wrote: Use $_SERVER[SERVER_NAME] ---John Holmes... -Original Message- From: The_RadiX [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 21, 2001 10:36 PM To: [EMAIL PROTECTED] Subject: [PHP] Apache: SERVER_NAME gone? Hi Y'all... Ok. I just got Apache 1.3.xx and I have PHP4.1.1 and MySQL 3.23.47 on WinXP Pro... I am currently using IIS5.1 with PHP4 and MySQL but I'd like to move across to Apache.. Catch is? I have hunted through all the FAQ's for Apache and there is no mention of how-to configure Apache to actually execute PHP's... So I went into the PHP doc's and there is a small mention.. So I finally get the php's to run.. BUT.. when I call $SERVER_NAME in my php's like I always have.. The variable seems to no longer exist... what gives?? Thanks all.. I am sure it's just a name change or something that Apache uses.. Or maybe I have to register the PHP global var's somehow through Apache?? don't really know.. Anyway thanks a heap in a advance because I'd really love to start delving into this great subdomaining/.htaccess world :) Thanks again.. Greatly appreciated... ::: : Julien Bonastre [The-Spectrum.org CEO] : A.K.A. The_RadiX : [EMAIL PROTECTED] : ABN: 64 235 749 494 : QUT Student :: 04475739 ::: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] POST/GET is not working for PHP 4.2.0 on W2K AdvancedServer
also consider extract or import_request_variables as they can be useful too. regards, philip olson On Sat, 27 Apr 2002, John Holmes wrote: Register_globals is off by default and you have to use the $_GET and $_POST arrays for your data. ---John Holmes... -Original Message- From: JaseyX [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 27, 2002 1:38 AM To: [EMAIL PROTECTED] Subject: [PHP] POST/GET is not working for PHP 4.2.0 on W2K Advanced Server Hi there, Anyone else having trouble with vanished form posts/gets with the new PHP 4.2.0 on Windows 2000 Advanced Server? I re-installed 4.1.1 and everything worked again... Regs, Jason __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session expires on server side
session cookie exists on client side and it is set to last 5 days. the problem is that after some time session data expires. cookie on client side exists ($PHPSESSID), but session data on server side does not exists. i think that the answer is something like: ini_set(session.cache_expire, 7200); but i'm not sure. i need this fast, so thnx to anybody with a solution. Aljosa P.S. sorry for my bad english, here is the code: -- ?php $time = (60*60*24*5); ini_set(session.cache_expire, 7200); $date = gmdate (D, d M Y H:i:s) . GMT; header (Date: . $date); header (Expires: . $date); header (Last-Modified: . $date); header (Pragma: no-cache); header (Cache-Control: no-cache); session_set_cookie_params($time); ? -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: right place to start a session?
Thanks Miguel and Nathan for your help! If I can make this more secure I would definitely like to do so. Suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] compiling extensions from HEAD for 4.1.1?
Hi folks, I would like to use a extension from the php4-cvs for my current php4.1.1-production-system. Is it possible to use such an extension? if so, how? using phpize produces error messages about the m4-macros. thanks a lot, Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] right place to start a session?
The session_start() needs to come before any code outputs anything to the browser, so in your case you need to put it before the html and body tags: ?php session_start(); ? html body ? etc... Padraig Kirk Babb wrote: Here's my code: html body ?php //trying to start a session right here for the usr and pwd variables session_start(); session_register(usr, pwd); if (isset($login)): ? FORM ACTION='?php echo($PHP_SELF); ? etc., etc where the usr enters their usrname and pwd but I get the following errors: Warning: Cannot send session cookie - headers already sent by (output started at c:\program files\apache group\apache\htdocs\newsadmin\news.php:3) in c:\program files\apache group\apache\htdocs\newsadmin\news.php on line 5 Warning: Cannot send session cache limiter - headers already sent (output started at c:\program files\apache group\apache\htdocs\newsadmin\news.php:3) in c:\program files\apache group\apache\htdocs\newsadmin\news.php on line 5 Have tried moving the session to the next part of the script after the form posts to self with no success. I would like to keep the usr and pwd variables for use later since it involves multiple queries to MySQL, right now I have to have the information entered AGAIN! and I know that is a pain for users. Please help me out - there are several form's in the script using $PHP_SELF and it seems sessions is the way to go. I'm in need of a good samaritan here... Thanks! -Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] simplify if/then statement
Hi, I've got the following statement for a state options menu. How can this be expressed in a simple manner for all 52 states? //choose state if ($state == AL) { // include class include(CalcAL.class.inc); } else if ($state == AR) { // include class include(CalcAR.class.inc); } else if ($state == AZ) { // include class include(CalcAZ.class.inc); } else{ echo Please select a State.br\n; } Thank You Very Much, Jim Long -- http://jimlong.net/web -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PayPal: Instant Payment Notification
On Sunday 28 April 2002 00:25, Lauri Vain wrote: Has anybody worked with PayPal's Instant Payment Notification? Not yet, but am about to. How exactly does it work -- will the payer ever go to PayPal's site itself (and leave my site for a sec) or will all contact with PayPal's servers be handled by my script? No, the user doesn't 'leave' your site, all the processing goes on behind the scenes. I have to write a system that enables payments via this service, but I'm low on documentation and this service is a new one for me. An overview of the process and pointers would be great! Paypal provides some scripts which looks self-explanatory. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Never leave anything to chance; make sure all your crimes are premeditated. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stop to fast caching/parsing
On Saturday 27 April 2002 23:57, Jan Peuker wrote: But I WANT to do something else, loading other code! But ok, I will check at first, then include a short header before dying. This runs, but isn't beautiful. Thanks. If you want (hopefully) better suggestions, post your code. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Research is to see what everybody else has seen, and think what nobody else has thought. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] simplify if/then statement
$incfilename = Calc.$state..class.inc; if (file_exists($incfilename)) include($incfilename); else echo Please select a State.br\n; -- Stuart -Original Message- From: Jim Long [mailto:[EMAIL PROTECTED]] Sent: 27 April 2002 20:00 To: php Subject: [PHP] simplify if/then statement Hi, I've got the following statement for a state options menu. How can this be expressed in a simple manner for all 52 states? //choose state if ($state == AL) { // include class include(CalcAL.class.inc); } else if ($state == AR) { // include class include(CalcAR.class.inc); } else if ($state == AZ) { // include class include(CalcAZ.class.inc); } else{ echo Please select a State.br\n; } Thank You Very Much, Jim Long -- http://jimlong.net/web -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simplify if/then statement
On Sunday 28 April 2002 02:59, Jim Long wrote: Hi, I've got the following statement for a state options menu. How can this be expressed in a simple manner for all 52 states? //choose state if ($state == AL) { // include class include(CalcAL.class.inc); } else if ($state == AR) { Take a look at the switch construct. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Parsley is gharsley. -- Ogden Nash */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simplify if/then statement
On Sat, 27 Apr 2002, Jim Long wrote: I've got the following statement for a state options menu. How can this be expressed in a simple manner for all 52 states? switch(strtolower($state)) { case 'al': include 'CalcALclass.inc'; break; case 'ar': include 'CalcALclass.inc'; break; } Or, really, just: include Calc{$state}class.inc; miguel //choose state if ($state == AL) { // include class include(CalcAL.class.inc); } else if ($state == AR) { // include class include(CalcAR.class.inc); } else if ($state == AZ) { // include class include(CalcAZ.class.inc); } else{ echo Please select a State.br\n; } Thank You Very Much, Jim Long -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: init_set(): auto_append_file doesn't work?
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Matt Wong) wrote: init_set doesn't seem to work for setting auto_append_file, in php 4.1.2. the master setting is NULL, and the local setting is properly set when I do a phpinfo(), but the file never gets appended. Any ideas? The function is ini_set(), not init_set(). -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PayPal: Instant Payment Notification
Hi all- Has anybody worked with PayPal's Instant Payment Notification? Not yet, but am about to. we integrated paypal in phpauction. At paypal.com, one you register as developer, you have access to their documentation. That's enough to get it working. How exactly does it work -- will the payer ever go to PayPal's site itself (and leave my site for a sec) or will all contact with PayPal's servers be handled by my script? No, the user doesn't 'leave' your site, all the processing goes on behind the scenes. In our implementation, phpauction set up a form with hidden fields containing the data paypal expects to receive. Once the user submit that form he goes to paypal and makes the payment. In that form you pass to paypay a Confirm URL you want your users to be redirected after they do the payment and a Cancel URL where you want your users to be redirected if they press Cancel at peupal. What you'll also have to do is to set up the IPN url, where paypal will POST the transaction result in the format described in the documentation. Once your IPN script receives the POST from paypal, it will be able to check the transaction's result and act accordingly (tipically update some database tables). I cannot pass you the entire code since it belongs to the non-GPL version of phpauction but will surelly post some pieces of code here if need it. Cheers Gianluca I have to write a system that enables payments via this service, but I'm low on documentation and this service is a new one for me. An overview of the process and pointers would be great! Paypal provides some scripts which looks self-explanatory. -- Gianluca Baldo Mallorca 186 - 3º 1ª 08036 Barcelona (Spain) tel/fax +34 93 454 93 24 http://www.phpauction.org http://www.gianlucabaldo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] simplify if/then statement
I'd do something similar to this, along with putting all states in an array to make sure $state is actually a state (in_array). And maybe you want to add guam :) a) be sure $state is set, else load default b) be sure $state is not bogus, else yell at them c) be sure the $state file exists, if so, include it else houston we have a problem Regards, Philip Olson On Sat, 27 Apr 2002, Stuart Dallas wrote: $incfilename = Calc.$state..class.inc; if (file_exists($incfilename)) include($incfilename); else echo Please select a State.br\n; -- Stuart -Original Message- From: Jim Long [mailto:[EMAIL PROTECTED]] Sent: 27 April 2002 20:00 To: php Subject: [PHP] simplify if/then statement Hi, I've got the following statement for a state options menu. How can this be expressed in a simple manner for all 52 states? //choose state if ($state == AL) { // include class include(CalcAL.class.inc); } else if ($state == AR) { // include class include(CalcAR.class.inc); } else if ($state == AZ) { // include class include(CalcAZ.class.inc); } else{ echo Please select a State.br\n; } Thank You Very Much, Jim Long -- http://jimlong.net/web -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simplify if/then statement
Hi, Make an array $arr of all the states and loop $state = AR; $arr = array(); array_push($arr, AL, AR, AZ); foreach ($arr as $key = $value) { if ($state == $value){ include(Calc$value.class.inc); } } Cheers, Pekka http://photography-on-the.net/ At 4/27/2002, you wrote: Hi, I've got the following statement for a state options menu. How can this be expressed in a simple manner for all 52 states? //choose state if ($state == AL) { // include class include(CalcAL.class.inc); } else if ($state == AR) { // include class include(CalcAR.class.inc); } else if ($state == AZ) { // include class include(CalcAZ.class.inc); } else{ echo Please select a State.br\n; } Thank You Very Much, Jim Long -- http://jimlong.net/web -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] simplify if/then statement
On Sat, 27 Apr 2002, Philip Olson wrote: I'd do something similar to this, along with putting all states in an array to make sure $state is actually a state (in_array). And maybe you want to add guam :) As an early Christmas present, here's the array (to save the OP some typing - I'm posting this to the list because I use it a lot and assume it'd be handy for others too). Uses USPS 2-letter abbreviations and includes territories. $states = array( 'AK' = 'Alaska', 'AL' = 'Alabama', 'AR' = 'Arkansas', 'AS' = 'American Samoa', 'AZ' = 'Arizona', 'CA' = 'California', 'CO' = 'Colorado', 'CT' = 'Connecticut', 'DC' = 'District of Columbia', 'DE' = 'Delaware', 'FL' = 'Florida', 'GA' = 'Georgia', 'GU' = 'Guam', 'HI' = 'Hawaii', 'IA' = 'Iowa', 'ID' = 'Idaho', 'IL' = 'Illinois', 'IN' = 'Indiana', 'KS' = 'Kansas', 'KY' = 'Kentucky', 'LA' = 'Louisiana', 'MA' = 'Massachusetts', 'MD' = 'Maryland', 'ME' = 'Maine', 'MH' = 'Marshall Islands', 'MI' = 'Michigan', 'MN' = 'Minnesota', 'MO' = 'Missouri', 'MP' = 'Northern Mariana Islands', 'MS' = 'Mississippi', 'MT' = 'Montana', 'NC' = 'North Carolina', 'ND' = 'North Dakota', 'NE' = 'Nebraska', 'NH' = 'New Hampshire', 'NJ' = 'New Jersey', 'NM' = 'New Mexico', 'NV' = 'Nevada', 'NY' = 'New York', 'OH' = 'Ohio', 'OK' = 'Oklahoma', 'OR' = 'Oregon', 'PA' = 'Pennsylvania', 'PR' = 'Puerto Rico', 'RI' = 'Rhode Island', 'SC' = 'South Carolina', 'SD' = 'South Dakota', 'TN' = 'Tennessee', 'TX' = 'Texas', 'UT' = 'Utah', 'VA' = 'Virginia', 'VI' = 'Virgin Islands (U.S.)', 'VT' = 'Vermont', 'WA' = 'Washington', 'WI' = 'Wisconsin', 'WV' = 'West Virginia', 'WY' = 'Wyoming'); miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simplify if/then statement
Using pull down for $state. This works great! $incfilename = Calc.$state..class.inc; if (file_exists($incfilename)) include($incfilename); else echo Please select a State.br\n; Thanks To Everyone, j -- http://jimlong.net/web I'd do something similar to this, along with putting all states in an array to make sure $state is actually a state (in_array). And maybe you want to add guam :) a) be sure $state is set, else load default b) be sure $state is not bogus, else yell at them c) be sure the $state file exists, if so, include it else houston we have a problem -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP-GTK 0.5.1 released
Hello, fans of GUI development! PHP-GTK 0.5.1 also known as hardboiled wonderland has escaped from the CVS holding pen. Be on the lookout. The identifying features are: - changed gdkwindow::set_cursor() to allow reverting the cursor to default one. (Andrei) - fixed gtk::input_add() for pre-streams PHP versions. (Andrei) - adapted build system to work with the new PHP build system. (Andrei) - made gtk::input_add() work with PHP streams. (Andrei) - fixed gtkscintilla::marker_add() return type. (Alan) - fixed property and method access on GdkBitmap. (Andrei) - fixed a crash bug in gtkclist::append() when size of input was greater than the number of columns. (Markus) Consider it armed with features and extremely addicting. More information can be found at http://gtk.php.net/. Cheers! -Andrei -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] tutorial on global variables
Can someone point me toward a tutorial on the proper use of global references under PHP4. I have been declaring function something() { global $foo, $bar; /* some actions */ } in functions and I understand that this is not the way I'm supposed to be doing this. Or there is a new way that is preferred. John Hughes __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sessions and reload/refresh
Is it possible that everytime un click the refresh button a new session is created? Here's my index.php Every time refresh this page a new session is created. ?php function MostrarPaginaPrincipal() { include html/index.html; } include include/sesiones.php; include include/permisos.inc.php; echo session_id(); session_start(); if(!session_is_registered(ses_activa)){ include include/permisos.inc.php; global $ses_usuario_perm; global $ses_activa; global $ses_logged_in; $ses_usuario_perm = $PERM_VISITA; $ses_activa = true; $ses_logged_in = false; session_name(SESSRONDAID); session_register(ses_activa); session_register(ses_logged_in); session_register(ses_usuario_perm); echo session_id(); } MostrarPaginaPrincipal(); exit(); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Producing images in different sizes
I think he already has the best solution. Store two images. How many thumbnails are there on a page? At 1-2 seconds per image to resize how long will you make every visitor wait to see the thumbnails? Disk space is cheap. If you have to buy another drive - no big deal. I don't know about you, but for me if a web page doesn't load in about 10-15 seconds I'm outa here! Rick ** Reply to note from Miguel Cruz [EMAIL PROTECTED] Sat, 27 Apr 2002 11:36:54 -0500 (CDT) On Sat, 27 Apr 2002, Ray Paseur 703.346.0600 wrote: I am storing several detailed images at about 400x400 pixels (inventory for an art gallery). I show a page with thumbnails of the images. When a site visitor clicks on a thumbnail, I open a separate window to display the detailed image. Presently I am storing two copies of each image - full size and thumb. My objective is to store only one copy of each image - full size. (The rationale behind this is a complicated story involving old gallery owners, digital cameras, rudimentary image editing skills, etc.) I want the server to read the full size image, but resize it down to the thumbnail size before sending it, thus saving transmission time. Are there any server-side applications that can handle this? You could use ImageMagick (particularly, the 'convert' program) to do this but decent results are not fast (not that it'll take several seconds or anything, but it does take a certain amount of time, and everything adds up). If you want to do this on the fly, I'd suggest having it save the thumbnails when they're generated so that the next time someone comes, it doesn't have to go through the process again. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Rick Widmer Internet Marketing Specialists http://www.developersdesk.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Directory System Splitter
search zend.com for breadcrumbs - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, April 27, 2002 2:01 PM Subject: Re: [PHP] Directory System Splitter On Saturday 27 April 2002 20:34, Randum Ian wrote: [snip] For example: http://www.danceportal.co.uk/diary/2002/may/ has this in the panel: Home / Diary / 2002 / May / -- These are links back down the system of directories. http://www.danceportal.co.uk/charts/randumian/mon-22-apr-2002.php has this: Home / Charts / Randum Ian / Monday, April 22, 2002 Is it possible to automate this in a template so that it can work out where it is and create the correct links? Yes. http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-no-answers.html Presumably you want to know *how* to do it? Use phpinfo() to see what predefined vars you can use to get your document path. Then probably use explode() to get the individual components of the path. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Are we not men? */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] new guy
Running Apache 1.3 , XP Pro, and PHP 4.2 but get this: Can't find this ref: in apache conf nor php.ini Warning: Failed opening '/inetpub/wwwroot/test.php' for inclusion (include_path='.;c:\php4\pear') in Unknown on line 0 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 1. ImageTTFBox not working and 2. System command
At 27.04.2002 18:59, you wrote: Hi all, I have problem with TTF support on my vhost. PHP says it has no ttf support. The configure command is: './configure' '--prefix=/opt/php' '--enable-exif' '--with-apxs' '--enable-memory-limit=yes' '--enable-track-vars' '--enable-trans-sid' '--enable-wddx' '--enable-ftp' '--with-gd=../gd' '--enable-gd-imgstrttf' '--with-jpeg-dir' '--with-ttf' '--enable-gd-native-ttf' '--with-t1lib=/usr/lib' '--with-mysql=/usr/' '--with-png-dir' '--with-config-file-path=/etc/opt/httpd/' '--with-zlib' '--with-mhash' '--with-pdflib=/usr/lib/' '--enable-sysvsem' '--enable-sysvshm' '--enable-memory-limit' and GD section of PHP Info looks like this: GD Support enabled GD Version 1.6.2 or higher T1Lib Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled anyone could help? Admin says that on their website TTF functions work fine. Maybe I´m wrong, but in the past you have to compile and install the gd and other libraries first, before compiling php. Maybe this is the fault Additionally, i'm execute a shell command (to create thumbnail with ImageMagick) but it does not do anything. The command is OK as it works by SSH. use system() or passthru to wath eventually appearing error messages. Maybe the apache user has no rights to work with ImageMagic. But If you have gd, there´s no need to use IM. Remek Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: tutorial on global variables
[EMAIL PROTECTED] (John Hughes) wrote: Can someone point me toward a tutorial on the proper use of global references under PHP4. I have been declaring function something() { global $foo, $bar; /* some actions */ } in functions and I understand that this is not the way I'm supposed to be doing this. Or there is a new way that is preferred. you can do it that way, but if you want to avoid calling global all the time you might consider this approach: $GLOBALS[foo] = 123; function something() { echo $GLOBALS[foo]; } -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions and Query String Variable Handling
Env: Apache 1.3.x/php4.0.6/mysql3.23.x Scenario: I have built a system that uses PHP sessions for user access. Within the system I send user notifications via email. Within the email are links to certain pages with variables. For example. http://mysite.com/view_page.htm?id=6 My system checks to see if the session is valid. Since the user is coming from an email. There is no session. So the user is prompted for the user and password. They enter and click submit. The authentication passes the user to right page, but losses the variables in the query string. Thus causing errors. Here is the authentication code... set session settings from login formif (!session_is_registered("valid_user") $session_login=="proc") {if ($userid $password) { // if the user has just tried to log in $db_conn = mysql_connect("localhost"); mysql_select_db("$dbname", $db_conn); $query = "select * from auth_users " ."where auth_username='$userid' " ." and auth_password='$password' "; $result = mysql_query($query, $db_conn); if (mysql_num_rows($result) 0 ){ // if they are in the database register the user id $valid_user = $userid; $valid_group=mysql_result($result,0,"auth_group");$valid_perms=mysql_result($result,0,"auth_perms");$valid_auth_id=mysql_result($result,0,"auth_id"); session_register("valid_user");session_register("valid_group");session_register("valid_perms");session_register("valid_auth_id"); } else {$invalid_login= "Invalid login: Could not log you in...!--ERROR: $dbname P $query--";}}} Any Ideas on how to pass the query string variables through the authentication process? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions and Query String Variable Handling
$page = $_SERVER[SERVER_NAME] . $_SERVER[SCRIPT_NAME] . $_SERVER[QUERY_STRING]; That will recreate the URL that the user clicked on. Save that to a variable before you check for a session. Once you start a session or verify that one exists, use header() to send them back to that page. ---John Holmes. -Original Message- From: Dennis Moore [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 27, 2002 2:37 PM To: [EMAIL PROTECTED] Subject: [PHP] Sessions and Query String Variable Handling Env: Apache 1.3.x/php4.0.6/mysql3.23.x Scenario: I have built a system that uses PHP sessions for user access. Within the system I send user notifications via email. Within the email are links to certain pages with variables. For example. http://mysite.com/view_page.htm?id=6 My system checks to see if the session is valid. Since the user is coming from an email. There is no session. So the user is prompted for the user and password. They enter and click submit. The authentication passes the user to right page, but losses the variables in the query string. Thus causing errors. Here is the authentication code... set session settings from login form if (!session_is_registered(valid_user) $session_login==proc) { if ($userid $password) { // if the user has just tried to log in $db_conn = mysql_connect(localhost); mysql_select_db($dbname, $db_conn); $query = select * from auth_users .where auth_username='$userid' . and auth_password='$password' ; $result = mysql_query($query, $db_conn); if (mysql_num_rows($result) 0 ) { // if they are in the database register the user id $valid_user = $userid; $valid_group=mysql_result($result,0,auth_group); $valid_perms=mysql_result($result,0,auth_perms); $valid_auth_id=mysql_result($result,0,auth_id); session_register(valid_user); session_register(valid_group); session_register(valid_perms); session_register(valid_auth_id); } else { $invalid_login= Invalid login: Could not log you in... !--ERROR: $dbname P $query--; } } } Any Ideas on how to pass the query string variables through the authentication process?
RE: [PHP] Sessions and Query String Variable Handling
You'll have to add an http:// to that string, too. ---John Holmes... -Original Message- From: John Holmes [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 27, 2002 5:50 PM To: 'Dennis Moore'; [EMAIL PROTECTED] Subject: RE: [PHP] Sessions and Query String Variable Handling $page = $_SERVER[SERVER_NAME] . $_SERVER[SCRIPT_NAME] . $_SERVER[QUERY_STRING]; That will recreate the URL that the user clicked on. Save that to a variable before you check for a session. Once you start a session or verify that one exists, use header() to send them back to that page. ---John Holmes. -Original Message- From: Dennis Moore [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 27, 2002 2:37 PM To: [EMAIL PROTECTED] Subject: [PHP] Sessions and Query String Variable Handling Env: Apache 1.3.x/php4.0.6/mysql3.23.x Scenario: I have built a system that uses PHP sessions for user access. Within the system I send user notifications via email. Within the email are links to certain pages with variables. For example. http://mysite.com/view_page.htm?id=6 My system checks to see if the session is valid. Since the user is coming from an email. There is no session. So the user is prompted for the user and password. They enter and click submit. The authentication passes the user to right page, but losses the variables in the query string. Thus causing errors. Here is the authentication code... set session settings from login form if (!session_is_registered(valid_user) $session_login==proc) { if ($userid $password) { // if the user has just tried to log in $db_conn = mysql_connect(localhost); mysql_select_db($dbname, $db_conn); $query = select * from auth_users .where auth_username='$userid' . and auth_password='$password' ; $result = mysql_query($query, $db_conn); if (mysql_num_rows($result) 0 ) { // if they are in the database register the user id $valid_user = $userid; $valid_group=mysql_result($result,0,auth_group); $valid_perms=mysql_result($result,0,auth_perms); $valid_auth_id=mysql_result($result,0,auth_id); session_register(valid_user); session_register(valid_group); session_register(valid_perms); session_register(valid_auth_id); } else { $invalid_login= Invalid login: Could not log you in... !--ERROR: $dbname P $query--; } } } Any Ideas on how to pass the query string variables through the authentication process? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions and Query String Variable Handling
You can also use $page = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; - Original Message - From: John Holmes [EMAIL PROTECTED] To: 'Dennis Moore' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, April 27, 2002 8:49 PM Subject: RE: [PHP] Sessions and Query String Variable Handling $page = $_SERVER[SERVER_NAME] . $_SERVER[SCRIPT_NAME] . $_SERVER[QUERY_STRING]; That will recreate the URL that the user clicked on. Save that to a variable before you check for a session. Once you start a session or verify that one exists, use header() to send them back to that page. ---John Holmes. -Original Message- From: Dennis Moore [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 27, 2002 2:37 PM To: [EMAIL PROTECTED] Subject: [PHP] Sessions and Query String Variable Handling Env: Apache 1.3.x/php4.0.6/mysql3.23.x Scenario: I have built a system that uses PHP sessions for user access. Within the system I send user notifications via email. Within the email are links to certain pages with variables. For example. http://mysite.com/view_page.htm?id=6 My system checks to see if the session is valid. Since the user is coming from an email. There is no session. So the user is prompted for the user and password. They enter and click submit. The authentication passes the user to right page, but losses the variables in the query string. Thus causing errors. Here is the authentication code... set session settings from login form if (!session_is_registered(valid_user) $session_login==proc) { if ($userid $password) { // if the user has just tried to log in $db_conn = mysql_connect(localhost); mysql_select_db($dbname, $db_conn); $query = select * from auth_users .where auth_username='$userid' . and auth_password='$password' ; $result = mysql_query($query, $db_conn); if (mysql_num_rows($result) 0 ) { // if they are in the database register the user id $valid_user = $userid; $valid_group=mysql_result($result,0,auth_group); $valid_perms=mysql_result($result,0,auth_perms); $valid_auth_id=mysql_result($result,0,auth_id); session_register(valid_user); session_register(valid_group); session_register(valid_perms); session_register(valid_auth_id); } else { $invalid_login= Invalid login: Could not log you in... !--ERROR: $dbname P $query--; } } } Any Ideas on how to pass the query string variables through the authentication process? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] I've Got It :: Windows PHP Users Read This
if you get errors trying to include files cannot find include file in c:/php4/pear/ open up your php.ini and find the windows include path directive. paste this there include_path = ./ will sort out that error have fun Vins :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: new guy
check my new post I've Got IT :: Windows Users Read This will sort your prob out Cheerz Vins Don Tait [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Running Apache 1.3 , XP Pro, and PHP 4.2 but get this: Can't find this ref: in apache conf nor php.ini Warning: Failed opening '/inetpub/wwwroot/test.php' for inclusion (include_path='.;c:\php4\pear') in Unknown on line 0 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache: SERVER_NAME gone?
Hmm because $SERVER_NAME is created IF the php directive register_globals = on. this setting is off by default as of PHP 4.2.0. all server predefined variables behave this way, such as $PHP_SELF, etc. Yes so I've heard... One thing though.. I use PHP4.1.1... not 4.2.x Anywayz will try the $_SERVER[xxx] trick ::: : Julien Bonastre [The-Spectrum.org CEO] : A.K.A. The_RadiX : [EMAIL PROTECTED] : ABN: 64 235 749 494 : QUT Student :: 04475739 ::: - Original Message - From: Philip Olson [EMAIL PROTECTED] To: John Holmes [EMAIL PROTECTED] Cc: 'The_RadiX' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, April 28, 2002 3:15 AM Subject: RE: [PHP] Apache: SERVER_NAME gone? because $SERVER_NAME is created IF the php directive register_globals = on. this setting is off by default as of PHP 4.2.0. all server predefined variables behave this way, such as $PHP_SELF, etc. regards, philip On Sat, 27 Apr 2002, John Holmes wrote: Use $_SERVER[SERVER_NAME] ---John Holmes... -Original Message- From: The_RadiX [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 21, 2001 10:36 PM To: [EMAIL PROTECTED] Subject: [PHP] Apache: SERVER_NAME gone? Hi Y'all... Ok. I just got Apache 1.3.xx and I have PHP4.1.1 and MySQL 3.23.47 on WinXP Pro... I am currently using IIS5.1 with PHP4 and MySQL but I'd like to move across to Apache.. Catch is? I have hunted through all the FAQ's for Apache and there is no mention of how-to configure Apache to actually execute PHP's... So I went into the PHP doc's and there is a small mention.. So I finally get the php's to run.. BUT.. when I call $SERVER_NAME in my php's like I always have.. The variable seems to no longer exist... what gives?? Thanks all.. I am sure it's just a name change or something that Apache uses.. Or maybe I have to register the PHP global var's somehow through Apache?? don't really know.. Anyway thanks a heap in a advance because I'd really love to start delving into this great subdomaining/.htaccess world :) Thanks again.. Greatly appreciated... ::: : Julien Bonastre [The-Spectrum.org CEO] : A.K.A. The_RadiX : [EMAIL PROTECTED] : ABN: 64 235 749 494 : QUT Student :: 04475739 ::: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Producing images in different sizes
I'm guessing the issue is that it complicates the process of adding new images, because someone has to create and upload two corresponding files. This way, they get the benefit of rapid page generation combined with a simpler administration process. miguel On Sat, 27 Apr 2002 [EMAIL PROTECTED] wrote: I think he already has the best solution. Store two images. How many thumbnails are there on a page? At 1-2 seconds per image to resize how long will you make every visitor wait to see the thumbnails? Disk space is cheap. If you have to buy another drive - no big deal. I don't know about you, but for me if a web page doesn't load in about 10-15 seconds I'm outa here! Rick ** Reply to note from Miguel Cruz [EMAIL PROTECTED] Sat, 27 Apr 2002 11:36:54 -0500 (CDT) On Sat, 27 Apr 2002, Ray Paseur 703.346.0600 wrote: I am storing several detailed images at about 400x400 pixels (inventory for an art gallery). I show a page with thumbnails of the images. When a site visitor clicks on a thumbnail, I open a separate window to display the detailed image. Presently I am storing two copies of each image - full size and thumb. My objective is to store only one copy of each image - full size. (The rationale behind this is a complicated story involving old gallery owners, digital cameras, rudimentary image editing skills, etc.) I want the server to read the full size image, but resize it down to the thumbnail size before sending it, thus saving transmission time. Are there any server-side applications that can handle this? You could use ImageMagick (particularly, the 'convert' program) to do this but decent results are not fast (not that it'll take several seconds or anything, but it does take a certain amount of time, and everything adds up). If you want to do this on the fly, I'd suggest having it save the thumbnails when they're generated so that the next time someone comes, it doesn't have to go through the process again. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Rick Widmer Internet Marketing Specialists http://www.developersdesk.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions and Query String Variable Handling
Thanks, Is there any way of doing this without using the header() to redirect? I have some functions that get executed before the sessions stuff. I am trying to avoid using output buffering or re-writing my code. /dkm - Original Message - From: John Holmes [EMAIL PROTECTED] To: 'Dennis Moore' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, April 27, 2002 8:49 PM Subject: RE: [PHP] Sessions and Query String Variable Handling $page = $_SERVER[SERVER_NAME] . $_SERVER[SCRIPT_NAME] . $_SERVER[QUERY_STRING]; That will recreate the URL that the user clicked on. Save that to a variable before you check for a session. Once you start a session or verify that one exists, use header() to send them back to that page. ---John Holmes. -Original Message- From: Dennis Moore [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 27, 2002 2:37 PM To: [EMAIL PROTECTED] Subject: [PHP] Sessions and Query String Variable Handling Env: Apache 1.3.x/php4.0.6/mysql3.23.x Scenario: I have built a system that uses PHP sessions for user access. Within the system I send user notifications via email. Within the email are links to certain pages with variables. For example. http://mysite.com/view_page.htm?id=6 My system checks to see if the session is valid. Since the user is coming from an email. There is no session. So the user is prompted for the user and password. They enter and click submit. The authentication passes the user to right page, but losses the variables in the query string. Thus causing errors. Here is the authentication code... set session settings from login form if (!session_is_registered(valid_user) $session_login==proc) { if ($userid $password) { // if the user has just tried to log in $db_conn = mysql_connect(localhost); mysql_select_db($dbname, $db_conn); $query = select * from auth_users .where auth_username='$userid' . and auth_password='$password' ; $result = mysql_query($query, $db_conn); if (mysql_num_rows($result) 0 ) { // if they are in the database register the user id $valid_user = $userid; $valid_group=mysql_result($result,0,auth_group); $valid_perms=mysql_result($result,0,auth_perms); $valid_auth_id=mysql_result($result,0,auth_id); session_register(valid_user); session_register(valid_group); session_register(valid_perms); session_register(valid_auth_id); } else { $invalid_login= Invalid login: Could not log you in... !--ERROR: $dbname P $query--; } } } Any Ideas on how to pass the query string variables through the authentication process? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions and Query String Variable Handling
Not for server side. You can use a META REFRESH on the client side, but I personally find that ugly. This is why I always write my functions so that they don't output anything. They just assign the output to a variable and return it. That way, I can call the function anywhere, save the result, and just echo that variable where ever I need to. ---John Holmes... -Original Message- From: Dennis Moore [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 27, 2002 5:24 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Sessions and Query String Variable Handling Thanks, Is there any way of doing this without using the header() to redirect? I have some functions that get executed before the sessions stuff. I am trying to avoid using output buffering or re-writing my code. /dkm - Original Message - From: John Holmes [EMAIL PROTECTED] To: 'Dennis Moore' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, April 27, 2002 8:49 PM Subject: RE: [PHP] Sessions and Query String Variable Handling $page = $_SERVER[SERVER_NAME] . $_SERVER[SCRIPT_NAME] . $_SERVER[QUERY_STRING]; That will recreate the URL that the user clicked on. Save that to a variable before you check for a session. Once you start a session or verify that one exists, use header() to send them back to that page. ---John Holmes. -Original Message- From: Dennis Moore [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 27, 2002 2:37 PM To: [EMAIL PROTECTED] Subject: [PHP] Sessions and Query String Variable Handling Env: Apache 1.3.x/php4.0.6/mysql3.23.x Scenario: I have built a system that uses PHP sessions for user access. Within the system I send user notifications via email. Within the email are links to certain pages with variables. For example. http://mysite.com/view_page.htm?id=6 My system checks to see if the session is valid. Since the user is coming from an email. There is no session. So the user is prompted for the user and password. They enter and click submit. The authentication passes the user to right page, but losses the variables in the query string. Thus causing errors. Here is the authentication code... set session settings from login form if (!session_is_registered(valid_user) $session_login==proc) { if ($userid $password) { // if the user has just tried to log in $db_conn = mysql_connect(localhost); mysql_select_db($dbname, $db_conn); $query = select * from auth_users .where auth_username='$userid' . and auth_password='$password' ; $result = mysql_query($query, $db_conn); if (mysql_num_rows($result) 0 ) { // if they are in the database register the user id $valid_user = $userid; $valid_group=mysql_result($result,0,auth_group); $valid_perms=mysql_result($result,0,auth_perms); $valid_auth_id=mysql_result($result,0,auth_id); session_register(valid_user); session_register(valid_group); session_register(valid_perms); session_register(valid_auth_id); } else { $invalid_login= Invalid login: Could not log you in... !--ERROR: $dbname P $query--; } } } Any Ideas on how to pass the query string variables through the authentication process? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache: SERVER_NAME gone?
On Tue, 23 Jan 2001, The_RadiX wrote: Hmm because $SERVER_NAME is created IF the php directive register_globals = on. this setting is off by default as of PHP 4.2.0. all server predefined variables behave this way, such as $PHP_SELF, etc. Yes so I've heard... One thing though.. I use PHP4.1.1... not 4.2.x Anywayz will try the $_SERVER[xxx] trick Please realize that it doesn't matter what version you're using, I was just saying the default. So, you should go see what your settings are via the wonderful phpinfo() function. In fact, phpinfo will show you the values of many predefined variables such as SERVER_NAME, PHP_SELF, REQUEST_URI, etc. Which ones exist depends on the particular web server. If a var exists at all, phpinfo will tell you. $_SERVER is an array of all web server predefined variables. As is $HTTP_SERVER_VARS. At least one of these will always be available (nobody uses 4.0.2- anymore right? Phew, no need to bring up track_vars then :) Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: tutorial on global variables
On Sunday 28 April 2002 04:39, Henrik Hansen wrote: [EMAIL PROTECTED] (John Hughes) wrote: Can someone point me toward a tutorial on the proper use of global references under PHP4. The manual has very good information. I have been declaring function something() { global $foo, $bar; /* some actions */ } in functions and I understand that this is not the way I'm supposed to be doing this. Or there is a new way that is preferred. That is a perfectly valid declaration, but without knowing your intent one cannot say whether it is 'right' or 'wrong'. The thing you need to remember with PHP is that unlike many other languages, by default variables are not global in nature. Thus in order to use a variable that is defined outside of a function you need to declare it like you have above. you can do it that way, but if you want to avoid calling global all the time you might consider this approach: $GLOBALS[foo] = 123; $foo = 123; # No need to use the $GLOBALS array when outside of a function function something() { echo $GLOBALS[foo]; } -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* ...if the church put in half the time on covetousness that it does on lust, this would be a better world. - Garrison Keillor, Lake Wobegon Days */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache: SERVER_NAME gone?
On Tuesday 23 January 2001 07:55, The_RadiX wrote: Hmm because $SERVER_NAME is created IF the php directive register_globals = on. this setting is off by default as of PHP 4.2.0. all server predefined variables behave this way, such as $PHP_SELF, etc. Yes so I've heard... One thing though.. I use PHP4.1.1... not 4.2.x Read the changelog (or history). A lot of default behaviour has changed starting from 4.1.X. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Happiness isn't something you experience; it's something you remember. -- Oscar Levant */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] class PHP
The text of this proposal, test code, and updates live at petermoulding.com/class. I place it here for discussion of the best approach before people build code. Class PHP An invention for a classier PHP. This invention uses PHP classes as Web pages. The invention can be implemented as a wrapper around PHP or as an enhancement to PHP. In Apache 2, the invention can be implemented as a filter to precede PHP. I will give a quick outline of the requirement, then sketches of implementations, then detailed examples prototyped using PHP. The invention is named class. An Apache implementation could be a module named class. If you write code to implement this invention, suffix the project name with your name as in class_John. To prevent a rapacious company copyrighting this invention using the excuse that it is a business process or anything else they can copyright, I declare my copyright on everything in this invention and any processes derivable from this. Please make your code implementations GPL, www.gnu.org/copyleft/gpl.html, and mention my page at petermoulding.com/class. Invention Requirement The main requirement is to replace PHP's page input with invented input. Here is a file named any_class.class that containing a PHP class named any_class: ?php class any_class { function any_class() { /* code to build a Web page. */ } } ? Here is a Web page containing a PHP script to build the entire page using the PHP class any_class: ?php include_once(any_class.class); $any_class = new any_class(); ? The invention makes PHP initiate any_class.class as if any_class were included and instantiated by the example Web page. PHP Wrapper The invention could be implemented as a module for Apache or another Web server by writing a wrapper for PHP. The wrapper would accept a call from Apache then pass the call on to PHP so PHP could perform 100% unaltered as if PHP were called direct from Apache. The module would look for class requests with a page of the form *.class then intercept the URL and prepare to pass invented input to PHP. The Apache configuration parameters can ensure all requests for class go to class and only requests for class to class. In a mixed class/PHP environment, the requested class can go to class and the PHP requests can go direct to PHP. There could also be a check in class for a class file so that all requests are directed to class and class processes just those with a matching class file. When class finds a valid class request, class builds a PHP Web page that includes the class file and initiates the class. To make PHP read the invented Web page, you could trap PHP's Web page read and substitute the invented page. As PHP has to access files within the constraints of a Web server, the access technique could vary from release to release and across Web servers. I will describe two quick implementation possibilities. If PHP reads files via Apache's file read functions (or an equivalent on other web servers), class gets to view all file requests from PHP to Apache and monitor all replies. Class can then pass the invented page back to PHP without the request reaching Apache. PHP remains untouched by class. Where a Web server does not provide file access functions or PHP chooses to not use those functions, class would need a modification to PHP to intercept file reads. The interception depends on the exact compilation of PHP and would be in the form of a wrapper around a file access routine in PHP. The wrapper (or interception layer) needs to be at a level where the code can see file names and subvert the whole file read process. Interception at this level requires PHP release dependent coding and is a step toward the PHP enhancement described next. PHP Enhancement A PHP enhancement would be an implementation of the invention direct within PHP's code so that PHP can react to class requests in conjunction with an external process or without an external process. The ultimate enhancement would be to incorporate the whole invention within PHP so there are no additional installation steps required. A PHP enhancement could use a wrapper as described in PHP Wrapper or the Apache 2 filter described next but use those devices just to trigger class processing then perform the whole processing within PHP. This approach has the advantage that the processing is independent of the trigger method and the trigger method is free from processing code. The PHP enhancement could discover the need for class processing by whatever method suits the web server environment. The enhancement would then verify the action is valid within constrains specified in php.ini, verify a class file is available, and invoke the class file as if from an invented Web page of the same name as the class file. Apache 2 Filter To implement this idea as an Apache 2 filter, you need a link to PHP that lets PHP know your code will provide the Web page input. Your code then invents a Web page of the
[PHP] does ImageCreateFromJPEG suck up memory?
Hi, I was using this little check to see if an uploaded image has the correct type: if($img $img_type != 'image/jpeg'){ $error['img'] = 'image has to be jpegBR'; } but the ImageCreateFromJPEG function in the next script returned: Warning: imagecreatefromjpeg: '/tmp/1.jpg' is not a valid JPEG file This seems to happen with images that are kind of corrupted or something, I am not sure why. Anyhow, I implemented this as an error check instead: if(!$photo = ImageCreateFromJPEG($img)){ $error['img'] = 'image is not a valid jpeg fileBR'; } This works, but my question is do I have to use 'ImageDestroy' everytime after I used the 'ImageCreateFromJPEG' function? Would now any tmp files be clogging up the /tmp directory? Would it suck up memory? Thanks, DrTebi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question
Is it possible to have PHP find out the ethernet's card MAC address?? I know that one can parse the output of dmesg or equvalent to find it out, but that would be OS platform specific code. I just want to know if php has a native way of finding out that information. Thanks Gerard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PGP
Please Cc: me on replies... I've got to be doing something stupid, because I've succeeded at this PGP (gpg, whatever) stuff before (years ago), but... I'm doing this: $test = escapeshellarg($cleartext); exec(cat $test | /usr/bin/pgpe -a -t -f -r '[EMAIL PROTECTED]' --pubring=/home/bodyline/.pgp/pubring.pkr --secring=/home/bodyline/.pgp/secring.pkr, $result, $error); echo TESTBR\n; echo implode(BR\n, $result); if ($error){ echo OS Error: $errorBR\n; } echo END TESTBR\n; I'm getting this output: -BEGIN PGP MESSAGE- Version: PGPfreeware 5.0i for non-commercial use MessageID: 3kStB52ChIWntEDMoGnXmy62k/g83h8g qANQR1DBwk4DyES2iJ7I3h4QC/4t4gfjedwU6InFgKPNFXWg05fDCVT465vays98 5f8uuQbSsecwjSOC8EuG/23yxLu8Cx+0utaz11/DiSym72YhTkxk38XQEAeP3wYT M4IRnH5T1JE7QvGif/MyqcmU3lOz5RQ7mqZtv+HmAs/gbW8E/sCSmiV4XEz/tv+e GkBg8/ga+KoL7HguGAg39Rbu5Ex1/sXW4l04+FFZyf2X9Pii1evr66QOxqIuqvsF ztomPJMiMdqYsn4hsbi9nOjBzf0pnFR4Z96SlnDURDwQ7M9O5Z4QO735UYTv+9gw 4A5jtKfXZsue2rC6gJ4QT+QZuk5KvjAlSh8/Dsrn5c6/gKWOz9Zn70VbhRqb4DT6 YGeCCFBjuGzCwL/RS+luNr5PxANFFfj0qS75SDRsvsEN0cUafRA8U9BbTLK+toEB y3JkQufZtAdC5aHD/QcWnkGojAaM/fK1ZHxLyp09VHjWpT+2TI76kmTOnfGLuuw3 N9688m9To7Hrn+pRNeyHT5+zm9cL/isNsdbuSW/4XO+W/niTGLpAI/jHt7HkCRpr LDvyoCDONT64xfqY17i16VBenH4KIdUIc+pz9qrETjBcRFJ7Z7JOeOrOxi/VQecT jgr6D+xt4Zpl16LXPcd5baGcs6uCl3MD1zyjMKLvlOjiZ5yZ482iyLvYcdplZ5/R +hP1GrkDwOZq1lsuJtJ6B/Ptz5E03A+bEQ9OAw4PHB214ZJ7apCuscTcBJOu7+wj 47wLLplEUOgMRIB+DZ8wp2Qq10+vYt3VyB8m6ef+Lq7bqT2bUioBoQg/gO4VSQrA sg/l4SGgc8wW7fvGRI4XmrSHhDJcYrRcRw8rJS9rsQXBKIUIUfIfVZ2v/iynEAlP qykTt84J8iHdFTYxwO4wwJC8w7Hahdc+AyYwsWANwmsF/QCZqzzWL76uTQ9ocasd lh9U5u2VJZcwJ20OVKziaAlXu8u0AGNaOaqW7EcTrImEar6pSNJC6PGy3ISSXkbW QFSHqJdsVUg873d/uMlrB8s0cI85kMkbb+162VCtITH/ckCxqtYiCwFvHVC+6Rq7 p1fD =6EMp -END PGP MESSAGE- I plug that into: /usr/bin/pgpv -f -o output Everything seems fine... Except output has this in it: ^Kb^Estdin^H^@^@^@ That ain't right. I've tried it with pasting the PGP MESSAGE and then ^D, and I've tried it with the message in a file, and I'm just completely stumped at this point. With and without -t as well. Pretty much the same thing. I can do a test from the command line without PHP getting involved, and it all works just fine as well... I've generated a second keypair and tried the second recipient (-r) and get the same thing. I dunno when it happened, but both pgp.com and gpg.org are useless now, so I dunno where to turn... And it *IS* working until PHP gets in the picture. PHP is running as a CGI and exec('whoami') tells me I'm the user who owns the keyring, and the output sure *LOOKS* like a PGP message, so, like, it's not that PGP isn't doing something with my input. I've tried it with the whole popen thing, and with the mkfifo thing for fake pipes, and I'll be durned if I can get those to do any better. I can make them worse, by making stupid mistakes, but not better :-) What am I doing that's stupid?... -- Got Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] class PHP
Can someone translate this to English? -Original Message- From: Peter [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 27, 2002 7:21 PM To: [EMAIL PROTECTED] Subject: [PHP] class PHP The text of this proposal, test code, and updates live at petermoulding.com/class. I place it here for discussion of the best approach before people build code. Class PHP An invention for a classier PHP. This invention uses PHP classes as Web pages. The invention can be implemented as a wrapper around PHP or as an enhancement to PHP. In Apache 2, the invention can be implemented as a filter to precede PHP. I will give a quick outline of the requirement, then sketches of implementations, then detailed examples prototyped using PHP. The invention is named class. An Apache implementation could be a module named class. If you write code to implement this invention, suffix the project name with your name as in class_John. To prevent a rapacious company copyrighting this invention using the excuse that it is a business process or anything else they can copyright, I declare my copyright on everything in this invention and any processes derivable from this. Please make your code implementations GPL, www.gnu.org/copyleft/gpl.html, and mention my page at petermoulding.com/class. Invention Requirement The main requirement is to replace PHP's page input with invented input. Here is a file named any_class.class that containing a PHP class named any_class: ?php class any_class { function any_class() { /* code to build a Web page. */ } } ? Here is a Web page containing a PHP script to build the entire page using the PHP class any_class: ?php include_once(any_class.class); $any_class = new any_class(); ? The invention makes PHP initiate any_class.class as if any_class were included and instantiated by the example Web page. PHP Wrapper The invention could be implemented as a module for Apache or another Web server by writing a wrapper for PHP. The wrapper would accept a call from Apache then pass the call on to PHP so PHP could perform 100% unaltered as if PHP were called direct from Apache. The module would look for class requests with a page of the form *.class then intercept the URL and prepare to pass invented input to PHP. The Apache configuration parameters can ensure all requests for class go to class and only requests for class to class. In a mixed class/PHP environment, the requested class can go to class and the PHP requests can go direct to PHP. There could also be a check in class for a class file so that all requests are directed to class and class processes just those with a matching class file. When class finds a valid class request, class builds a PHP Web page that includes the class file and initiates the class. To make PHP read the invented Web page, you could trap PHP's Web page read and substitute the invented page. As PHP has to access files within the constraints of a Web server, the access technique could vary from release to release and across Web servers. I will describe two quick implementation possibilities. If PHP reads files via Apache's file read functions (or an equivalent on other web servers), class gets to view all file requests from PHP to Apache and monitor all replies. Class can then pass the invented page back to PHP without the request reaching Apache. PHP remains untouched by class. Where a Web server does not provide file access functions or PHP chooses to not use those functions, class would need a modification to PHP to intercept file reads. The interception depends on the exact compilation of PHP and would be in the form of a wrapper around a file access routine in PHP. The wrapper (or interception layer) needs to be at a level where the code can see file names and subvert the whole file read process. Interception at this level requires PHP release dependent coding and is a step toward the PHP enhancement described next. PHP Enhancement A PHP enhancement would be an implementation of the invention direct within PHP's code so that PHP can react to class requests in conjunction with an external process or without an external process. The ultimate enhancement would be to incorporate the whole invention within PHP so there are no additional installation steps required. A PHP enhancement could use a wrapper as described in PHP Wrapper or the Apache 2 filter described next but use those devices just to trigger class processing then perform the whole processing within PHP. This approach has the advantage that the processing is independent of the trigger method and the trigger method is free from processing code. The PHP enhancement could discover the need for class processing by whatever method suits the web server environment. The enhancement would then verify the action is valid within constrains specified in php.ini, verify a class