[PHP] Merging Results of Queries
Hello guys I have a database system that has many databases and many tables on each database. I am trying to create a kind of search engine to seek data all over my database. I need to know if is possible to merge the results of my queries to later show them on a table or it is easier to perform the query and print the results on a HTML table leaving the table open, than perform another query and print it on until it is all over and close the table with ? Thank you Daniel F. Castro [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strip spaces from inside string
Say I have a string "xyz abc def" and I want to remove all of the spaces withing the string to create a new one. What's the best way? Thanks, ChuckB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strip spaces from inside string
> Say I have a string "xyz abc def" and I want to remove all of the spaces > withing the string to create a new one. What's the best way? Or you can use eregi_replace(), but I don't know what the regex would be. I *think* you can do: Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] strip spaces from inside string
-Original Message- From: Chuck Barnett [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 03, 2002 2:01 PM To: PHP General List Subject: [PHP] strip spaces from inside string Say I have a string "xyz abc def" and I want to remove all of the spaces withing the string to create a new one. What's the best way? Thanks, ChuckB -- 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: Merging Results of Queries
You can select from multiple databases and tables, ie: SELECT database.table.field, otherdb.othertable.other FROM database.table, otherdb.othertable; Even from two, three, four databases. But your queries might either get too complicated or slow. So, store the results from simpler selects, using only two databases, on temporaries tables of Type = HEAP. It's like they are 'memory tables', and faster. So you can again select from another database and from this temporary. Well, use temporary table to reduce the number of Joins :-) This is kind of a query merger done in sql... other option is to merge the individual sql queries using array_merge or similar functions. -- Julio Nobrega. "Daniel Ferreira Castro" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello guys > > I have a database system that has many databases and many tables on each > database. I am trying to create a kind of search engine to seek data all > over my database. > > I need to know if is possible to merge the results of my queries to later > show them on a table or it is easier to perform the query and print the > results on a HTML table leaving the table open, than perform another query > and print it on until it is all over and close the table with ? > > Thank you > > Daniel F. Castro > [EMAIL PROTECTED] > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FTP RAW
Hey Chris: On Tue, Mar 26, 2002 at 12:44:21PM -0700, Chris wrote: > OK. I don't know how I can be more specific, but I will try. Dude, let's look at your initial question to the list: >> Can anyone help me with the command I need for a RAW FTP file >> upload? I can create connections and they empty file, but I have no >> idea how to get the data into the file and I have tried everything. That's vague. Now that you've clarified a bit of how you're doing what you're trying to do, let's see what we can do to help... > I have used fopen(ftp://url) to upload files to the FTP server from a > web form, however this fails on files over 5k in size. > > I do not have the FTP functions installed on the server I will be using. > > I simply want to know how I would use the raw FTP commands with an > fsockopen() function. I know how to use this to connect to the file server, > change directories, etc.. The question is how do I use the fsocket() with > raw FTP commands to upload a file? Is that not specific? Just so I'm being clear, When I was talking about fopen(), fputs() and fclose(), I meant you need to make a file on your local hard drive first. I wasn't talking about using these functions directly with the file pointer generated by fsockopen(). Anwyway, once the file is created on your drive, THEN, you can use FTP to put the file on the remote server. Okay, to be straight up, I haven't used PHP's socket functions yet. It's cool, you're able log in and to cd into the right directory. Uh, now what to do??? Let's see what the FRC for FTP says... ftp://ftp.isi.edu/in-notes/rfc959.txt. How about trying: fputs($fp, "STOR ./foo.txt\r\n"); --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [Session]
On Tuesday, March 26, 2002, at 02:42 PM, Evan wrote: > I have PHP 4.1.2 (the latest, I downloaded it a week ago). > The manual says that: > * > If track_vars is enabled and register_globals is disabled, only members > of > the global associative array $HTTP_SESSION_VARS can be registered as > session > variables. The restored session variables will only be available in the > array $HTTP_SESSION_VARS. > * > > I won't use $_SESSION cause it seems that is a bit buggy have a > search > with google->user group "$_SESSION". Okay, suit yourself -- but a reminder that $_SESSION is the 'official' method of referring to the SESSION array, and that $HTTP_SESSION_VARS has been deprecated and may not be available in a later release of PHP, thus rendering your code obsolete if you should ever upgrade. Read it for yourself, http://www.php.net/manual/en/language.variables.predefined.php Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sorting data from a field
Hello again :) I have a db field that holds the first and last name of a person. Is there a way to sort by the last name in that field? The whole reason for this is to populate a select box sorted by last name. I don't want to go back and create a separate field if I don't have to. Any help is appreciated. Thanks, Chuck -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sorting data from a field
On Sun, 3 Feb 2002, Chuck Barnett wrote: > I have a db field that holds the first and last name of a person. Is > there a way to sort by the last name in that field? > > The whole reason for this is to populate a select box sorted by last name. > > I don't want to go back and create a separate field if I don't have to. You can do something cheesy like this: select name from table order by substring(name, locate(' ', name)) but really I'd advise splitting it into separate fields because your queries will run faster and you'll have more flexibility in the long term. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] sorting data from a field
Good day. You can do this using the "ORDER" clause in SQL. Please consult your particular database's documentation for more information. Alternately, you can load all of the unsorted results into an associative array, and use PHP's native sorting functions (such as ksort() ) to sort the results. Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: Chuck Barnett [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 03, 2002 1:50 PM To: PHP General List Subject: [PHP] sorting data from a field Hello again :) I have a db field that holds the first and last name of a person. Is there a way to sort by the last name in that field? The whole reason for this is to populate a select box sorted by last name. I don't want to go back and create a separate field if I don't have to. Any help is appreciated. Thanks, Chuck -- 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] sorting data from a field
Good day, Sorry, I didn't read your request as clearly as I should have. =) If you have a single field, the best way would be to load all of the results, and then have PHP split() the results by whitespace. Then store the results by associative array and use ksort() to sort them. The best way would be to have a first name and last name field. This addresses situations where people have their family name first and their given name second. Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: Darren Gamble [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 2:13 PM To: 'Chuck Barnett'; PHP General List Subject: RE: [PHP] sorting data from a field Good day. You can do this using the "ORDER" clause in SQL. Please consult your particular database's documentation for more information. Alternately, you can load all of the unsorted results into an associative array, and use PHP's native sorting functions (such as ksort() ) to sort the results. Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: Chuck Barnett [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 03, 2002 1:50 PM To: PHP General List Subject: [PHP] sorting data from a field Hello again :) I have a db field that holds the first and last name of a person. Is there a way to sort by the last name in that field? The whole reason for this is to populate a select box sorted by last name. I don't want to go back and create a separate field if I don't have to. Any help is appreciated. Thanks, Chuck -- 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] templates with php
Has anybody uses other engine besides Smart or php-templates (@freebsd ports) I trying to get into the subject but I don't know which to start with. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sorting data from a field
To do that is it necesary to loop the $result variable and assign each array($name => $value) ? > Alternately, you can load all of the unsorted results into an associative > array, and use PHP's native sorting functions (such as ksort() ) to sort the > results. > > > Darren Gamble > Planner, Regional Services > Shaw Cablesystems GP > 630 - 3rd Avenue SW > Calgary, Alberta, Canada > T2P 4L4 > (403) 781-4948 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] sorting data from a field
you can extract and sort on the last name: mysql> select substring(myname,locate(" ",myname)+1) as lname from mytable order by lname; this assumes names are stored as "john doe", that is with a space separator -Original Message- From: Chuck Barnett [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 03, 2002 2:50 PM To: PHP General List Subject: [PHP] sorting data from a field Hello again :) I have a db field that holds the first and last name of a person. Is there a way to sort by the last name in that field? The whole reason for this is to populate a select box sorted by last name. I don't want to go back and create a separate field if I don't have to. Any help is appreciated. Thanks, Chuck -- 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] Loading Images
At 26.03.2002 12:47, you wrote: > >I don't have any code for this, but I'm hoping someone can point me in the >right direction. I want to load images or navigation menus dynamically. Is >it possible to build a database of images and then use php to display >them? Or something along these lines. I know this must be possible, >becuase I see sites that do something like this, and I cant seem to right >click the image and save it. Does this make any sense? >Thanks. >-Chris Storing images in a db is not a good idea. instead store them in your filesystem an have a reference to them in your db. Then you can make everything ;-) Even there´s no real security for grabbing pics. If your client can see them, they are on his/her machine. To prevent the right-click, you have to use JavaScript, but that only works, if the user has it switched on. A little more secure is putting the pics in flash-movies. But I think there are already programs out, which allow to extract pictures and componenets. HTH Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Newman] Help Needed with a redir script.
I have a list of links! $linkone="http://server1.dyndns.org/";; $linktwo="http://server2.dyndns.org/";; I would like to make a script that looks for http://server1.dyndns.org/, if it returns a 404, or DNS error then it redirects to http://server2.dyndns.org/ this server. Any suggestions. Philip J. Newman PhilipNZ :: Design Solutions http://www.philipnz.com/ [EMAIL PROTECTED] ICQ# 20482482 +64 25 6144012 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Loading Images
I wasn't so much concearned about security of users grabbin pics. I am more trying to learn how these people load there menus dynamically and pics dynamically. Do you have any links to pages or code that describe how to make a link in the db to pics on my filesystem? Thanks. -Chris On Tue, 26 Mar 2002 [EMAIL PROTECTED] wrote: > At 26.03.2002 12:47, you wrote: > > > >I don't have any code for this, but I'm hoping someone can point me in the > >right direction. I want to load images or navigation menus dynamically. Is > >it possible to build a database of images and then use php to display > >them? Or something along these lines. I know this must be possible, > >becuase I see sites that do something like this, and I cant seem to right > >click the image and save it. Does this make any sense? > >Thanks. > >-Chris > Storing images in a db is not a good idea. instead store them > in your filesystem an have a reference to them in your db. > Then you can make everything ;-) > > Even there´s no real security for grabbing pics. If your client can see them, > they are on his/her machine. To prevent the right-click, you have to use > JavaScript, but that only works, if the user has it switched on. > A little more secure is putting the pics in flash-movies. But I think there are > already programs out, which allow to extract pictures and componenets. > HTH Oliver > > > -- > 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] Having problems getting file uploads to work properly
Greetings: I am having problems getting file uploads to completely function. I have a test script that acknowledges the file was successfully uploaded, and I can use the move_uploaded_file function without error, however, NOTHING shows up in any of the directories Im dealing with. I know my file permissions are set correctly, and I had this problem with both PHP compiled fresh on OpenBSD, and PHP installed on Win2K. This is with the newest version 4.1.2, where they fixed some security problems with the file upload functionality. Is there perhaps a correlation? Thanks! - Joel
Re: [PHP] [Session] (it seems to be a bug in PHP 4.1.2)
On 26 Mar 2002 at 20:42, Evan wrote: > I have PHP 4.1.2 (the latest, I downloaded it a week ago). PHP 4.1.2 has several bugs. One of them is that Apache and sessions variables do not work. It is best not to upgrade to 4.1.2! see the bug report on session variables & following discussion and suggestions to solve it http://bugs.php.net/bug.php?id=16102 Chris -- ! please check my email address ! ! only my email [EMAIL PROTECTED] works ! ! email [EMAIL PROTECTED] is a black hole since januari 2002 ! Chris Hayes - Droef 35 - Wageningen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Where is php.ini on Mac OS X?
Can some one please tell me where php.ini is located on Mac OS X? Thanks, Chuck Payne Magi Design and Support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Where is php.ini on Mac OS X?
Can some one please tell me where php.ini is located on Mac OS X? Thanks, Chuck Payne Magi Design and Support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to get consistent UTC from gmmktime (w/o dst-offset) ????
hi. i'm storing events in a mysql-db, using epoch timestamps to pinpoint the exact date/time for an event. so far, I have been using localtime, being aware that there are inconsistencies in the number of epoch-seconds, when DST flips on and off. nevertheless, that works fine as long as you stick to mktime() and date() for all the date-math as in mktime(0,0,0,$month,$day+$offset,$year) but as soon as you leave php and have to do some calculation in javascript, you will encounter functions that behave differently on the pc and mac platforms. so you have to revert back to the 'add 86400-seconds' to calculate the next day. so I thought it would be nice to have all the timestamps as linear, non-dst-epoch-seconds (UTC) and I went into the gmmktime() and gmdate() functions, assuming they would do the math in a linear second-based timespace (in GMT, without DST). That seems to be the case for the output of 'gmdate', that remains correct, if you count up seconds across the DST boundary (see second example). but it seems that there is no way to calculate the gmt-epoch for a given date using gmmktime without having to add/subtract the TZ manually. gmmktime will always take your local DST-settings into calculation and upon conversion back with gmdate, you will be off by the number of hours of your timezone. I thought gmmktime() would handle this as if the computer would be in Greenwich (TZ=0), which would then leave us with the two functions encoding/decoding consistently. anyone having solved this properly? - print "count days:\n"; for($day=0; $day<7; $day++){ $timgmt = gmmktime(0,0,0,3,28+$day,2002); $timloc = mktime(0,0,0,3,28+$day,2002); print $timgmt . "= gmmktim epoch - " . gmdate("D d.m.Y H:i I",$timgmt) . "\n"; print $timloc . "= mktim epoch - " . date("D d.m.Y H:i I",$timloc) . "\n"; print "\n"; } count days: 101727= gmmktim epoch - Wed 27.03.2002 23:00 0 101727= mktim epoch - Thu 28.03.2002 00:00 0 1017356400= gmmktim epoch - Thu 28.03.2002 23:00 0 1017356400= mktim epoch - Fri 29.03.2002 00:00 0 1017442800= gmmktim epoch - Fri 29.03.2002 23:00 0 1017442800= mktim epoch - Sat 30.03.2002 00:00 0 1017529200= gmmktim epoch - Sat 30.03.2002 23:00 0 1017529200= mktim epoch - Sun 31.03.2002 00:00 0 <<\n"; $baseepoch = $timloc = mktime(0,0,0,3,28,2002); for($day=0; $day<7; $day++){ $epochnow = $baseepoch + (60 * 60 * 24 * $day); print $epochnow . "= gmmktim epoch - " . gmdate("D d.m.Y H:i I",$epochnow) . "\n"; print $epochnow . "= mktim epoch - " . date("D d.m.Y H:i I",$epochnow) . "\n"; print "\n"; } count seconds: 101727= gmmktim epoch - Wed 27.03.2002 23:00 0 <<< consistent, but off by -1 (your TZ) 101727= mktim epoch - Thu 28.03.2002 00:00 0 1017356400= gmmktim epoch - Thu 28.03.2002 23:00 0 1017356400= mktim epoch - Fri 29.03.2002 00:00 0 1017442800= gmmktim epoch - Fri 29.03.2002 23:00 0 1017442800= mktim epoch - Sat 30.03.2002 00:00 0 1017529200= gmmktim epoch - Sat 30.03.2002 23:00 0 1017529200= mktim epoch - Sun 31.03.2002 00:00 0 1017615600= gmmktim epoch - Sun 31.03.2002 23:00 0 1017615600= mktim epoch - Mon 01.04.2002 01:00 1 1017702000= gmmktim epoch - Mon 01.04.2002 23:00 0 1017702000= mktim epoch - Tue 02.04.2002 01:00 1 1017788400= gmmktim epoch - Tue 02.04.2002 23:00 0 1017788400= mktim epoch - Wed 03.04.2002 01:00 1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DB] how to get consistent UTC from gmmktime (w/o dst-offset) ????
BTW for all who are following this, Patrick has cleverly illustrated that most of the northern hemisphere locations where summer time is observed will 'spring forward' this weekend. Most of the southern hemisphere locations that were in summer time did their 'fall back' last weekend! NB the two uses of the word "most"! Hi Patrick, References from the manual: - gmmktime -- Get UNIX timestamp for a GMT date - gmdate -- Format a GMT/CUT date/time Identical to the date() function except that the time returned is Greenwich Mean Time (GMT). For example, when run in Finland (GMT +0200), the first line below prints "Jan 01 1998 00:00:00", while the second prints "Dec 31 1997 22:00:00". echo date ("M d Y H:i:s", mktime (0,0,0,1,1,1998)); echo gmdate ("M d Y H:i:s", mktime (0,0,0,1,1,1998)); - The definition of the Unix Epoch is itself in GMT (and adjusted from there to local time using the +/-TZ difference): "the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)". When playing around with UNIX epoch seconds it is important to keep them time-zone separated. So try working your test backwards and putting in a data/time and then asking for the GMT and the local timestamp values. They will also be separated by the one hour/two hours. Question answered, or in my haste to get to my dinner...? Regards, =dn > i'm storing events in a mysql-db, using epoch timestamps to pinpoint the > exact date/time for an event. > > so far, I have been using localtime, being aware that there are > inconsistencies > in the number of epoch-seconds, when DST flips on and off. nevertheless, that > works fine as long as you stick to mktime() and date() for all the date-math > as in mktime(0,0,0,$month,$day+$offset,$year) > > but as soon as you leave php and have to do some calculation in javascript, > you will encounter functions that behave differently on the pc and mac > platforms. so you have to revert back to the 'add 86400-seconds' to calculate > the next day. > > so I thought it would be nice to have all the timestamps as linear, > non-dst-epoch-seconds (UTC) and I went into the gmmktime() and gmdate() > functions, assuming they would do the math in a linear second-based timespace > (in GMT, without DST). That seems to be the case for the output of 'gmdate', > that remains correct, if you count up seconds across the DST boundary (see > second example). > > but it seems that there is no way to calculate the gmt-epoch for a given > date using gmmktime without having to add/subtract the TZ manually. gmmktime > will always take your local DST-settings into calculation and upon conversion > back with gmdate, you will be off by the number of hours of your timezone. > I thought gmmktime() would handle this as if the computer would be in > Greenwich > (TZ=0), which would then leave us with the two functions encoding/decoding > consistently. > > anyone having solved this properly? > > - > print "count days:\n"; > for($day=0; $day<7; $day++){ > $timgmt = gmmktime(0,0,0,3,28+$day,2002); > $timloc = mktime(0,0,0,3,28+$day,2002); > print $timgmt . "= gmmktim epoch - " . gmdate("D d.m.Y H:i I",$timgmt) . > "\n"; > print $timloc . "= mktim epoch - " . date("D d.m.Y H:i I",$timloc) . > "\n"; > print "\n"; > } > > > count days: > 101727= gmmktim epoch - Wed 27.03.2002 23:00 0 > 101727= mktim epoch - Thu 28.03.2002 00:00 0 > > 1017356400= gmmktim epoch - Thu 28.03.2002 23:00 0 > 1017356400= mktim epoch - Fri 29.03.2002 00:00 0 > > 1017442800= gmmktim epoch - Fri 29.03.2002 23:00 0 > 1017442800= mktim epoch - Sat 30.03.2002 00:00 0 > > 1017529200= gmmktim epoch - Sat 30.03.2002 23:00 0 > 1017529200= mktim epoch - Sun 31.03.2002 00:00 0 > << 1017619200= gmmktim epoch - Mon 01.04.2002 00:00 0 <<< off by one hour due to > DST > 1017612000= mktim epoch - Mon 01.04.2002 00:00 1 > > 1017705600= gmmktim epoch - Tue 02.04.2002 00:00 0 > 1017698400= mktim epoch - Tue 02.04.2002 00:00 1 > > 1017792000= gmmktim epoch - Wed 03.04.2002 00:00 0 > 1017784800= mktim epoch - Wed 03.04.2002 00:00 1 > > > - > print "count seconds:\n"; > $baseepoch = $timloc = mktime(0,0,0,3,28,2002); > for($day=0; $day<7; $day++){ > $epochnow = $baseepoch + (60 * 60 * 24 * $day); > print $epochnow . "= gmmktim epoch - " . gmdate("D d.m.Y H:i I",$epochnow) . > "\n"; > print $epochnow . "= mktim epoch - " . date("D d.m.Y H:i I",$epochnow) . > "\n"; > print "\n"; > } > > count seconds: > 101727= gmmktim epoch - Wed 27.03.2002 23:00 0 <<< consistent, but off by > -1 (your TZ) > 101727= mktim epoch - Thu 28.03.2002 00:00 0 > > 1017356400= gmmktim epoch - Thu 28.03.2002 23:00 0 > 1017356400= mktim epoch - Fri 29.03.2002 00:00 0 > > 1017442800= gmmktim epoch - Fri 29.03.2002 23:00 0 > 1017442800= mktim epoch - Sat 30.03.2002 00:00 0 > > 1017529200= gmmktim epoch - Sat 30.03.2002
[PHP] PHP and APACHE & VirtualDomains
We have PHP and APACHE (1.3.19) installed and an instance of apache is running with php support enabled. I need to set up another instance of httpd using a seperate config file. However I cannot get PHP support enabled. I cannot find where the PHP modules are. I called a phpinfo() on the instance which is already running and it returned: It said the config file was in /usr/local/lib/php.ini I think i am looking for the module mod_php4 but I cannot see where it is. Any ideas? ALSO I'm having lots of trouble with VirtualDomains. I have an instance second httpd running (without php) on a port other than 80 and it runs fine. But whenever I add VirtualDomain to the httpd.conf the main page gets replaced by the main page of the VirtualDomain. This is really anoying me is there anything I should check for? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [Newman] Help Needed with a redir script.
Not sure on the 404 part, you might look at CURL. For the DNS part you could do if (!gethostbyname(server1.dydns.org)) { header ("Location server2.dycns.org"); } This function is in the PHP manual. Jason -Original Message- From: Philip J. Newman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 2:42 PM To: [EMAIL PROTECTED] Subject: [PHP] [Newman] Help Needed with a redir script. I have a list of links! $linkone="http://server1.dyndns.org/";; $linktwo="http://server2.dyndns.org/";; I would like to make a script that looks for http://server1.dyndns.org/, if it returns a 404, or DNS error then it redirects to http://server2.dyndns.org/ this server. Any suggestions. Philip J. Newman PhilipNZ :: Design Solutions http://www.philipnz.com/ [EMAIL PROTECTED] ICQ# 20482482 +64 25 6144012 -- 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] [Session]
> I am probably wrong about this, but I thought that you could register > session variables using this technique only if you are using > PHP 4.1.x > and you use the format: > > $_SESSION['v_s'] = 500; The key point is the register_globals setting in php.ini. If it is set to on, then register variables this way, regardless of the version: $v_s = 500; session_register{'v_s'); If it is set to off, then do as above, assuming your version is new enough to support the new array $_SESSION[]: $_SESSION['v_s'] = 500; The array $_SESSION[] is pretty new, maybe 4.1.2? Even with this new array, you can still use the old method for registering variables. Also, in a recent release, or else coming up shortly, the default setting for register_globals will be changed from "on" to "off". Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem sending email message, from Newman.
Below is some code that I have used to send an email Via mail. The message sends with the correct data, HOWEVER my mail server don't like the header and sends the email back to admin. ROUTER: Failure delivering mail message to recipient: [EMAIL PROTECTED] [ROUTER: Unexpected SMTP Server 'ihug.co.nz' [250] received: 550 Syntax error in 'From' header: missing or malformed local part (expected word or "<"): failing address is: Philip J. Newman] Can anyone help with this $msg = "Thanks, $name. Your entry had been added, Good Luck."; $msg .= "Email: $email.\n"; $msg .= "Text: $address, $suburb.\n"; $msg .= "Answer: $answer"; $mailheaders = "From: Philip J. Newman\n"; $mailheaders .= "Reply-To: [EMAIL PROTECTED]\n\n"; mail("$email", "[Newman] Conformation of entry. ", $msg, $mailheaders); Philip J. Newman PhilipNZ :: Design Solutions http://www.philipnz.com/ [EMAIL PROTECTED] ICQ# 20482482 +64 25 6144012 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Where is php.ini on Mac OS X?
Try looking in your /usr/local/bin directory.. It should be there. Cheers! Rick "And God shall wipe away all tears from their eyes; and there shall be no more death, neither sorrow, nor crying, neither shall there be any more pain: for the former things are passed away." - Revelation 21:4 > From: "Chuck \"PUP\" Payne" <[EMAIL PROTECTED]> > Date: Tue, 26 Mar 2002 17:49:44 -0500 > To: <[EMAIL PROTECTED]> > Subject: [PHP] Where is php.ini on Mac OS X? > > Can some one please tell me where php.ini is located on Mac OS X? > > Thanks, > > Chuck Payne > Magi Design and Support > > > -- > 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] Problem sending email message, from Newman.
Can you show the contents of the variable $email ? miguel On Wed, 27 Mar 2002, Philip J. Newman wrote: > Below is some code that I have used to send an email Via mail. The message > sends with the correct data, HOWEVER my mail server don't like the header > and sends the email back to admin. > > ROUTER: Failure delivering mail message to recipient: [EMAIL PROTECTED] > [ROUTER: Unexpected SMTP Server 'ihug.co.nz' [250] received: 550 Syntax > error in 'From' header: missing or malformed local part (expected word or > "<"): failing address is: Philip J. Newman] > > Can anyone help with this > > $msg = "Thanks, $name. Your entry had been added, Good Luck."; > $msg .= "Email: $email.\n"; > $msg .= "Text: $address, $suburb.\n"; > $msg .= "Answer: $answer"; > > $mailheaders = "From: Philip J. Newman\n"; > $mailheaders .= "Reply-To: [EMAIL PROTECTED]\n\n"; > > mail("$email", "[Newman] Conformation of entry. ", $msg, $mailheaders); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Loading Images
It is quite easy to store images in a database and display them on the screen. You can find tutorials about this online (sorry I don't have any direct links). There are also numerous FREE scripts pre-written that you can integrate into your site, or use to learn how to do this yourself. There is a catch however... and that is you will not be able to display anything else along with those images because special content headers must be sent to let the browser know what kind of data it's receiving. Is it a JPEG, GIF or PNG? If the headers are not sent, or the wrong headers are sent, the image will either not display or the user will see endless rows of junk text spewed onto the screen (the binary data in ASCII form!!). So this method will only work if you want to display the images in a frame, one at a time, and by them selves. You won't be able to intermingle HTML so forget about doing dynamic menus with this method. The way these dynamic sites work is by storing the paths to each image in the database rather than the images themselves... so you're back to the file system solution. Anyway I hope this helps answer some of the questions you were having about this method. :) -Kevin -Original Message- From: Omland Christopher m [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 2:45 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Loading Images I wasn't so much concearned about security of users grabbin pics. I am more trying to learn how these people load there menus dynamically and pics dynamically. Do you have any links to pages or code that describe how to make a link in the db to pics on my filesystem? Thanks. -Chris On Tue, 26 Mar 2002 [EMAIL PROTECTED] wrote: > At 26.03.2002 12:47, you wrote: > > > >I don't have any code for this, but I'm hoping someone can point me in the > >right direction. I want to load images or navigation menus dynamically. Is > >it possible to build a database of images and then use php to display > >them? Or something along these lines. I know this must be possible, > >becuase I see sites that do something like this, and I cant seem to right > >click the image and save it. Does this make any sense? > >Thanks. > >-Chris > Storing images in a db is not a good idea. instead store them > in your filesystem an have a reference to them in your db. > Then you can make everything ;-) > > Even there´s no real security for grabbing pics. If your client can see them, > they are on his/her machine. To prevent the right-click, you have to use > JavaScript, but that only works, if the user has it switched on. > A little more secure is putting the pics in flash-movies. But I think there are > already programs out, which allow to extract pictures and componenets. > HTH Oliver > > > -- > 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] Problem sending email message, from Newman.
$email = [EMAIL PROTECTED] example - Original Message - From: "Miguel Cruz" <[EMAIL PROTECTED]> To: "Philip J. Newman" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, March 27, 2002 11:14 AM Subject: Re: [PHP] Problem sending email message, from Newman. > Can you show the contents of the variable $email ? > > miguel > > On Wed, 27 Mar 2002, Philip J. Newman wrote: > > > Below is some code that I have used to send an email Via mail. The message > > sends with the correct data, HOWEVER my mail server don't like the header > > and sends the email back to admin. > > > > ROUTER: Failure delivering mail message to recipient: [EMAIL PROTECTED] > > [ROUTER: Unexpected SMTP Server 'ihug.co.nz' [250] received: 550 Syntax > > error in 'From' header: missing or malformed local part (expected word or > > "<"): failing address is: Philip J. Newman] > > > > Can anyone help with this > > > > $msg = "Thanks, $name. Your entry had been added, Good Luck."; > > $msg .= "Email: $email.\n"; > > $msg .= "Text: $address, $suburb.\n"; > > $msg .= "Answer: $answer"; > > > > $mailheaders = "From: Philip J. Newman\n"; > > $mailheaders .= "Reply-To: [EMAIL PROTECTED]\n\n"; > > > > mail("$email", "[Newman] Conformation of entry. ", $msg, $mailheaders); > > > -- > 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] Problem sending email message, from Newman.
Ah, never mind, the problem is that your From: header is invalid. You have: From: Philip J. Newman which is not a valid address format. Try something like this: From: "Philip J. Newman" <[EMAIL PROTECTED]> miguel On Wed, 27 Mar 2002, Philip J. Newman wrote: > $email = [EMAIL PROTECTED] example > > - Original Message - > From: "Miguel Cruz" <[EMAIL PROTECTED]> > To: "Philip J. Newman" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Wednesday, March 27, 2002 11:14 AM > Subject: Re: [PHP] Problem sending email message, from Newman. > > > > Can you show the contents of the variable $email ? > > > > miguel > > > > On Wed, 27 Mar 2002, Philip J. Newman wrote: > > > > > Below is some code that I have used to send an email Via mail. The > message > > > sends with the correct data, HOWEVER my mail server don't like the > header > > > and sends the email back to admin. > > > > > > ROUTER: Failure delivering mail message to recipient: [EMAIL PROTECTED] > > > [ROUTER: Unexpected SMTP Server 'ihug.co.nz' [250] received: 550 Syntax > > > error in 'From' header: missing or malformed local part (expected word > or > > > "<"): failing address is: Philip J. Newman] > > > > > > Can anyone help with this > > > > > > $msg = "Thanks, $name. Your entry had been added, Good Luck."; > > > $msg .= "Email: $email.\n"; > > > $msg .= "Text: $address, $suburb.\n"; > > > $msg .= "Answer: $answer"; > > > > > > $mailheaders = "From: Philip J. Newman\n"; > > > $mailheaders .= "Reply-To: [EMAIL PROTECTED]\n\n"; > > > > > > mail("$email", "[Newman] Conformation of entry. ", $msg, $mailheaders); > > > > > > -- > > 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] Re: which php book 2 buy ?
It is, the picture should prove that. On Tue, 26 Mar 2002, Scott St. John wrote: > I didn't think Programming PHP was out yet? > > > On Tue, 26 Mar 2002, Rasmus Lerdorf wrote: > > > Or, of course, if you want to be cool like Carl: > > > > http://lerdorf.com/buy/ > > > > ;) > > > > -Rasmus > > > > On Tue, 26 Mar 2002, Ralph Friedman wrote: > > > > > In article <[EMAIL PROTECTED]>, Septic Flesh wrote: > > > > I wanna buy a book from amazon . . .but don't know which one.. > > > > Do you know where I will find examples of shopping carts ? (which book ?) > > > > > > > > > > "Creating Dynamic Web Pages Using PHP and MySQL" by David Tansley. > > > > > > -- > > > Rgds > > > Ralph > > > > > > > > > > > > -- > > > 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] Re: OT Re: [PHP] Re: which php book 2 buy ?
No idea, I don't follow O'Reilly covers all that closely. This one arrived on my doorstep a couple of days ago. According to Barnes & Noble it starts shipping today. Not sure why Amazon says it isn't published yet. The fact that I have a copy would seem to disprove that. -Rasmus On Tue, 26 Mar 2002, Erik Price wrote: > Totally off topic -- > > I thought that O'Reilly had switched to using a white binding with black > text on all of their newly-[re]printed books. The picture of the > sleeping babe with the book shows an older style, with a colored field > (green) and white text. Maybe this is a localization thing. > > > On Tuesday, March 26, 2002, at 01:51 PM, Rasmus Lerdorf wrote: > > > Or, of course, if you want to be cool like Carl: > > > > http://lerdorf.com/buy/ > > > > ;) > > > > > > > > > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Loading Images
U, is that correct? I thought (although never tried) that you could reference an image as or simular, in which case the headers and everything else CAN be sent in the image tag, which is embeded in a HTML page -- isn't that how they do counters etc etc?? At the moment, I'm just storing my images in my file system, and storing the URLs in my database (as discussed by someone else in this thread), which works fine, as long as nobody deletes the image without deleting the URL from the DB. On the topic of preventing users from saving images, the attempts are futile, because they can also just look at your source to DL the image from it's URL. One thing I have seen work instead of disabling right-click is to have a clear layer (DIV) above the whole page, which (for me) prevents me from selecting text + images from below. Although I don't know how reliable this is. Justin French - http://indent.com.au http://soundpimps.com - on 27/03/02 10:16 AM, Kevin Stone ([EMAIL PROTECTED]) wrote: > It is quite easy to store images in a database and display them on the > screen. You can find tutorials about this online (sorry I don't have > any direct links). There are also numerous FREE scripts pre-written > that you can integrate into your site, or use to learn how to do this > yourself. > > There is a catch however... and that is you will not be able to display > anything else along with those images because special content headers > must be sent to let the browser know what kind of data it's receiving. > Is it a JPEG, GIF or PNG? If the headers are not sent, or the wrong > headers are sent, the image will either not display or the user will see > endless rows of junk text spewed onto the screen (the binary data in > ASCII form!!). > > So this method will only work if you want to display the images in a > frame, one at a time, and by them selves. You won't be able to > intermingle HTML so forget about doing dynamic menus with this method. > > The way these dynamic sites work is by storing the paths to each image > in the database rather than the images themselves... so you're back to > the file system solution. > > Anyway I hope this helps answer some of the questions you were having > about this method. :) > > -Kevin > > -Original Message- > From: Omland Christopher m [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 26, 2002 2:45 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Loading Images > > I wasn't so much concearned about security of users grabbin pics. I am > more trying to learn how these people load there menus dynamically and > pics dynamically. Do you have any links to pages or code that describe > how > to make a link in the db to pics on my filesystem? > Thanks. > -Chris > > On Tue, 26 Mar 2002 [EMAIL PROTECTED] wrote: > >> At 26.03.2002 12:47, you wrote: >>> >>> I don't have any code for this, but I'm hoping someone can point me > in the >>> right direction. I want to load images or navigation menus > dynamically. Is >>> it possible to build a database of images and then use php to display >>> them? Or something along these lines. I know this must be possible, >>> becuase I see sites that do something like this, and I cant seem to > right >>> click the image and save it. Does this make any sense? >>> Thanks. >>> -Chris >> Storing images in a db is not a good idea. instead store them >> in your filesystem an have a reference to them in your db. >> Then you can make everything ;-) >> >> Even there´s no real security for grabbing pics. If your client can > see them, >> they are on his/her machine. To prevent the right-click, you have to > use >> JavaScript, but that only works, if the user has it switched on. >> A little more secure is putting the pics in flash-movies. But I think > there are >> already programs out, which allow to extract pictures and componenets. >> HTH Oliver >> >> >> -- >> 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] Code Bulk
Im in a debate with someone else. Basically were debating code bulk. This is just an example -> run_this_code; } echo 'Finished'; ?> Now, if I understand php correctly, the whole script gets parsed, but since $run_this code isn't set, $this->run_this_code doesn't get echoed/executed. What this other person is telling me that its more effiecient for *him* to have -> instead. The script is a general purpose script. Its not built for one person. Some may use $run_this_code and some may not. So in taking out that bit of code, all it does is save the parser, what fraction of a fraction of a second?? Im just looking for ammunition so I could go and shoot this guy down... :) Thanks for listening -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Code Bulk
any speed difference will be miniscule/negligible - is speed, to the microsecond, important in this situation? -Original Message- From: Gerard Samuel [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 27, 2002 11:23 AM To: PHP Subject: [PHP] Code Bulk Im in a debate with someone else. Basically were debating code bulk. This is just an example -> run_this_code; } echo 'Finished'; ?> Now, if I understand php correctly, the whole script gets parsed, but since $run_this code isn't set, $this->run_this_code doesn't get echoed/executed. What this other person is telling me that its more effiecient for *him* to have -> instead. The script is a general purpose script. Its not built for one person. Some may use $run_this_code and some may not. So in taking out that bit of code, all it does is save the parser, what fraction of a fraction of a second?? Im just looking for ammunition so I could go and shoot this guy down... :) Thanks for listening -- 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] Code Bulk
Actually, the file in question is 3000 lines long, 99% in functions. Im trying to tell him that he may not see any speed ups in code execution. As long as I know Im right, its just the peace of mind when I go to bed tonight :) Martin Towell wrote: > any speed difference will be miniscule/negligible - is speed, to the > microsecond, important in this situation? > > -Original Message- > From: Gerard Samuel [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 27, 2002 11:23 AM > To: PHP > Subject: [PHP] Code Bulk > > > Im in a debate with someone else. > Basically were debating code bulk. > > This is just an example -> > > if (isset($run_this_code)) { > echo $this->run_this_code; > } > echo 'Finished'; > ?> > > Now, if I understand php correctly, the whole script gets parsed, but > since $run_this code isn't set, $this->run_this_code doesn't get > echoed/executed. What this other person is telling me that its more > effiecient for *him* to have -> > > echo 'Finished'; > ?> > > instead. > > The script is a general purpose script. Its not built for one person. > Some may use $run_this_code and some may not. So in taking out that bit > of code, all it does is save the parser, what fraction of a fraction of > a second?? > Im just looking for ammunition so I could go and shoot this guy down... :) > > Thanks for listening > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Code Bulk
Why not just take that file and remove anything that isn't a function (so nothing actually executes) and then do something like: print microtime(); include "thatfile.php"; print microtime(); and see how long it took to parse 3000 lines... one more line isn't going to make that much difference. On Tue, 26 Mar 2002, Gerard Samuel wrote: > Actually, the file in question is 3000 lines long, 99% in functions. > Im trying to tell him that he may not see any speed ups in code execution. > As long as I know Im right, its just the peace of mind when I go to bed > tonight :) > > > Martin Towell wrote: > > any speed difference will be miniscule/negligible - is speed, to the > > microsecond, important in this situation? > > > > -Original Message- > > From: Gerard Samuel [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, March 27, 2002 11:23 AM > > To: PHP > > Subject: Code Bulk > > > > > > Im in a debate with someone else. > > Basically were debating code bulk. > > > > This is just an example -> > > > > > if (isset($run_this_code)) { > > echo $this->run_this_code; > > } > > echo 'Finished'; > > ?> > > > > Now, if I understand php correctly, the whole script gets parsed, but > > since $run_this code isn't set, $this->run_this_code doesn't get > > echoed/executed. What this other person is telling me that its more > > effiecient for *him* to have -> > > > > > echo 'Finished'; > > ?> > > > > instead. > > > > The script is a general purpose script. Its not built for one person. > > Some may use $run_this_code and some may not. So in taking out that bit > > of code, all it does is save the parser, what fraction of a fraction of > > a second?? > > Im just looking for ammunition so I could go and shoot this guy down... :) > > > > Thanks for listening > > > > > > > > -- > 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] Re: which php book 2 buy ?
Great photo :-} Any reviews on the book yet? Warren Vail Tools, Metrics & Quality Processes (415) 667-7814 Pager (877) 774-9891 215 Fremont 02-658 -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 3:29 PM To: Scott St. John Cc: Ralph Friedman; [EMAIL PROTECTED] Subject: Re: [PHP] Re: which php book 2 buy ? It is, the picture should prove that. On Tue, 26 Mar 2002, Scott St. John wrote: > I didn't think Programming PHP was out yet? > > > On Tue, 26 Mar 2002, Rasmus Lerdorf wrote: > > > Or, of course, if you want to be cool like Carl: > > > > http://lerdorf.com/buy/ > > > > ;) > > > > -Rasmus > > > > On Tue, 26 Mar 2002, Ralph Friedman wrote: > > > > > In article <[EMAIL PROTECTED]>, Septic Flesh wrote: > > > > I wanna buy a book from amazon . . .but don't know which one.. > > > > Do you know where I will find examples of shopping carts ? (which book ?) > > > > > > > > > > "Creating Dynamic Web Pages Using PHP and MySQL" by David Tansley. > > > > > > -- > > > Rgds > > > Ralph > > > > > > > > > > > > -- > > > 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]
Hi can anyone help me, I am getting this error when I try to start session: Warning: Cannot send session cookie - headers already sent by (output started at /var/www/kulchitski/btl/btl.php:2) in /var/www/kulchitski/btl/_talkroom_edit.php on line 39 I didn't start session before, in fact I never use session here except this step. Can anyone suggest anything? Thanks, Vlad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] rdf utf-8 to sql mysql latin1
Hi all, My purpose is to transform an rdf utf-8 file into sql for mysql. Data are both in french/english, in french there are stange caractere that doesnt render well (çèé...) What the output had to be ? Mysql only support latin1 ? I m lost in all that encodage ! Help me I dont know how to parametrer the php parser I make. // create parser $xp = xml_parser_create("UTF-8"); // set element handler xml_set_element_handler($xp, "elementBegin", "elementEnd"); xml_set_character_data_handler($xp, "characterData"); xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, TRUE); xml_parser_set_option($xp, XML_OPTION_SKIP_WHITE, TRUE); xml_parser_set_option($xp, XML_OPTION_TARGET_ENCODING, 'UTF-8'); Have I to decode / encode //if (!($xml = utf8_encode($xml))) { //echo 'ERROR'."\n"; //} Thanks for all. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [Session] (it seems to be a bug in PHP 4.1.2)
Just to clarify, that is a Windows-specific bug. Non-Windows works just fine. On Tue, 26 Mar 2002, Chris wrote: > On 26 Mar 2002 at 20:42, Evan wrote: > > I have PHP 4.1.2 (the latest, I downloaded it a week ago). > > PHP 4.1.2 has several bugs. > One of them is that Apache and sessions variables do not work. > > It is best not to upgrade to 4.1.2! > > see the bug report on session variables & following discussion and > suggestions to solve it > > http://bugs.php.net/bug.php?id=16102 > > > Chris > > -- > !please check my email address ! > !only my email [EMAIL PROTECTED] works ! > !email [EMAIL PROTECTED] is a black hole since januari 2002 ! > > Chris Hayes - Droef 35 - Wageningen > > > -- > 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]
That would mean that you have some type of output to the browser, i.e. blank line, or some text, before you are calling your session/cookie - Original Message - From: "Vlad Kulchitski" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 26, 2002 8:17 PM Subject: [PHP] Hi can anyone help me, I am getting this error when I try to start session: Warning: Cannot send session cookie - headers already sent by (output started at /var/www/kulchitski/btl/btl.php:2) in /var/www/kulchitski/btl/_talkroom_edit.php on line 39 I didn't start session before, in fact I never use session here except this step. Can anyone suggest anything? Thanks, Vlad -- 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] Re: Code Bulk
That is an excellent example. And just for the hell of it, Ill leave the lines that aren't in the function as is, just for the hell of it. Thanks. Philip Hallstrom wrote: > Why not just take that file and remove anything that isn't a function (so > nothing actually executes) and then do something like: > > print microtime(); > include "thatfile.php"; > print microtime(); > > and see how long it took to parse 3000 lines... one more line isn't going > to make that much difference. > > On Tue, 26 Mar 2002, Gerard Samuel wrote: > > >>Actually, the file in question is 3000 lines long, 99% in functions. >>Im trying to tell him that he may not see any speed ups in code execution. >>As long as I know Im right, its just the peace of mind when I go to bed >>tonight :) >> >> >>Martin Towell wrote: >> >>>any speed difference will be miniscule/negligible - is speed, to the >>>microsecond, important in this situation? >>> >>>-Original Message- >>>From: Gerard Samuel [mailto:[EMAIL PROTECTED]] >>>Sent: Wednesday, March 27, 2002 11:23 AM >>>To: PHP >>>Subject: Code Bulk >>> >>> >>>Im in a debate with someone else. >>>Basically were debating code bulk. >>> >>>This is just an example -> >>> >if (isset($run_this_code)) { >>> echo $this->run_this_code; >>>} >>>echo 'Finished'; >>>?> >>> >>>Now, if I understand php correctly, the whole script gets parsed, but >>>since $run_this code isn't set, $this->run_this_code doesn't get >>>echoed/executed. What this other person is telling me that its more >>>effiecient for *him* to have -> >>> >echo 'Finished'; >>>?> >>> >>>instead. >>> >>>The script is a general purpose script. Its not built for one person. >>>Some may use $run_this_code and some may not. So in taking out that bit >>>of code, all it does is save the parser, what fraction of a fraction of >>>a second?? >>>Im just looking for ammunition so I could go and shoot this guy down... :) >>> >>>Thanks for listening >>> >>> >> >> >> >>-- >>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]
On Tue, 26 Mar 2002, Vlad Kulchitski wrote: > Hi can anyone help me, I am getting this error when I try > to start session: > > Warning: Cannot send session cookie - headers already sent by (output > started at /var/www/kulchitski/btl/btl.php:2) in > /var/www/kulchitski/btl/_talkroom_edit.php on line 39 > > I didn't start session before, in fact I never use session here > except this step. Can anyone suggest anything? 1) Read the list and the archive. This comes up at least once per day, including on days when I know I saw you post to the list. 2) It means that you generated output prior to a session_register or session_start call. Make sure you don't print anything and don't have any space outside of http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Building Libraries
Hi All, This is my first participation in this group, so my question is I write a function in c, but I need use this function and more joined in a library make using the command ar rc alexlib.a x.o, but this procedure show a error when I use this in my browser, please anyone can help me. thanks example file x.c int function addvalue ( int *a ) { *a = *a + 1; return (a); } gcc -c x.c ar rc alexlib.a x.o php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP]
OK, hope you don't mind I follow up a question, and it will be up to you to answer or not, this is very general and important to me. My whole project main template is FILE.PHP, the content is changed based on the values sent via QUERY_STRING. SO: Below is the approximate outline: (basically the content is loaded from smaller scripts, but main does language switching, loading menu in appropriate language and so on. FILE.PHP _about.php _one.php _two.php So my question is, is it better to use separate .PHP file for every part of the page and load template design requirements (like 'header' and 'footer') via REQUIRE() so there's no conflict with sessions for instance? Because the code is already BIG: http://www.kulchitski.com/btl/source.php So anyway, for who are experienced the question goes, is it better to use separate file for every script? Or do like I do use one main and then include('content'php') based on the value passed in the string. With my current session problem I don't thnk I can overcome the problem with current design structure, I need to use different file for ADMIN because the template is already formed before it included the file with the script that tries to create a session. Anyway, this certainly makes it clearer - thank you guys. Vlad -Original Message- From: Miguel Cruz [mailto:[EMAIL PROTECTED]] Sent: 26 ÂÅÒÅÚÎÑ 2002 Ò. 20:41 To: Vlad Kulchitski Cc: [EMAIL PROTECTED] Subject: Re: [PHP] On Tue, 26 Mar 2002, Vlad Kulchitski wrote: > Hi can anyone help me, I am getting this error when I try > to start session: > > Warning: Cannot send session cookie - headers already sent by (output > started at /var/www/kulchitski/btl/btl.php:2) in > /var/www/kulchitski/btl/_talkroom_edit.php on line 39 > > I didn't start session before, in fact I never use session here > except this step. Can anyone suggest anything? 1) Read the list and the archive. This comes up at least once per day, including on days when I know I saw you post to the list. 2) It means that you generated output prior to a session_register or session_start call. Make sure you don't print anything and don't have any space outside of http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] design pattern
can anybody point me to tutorial, articles on implementing design patterns using PHP ?? __ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP]
I don't know if this helps, but you may find life becomes simpler if you keep all your session variables in one array. Then you can session_register that at the very top of your code and cover all bases at once. miguel On Tue, 26 Mar 2002, Vlad Kulchitski wrote: > OK, hope you don't mind I follow up a question, and it will be up to you to answer >or not, this is very general and important to me. > > My whole project main template is FILE.PHP, the content is changed based on the >values sent via QUERY_STRING. SO: > > Below is the approximate outline: (basically the content is loaded from smaller >scripts, but main does language switching, loading menu in appropriate language and >so on. > > FILE.PHP > _about.php > _one.php > _two.php > > So my question is, is it better to use separate .PHP file for every part of the page >and load template design requirements (like 'header' and 'footer') via REQUIRE() so >there's no conflict with sessions for instance? Because the code is already BIG: > > http://www.kulchitski.com/btl/source.php > > So anyway, for who are experienced the question goes, is it better to use separate >file for every script? Or do like I do use one main and then include('content'php') >based on the value passed in the string. > > With my current session problem I don't thnk I can overcome the problem with current >design structure, I need to use different file for ADMIN because the template is >already formed before it included the file with the script that tries to create a >session. > > Anyway, this certainly makes it clearer - thank you guys. > Vlad > > > -Original Message- > From: Miguel Cruz [mailto:[EMAIL PROTECTED]] > Sent: 26 ÂÅÒÅÚÎÑ 2002 Ò. 20:41 > To: Vlad Kulchitski > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] > > On Tue, 26 Mar 2002, Vlad Kulchitski wrote: > > Hi can anyone help me, I am getting this error when I try > > to start session: > > > > Warning: Cannot send session cookie - headers already sent by (output > > started at /var/www/kulchitski/btl/btl.php:2) in > > /var/www/kulchitski/btl/_talkroom_edit.php on line 39 > > > > I didn't start session before, in fact I never use session here > > except this step. Can anyone suggest anything? > > 1) Read the list and the archive. This comes up at least once per day, > including on days when I know I saw you post to the list. > > 2) It means that you generated output prior to a session_register or > session_start call. Make sure you don't print anything and don't have any > space outside of > 3) Read the list and the archive. This comes up at least once per day, > including on days when I know I saw you post to the list. > > 4) Read the list and the archive. This comes up at least once per day, > including on days when I know I saw you post to the list. > > miguel > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Any PHP equivalent of Macromedia ColdFusion's location tag?
Is there any PHP function that works like ColdFusion's location tag? After a certain execution, I wish to leave the current PHP page entirely and go to another page. Is this possible? I'm scouring the help stuff and am still digging for answers. Thanks.
RE: [PHP] Any PHP equivalent of Macromedia ColdFusion's location tag?
> Is there any PHP function that works like ColdFusion's location tag? > After a certain execution, I wish to leave the current PHP > page entirely and go to another page. Is this possible? That's a HTTP Header, so you want to use the ... Header() command. A Location header is what does the redirection. http://url.of.site/path/to/file.html";); ?> J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ID NUMBER HELP
Can someone help me with this. I'm trying to get ?id= set to the id number of the name in the database. I can get ?id="THE NAME" but I can't get it to pick up the id number. here is the code i"m trying: while($row = mysql_fetch_array($result)) { printf("%s\n", $PHP_SELF, $row["ID"], $row["Name"], $row["Name"]); } If I change the first $row["ID"] to $row["Name"] then ?id="Name here" but then when I try to extract the information from the database using: $result = mysql_query("SELECT * FROM Profiles WHERE id=$id", $dbcnx); $row = mysql_fetch_array($result); It won't work, but in the address bar if I manually change ?id=1 then the information will load fine. Can anyone help? Thanks. -Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ID NUMBER HELP
Try echo ''.row["name"].''; if $row["id"] still isn't shown, then you most likely aren't getting the right data from the database to the correct variable... -Original Message- From: Omland Christopher m [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 7:53 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: [PHP] ID NUMBER HELP Can someone help me with this. I'm trying to get ?id= set to the id number of the name in the database. I can get ?id="THE NAME" but I can't get it to pick up the id number. here is the code i"m trying: while($row = mysql_fetch_array($result)) { printf("%s\n", $PHP_SELF, $row["ID"], $row["Name"], $row["Name"]); } If I change the first $row["ID"] to $row["Name"] then ?id="Name here" but then when I try to extract the information from the database using: $result = mysql_query("SELECT * FROM Profiles WHERE id=$id", $dbcnx); $row = mysql_fetch_array($result); It won't work, but in the address bar if I manually change ?id=1 then the information will load fine. Can anyone help? Thanks. -Chris -- 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] Any PHP equivalent of Macromedia ColdFusion's location tag?
Hi, Thanks for the reply. I saw this as well in the mailing list archives, but everyone is saying you cannot output ANYTHING before calling header. Unfortunately, I'm calling this at the end of a process, so it won't work. It tells me I've already sent out header information. I've basically created a single PHP page with a form. When the form is submitted, it submits to itself. It checks if the form is submitted, and then goes to mail the contents to someone. After mailing, I want to go to a Thank You page. I want to get away from this PHP page, because I don't want a person refreshing the page and causing the PHP page to submit again. Thus, is there something else I can do? Or am I just not seeing this? Thanks, Stephen - Original Message - From: "James" <[EMAIL PROTECTED]> To: "webapprentice" <[EMAIL PROTECTED]> Sent: Tuesday, March 26, 2002 10:20 PM Subject: Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's location tag? > header("Location: http://www.google.com";); > replace that url with the page you want it to go to > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's locationtag?
So use a Javascript meta-refresh On Wed, 27 Mar 2002, webapprentice wrote: > Hi, > Thanks for the reply. I saw this as well in the mailing list archives, but > everyone is saying you cannot output ANYTHING before calling header. > > Unfortunately, I'm calling this at the end of a process, so it won't work. > It tells me I've already sent out header information. > > I've basically created a single PHP page with a form. When the form is > submitted, it submits to itself. It checks if the form is submitted, and > then goes to mail the contents to someone. After mailing, I want to go to a > Thank You page. I want to get away from this PHP page, because I don't want > a person refreshing the page and causing the PHP page to submit again. > > Thus, is there something else I can do? Or am I just not seeing this? > > Thanks, > Stephen > > > > > - Original Message - > From: "James" <[EMAIL PROTECTED]> > To: "webapprentice" <[EMAIL PROTECTED]> > Sent: Tuesday, March 26, 2002 10:20 PM > Subject: Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's location > tag? > > > > header("Location: http://www.google.com";); > > replace that url with the page you want it to go to > > > > > > > -- > 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] PDFlib error - pdf_color or pdf_setrgbcolor
Hi, I'm trying to fill a rectangle with color in a php generated PDF document. I get the following error: *Fatal error*: PDFlib error: illegal state 0x in */usr/local/apache/htdocs/EDR/generate_edr.php* on line *144* I have tried both of the following on line 144: pdf_setcolor($pdf, "both", "gray", 1); pdf_setrgbcolor($pdf,1,1,0); If I comment out the line to set color the PDF document gets generated correctly. I can't find any reference* *to this error on mailing lists or documentation. I'm using PHP Version 4.1.1 and PDFlib 4.0.1. Does anyone have any ideas, thanks. Wayne Bastow -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Code Bulk
GS> echo 'Finished'; ?>> I can do one better: ... ?>Finishedhttp://mrclay.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's location tag?
Hi Mr. Lerdorf, I look forward to you upcoming O'Reilly PHP book. =) Yes, a META tag refresh or Javascript control seems to be the only way left. Strange that URL redirection is so unusual to implement in PHP compared to ASP or Coldfusion (unless they do something klunky under the hood). Anyway, I also noticed that when the manual says you cannot output ANYTHING, I found out that if I close out all my spaces in the PHP page by tightening the php container tags, I will not output anything first. I forgot that even whitespace would be considered a web page and would generate http headers (since the PHP processor probably translates whitespace as echo/print statements). Thanks. --Stephen - Original Message - From: "Rasmus Lerdorf" <[EMAIL PROTECTED]> To: "webapprentice" <[EMAIL PROTECTED]> Cc: "James" <[EMAIL PROTECTED]>; "Jason Murray" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, March 27, 2002 12:01 AM Subject: Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's location tag? > So use a Javascript meta-refresh > > On Wed, 27 Mar 2002, webapprentice wrote: > > > Hi, > > Thanks for the reply. I saw this as well in the mailing list archives, but > > everyone is saying you cannot output ANYTHING before calling header. > > > > Unfortunately, I'm calling this at the end of a process, so it won't work. > > It tells me I've already sent out header information. > > > > I've basically created a single PHP page with a form. When the form is > > submitted, it submits to itself. It checks if the form is submitted, and > > then goes to mail the contents to someone. After mailing, I want to go to a > > Thank You page. I want to get away from this PHP page, because I don't want > > a person refreshing the page and causing the PHP page to submit again. > > > > Thus, is there something else I can do? Or am I just not seeing this? > > > > Thanks, > > Stephen > > > > > > > > > > - Original Message - > > From: "James" <[EMAIL PROTECTED]> > > To: "webapprentice" <[EMAIL PROTECTED]> > > Sent: Tuesday, March 26, 2002 10:20 PM > > Subject: Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's location > > tag? > > > > > > > header("Location: http://www.google.com";); > > > replace that url with the page you want it to go to > > > > > > > > > > > > -- > > 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] Any PHP equivalent of Macromedia ColdFusion's location tag?
Or, alter your page's structure so that it writes its output into a buffer, and echo/print it at the end of the page. That way you can do the redirect at any point it's needed within the page logic. Jason -- Jason Murray [EMAIL PROTECTED] Web Developer, Melbourne IT "Work now, freak later!" > -Original Message- > From: webapprentice [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 27, 2002 4:25 PM > To: Rasmus Lerdorf > Cc: James; Jason Murray; [EMAIL PROTECTED] > Subject: Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's > location tag? > > > Hi Mr. Lerdorf, > I look forward to you upcoming O'Reilly PHP book. =) > > Yes, a META tag refresh or Javascript control seems to be the > only way left. > Strange that URL redirection is so unusual to implement in > PHP compared to > ASP or Coldfusion (unless they do something klunky under the hood). > > Anyway, I also noticed that when the manual says you cannot > output ANYTHING, > I found out that if I close out all my spaces in the PHP page > by tightening > the php container tags, I will not output anything first. I > forgot that > even whitespace would be considered a web page and would generate http > headers (since the PHP processor probably translates whitespace as > echo/print statements). > > Thanks. > > --Stephen > > - Original Message - > From: "Rasmus Lerdorf" <[EMAIL PROTECTED]> > To: "webapprentice" <[EMAIL PROTECTED]> > Cc: "James" <[EMAIL PROTECTED]>; "Jason Murray" > <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Wednesday, March 27, 2002 12:01 AM > Subject: Re: [PHP] Any PHP equivalent of Macromedia > ColdFusion's location > tag? > > > > So use a Javascript meta-refresh > > > > On Wed, 27 Mar 2002, webapprentice wrote: > > > > > Hi, > > > Thanks for the reply. I saw this as well in the mailing > list archives, > but > > > everyone is saying you cannot output ANYTHING before > calling header. > > > > > > Unfortunately, I'm calling this at the end of a process, > so it won't > work. > > > It tells me I've already sent out header information. > > > > > > I've basically created a single PHP page with a form. > When the form is > > > submitted, it submits to itself. It checks if the form > is submitted, > and > > > then goes to mail the contents to someone. After > mailing, I want to go > to a > > > Thank You page. I want to get away from this PHP page, > because I don't > want > > > a person refreshing the page and causing the PHP page to > submit again. > > > > > > Thus, is there something else I can do? Or am I just not > seeing this? > > > > > > Thanks, > > > Stephen > > > > > > > > > > > > > > > - Original Message - > > > From: "James" <[EMAIL PROTECTED]> > > > To: "webapprentice" <[EMAIL PROTECTED]> > > > Sent: Tuesday, March 26, 2002 10:20 PM > > > Subject: Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's > location > > > tag? > > > > > > > > > > header("Location: http://www.google.com";); > > > > replace that url with the page you want it to go to > > > > > > > > > > > > > > > > > -- > > > 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] Any PHP equivalent of Macromedia ColdFusion's locationtag?
> Hi Mr. Lerdorf, > I look forward to you upcoming O'Reilly PHP book. =) > > Yes, a META tag refresh or Javascript control seems to be the only way left. > Strange that URL redirection is so unusual to implement in PHP compared to > ASP or Coldfusion (unless they do something klunky under the hood). They do. There is no magic here. If you want output on a page and also do a redirect, the only way to do it is with a javascript meta-refresh (well, you can do some tricks with frames as well, but I lump those tricks under Javascript redirects). I don't care what ASP of Cold Fusion tells you, if they allow you to send some data for the page and then redirect, then they are either doing a Javascript meta-refresh or simply tossing your data and doing a Location redirect. If you have no output, then you can use a Location redirect. What ASP and Cond Fusion might do is buffer your output and simply throw it away if you then at some point do a Location redirect. That seems kind of silly to me though. It seems like a mistake to me to just chuck away output data like that. You can do that with PHP as well by turning on output buffering. You can send all sorts of output after a Location redirect, but there will be no browser around to see it because it has already received the Location redirect and is off viewing the other page. > Anyway, I also noticed that when the manual says you cannot output ANYTHING, > I found out that if I close out all my spaces in the PHP page by tightening > the php container tags, I will not output anything first. I forgot that > even whitespace would be considered a web page and would generate http > headers (since the PHP processor probably translates whitespace as > echo/print statements). Yup, a space is as valid a character as any other. -Rasmus PS. One of the things with PHP is that we have never gone out of our way to hide the actual mechanics of HTTP very much from the users. I think it is important for people to actually understand what is going on. That's why we don't have a redirect() function but instead tell you to send an HTTP header called Location. Because that is what needs to happen under the covers. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's locationtag?
Seems like you're getting confused about output verses php code. Let's say you have a file called "form.php"... it submits to itself, checking the submitted data. if the form input is good, you want to do "stuff", then redirect them to a thanks page. if it isn't, you want to send them back to try again. Easy. form.php --- Thanks! --- So, obviously it needs massaging, and none of the code is tested, but it's the same way I do my forms. It'd be better if you told them where they went wrong on the form, and there are lots of ways to streamline the code and make it more modular, but this should be enough to give you an idea about how you can use the header(), and at what point you've sent "output" to the browser. Justin French Creative Director http://Indent.com.au -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to get user full name using PHP function?
Hi all, I'm writing a web mail. Having problem grabbing user full name to be included in the email. So I hv a few questions: 1) How do I fetch the user's full name using a PHP function WITHOUT calling system program finger? I already have the Linux user ID and password since I am using HTTP authentication. 2) How do I fetch it using finger? 3) Do I put the full name in the from->personal variable? Thanx Gaukia _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to get user full name using PHP function?
On Wednesday 27 March 2002 14:44, gaukia 345 wrote: > Hi all, > > I'm writing a web mail. Having problem grabbing user full name to be > included in the email. So I hv a few questions: > > 1) How do I fetch the user's full name using a PHP function WITHOUT calling > system program finger? I already have the Linux user ID and password since > I am using HTTP authentication. > > 2) How do I fetch it using finger? > > 3) Do I put the full name in the from->personal variable? Where did you want to get the user's full name from !?! Assuming the people using your webmail have system accounts on the machine running your webmail then you could try looking in /etc/passwd. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* politics, n.: A strife of interests masquerading as a contest of principles. The conduct of public affairs for private advantage. -- Ambrose Bierce */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Does this seem odd? File Upload Permissions
Why does PHP set the execute bit on an uploaded file? This means a user could upload a script and it would be executable. Ouch! Especially if the file is available via httpd after upload. . . HELP. I am saving to a directory with permissions of 766 And when php copies the file it assigns the following permissions. rwxr-xr-x I am using the copy command to move the file from the tmp directory. David McInnis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Does this seem odd? File Upload Permissions
The default file permission for new files on the *nix system may be set to something like 755... that could be the problem... -Original Message- From: David McInnis [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 11:03 PM To: [EMAIL PROTECTED] Subject: [PHP] Does this seem odd? File Upload Permissions Why does PHP set the execute bit on an uploaded file? This means a user could upload a script and it would be executable. Ouch! Especially if the file is available via httpd after upload. . . HELP. I am saving to a directory with permissions of 766 And when php copies the file it assigns the following permissions. rwxr-xr-x I am using the copy command to move the file from the tmp directory. David McInnis -- 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] Does this seem odd? File Upload Permissions
First, the execute bit means nothing over HTTP. So they couldn't just execute it remotely. They would need an account on the box. And second, PHP does not set the x bit, you are doing that. Check your default umask or set it explicitly with a call to umask() before copying the file into place. On Tue, 26 Mar 2002, David McInnis wrote: > Why does PHP set the execute bit on an uploaded file? This means a user > could upload a script and it would be executable. Ouch! Especially if > the file is available via httpd after upload. . . HELP. > > I am saving to a directory with permissions of 766 > > And when php copies the file it assigns the following permissions. > > rwxr-xr-x > > I am using the copy command to move the file from the tmp directory. > > David McInnis > > > > > -- > 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] Does this seem odd? File Upload Permissions
That's not entirely true... if php is running as cgi it would need the execution bit set. Or if someone wanted to write a shell script in php to be used to help compromise a server it would need to be executable as well... -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 11:08 PM To: David McInnis Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Does this seem odd? File Upload Permissions First, the execute bit means nothing over HTTP. So they couldn't just execute it remotely. They would need an account on the box. And second, PHP does not set the x bit, you are doing that. Check your default umask or set it explicitly with a call to umask() before copying the file into place. On Tue, 26 Mar 2002, David McInnis wrote: > Why does PHP set the execute bit on an uploaded file? This means a user > could upload a script and it would be executable. Ouch! Especially if > the file is available via httpd after upload. . . HELP. > > I am saving to a directory with permissions of 766 > > And when php copies the file it assigns the following permissions. > > rwxr-xr-x > > I am using the copy command to move the file from the tmp directory. > > David McInnis > > > > > -- > 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] Does this seem odd? File Upload Permissions
But it would mean that you would have to severly misconfigure your server and write severely braindead code. Simply putting a file in your document_root that has the x bit set will under normal circumstances not do anything. On Tue, 26 Mar 2002, Demitrious S. Kelly wrote: > That's not entirely true... if php is running as cgi it would need the > execution bit set. Or if someone wanted to write a shell script in php > to be used to help compromise a server it would need to be executable as > well... > > -Original Message- > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 26, 2002 11:08 PM > To: David McInnis > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Does this seem odd? File Upload Permissions > > First, the execute bit means nothing over HTTP. So they couldn't just > execute it remotely. They would need an account on the box. > > And second, PHP does not set the x bit, you are doing that. Check your > default umask or set it explicitly with a call to umask() before copying > the file into place. > > > On Tue, 26 Mar 2002, David McInnis wrote: > > > Why does PHP set the execute bit on an uploaded file? This means a > user > > could upload a script and it would be executable. Ouch! Especially > if > > the file is available via httpd after upload. . . HELP. > > > > I am saving to a directory with permissions of 766 > > > > And when php copies the file it assigns the following permissions. > > > > rwxr-xr-x > > > > I am using the copy command to move the file from the tmp directory. > > > > David McInnis > > > > > > > > > > -- > > 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] Does this seem odd? File Upload Permissions
Either severely mis-configure, or make a mistake (damn us humans and our mistakes :) -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 11:15 PM To: Demitrious S. Kelly Cc: 'David McInnis'; [EMAIL PROTECTED] Subject: RE: [PHP] Does this seem odd? File Upload Permissions But it would mean that you would have to severly misconfigure your server and write severely braindead code. Simply putting a file in your document_root that has the x bit set will under normal circumstances not do anything. On Tue, 26 Mar 2002, Demitrious S. Kelly wrote: > That's not entirely true... if php is running as cgi it would need the > execution bit set. Or if someone wanted to write a shell script in php > to be used to help compromise a server it would need to be executable as > well... > > -Original Message- > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 26, 2002 11:08 PM > To: David McInnis > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Does this seem odd? File Upload Permissions > > First, the execute bit means nothing over HTTP. So they couldn't just > execute it remotely. They would need an account on the box. > > And second, PHP does not set the x bit, you are doing that. Check your > default umask or set it explicitly with a call to umask() before copying > the file into place. > > > On Tue, 26 Mar 2002, David McInnis wrote: > > > Why does PHP set the execute bit on an uploaded file? This means a > user > > could upload a script and it would be executable. Ouch! Especially > if > > the file is available via httpd after upload. . . HELP. > > > > I am saving to a directory with permissions of 766 > > > > And when php copies the file it assigns the following permissions. > > > > rwxr-xr-x > > > > I am using the copy command to move the file from the tmp directory. > > > > David McInnis > > > > > > > > > > -- > > 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
Re: [PHP] How to get user full name using PHP function?
On Wed, 27 Mar 2002, gaukia 345 wrote: > I'm writing a web mail. Having problem grabbing user full name to be > included in the email. So I hv a few questions: > > 1) How do I fetch the user's full name using a PHP function WITHOUT > calling system program finger? I already have the Linux user ID and > password since I am using HTTP authentication. Check out the function posix_getpwnam(), in particular, the gecos field. This obviously only works if the user account is present on your web server. > 2) How do I fetch it using finger? I wouldn't if I were you. > 3) Do I put the full name in the from->personal variable? Difficult to say. What is the from->personal variable? miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Does this seem odd? File Upload Permissions
OK. But I am not changing the permissions. How am I setting the x bit? I am not doing anything in my code except executing a copy() or move_uploaded_file(). Is my server not configured correctly? If so, how do I change the default permissions? By the way, move_uploaded_file() sets completely different permissions [-rw---]than copy() [rwxr-xr-x]. I still say . . . "strange". David -Original Message- From: Demitrious S. Kelly [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 11:24 PM To: 'Rasmus Lerdorf' Cc: 'David McInnis'; [EMAIL PROTECTED] Subject: RE: [PHP] Does this seem odd? File Upload Permissions Either severely mis-configure, or make a mistake (damn us humans and our mistakes :) -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 11:15 PM To: Demitrious S. Kelly Cc: 'David McInnis'; [EMAIL PROTECTED] Subject: RE: [PHP] Does this seem odd? File Upload Permissions But it would mean that you would have to severly misconfigure your server and write severely braindead code. Simply putting a file in your document_root that has the x bit set will under normal circumstances not do anything. On Tue, 26 Mar 2002, Demitrious S. Kelly wrote: > That's not entirely true... if php is running as cgi it would need the > execution bit set. Or if someone wanted to write a shell script in php > to be used to help compromise a server it would need to be executable as > well... > > -Original Message- > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 26, 2002 11:08 PM > To: David McInnis > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Does this seem odd? File Upload Permissions > > First, the execute bit means nothing over HTTP. So they couldn't just > execute it remotely. They would need an account on the box. > > And second, PHP does not set the x bit, you are doing that. Check your > default umask or set it explicitly with a call to umask() before copying > the file into place. > > > On Tue, 26 Mar 2002, David McInnis wrote: > > > Why does PHP set the execute bit on an uploaded file? This means a > user > > could upload a script and it would be executable. Ouch! Especially > if > > the file is available via httpd after upload. . . HELP. > > > > I am saving to a directory with permissions of 766 > > > > And when php copies the file it assigns the following permissions. > > > > rwxr-xr-x > > > > I am using the copy command to move the file from the tmp directory. > > > > David McInnis > > > > > > > > > > -- > > 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] Getting QUALITY text on an image
Here's the situation. I run the website for a macintosh user folding@home team. We are providing certificates for users who have done a signifigant amount of work for the team. I have jpeg templates and I'm using ImageTTFBBox and ImageTTFText to write the username of the user on the certificate. Some of the more "artistic" mac users have noticed some pixelation on the text. I'm looking for a way to clean that up. Is there a way to use Postscript fonts with php? I looked at the ImageMagik php extension, and it looks like it is still quite early in development. I haven't used ImageMagik much, but would an exec() call to the real ImageMagick and then have php display what it does be a solution to this? (yes- I know exec() isn't as good as pure php but hey-) If you want to see it for yourself, look at the images produced by the usernames with links at http://macaddict4life.dhs.org/walloffame.php The source to the image generation is at http://macaddict4life.dhs.org/Certs/certificate.phps I'm currently using php 4.1.2 with GD-2 and FreeType 2 support (x86 Linux Apache DSO) -=-=-=-=-=-=-=-=- Different matter, is there a way to pass the username to the php script from a hyperlink w/o needing a ?name=blah in the link? It would be cool if the script could just end in .jpeg opposed to .jpeg?name=blah (in that directory apache handled .jpeg as if it was .php) Thanks for any suggestions! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Trans_sid
Is there any other way of enabling trans_sid besides when compiling php? Can I enable it in the php.ini file or .htaccess? And if so what would the syntax be? I've tried multiple things, but nothing seems to work.. If that's not possible is there a way of getting rid of the '?' in the url when people have cookies enabled? When cookies are not enabled the sid will follow the '?' in the url since currently all my links have at the end.. So for example: Please login As you can see there will always be the '?' at the end of login.htm.. When the surfer has cookies off it doesn¹t look bad, but when he has them enabled.. It just looks strange :) Thanks! Rick "A good head and good heart are always a formidable combination. But when you add to that a literate tongue or pen, then you have something very special" - Nelson Mandela -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting QUALITY text on an image
I can't imagine you'll ever get results that are to anyone's satisfaction using JPEGs unless they aren't wearing their glasses. How about PDF? miguel On Tue, 26 Mar 2002, Michael A. Peters wrote: > Here's the situation. > > I run the website for a macintosh user folding@home team. > > We are providing certificates for users who have done a signifigant amount > of work for the team. > > I have jpeg templates and I'm using ImageTTFBBox and ImageTTFText to write > the username of the user on the certificate. > > Some of the more "artistic" mac users have noticed some pixelation on the > text. > I'm looking for a way to clean that up. > > Is there a way to use Postscript fonts with php? > I looked at the ImageMagik php extension, and it looks like it is still > quite early in development. > > I haven't used ImageMagik much, but would an exec() call to the real > ImageMagick and then have php display what it does be a solution to this? > (yes- I know exec() isn't as good as pure php but hey-) > > If you want to see it for yourself, look at the images produced by the > usernames with links at http://macaddict4life.dhs.org/walloffame.php > > The source to the image generation is at > http://macaddict4life.dhs.org/Certs/certificate.phps > > I'm currently using php 4.1.2 with GD-2 and FreeType 2 support (x86 Linux > Apache DSO) > > -=-=-=-=-=-=-=-=- > Different matter, is there a way to pass the username to the php script > from a hyperlink w/o needing a ?name=blah in the link? > > It would be cool if the script could just end in .jpeg opposed to > .jpeg?name=blah > (in that directory apache handled .jpeg as if it was .php) > > Thanks for any suggestions! > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Loading Images
At 26.03.2002 14:44, you wrote: >I wasn't so much concearned about security of users grabbin pics. I am >more trying to learn how these people load there menus dynamically and >pics dynamically. Do you have any links to pages or code that describe how >to make a link in the db to pics on my filesystem? >Thanks. >-Chris I cannot help you with code,also it wouldn´t really help you understanding the problem but give you more problems understanding my code. I use to have a table with the following structure TABLE MENU rn // that´s an autoincrement number for indexing page // on which page the component will appear "foobar.php3" pt // path to the pic (depending of quantity of path) "../pix/" nop // the name of the pic "foo.jpg" altval // the word which will be shown in the alt tag of the pics reference "This is the foopic" link// where will the link go "newfoo.php" orm // a number to order the sf // showflag, to switch off unwanted/uncompleted pages For pathinformations, I use an includefile which is included on every page. This holds the informations about tablewidth, pathes(oops that´s correct?), sitenames and everything the Site needs on every page. Now you just make a select like select * from menu where page="$PHP_SELF" where sf=1 order by orm And make your menu. If you put the menu in an extra page (or an object) you just have to include it on every "content page" and the work is done. echo '' while($res=answer from db) { echo '' echo '' echo ' echo '' } echo '' As you said you want to make a menu, width & height of the pics are known. Otherwise you shoul check them using fuctions from the graphic library. The Browsers are faster if they know exactly what the do. Maybe this gives you some understanding how to do it. Oliver (sorry all trailing ; are missing. It´s early today) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Does this seem odd? File Upload Permissions
On Wednesday 27 March 2002 15:33, David McInnis wrote: > OK. But I am not changing the permissions. How am I setting the x bit? > I am not doing anything in my code except executing a copy() or > move_uploaded_file(). Is my server not configured correctly? If so, how > do I change the default permissions? > > By the way, move_uploaded_file() sets completely different permissions > [-rw---]than copy() [rwxr-xr-x]. I still say . . . "strange". Have a look at the umask() function. If that doesn't solve your problem you can always explicitly set the permissions after moving/copying using chmod(). -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* If you lived today as if it were your last, you'd buy up a box of rockets and fire them all off, wouldn't you? -- Garrison Keillor */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php