|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Tue Nov 12 2002 - 20:28:10 CST
php-general Digest 13 Nov 2002 02:28:10 -0000 Issue 1701
Topics (messages 124000 through 124134):
Re: internet marketing
124000 by: David Rice
124011 by: Edward Peloke
Re: flushing data as it's being generated
124001 by: arthur chen
fsockopen() to ssl port gets protocol error
124002 by: Brad Bulger
Re: Oracle 7 support
124003 by: . Edwin
124004 by: Maxim Maletsky
124005 by: Maxim Maletsky
124007 by: Chris Hewitt
124014 by: . Edwin
124022 by: Dan Field
newbie: help with date arithmetic
124006 by: ROBERT MCPEAK
124010 by: Ernest E Vogelsinger
Re: _POST & _GET
124008 by: Charles Wiltgen
Converting "Time()" to date
124009 by: Todd Cary
124013 by: Ernest E Vogelsinger
Re: newbie: help with date arithmetic[Scanned]
124012 by: Michael Egan
124016 by: ROBERT MCPEAK
redirecting a user to a page after a password popup
124015 by: John Meyer
Re: Would appreciate thoughts on session management
124017 by: Charles Wiltgen
124023 by: Pablo
124049 by: Charles Wiltgen
124054 by: Ford, Mike [LSS]
124059 by: Charles Wiltgen
124091 by: Justin French
124101 by: Charles Wiltgen
124127 by: Michael Sims
124133 by: Charles Wiltgen
progress bar for use with PHP uploads
124018 by: Kenn Murrah
124019 by: Ernest E Vogelsinger
124020 by: 1LT John W. Holmes
SQLyog 2.51 - the definitve FREE Windows front-end to MySQL
124021 by: Karam Chand
Drop down list with date
124024 by: Miguel Brás
124026 by: Jason Wong
124064 by: rija
ereg_replace();
124025 by: Gustaf Sjoberg
124029 by: Ernest E Vogelsinger
124035 by: Gustaf Sjoberg
124039 by: Ernest E Vogelsinger
124123 by: Gustaf Sjoberg
get the output from a program
124027 by: Greg
124028 by: Adam Williams
124030 by: Gustaf Sjoberg
124031 by: Adam Williams
124034 by: Greg
124040 by: Adam Williams
FileSize and file_exist failing a file that I am sure is there
124032 by: Brandon Orther
124033 by: Ernest E Vogelsinger
124038 by: Brandon Orther
Send Attachment using Php
124036 by: Pushpinder Sngh Garcha
124037 by: Manuel Lemos
124043 by: Chris Boget
Re: form question ???
124041 by: Jim Hatridge
small php engine
124042 by: Maximilian Eberl
Why $ on variable names?
124044 by: brucedickey
124045 by: Leif K-Brooks
124046 by: Chris Wesley
124047 by: Jason Wong
124048 by: Rasmus Lerdorf
124050 by: brucedickey
124052 by: Philip Hallstrom
124063 by: Jonathan Rosenberg \(Tabby's Place\)
124065 by: Marco Tabini
124067 by: Jonathan Rosenberg \(Tabby's Place\)
124068 by: Larry Rosenman
124070 by: Jonathan Rosenberg \(Tabby's Place\)
124071 by: Larry Rosenman
124072 by: Joel Boonstra
124074 by: Marco Tabini
124084 by: Ernest E Vogelsinger
124086 by: Ernest E Vogelsinger
124107 by: brucedickey
Re: Help w/ $_SESSION
124051 by: conbud
PHP, MySQL, and Japanese text
124053 by: Step Schwarz
124134 by: . Edwin
php/mysql not mutually connected
124055 by: Alberto Brea
register_globals off issues
124056 by: Mark Spohr
124061 by: Ernest E Vogelsinger
Generating MS Excel files with PHP
124057 by: [-^-!-%-
124058 by: 1LT John W. Holmes
124062 by: Manuel Lemos
RELEASE: phpDocumentor 1.1.0 FINAL
124060 by: Greg Beaver
Query problem
124066 by: Cesar Aracena
124069 by: BigDog
124079 by: Cesar Aracena
124081 by: rija
124083 by: Davy Obdam
124090 by: Ernest E Vogelsinger
124093 by: rija
PHP HTTP Forwarding / Port Translation
124073 by: Mike MacDonald
124087 by: Ernest E Vogelsinger
ldap strong authentication
124075 by: Karim Jafarmadar
124108 by: BigDog
124110 by: Karim Jafarmadar
124112 by: Ray Hunter
124114 by: Karim Jafarmadar
124115 by: BigDog
124119 by: Karim Jafarmadar
124120 by: BigDog
Error Message
124076 by: Ben C.
124077 by: Adam Williams
124080 by: Ben C.
124082 by: Kevin Stone
124088 by: Ernest E Vogelsinger
phpMyAdmin 2.2.6
124078 by: Iguider
Re: phpMyAdmin please help
124085 by: Iguider
Re: Mcrypt Under IIS 5 / Win32?
124089 by: Nick Richardson
124109 by: BigDog
Problem with sessions
124092 by: Charlie Fowler
124094 by: Ernest E Vogelsinger
124102 by: rija
File Upload problem
124095 by: Van Andel, Robert
124099 by: Ernest E Vogelsinger
124103 by: Van Andel, Robert
124128 by: Van Andel, Robert
Can you read a parsing PHP page's results
124096 by: Colin Kettenacker
124098 by: 1LT John W. Holmes
displaying a TIFF file
124097 by: Joseph Szobody
124100 by: Ernest E Vogelsinger
No PHP question, rather Apache config
124104 by: Ernest E Vogelsinger
Trying to e-mail password
124105 by: Ben C.
124106 by: Ernest E Vogelsinger
124117 by: rija
124124 by: Ben C.
124125 by: Nick Richardson
Solution: Re: [PHP] No PHP question, rather Apache config
124111 by: Ernest E Vogelsinger
Multiple selections
124113 by: Todd Cary
124116 by: Ernest E Vogelsinger
124118 by: Marco Tabini
124121 by: Todd Cary
124122 by: David Rice
jobs?
124126 by: arthur chen
constants and sessions
124129 by: Eduardo M. Bragatto
syntax question...
124130 by: Kelly Meeks
124131 by: bahwi
124132 by: . Edwin
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Here's a site that has a lot of interesting stuff.
http://www.selfpromotion.com/
On Tuesday, November 12, 2002, at 09:51 AM, Edward Peloke wrote:
> My php site is almost done so now I need to begin the task of getting
> it
> noticed online. Can anyone suggest some good books or sites where I
> can
> learn all the basics and tricks for marketing my site?
>
> Thanks,
> Eddie
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Thanks for the info David, that site looks great!
-----Original Message-----
From: David Rice [mailto:davidrice
rogers.com]
Sent: Tuesday, November 12, 2002 9:33 AM
To: php-general
lists.php.net
Subject: Re: [PHP] internet marketing
Here's a site that has a lot of interesting stuff.
http://www.selfpromotion.com/
On Tuesday, November 12, 2002, at 09:51 AM, Edward Peloke wrote:
> My php site is almost done so now I need to begin the task of getting
> it
> noticed online. Can anyone suggest some good books or sites where I
> can
> learn all the basics and tricks for marketing my site?
>
> Thanks,
> Eddie
>
>
> --
> 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
attached mail follows:
Thanks, that did the trick! Should've read the documentation on flush( ). =]
----- Original Message -----
From: "Jason Wong" <php-general
gremlins.com.hk>
Newsgroups: php.general
To: <php-general
lists.php.net>
Sent: Tuesday, November 12, 2002 6:18 AM
Subject: Re: [PHP] flushing data as it's being generated
> On Tuesday 12 November 2002 22:10, arch wrote: > > Hi.. > > > > I'm using php to pull data from a mysql table and output it to the browser. > > Pretty basic stuff. The problem is that the output is very slow, seen from > > the browser end, because the html output isn't displayed at all until all > > the data has been retrieved. Actually it's just the <table> part of the > > html that delays. Every <table> row corresponds to a row from the mysql > > table, and many rows are being displayed. > > > > However, I've seen php generated pages that display the data even as it's > > being pulled from the database. So the delay time isn't as hard to endure. > > > > I'm wondering if anyone knows what the trick is to output a large volume of > > html data from php in the second way. I've tried adding flush to the end of > > every iteration of the loop that's looping through the rows of data, but it > > doesn't help. > > Most browsers only start rendering tables when they see the </table> tag. One > solution is to split your single table into multiple tables each with, say 10 > rows. However one drawback using this method is that if you do not specify > the column widths then they can vary from table to table and it may look a > bit odd. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Objects are lost only because people look where they are not rather than > where they are. > */ >
attached mail follows:
i'm doing a POST to an https server using fsockopen(). after doing the writes, i do fread($fp, 4096) until feof($fp) returns true. this seems to work fine, except that i get an SSL protocol error on the last read.
can anybody with a better understanding of this give me an idea why that's happening? thanks
attached mail follows:
Hello,
First, let me just say that I'm no Oracle guru. :) But while we're waiting for them...
"Ford, Mike [LSS]" <M.Ford
lmu.ac.uk> wrote:
> > -----Original Message-----
> > From: Dan Field [mailto:danf
ceredigion.gov.uk]
> > Sent: 12 November 2002 13:39
...[snip]...
> > That is great news, thanks Mike. My second problem then lies with my > > current PHP Setup. I have been using the binary RPMs from RedHat up to > > now, which do not sem to have been compiled with the Oracle > > functionality included. If I recompile PHP, will I need the Oracle > > headers on the machine also? If so this could be a problem as > > the Oracle > > server I wish to use is not on the same machine as the webserver. > > Sorry, I can't help with this one as I'm not the administrator of our main Unix > server, and my test server is Windows so I used the pre-compiled binaries. > > But hopefully one of the Oracle gurus on this list will spring to your aid! >
*I think* you need to have Oracle installed even if you wouldn't really connect to it but instead connect to a different server. Since I installed Oracle with most of the Linux installations that I did, I haven't really tried enabling Oracle support in PHP without Oracle on the same server. In other words, I haven't really tried configuring --with-oci8 without supplying the path (e.g. --with-oci8=/path/to/oracle/ ).
PHP will look for the needed file when configuring so I don't think you can really get away without installing Oracle first. (Of course, you can just try to find out what files are needed, ask a friend to give you a copy, "trick" php that it exists, etc.--it might not work though...)
Anyway, if you need Oracle, try the OTN site. There's one that you can use for development.
- E
attached mail follows:
Your machine will need the Oracle headers which are included in Oracle Client. So, in two words - your machine needs Oracle client installed.
Try doing:
echo $ORACLE_HOME
in your command prompt
-- Maxim Maletsky maximphp.net
Dan Field <danf
ceredigion.gov.uk> wrote... :
> On Tue, 2002-11-12 at 13:03, Ford, Mike [LSS] wrote: > > > -----Original Message----- > > > From: Dan Field [mailto:danf
ceredigion.gov.uk] > > > Sent: 12 November 2002 12:18 > > > > > > Can anyone tell me if Oracle 7 is supported by PHP 4.2.2 ? > > > > Yes. > > > > > I have found functions specific to Oracle 8i and some more generic > > > functions (are these only for Oracle 9?). > > > > No -- the OCI8 functions are actually recommended for Oracle 7 upwards. The > > ora_* functions are older and do not use the newer OCI methodology. > > That is great news, thanks Mike. My second problem then lies with my > current PHP Setup. I have been using the binary RPMs from RedHat up to > now, which do not sem to have been compiled with the Oracle > functionality included. If I recompile PHP, will I need the Oracle > headers on the machine also? If so this could be a problem as the Oracle > server I wish to use is not on the same machine as the webserver. > > Cheers > > -- > Dan Field > Systems Development Officer - Social Services Dept. > Ceredigion County Council. > > > > ******************************************************************************** > Mae'r neges ebost hon, ynghyd ag unrhyw ffeiliau sydd ynghlwm wrthi, > yn gyfrinachol ac at ddefnydd yr unigolyn neu sefydliad y cyfeiriwyd hi ato. > Pe dderbynioch y neges hon mewn camgymeriad, byddwch > mor garedig a rhoi gwybod i'r rheolwr system. > > Mae'r nodyn hwn hefyd yn cadarnhau bod y neges ebost hon wedi > cael ei archwilio am bresenoldeb feirws cyfrifiadurol gan MIMEsweeper. > > ******************************************************************************** > This email and any files transmitted with it are confidential and > intended solely for the use of the individual or entity to whom they > are addressed. If you have received this email in error please notify > the system manager. > > This footnote also confirms that this email message has been swept by > MIMEsweeper for the presence of computer viruses. > > ******************************************************************************** > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Well, I will spread some light - I maintain OCI8 extension :)
Your machine does not need Oracle Server installed, it needs Oracle Client installed. These are two completely different things.
So, try this in your command prompt:
echo $ORACLE_HOME
if you get a result, means the client is there and you can recompile php --with-oci8=$ORACLE_HOME
That will compile the OCI8 extension with all the required headers.
Cheers,
-- Maxim Maletsky maximphp.net
"
Edwin" <copperwalls
hotmail.com> wrote... :
> Hello, > > First, let me just say that I'm no Oracle guru. :) But while we're waiting > for them... > > "Ford, Mike [LSS]" <M.Ford
lmu.ac.uk> wrote: > > > > -----Original Message----- > > > From: Dan Field [mailto:danf
ceredigion.gov.uk] > > > Sent: 12 November 2002 13:39 > > ...[snip]... > > > > That is great news, thanks Mike. My second problem then lies with my > > > current PHP Setup. I have been using the binary RPMs from RedHat up to > > > now, which do not sem to have been compiled with the Oracle > > > functionality included. If I recompile PHP, will I need the Oracle > > > headers on the machine also? If so this could be a problem as > > > the Oracle > > > server I wish to use is not on the same machine as the webserver. > > > > Sorry, I can't help with this one as I'm not the administrator of our main > Unix > > server, and my test server is Windows so I used the pre-compiled binaries. > > > > But hopefully one of the Oracle gurus on this list will spring to your > aid! > > > > *I think* you need to have Oracle installed even if you wouldn't really > connect to it but instead connect to a different server. Since I installed > Oracle with most of the Linux installations that I did, I haven't really > tried enabling Oracle support in PHP without Oracle on the same server. In > other words, I haven't really tried configuring --with-oci8 without > supplying the path (e.g. --with-oci8=/path/to/oracle/ ). > > PHP will look for the needed file when configuring so I don't think you can > really get away without installing Oracle first. (Of course, you can just > try to find out what files are needed, ask a friend to give you a copy, > "trick" php that it exists, etc.--it might not work though...) > > Anyway, if you need Oracle, try the OTN site. There's one that you can use > for development. > > - E > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Dan Field wrote:
>functionality included. If I recompile PHP, will I need the Oracle >headers on the machine also? If so this could be a problem as the Oracle >server I wish to use is not on the same machine as the webserver. > Seems lots of us have not actually tried doing it without Oracle installed! To connect to a database you will need the networking code and specifically the tnsnames.ora file. Check for this. I think it unlikely to come with php since it is proprietry code. Its only the Oracle client installation you would need (not server) and only the networking code.
HTH Chris
attached mail follows:
"Maxim Maletsky" <maxim
php.net> wrote:
> > Well, I will spread some light - I maintain OCI8 extension :) > > Your machine does not need Oracle Server installed, it needs Oracle > Client installed. These are two completely different things. > > So, try this in your command prompt: > > echo $ORACLE_HOME > > if you get a result, means the client is there and you can recompile php > --with-oci8=$ORACLE_HOME > > That will compile the OCI8 extension with all the required headers. >
Now, that make sense :)
Thanks!
- E
attached mail follows:
> First, let me just say that I'm no Oracle guru. :) But while we're waiting > for them...
Thanks, all help appreciated :)
> *I think* you need to have Oracle installed even if you wouldn't really > connect to it but instead connect to a different server. Since I installed > Oracle with most of the Linux installations that I did, I haven't really > tried enabling Oracle support in PHP without Oracle on the same server. In > other words, I haven't really tried configuring --with-oci8 without > supplying the path (e.g. --with-oci8=/path/to/oracle/ ).
It certainly looks that way.
> PHP will look for the needed file when configuring so I don't think you can > really get away without installing Oracle first. (Of course, you can just > try to find out what files are needed, ask a friend to give you a copy, > "trick" php that it exists, etc.--it might not work though...)
Yes this is right too. I greabed the SRC RPM for PHP 4.2.2 and edited the spec file to include --with-oci8 but it now throws the following errors:
checking for Oracle-OCI8 support... yes, shared checking Oracle Install-Dir... checking Oracle version... configure: error: Oracle-OCI8 needed libraries not found error: Bad exit status from /var/tmp/rpm-tmp.47391 (%build)
> Anyway, if you need Oracle, try the OTN site. There's one that you can use > for development.
Luckally I had downloaded the Oracle-Linux (Version 8i) installer a few weeks ago incase this problem arised. but the installer is currently taking 98% of my CPU with the Java Runtime and it doesn't seem to be doing a lot else (not even a GUI window yet ..... 20 minutes later). I fear this is too OT for the list though.
If anyone does know if I can "trick" PHP by just copying some files from the Oracle-Linux.tar then this would be a great help though.
Thanks all for your support.
-- Dan Field Systems Development Officer - Social Services Dept. Ceredigion County Council.******************************************************************************** Mae'r neges ebost hon, ynghyd ag unrhyw ffeiliau sydd ynghlwm wrthi, yn gyfrinachol ac at ddefnydd yr unigolyn neu sefydliad y cyfeiriwyd hi ato. Pe dderbynioch y neges hon mewn camgymeriad, byddwch mor garedig a rhoi gwybod i'r rheolwr system.
Mae'r nodyn hwn hefyd yn cadarnhau bod y neges ebost hon wedi cael ei archwilio am bresenoldeb feirws cyfrifiadurol gan MIMEsweeper.
******************************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager.
This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses.
********************************************************************************
attached mail follows:
I'm trying to add/subract two dates. I think I need to use mktime() but I can't quite figure out how.
I'd like to do something like this:
(2002-11-15)-(2002-11-10)=5
or
(2002-12-10)-(2002-11-10)=20
Obviously taking into account number of days in a given month.
Does somebody have some code handy that does this? Any help would be greatly appreciated!
Thanks.
attached mail follows:
At 16:30 12.11.2002, ROBERT MCPEAK spoke out and said: --------------------[snip]-------------------- >I'm trying to add/subract two dates. I think I need to use mktime() but I >can't quite figure out how. > >I'd like to do something like this: > >(2002-11-15)-(2002-11-10)=5 > >or > >(2002-12-10)-(2002-11-10)=20 > >Obviously taking into account number of days in a given month. --------------------[snip]--------------------
:)) rtfm, again :))
1) http://www.php.net/manual/en/function.strtotime.php 2) http://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html
3) your second equation would return 30, not 20 ;-> 4) try this:
/* untested */ function days($str_from, $str_to) { $from = strtotime(isset($str_from) ? $str_from : 'now'); $to = strtotime(isset($str_to) ? $str_to : 'now'); if ($from > $to) { $x = $from; $from = $to; $to = $x; } $rslt = $to - $from; // number in seconds return (int)($rslt / 86400); // return days (1d = 86400 secs) } Hope this helps,
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
Ernest E Vogelsinger wrote...
> Sorry for the long post, but I believe it is important to have a look at the > relevant standards from time to time.
Very informative, thanks!
-- Charles Wiltgen
attached mail follows:
I have an array of months (monthList) that I use for a drop-down. I would like to initialize the month to "ThisMonth" using "time()". What is the best way to get "November"? from "time()"?
Todd
-- Ariste Software, Petaluma, CA 94952
attached mail follows:
At 16:46 12.11.2002, Todd Cary spoke out and said: --------------------[snip]-------------------- >I have an array of months (monthList) that I use for a drop-down. I >would like to initialize the month to "ThisMonth" using "time()". What >is the best way to get "November"? from "time()"? --------------------[snip]--------------------
:)) rtfm, again and again :))
1) http://www.php.net/manual/en/function.date.php 2) try this:
date('F', time());
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
Robert,
I've been looking at this myself over the past couple of days.
I gather the best approach is to convert your dates into UNIX timestamps.
For example:
$first_unix_time = mktime($hour1, $minutes1, $seconds1, $month1, $day1, $year1);
$second_unix_time = mktime($hour2, $minutes2, $seconds2, $month2, $day2, $year2);
Subtract the one from the other to give the difference:
$difference = $first_unix_time - $second_unix_time;
The result will be in seconds so you'll need to convert this depending on the format you require.
For example, to convert the difference to years you might do:
$years = floor($difference / (365 * 24 * 60 * 60));
Hope this helps,
Michael Egan
-----Original Message-----
From: ROBERT MCPEAK [mailto:RMCPEAK
jhuccp.org]
Sent: 12 November 2002 15:31
To: php-general
lists.php.net
Subject: [PHP] newbie: help with date arithmetic[Scanned]
I'm trying to add/subract two dates. I think I need to use mktime() but I can't quite figure out how.
I'd like to do something like this:
(2002-11-15)-(2002-11-10)=5
or
(2002-12-10)-(2002-11-10)=20
Obviously taking into account number of days in a given month.
Does somebody have some code handy that does this? Any help would be greatly appreciated!
Thanks.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
This is a great help. Thanks ya'll. And.... I will continue to, and do regulary RTFM 8-) I find that it generally sucks for a newbie.
>>> "Michael Egan" <MEgan
3tc.org.uk> 11/12/02 10:42AM >>>
Robert,
I've been looking at this myself over the past couple of days.
I gather the best approach is to convert your dates into UNIX timestamps.
For example:
$first_unix_time = mktime($hour1, $minutes1, $seconds1, $month1, $day1, $year1);
$second_unix_time = mktime($hour2, $minutes2, $seconds2, $month2, $day2, $year2);
Subtract the one from the other to give the difference:
$difference = $first_unix_time - $second_unix_time;
The result will be in seconds so you'll need to convert this depending on the format you require.
For example, to convert the difference to years you might do:
$years = floor($difference / (365 * 24 * 60 * 60));
Hope this helps,
Michael Egan
-----Original Message-----
From: ROBERT MCPEAK [mailto:RMCPEAK
jhuccp.org]
Sent: 12 November 2002 15:31
To: php-general
lists.php.net
Subject: [PHP] newbie: help with date arithmetic[Scanned]
I'm trying to add/subract two dates. I think I need to use mktime() but I can't quite figure out how.
I'd like to do something like this:
(2002-11-15)-(2002-11-10)=5
or
(2002-12-10)-(2002-11-10)=20
Obviously taking into account number of days in a given month.
Does somebody have some code handy that does this? Any help would be greatly appreciated!
Thanks.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi, I'm generating a 401 header for a few pages, and if they click cancel, I want to send them to a 401 page. How do I do this? I've tried a header after those headers, but that just redirects them automatically.
attached mail follows:
Justin,
Many thanks for the reply. I didn't provide enough detail in some spots, and I'll attempt to clarify.
> Seems to me like this would generate a lot of extra server traffic, and a > little confusion... The only benefit I can see is that you're getting rid of > ugly page URLs.
User experience is very important to me. I'm creating a tool for other people, and as far as I'm concerned my users "own" the URL that the user sees and bookmarks.
> So, your URLs will actually look like > http://www.site.com/article.php?PHPSESSID=12413523245546453
No problem, since the user will never see this and other session properties using this Invisible Get method even with cookies disabled. (Even it it turns out that I still need to pass the session ID to the "user URL" for people with locked cookie jars, that's okay.)
> Nothing I can see in your code/idea changes the fact that EACH INSTANCE OF A > SCRIPT NEEDS TO MAINTAIN STATE (carry the session around).
That's fine. You and Ernest convinced me that it was silly to try and reinvest the wheel. Now I'm only concerned with the wheel experience.
> 2. bookmarking/linking/etc... essentially what you're saying is that one > URL, page.php, will do many different things (like present many different > articles), based on session information... this doesn't sound to good to me...
Yuck, yeah...what I have in mind is not that evil. :^P The page will be basically the same, but the objects on it need to retain their state during a session.
For example, let's say I have 50 "spinner" objects on a page. All spinners have a value that must be persistent, plus buttons/links that increment and decrement. Those buttons/links call "submit.php" to pass changes to persistent variables back to itself.
> You *may* want to consider the apache mod_rewrite stuff.
The article was very interesting and I may use it for some other stuff, but I need to call submit.php to put the objects properties into my session globals.
> Just one last note... PHP sessions, by default, store the session variables > in files transparently (ie, you don't have to do much), NOT a database. So, > writing a script that requires sessions will NOT require MySQL.
Thanks for the clarification. Yesterday was my first experience with PHP sessions, and I didn't quite get it.
> Just look at amazon, yahoo, msn, or any other big site... they just pass the > sid around in URLs, and people deal with it. Learn from the "best".
The best is not good enough! :O) They shouldn't keep transient session information in the URL.
If the only drawback to Invisible Get is the (unnoticeable) serving of the tiny interim page, I think this could be a really good solution.
-- Charles Wiltgen
attached mail follows:
On 11/12/02 10:15 AM, Charles Wiltgen (lists
wiltgen.net) wrote:
>> So, your URLs will actually look like >> http://www.site.com/article.php?PHPSESSID=12413523245546453 > > No problem, since the user will never see this and other session properties > using this Invisible Get method even with cookies disabled.
Your method assumes something about your users: that they click on links. This may be unlikely, but what if a user uses the 'copy URL to clipboard' (or equivalent) feature of their browser? It could be pasted into an e-mail, posted to a newsgroup, etc.
While 'Invisible Gets' may handle the general case, they do not entirely solve the problem.
Pablo
attached mail follows:
Pablo wrote...
> Your method assumes something about your users: that they click on links. > This may be unlikely, but what if a user uses the 'copy URL to clipboard' > (or equivalent) feature of their browser? It could be pasted into an e-mail, > posted to a newsgroup, etc.
Exactly -- this is the problem that's solved by using my Invisible Get method. With this method, the URL doesn't get filled with session object properties which aren't useful (or wanted) outside of the current session.
-- Charles Wiltgen
attached mail follows:
> -----Original Message-----
> From: Charles Wiltgen [mailto:lists
wiltgen.net]
> Sent: 12 November 2002 18:48
>
> > Your method assumes something about your users: that they
> click on links.
> > This may be unlikely, but what if a user uses the 'copy URL
> to clipboard'
> > (or equivalent) feature of their browser? It could be
> pasted into an e-mail,
> > posted to a newsgroup, etc.
>
> Exactly -- this is the problem that's solved by using my Invisible Get
> method. With this method, the URL doesn't get filled with
> session object
> properties which aren't useful (or wanted) outside of the
> current session.
I've been staying out of this discussion as I've been sure there was something I was missing, but this comment I really don't understand -- if you use PHP's built-in sessions, all that gets into the URL (maybe, if cookies are disabled) is the session ID -- *everything* else is kept server-side and keyed off that ID. You've got to propagate the ID *somehow* -- with cookies if the user allows that, but otherwise by putting it in the URL; how does your "invisible Get" prevent that?
Yours confused...
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
Ford, Mike [LSS] wrote...
> I've been staying out of this discussion as I've been sure there was something > I was missing, but this comment I really don't understand -- if you use PHP's > built-in sessions, all that gets into the URL (maybe, if cookies are disabled) > is the session ID -- *everything* else is kept server-side and keyed off that > ID.
By the time the page appears, PHP is done. So for any changes that happen after the page loads, you need a way to get that back into PHP.
The "Invisible Get" method allows you to use GET variables for this without filling the URL with effluvia (like temporary object properties) that you wouldn't want bookmarked.
For example, take my "spinner object" example. By using Invisible Get, after clicking on the "increment spinner" button the user sees
rather than
<http://www.getsome.com/submit.php?spinnerValue=38>
And, as far as I can tell, there are really no drawbacks other than having to serve a tiny, unnoticeable interstitial page. I'm trying to figure out if there's a way I can generate even that on the fly with JavaScript, but I don't know anything about JavaScript.
-- Charles Wiltgen
attached mail follows:
Well, you seem so sure it will work, so give it a go... I can't see how, but am totally willing to learn!
Have you got any info on invisible gets?
Justin French -------------------- Creative Director http://Indent.com.au Web Developent & Graphic Design --------------------
attached mail follows:
Justin French wrote...
> Well, you seem so sure it will work, so give it a go... I can't see how, but > am totally willing to learn! > > Have you got any info on invisible gets?
It's simple, which is one thing I like about it. My submit.php looks like this:
<?php session_start(); header('Location: ' . $_REQUEST['target']);
reset ($_REQUEST); while (list ($key, $value) = each ($_REQUEST)) { switch ($key) { case "target": break; case "PHPSESSID": break; default: $_SESSION[$key] = $value; break; } }
echo " "; // NN4 requires that we output something... exit(); ?>
Then to send a new value for a variable, I just have link that looks like <http://www.domain.com/submit.php?variable=3>.
-- Charles Wiltgen
attached mail follows:
On Tue, 12 Nov 2002 15:55:52 -0800, you wrote:
>It's simple, which is one thing I like about it. My submit.php looks like >this: > > <?php > session_start(); > header('Location: ' . $_REQUEST['target']); [snip]
I'm curious...your redirect doesn't include the session ID, so how you maintain session information for people who don't have cookies enabled? It's always been my experience that trans sid doesn't append the SID to header redirects. You have to do it manually (I use the SID constant for this purpose).
Of course, the above would work for clients that send the appropriate cookie, but if you're using cookies anyway why go to all this trouble?
I apologize if I'm not understanding what you're trying to accomplish...
attached mail follows:
Michael Sims wrote...
> It's always been my experience that trans sid doesn't append the SID to header > redirects. You have to do it manually (I use the SID constant for this > purpose).
When I test on a browser with cookies disabled, I imagine I'll find that I have to do that. That's okay, though.
> Of course, the above would work for clients that send the appropriate cookie, > but if you're using cookies anyway why go to all this trouble?
Because (for example) you can't have a button on your page that adjusts a property (represented as a PHP session variable) of some object on a page. Instead, you have to use GET variables, PUT variables or cookies to pass data to the next page.
GET variables seem to be the best choice for non-form items. The problem with GET variables is that, normally, you see them in the address bar. This is user-unfriendly, allows people to bookmark URLs that won't work outside of their session, etc. Today alone, 3 out of 4 URLs that people IM'd me didn't work, because they were filled with session-specific properties.
<http://www.getsome.com/?spinnerValue=38>
My Invisible GET method avoids all of this.
-- Charles Wiltgen
attached mail follows:
Greetings ....
Can anyone point me in the direction of a Javascript code snippet that would display a progress bar for a PHP upload? I'm sure it can be done that way, but honestly, I lack the Javascript skills to make it happen ....
Any and all help would be appreciated.
Thanks.
Kenn
attached mail follows:
At 17:27 12.11.2002, Kenn Murrah spoke out and said: --------------------[snip]-------------------- >Can anyone point me in the direction of a Javascript code snippet that would >display a progress bar for a PHP upload? I'm sure it can be done that way, >but honestly, I lack the Javascript skills to make it happen .... --------------------[snip]--------------------
If I understood you correctly you want to accomplish something like
a) you have a file upload form b) user clicks "upload", and a progress meter is displayed c) when the upload is done, the progress meter will be at 100% and vanish or tell "finished" or something like that
I'm afraid this cannot be done very easily. What you'd need to know at the moment the user clicks on "upload" would be the actual filesize, and the average transmission speed so you can estimate the pace to go from 0 to 100. And, you need both values at the client's, a server side script is not yet active at this time.
I'd suggest to take the easy road (seen on a couple of other sites)... Create an animated gif with a progress bar constantly scrolling. In your form's "onSubmit()" method (at the client's side!), do a window.open() with the appropriate parameters to generate a small window without any controls, sized sufficiently to just contain this gif.
The URL of this popup would be a PHP script (with the same session ID of the uploader) which would basically do this:
if (!$_SESSION['popup_opened']) { $_SESSION['popup_opened'] = true; send_popup_html(); } elseif (!$_SESSION['xmit_done']) header('HTTP/1.0 204 No Content'); else send_close_html();
send_popup_html would add a header to refresh the popup: header('Refresh: 1; URL=http://'.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']?SID);
send_close_html would simply send html like <body onload='window.close();'>
I hope you get the idea... Basically the crucial stuff is the refresh header for the popup url that causes the client to _try_ to refresh every second. As long as the transfer is not finished, the popup script simply replies with "204 No Content", so the browser would change nothing with the popup. When the upload is eventually finished, the refresh request succeeds, but the only stuff the client receives is a javascript closing the popup...
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
There's no way to know the percentage of the file that's uploaded, so you can't have a true progress indicator. You could just use a little popup that shows a 'wait, we're doing something' graphic that the following page closes when it loads.
---John Holmes...
----- Original Message -----
From: "Kenn Murrah" <kennmurrah
nomoire.com>
To: "php list" <php-general
lists.php.net>
Sent: Tuesday, November 12, 2002 11:27 AM
Subject: [PHP] progress bar for use with PHP uploads
Greetings ....
Can anyone point me in the direction of a Javascript code snippet that would display a progress bar for a PHP upload? I'm sure it can be done that way, but honestly, I lack the Javascript skills to make it happen ....
Any and all help would be appreciated.
Thanks.
Kenn
attached mail follows:
Greetings....
SQLyog v2.51. The definitive Windows Front End for MySQL. SQLyog is FREE!
Some of the new features added in SQLyog 2.51 are -
-- Alter Table structure in an easy to use Grid mode. -- Optimized for speed and network resources. -- Insert / Update data in a table. -- Insert / Update BLOB data. All popular formats supported (BMP/PNG/GIF/JPG). -- Save your BLOB data in a file. -- Very fast client side sorting / filtering. -- Create / Edit Users. -- Manage permissions for Database / Table / Column. -- View information for Database / Table. -- Export database schema in HTML. -- Execute very large ( size limited by OS ) SQL batch files. -- Export data in Fixed Width format. -- View all queries executed in history log. -- Various operations on tables. -- Backup / Restore databases and tables. -- Improved Export functionality. -- Improved Import functionality. -- Improved SQL Editor. -- Show / Hide Result Pane. -- Lot of bug fixes. -- And many more...
You can download the new SQLyog at http://www.webyog.com/sqlyog/download.html
Thanks for your attention.
Rgds Karam
__________________________________________________ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2
attached mail follows:
Hello guys,
I have a question:
How can I create a drop down menu where the choices are the days of the month, displaying always the next 7 days?
What I mean is, create a drop down menu and show the today's date, next day, and next...
Example: Today is 12th, then the menu shows the following option to be choosen 12/11/02 13/11/02 14/11/02 15/11/02 16/11/02 17/11/02 18/11/02
Tomorrow 13th will display 13/11/02 14/11/02 15/11/02 16/11/02 17/11/02 18/11/02 19/11/02
and so on...
Thx Regards Miguel
attached mail follows:
On Wednesday 13 November 2002 01:15, Miguel Brás wrote: > Hello guys, > > I have a question: > > How can I create a drop down menu where the choices are the days of the > month, displaying always the next 7 days? > > What I mean is, create a drop down menu and show the today's date, next > day, and next... > > Example: Today is 12th, then the menu shows the following option to be > choosen > 12/11/02 > 13/11/02 > 14/11/02 > 15/11/02 > 16/11/02 > 17/11/02 > 18/11/02
You'll need to use some combination of time() & strftime(), and whilst not strictly necessary but highly recommended strtotime().
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* I bought some used paint. It was in the shape of a house. -- Steven Wright */
attached mail follows:
Try this one: echo "<select>" ;
for ($d=0 ; $d <7 ; $d++) echo "<option onchange=\"javascript:document.location.href='link'\">".date("d/m/y", strtotime("+$d day"))."\n " ; echo "</option> </select>" ;
----- Original Message -----
From: "Miguel Brás" <molino26
netcabo.pt>
To: <php-general
lists.php.net>
Sent: Wednesday, November 13, 2002 4:15 AM
Subject: [PHP] Drop down list with date
> Hello guys, > > I have a question: > > How can I create a drop down menu where the choices are the days of the > month, displaying always the next 7 days? > > What I mean is, create a drop down menu and show the today's date, next day, > and next... > > Example: Today is 12th, then the menu shows the following option to be > choosen > 12/11/02 > 13/11/02 > 14/11/02 > 15/11/02 > 16/11/02 > 17/11/02 > 18/11/02 > > Tomorrow 13th will display > 13/11/02 > 14/11/02 > 15/11/02 > 16/11/02 > 17/11/02 > 18/11/02 > 19/11/02 > > and so on... > > Thx > Regards > Miguel > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Hi, i'm trying to replace every instance of "<br>" within the "<pre>..</pre>" tags. i want all other breakrows to remain the same.
i've tried numerous regular expressions, but i can't find a way to just replace the breakrows.. it replaces _everything_ bewteen <pre> and </pre>.
example $string:
test<br> test<br> test<br> <pre> testing<br> testing<br> </pre> test<br> test<br>
i want that to look like:
test<br> test<br> test<br> <pre> testing testing </pre> test<br> test<br>
-- Gustaf Sjoberg <gsvacfu.org> <(" <) <(" )> <( ")> (> ")>
attached mail follows:
At 17:49 12.11.2002, Gustaf Sjoberg spoke out and said: --------------------[snip]-------------------- >Hi, >i'm trying to replace every instance of "<br>" within the "<pre>..</pre>" >tags. i want all other breakrows to remain the same. > >i've tried numerous regular expressions, but i can't find a way to just >replace the breakrows.. it replaces _everything_ bewteen <pre> and </pre>. --------------------[snip]--------------------
You need a two-phase operation on this:
1) isolate all <pre></pre> elements preg_match('/(.*?)<pre>(.*?)<\/pre>(.*)/is', $string, $armatch);
$armatch now contains: [0] all, ignore this [1] everything before <pre> [2] everything within <pre></pre> [3] the rest after </pre>
2) go on and replace all <br>'s here: preg_replace('/<br>\n?/is', "\n", $armatch[2]);
The whole stuff would look something like
/* UNTESTED */ function kill_br_within_pre($string) { $re1 = '/(.*?)<pre>(.*?)<\/pre>(.*)/is'; $re2 = '/<br>\n?/is'; $result = null;
while ($string) { $armatch = preg_match($re1, $string, $arMatch); if (is_array($arMatch)) { $result .= $arMatch[1]; $result .= preg_replace($re2, "\n", $arMatch[2]); $string = $arMatch[3]; } else break; } $result .= $string; return $result; }
This assumes that all <pre> are properly closed with </pre>. As said, I didn't test, but it should work this or a similar way.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
many thanks, and kudos for the quick reply. i will try that right away!
as a sub-question, do you mind telling me where you learned regexp? i've been searching google all day with no luck, i've just find more or less basic regexp guides. did you learn through practice or do you have a secret source? ;-)
On Tue, 12 Nov 2002 18:35:55 +0100
ernest
vogelsinger.at (Ernest E Vogelsinger) wrote:
>At 17:49 12.11.2002, Gustaf Sjoberg spoke out and said: >--------------------[snip]-------------------- >>Hi, >>i'm trying to replace every instance of "<br>" within the "<pre>..</pre>" >>tags. i want all other breakrows to remain the same. >> >>i've tried numerous regular expressions, but i can't find a way to just >>replace the breakrows.. it replaces _everything_ bewteen <pre> and </pre>. >--------------------[snip]-------------------- > >You need a two-phase operation on this: > >1) isolate all <pre></pre> elements > preg_match('/(.*?)<pre>(.*?)<\/pre>(.*)/is', $string, $armatch); > >$armatch now contains: > [0] all, ignore this > [1] everything before <pre> > [2] everything within <pre></pre> > [3] the rest after </pre> > >2) go on and replace all <br>'s here: > preg_replace('/<br>\n?/is', "\n", $armatch[2]); > >The whole stuff would look something like > >/* UNTESTED */ >function kill_br_within_pre($string) >{ > $re1 = '/(.*?)<pre>(.*?)<\/pre>(.*)/is'; > $re2 = '/<br>\n?/is'; > $result = null; > > while ($string) { > $armatch = preg_match($re1, $string, $arMatch); > if (is_array($arMatch)) { > $result .= $arMatch[1]; > $result .= preg_replace($re2, "\n", $arMatch[2]); > $string = $arMatch[3]; > } > else break; > } > $result .= $string; > return $result; >} > >This assumes that all <pre> are properly closed with </pre>. As said, I >didn't test, but it should work this or a similar way. > > >-- > >O Ernest E. Vogelsinger > (\) ICQ #13394035 > ^ http://www.vogelsinger.at/ >
-- Gustaf Sjoberg <gsvacfu.org> <(" <) <(" )> <( ")> (> ")>
attached mail follows:
At 18:44 12.11.2002, Gustaf Sjoberg spoke out and said: --------------------[snip]-------------------- >many thanks, and kudos for the quick reply. i will try that right away! > >as a sub-question, do you mind telling me where you learned regexp? i've >been searching google all day with no luck, i've just find more or less >basic regexp guides. did you learn through practice or do you have a secret >source? ;-) --------------------[snip]--------------------
This stems from my old Perl days - I recommend reading the "Camel Book" :)
Refer to http://www.perldoc.com/perl5.6/pod/perlre.html and eat this page - you'll be a RegEx whiz in seconds (naahh - it takes a bit longer ;->)
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
hi, i tried to implement the code, but it does not work if the string:
a) doesnt contain any <pre>..</pre> b) doesnt contain any <pre> c) doesnt contain any </pre> d) contains multiple <pre>..</pre>'s
so i altered it a little and this is what i came up with:
<? function remove_br_in_pre($string) { unset($result); if (!preg_match('/(.*?<pre>)(.*?)(<\/pre>)(.*)/is', $string)) { if (!preg_match('/<pre>/is', $string)) return $string; else $string .= "</pre>"; } while ($string) { preg_match('/(.*?<pre>)(.*?)(<\/pre>)(.*)/is', $string, $arMatch); if (is_array($arMatch)) { $result .= $arMatch[1]; $result .= str_replace('<br>','',$arMatch[2]); $result .= $arMatch[3]; if (!preg_match('/<pre>/is', $arMatch[4])) { $result .= $arMatch[4]; return $result; } $string = $arMatch[4]; } else break; } } //test string $param = "test<br>test<br><pre><br>testing<br>testing<br></pre>test<br>test<br>test<pre>test<br>test</pre>testing<br>test"; echo remove_br_in_pre($param); ?>
now, i've tried it in a few different scenarios and it seems to be working, although the function might be redundant and far from pretty - it gets the job done. however, i have a question; what does the "is" in //is denote? ;-) (doesnt it feel great to have code sniplets you have no idea what they do in your scripts? ;-))
also, do you see any direct "bugs slash features" in the current function? i'm not usually asking someone who spends his freetime helping others "baby sit" my code, but this was my first day using regular expressions so i've been taking a few sure shots.. so it would be great if you could just take a quick glance at it.
thanks in anticipation, GS
On Tue, 12 Nov 2002 18:57:04 +0100
ernest
vogelsinger.at (Ernest E Vogelsinger) wrote:
>At 18:44 12.11.2002, Gustaf Sjoberg spoke out and said: >--------------------[snip]-------------------- >>many thanks, and kudos for the quick reply. i will try that right away! >> >>as a sub-question, do you mind telling me where you learned regexp? i've >>been searching google all day with no luck, i've just find more or less >>basic regexp guides. did you learn through practice or do you have a secret >>source? ;-) >--------------------[snip]-------------------- > >This stems from my old Perl days - I recommend reading the "Camel Book" :) > >Refer to http://www.perldoc.com/perl5.6/pod/perlre.html and eat this page - >you'll be a RegEx whiz in seconds (naahh - it takes a bit longer ;->) > > >-- > >O Ernest E. Vogelsinger > (\) ICQ #13394035 > ^ http://www.vogelsinger.at/ >
-- Gustaf Sjoberg <gsvacfu.org> <(" <) <(" )> <( ")> (> ")>
attached mail follows:
Hi- Is there a way in PHP to execute a program and then have it pass its output back to PHP? Say I wanted to return the value that running "df" produced and put it in a web page? Thanks!! -Greg
attached mail follows:
look up exec()
Adam
On Tue, 12 Nov 2002, Greg wrote:
> Hi- > Is there a way in PHP to execute a program and then have it pass its output > back to PHP? Say I wanted to return the value that running "df" produced > and put it in a web page? Thanks!! > -Greg > > > >
attached mail follows:
this is just a shot in the dark, beware. but i think you could make use of the system() function and pass the output to a file.
ex. system('df > ~/public_html/output.tmp');
but i've never tried the function, try to search php.net functions for system
On Tue, 12 Nov 2002 12:33:09 -0500
gregchagnon
hotmail.com (Greg) wrote:
>Hi- >Is there a way in PHP to execute a program and then have it pass its output >back to PHP? Say I wanted to return the value that running "df" produced >and put it in a web page? Thanks!! >-Greg > >
-- Gustaf Sjoberg <gsvacfu.org> <(" <) <(" )> <( ")> (> ")>
attached mail follows:
actually, look up system() I think it would be better in your case.
Adam
On Tue, 12 Nov 2002, Greg wrote:
> Hi- > Is there a way in PHP to execute a program and then have it pass its output > back to PHP? Say I wanted to return the value that running "df" produced > and put it in a web page? Thanks!! > -Greg > > > >
attached mail follows:
exec() worked jsut fine. Is there any drawback to using this? -Greg
"Adam Williams" <awilliam
mdah.state.ms.us> wrote in message
news:Pine.LNX.4.33L2.0211121138370.5968-100000
roark.mdah.state.ms.us...
> actually, look up system() I think it would be better in your case.
>
> Adam
>
> On Tue, 12 Nov 2002, Greg wrote:
>
> > Hi-
> > Is there a way in PHP to execute a program and then have it pass its
output
> > back to PHP? Say I wanted to return the value that running "df"
produced
> > and put it in a web page? Thanks!!
> > -Greg
> >
> >
> >
> >
>
attached mail follows:
No if it works use it, but if you choose to go with system() you will need to pass the command through escapeshellcmd() as a security precaution.
Adam
On Tue, 12 Nov 2002, Greg wrote:
> exec() worked jsut fine. Is there any drawback to using this?
> -Greg
>
> "Adam Williams" <awilliam
mdah.state.ms.us> wrote in message
> news:Pine.LNX.4.33L2.0211121138370.5968-100000
roark.mdah.state.ms.us...
> > actually, look up system() I think it would be better in your case.
> >
> > Adam
> >
> > On Tue, 12 Nov 2002, Greg wrote:
> >
> > > Hi-
> > > Is there a way in PHP to execute a program and then have it pass its
> output
> > > back to PHP? Say I wanted to return the value that running "df"
> produced
> > > and put it in a web page? Thanks!!
> > > -Greg
> > >
> > >
> > >
> > >
> >
>
>
>
>
attached mail follows:
Hello,
When try to get a file_exist response I get the following error:
Warning: stat failed for /home/admin/2002-11-12-Part1.mp3
(errno=2 - No such file or directory) in
<b>/home/admin/hsReleaser.php</b> on line <b>20</b><br>
But I am rather sure that the file does exist. If I open
/home/admin/2002-11-12-Part1.mp3 it does exist.
--------------------------------------------
Brandon Orther
WebIntellects Design/Development Manager
brandon
webintellects.com 800-994-6364
www.webintellects.com <http://www.webintellects.com/>
--------------------------------------------
attached mail follows:
At 17:27 12.11.2002, Brandon Orther spoke out and said: --------------------[snip]-------------------- >When try to get a file_exist response I get the following error: > >Warning: stat failed for /home/admin/2002-11-12-Part1.mp3 > (errno=2 - No such file or directory) in ><b>/home/admin/hsReleaser.php</b> on line <b>20</b><br> > >But I am rather sure that the file does exist. If I open >/home/admin/2002-11-12-Part1.mp3 it does exist. --------------------[snip]--------------------
Maybe the open_basedir limitation is in effect, and /home/admin is outside the allowed base directory?
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
Hello,
Open_basedir is not set in the php.ini and I can rename the files
without an issue using the rename function.
--------------------------------------------
Brandon Orther
WebIntellects Design/Development Manager
brandon
webintellects.com 800-994-6364
www.webintellects.com <http://www.webintellects.com/>
--------------------------------------------
-----Original Message-----
From: Ernest E Vogelsinger [mailto:ernest
vogelsinger.at]
Sent: Tuesday, November 12, 2002 9:42 AM
To: Brandon Orther
Cc: PHP User Group
Subject: Re: [PHP] FileSize and file_exist failing a file that I am sure
is there
At 17:27 12.11.2002, Brandon Orther spoke out and said:
--------------------[snip]--------------------
>When try to get a file_exist response I get the following error:
>
>Warning: stat failed for /home/admin/2002-11-12-Part1.mp3
> (errno=2 - No such file or directory) in
><b>/home/admin/hsReleaser.php</b> on line <b>20</b><br>
>
>But I am rather sure that the file does exist. If I open
>/home/admin/2002-11-12-Part1.mp3 it does exist.
--------------------[snip]--------------------
Maybe the open_basedir limitation is in effect, and /home/admin is outside the allowed base directory?
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
Hi All
I have tried to use phpmailer() to send mail with attachments but it did not werk for me. Can anyone suggest some utility to send mail with attachment.
Thanks --Pushpinder
Pushpinder Singh Garcha _________________________________ Web Developer
attached mail follows:
Hello,
On 11/12/2002 03:50 PM, Pushpinder Sngh Garcha wrote: > Hi All > > I have tried to use phpmailer() to send mail with attachments but it did > not werk for me. > Can anyone suggest some utility to send mail with attachment.
You may want to try this class instead. If you still have trouble, just mail me back:
http://www.phpclasses.org/mimemessage
--Regards, Manuel Lemos
attached mail follows:
> I have tried to use phpmailer() to send mail with attachments but it > did not werk for me. > Can anyone suggest some utility to send mail with attachment.
I've been using Richard Heyes' mail class for quite some time with great success. You can find it here:
http://www.phpclasses.org/browse.html/package/32.html
Chris
attached mail follows:
HI Mike et al,,,
That was it! Thanks. Don't know how I missed that.... <G> So next question! How can I tell my program that I want only postive numbers inputed? ie no letters or neg numbers.
Thanks
JIM
On Monday 11 November 2002 19:57, Ford, Mike [LSS] wrote:
> > -----Original Message-----
> > From: Jim Hatridge [mailto:hatridge
fecundswamp.net]
> > Sent: 11 November 2002 16:27
> >
> > looking at the code below. It works and I get what I want on
> > the screen. BUT
> > it leaves a gap between the top lines and where the table
> > starts equal to the
> > size of the table, ie if the table is 5 lines long the gap is
> > 5 lines etc.
> >
> > Any ideas what I'm doing wrong?
>
> [snip]
>
> > printf(" <td>%s</td><td>%s</td><BR></tr>",
>
> Yes -- that <BR> between the </td> and the </tr> is most likely the
> culprit. Most browsers of my experience tend to render *any* content that
> is not correctly positioned within "container" tags above the table.
>
> Cheers!
>
> Mike
>
> ---------------------------------------------------------------------
> Mike Ford, Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS, LS6 3QS, United Kingdom
> Email: m.ford
lmu.ac.uk
> Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--
Vielfeind -- Viel Ehr'
Antiamerikanische Propaganda in der Philatelie des 20. Jahrhunderts
http:/www.fecundswamp.net/~hatridge/stamps/index.html
attached mail follows:
Hi list,
has anyone ever experimented to "melt down" the php engine to a few hundred KBs ? By leaving out not needed libraries/functions ?
What i am searching for is a very small webserver (exists) and a very small php-engine through which the webserver can process php-scripts.
We want to use it for demos. We are developing dynamic files, but to create demos and send them to the client as as zipped HTML we always have to rewrite things in html-hardcode or a type of javascript-mimikry
if we had a php-engine of about 500 kB, a webserver of 200 kB and 100 kB scripts & images, we could pack a whole, self-executing dynamic webpage demo into an e-Mail-attachement of 800 kB.
We don't want to send a full Apache and MySQL and PHP engine binaries of about 25 megs via e-Mail. Or Oracle ..
Has anyone ever done something like this ?
Max
attached mail follows:
I've searched, but haven't found the answer -- from a language design point of view, why are there $ on the front of PHP variable names?
Thanks,
Bruce
attached mail follows:
I'm just guessing here. For one thing, to seperate variables from constants. Also, it makes it possible to use variables within quotes.
brucedickey wrote:
>I've searched, but haven't found the answer -- from a language design point >of view, why are there $ on the front of PHP variable names? > >Thanks, > >Bruce > > >
-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
attached mail follows:
On Tue, 12 Nov 2002, brucedickey wrote:
> I've searched, but haven't found the answer -- from a language design point > of view, why are there $ on the front of PHP variable names?
... so Perl converts know where there variables are ;)
~Chris
attached mail follows:
On Wednesday 13 November 2002 02:35, Leif K-Brooks wrote: > I'm just guessing here. For one thing, to seperate variables from > constants. Also, it makes it possible to use variables within quotes.
Yup. So you can have:
print "I'm a $variable";
instead of the messy javascript way:
alert("I'm a " . $variable);
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Aleph-null bottles of beer on the wall, Aleph-null bottles of beer, You take one down, and pass it around, Aleph-null bottles of beer on the wall. */
attached mail follows:
So you can put variables inside quoted strings. Without $ how would this work?
price = 9.95; echo "The price is price";
It also means you can have variables that are the same name as function names.
-Rasmus
On Tue, 12 Nov 2002, brucedickey wrote:
> I've searched, but haven't found the answer -- from a language design point > of view, why are there $ on the front of PHP variable names? > > Thanks, > > Bruce > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Thanks for all the replies.
I just seemed to me that to add $ everywhere was more work (and not as aesthetic as a plain word) than using some other syntax for print. But, in fact, it could have been designed so you could still use
print "I'm a $variable";
without the use of $ in other uses of the variable (like in assignments and references to it), right? Rhetorical question.
(Just an initial impression of PHP)...
Bruce
-----Original Message-----
From: Jason Wong [mailto:php-general
gremlins.com.hk]
Sent: Tuesday, November 12, 2002 11:40 AM
To: php-general
lists.php.net
Subject: Re: [PHP] Why $ on variable names?
On Wednesday 13 November 2002 02:35, Leif K-Brooks wrote: > I'm just guessing here. For one thing, to seperate variables from > constants. Also, it makes it possible to use variables within quotes.
Yup. So you can have:
print "I'm a $variable";
instead of the messy javascript way:
alert("I'm a " . $variable);
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Aleph-null bottles of beer on the wall, Aleph-null bottles of beer, You take one down, and pass it around, Aleph-null bottles of beer on the wall. */
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
It could have, but what does "array" consist of below?
variable = "foo"; array[variable] = variable;
Is it "variable" => "variable", or "foo" => "foo" or "variable" => "foo" or ? By using $ you keep things simpler... at least to me :)
-philip
On Tue, 12 Nov 2002, brucedickey wrote:
> Thanks for all the replies.
>
> I just seemed to me that to add $ everywhere was more work (and not as
> aesthetic as a plain word) than using some other syntax for print. But, in
> fact, it could have been designed so you could still use
>
> print "I'm a $variable";
>
> without the use of $ in other uses of the variable (like in assignments and
> references to it), right? Rhetorical question.
>
> (Just an initial impression of PHP)...
>
> Bruce
>
>
> -----Original Message-----
> From: Jason Wong [mailto:php-general
gremlins.com.hk]
> Sent: Tuesday, November 12, 2002 11:40 AM
> To: php-general
lists.php.net
> Subject: Re: Why $ on variable names?
>
>
> On Wednesday 13 November 2002 02:35, Leif K-Brooks wrote:
> > I'm just guessing here. For one thing, to seperate variables from
> > constants. Also, it makes it possible to use variables within quotes.
>
> Yup. So you can have:
>
> print "I'm a $variable";
>
> instead of the messy javascript way:
>
> alert("I'm a " . $variable);
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Aleph-null bottles of beer on the wall,
> Aleph-null bottles of beer,
> You take one down, and pass it around,
> Aleph-null bottles of beer on the wall.
> */
>
>
> --
> 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
>
attached mail follows:
In an earlier message, Jason Wong [mailto:php-general
gremlins.com.hk] said
...
> Yup. So you can have:
> print "I'm a $variable";
> instead of the messy javascript way:
> alert("I'm a " . $variable);
But the language could still support variable evaluation within strings without requiring the '$' to always appear in front of a variable name.
So, a '$' within a string would mean "treat the following identifier as a variable to be evaluated". I believe that this introduces no inconsistencies & removes the ugly $s that litter PHP programs.
-- JR
attached mail follows:
If I can venture a comment, what you think "clutters" the code others may find a quick and easy way to identify a variable in it.
Just a thought.
Marco
-- ------------ php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmersCome visit us at http://www.phparch.com!
attached mail follows:
In an earlier message, Jason Wong [mailto:php-general
gremlins.com.hk] said
...
> Yup. So you can have:
> print "I'm a $variable";
> instead of the messy javascript way:
> alert("I'm a " . $variable);
But the language could still support variable evaluation within strings without requiring the '$' to always appear in front of a variable name.
So, a '$' within a string would mean "treat the following identifier as a variable to be evaluated". I believe that this introduces no inconsistencies & removes the ugly $s that litter PHP programs.
-- JR-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
In an earlier message, Marco Tabini [mailto:marcot
inicode.com] saidf ...
> If I can venture a comment, what you think > "clutters" the code others may find a quick and > easy way to identify a variable in it.
I guess this could be true. But I don't understand why someone would need an "easy" way to identify variables? Why not an easy way to identify function names? Or constants?
In any case, I don't recall anyone complaining that they had trouble "identifying variables" in C, C++, Modula, Pascal, Java, etc.
> Marco
-- JR
attached mail follows:
How about:
That's the way the language designers did it, and there's LOTS of PRODUCTION code out there that uses it.
See also the precedence of PERL.
LER
--On Tuesday, November 12, 2002 16:40:46 -0500 "Jonathan Rosenberg (Tabby's
Place)" <jr
tabbysplace.org> wrote:
> In an earlier message, Marco Tabini [mailto:marcot
inicode.com] saidf ...
>
>> If I can venture a comment, what you think
>> "clutters" the code others may find a quick and
>> easy way to identify a variable in it.
>
> I guess this could be true. But I don't understand why someone would need
> an "easy" way to identify variables? Why not an easy way to identify
> function names? Or constants?
>
> In any case, I don't recall anyone complaining that they had trouble
> "identifying variables" in C, C++, Modula, Pascal, Java, etc.
>
>> Marco
>
> --
> JR
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
-- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 972-414-9812 E-Mail: lerlerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
attached mail follows:
In an earlier message, Larry Rosenman [mailto:ler
lerctr.org] said ...
> How about:
> That's the way the language designers did it, and > there's LOTS of PRODUCTION code out there that uses it.
Because "that's the way it is"? Well, that's good enough for me. I'll never question anything else again & I trust you won't, either.
> See also the precedence of PERL.
Huh? What does the "precedence of PERL" mean?
> LER
-- JR
attached mail follows:
--On Tuesday, November 12, 2002 16:53:07 -0500 "Jonathan Rosenberg (Tabby's
Place)" <jr
tabbysplace.org> wrote:
> In an earlier message, Larry Rosenman [mailto:ler
lerctr.org] said ...
>
>> How about:
>
>> That's the way the language designers did it, and
>> there's LOTS of PRODUCTION code out there that uses it.
>
> Because "that's the way it is"? Well, that's good enough for me. I'll
> never question anything else again & I trust you won't, either.
You can't change the language at this date, and still call it PHP. There
is a LOT
of PHP code out there. I can question, but expecting it to change is not
realistic.
> >> See also the precedence of PERL. > > Huh? What does the "precedence of PERL" mean? PERL has all it's variables (scalar at any rate) prefixed with Dollar Signs.
> >> LER > > -- > JR >
-- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 972-414-9812 E-Mail: lerlerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
attached mail follows:
> That's the way the language designers did it, and there's LOTS of > PRODUCTION code out > there that uses it. > > See also the precedence of PERL.
Well, perl and PHP use the $ for slightly different reasons, it seems.
In perl, the *thing* in front of a variable name ($,
, %) indicates
what context the variable is being used in (scalar, list, hash).
Depending on what you want your variable to do, using a different
character makes all the difference. The leading character is not a part
of the variable name.
PHP seems to use the $ more for readability, and possibly for making the language easier to parse (and, of course, the aforementioned string-embedding). Since all variable types (scalars, arrays, objects) seem to use the $, it seems more for syntactic uses and less as something that changes how the object behaves.
However, I like having it there. It (as someone else mentioned) helps me quickly see where variables are used, both in and out of strings. It also probably helps syntax-highlighting text editors read the code more quickly, although it may be just as easy without.
All I know is when I think back to programming C++, I can't imagine how I could deal with variables that didn't have something in front of them to separate them from barewords.
Oh well.
-- [ joel boonstra | jboonstragospelcom.net ]
attached mail follows:
It's a design decision that works well for me too. I don't see it as a particular waste, considering that there are other wastes I'd like to get rid of. PHP is a maturing language and there is (imho) still a lot of ground to cover.
BTW, it's not a matter of "questioning"... as far as I'm concerned it'a matter of "considering" what the consequences of any change that is made to the software are. Consider the amount of damage that turning register_globals off has made--all you have to do is counting the e-mails the list gets every day; I counted up to ten in a day--and you'll see that changing the dollar sign convention, a much more pervasive convention, can be a disaster.
Marco
-- ------------ php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmersCome visit us at http://www.phparch.com!
attached mail follows:
> That's the way the language designers did it, and there's LOTS of > PRODUCTION code out > there that uses it. > > See also the precedence of PERL.
Well, perl and PHP use the $ for slightly different reasons, it seems.
In perl, the *thing* in front of a variable name ($,
, %) indicates
what context the variable is being used in (scalar, list, hash).
Depending on what you want your variable to do, using a different
character makes all the difference. The leading character is not a part
of the variable name.
PHP seems to use the $ more for readability, and possibly for making the language easier to parse (and, of course, the aforementioned string-embedding). Since all variable types (scalars, arrays, objects) seem to use the $, it seems more for syntactic uses and less as something that changes how the object behaves.
However, I like having it there. It (as someone else mentioned) helps me quickly see where variables are used, both in and out of strings. It also probably helps syntax-highlighting text editors read the code more quickly, although it may be just as easy without.
All I know is when I think back to programming C++, I can't imagine how I could deal with variables that didn't have something in front of them to separate them from barewords.
Oh well.
-- [ joel boonstra | jboonstragospelcom.net ]
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
At 22:40 12.11.2002, Jonathan Rosenberg \(Tabby's Place\) said: --------------------[snip]-------------------- >I guess this could be true. But I don't understand why someone would need >an "easy" way to identify variables? Why not an easy way to identify >function names? Or constants? > >In any case, I don't recall anyone complaining that they had trouble >"identifying variables" in C, C++, Modula, Pascal, Java, etc. --------------------[snip]--------------------
Quite right. But, having developed a couple of interpreters myself, I assume there's some sound reason.
Think of how an interpreter works. It parses the sourcecode in realtime, not as a compiler. People must _wait_, every time, until it is finished, not only once like a compiler. Thus designers of interpreted languages like something that can easily be distinguished, so you don't need to lookup a lot of hash tables to identify a symbol, or to resolve amiguities.
That's why the '$' preceds a variable name. Simply said, when the parser sees a '$', it knows which symbol table to look it up. If a token doesn't have a '$', it can be found in the table of keywords of the language's state machine.
Easy explanation, huh? Simple example: taken that a PHP application consists of 1000 tokens, 200 of the tokens are variable names, and 800 non-variable tokens, the interpreter would either 200 times look up the wrong symbol table (if it chooses to lookup the keywords first), or 800 times (if it looks up the entity table first).
Simply saves time...
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
At 22:56 12.11.2002, Joel Boonstra said: --------------------[snip]-------------------- >All I know is when I think back to programming C++, I can't imagine how >I could deal with variables that didn't have something in front of them >to separate them from barewords. --------------------[snip]--------------------
esp. in C++ you usually tend to use your own prefixes - something like 'm_' for member variables, '_' for statics or locals, etc. It even goes further using the hungarian notation (which I'm a great fan of).
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
Yeah, I wondered about that. Having heard that C was designed in part for the parser. A parser with no lookahead (or maybe 1 char of lookahead) was used, which is why hex numbers start with "0x" instead of being suffixed with "_16", just to contrive an example.
I would be curious to hear the author say whether this played a part in his decision.
Bruce
-----Original Message-----
From: Ernest E Vogelsinger [mailto:ernest
vogelsinger.at]
Sent: Tuesday, November 12, 2002 3:54 PM
To: Jonathan Rosenberg (Tabby's Place)
Cc: Marco Tabini; Jonathan Rosenberg (Tabby's Place); PHP-General
Subject: RE: [PHP] Why $ on variable names?
At 22:40 12.11.2002, Jonathan Rosenberg \(Tabby's Place\) said: --------------------[snip]-------------------- >I guess this could be true. But I don't understand why someone would need >an "easy" way to identify variables? Why not an easy way to identify >function names? Or constants? > >In any case, I don't recall anyone complaining that they had trouble >"identifying variables" in C, C++, Modula, Pascal, Java, etc. --------------------[snip]--------------------
Quite right. But, having developed a couple of interpreters myself, I assume there's some sound reason.
Think of how an interpreter works. It parses the sourcecode in realtime, not as a compiler. People must _wait_, every time, until it is finished, not only once like a compiler. Thus designers of interpreted languages like something that can easily be distinguished, so you don't need to lookup a lot of hash tables to identify a symbol, or to resolve amiguities.
That's why the '$' preceds a variable name. Simply said, when the parser sees a '$', it knows which symbol table to look it up. If a token doesn't have a '$', it can be found in the table of keywords of the language's state machine.
Easy explanation, huh? Simple example: taken that a PHP application consists of 1000 tokens, 200 of the tokens are variable names, and 800 non-variable tokens, the interpreter would either 200 times look up the wrong symbol table (if it chooses to lookup the keywords first), or 800 times (if it looks up the entity table first).
Simply saves time...
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I am using session_start, im using php 4.2.3
Lee
"Conbud" <conbudd
yahoo.com> wrote in message
news:20021112075942.16291.qmail
pb1.pair.com...
> Hey,
> I do have it in a variable but I just choose to leave it out.
> Ive tried so many different things with this and even what you gave me for
> some reason didnt work. The variables are being set, if I echo
> $_SESSION['user'] then right data is shown. However as soon as I put it in
> the mysql_query it stops working. Im using it for a login script that I
> include at the start of every page. Heres what I got:
>
> <?php
> session_start();
> ?>
> <?php
> $_SESSION['user'] = $_POST['user'];
> $_SESSION['pass'] = $_POST['pass'];
> ?>
> <?php
> $db = mysql_connect("$host", "user", "pass");
> mysql_select_db("$dtb",$db);
> $result = mysql_query("select count(*) AS numfound from admins where
> user='{$_SESSION['user']}' AND
> pass='{$_SESSION['pass']}'",$db);
> echo "".$_SESSION['user']." ".$_SESSION['pass']."";
>
> $result_ar = mysql_fetch_array($result);
> if ($result_ar['numfound'] < 1)
> {
> session_unset();
> session_destroy();
> include("error.php");
> exit;
> }
> ?>
>
> I include that at the top of every page I want to protect.
>
> Lee
>
> "Jason Wong" <php-general
gremlins.com.hk> wrote in message
> news:200211121537.49604.php-general
gremlins.com.hk...
> > On Tuesday 12 November 2002 15:05, conbud wrote:
> > > Hey,
> > > How would I insert $_SESSION['user'] and $_SESSION['pass']
> > >
> > > into this
> > > mysql_query("select count(*) AS numfound from admins where
user='$user'
> AND
> > > pass='$pass'",$db);
> > >
> > > right now I have
> > > $_SESSION['user'] = $_POST['user']
> > > $_SESSION['pass'] = $_POST['pass']
> > >
> > > and I need to put $_SESSION['user'] where the $user is in the above
> > > statement and so one w/ $pass
> >
> > You mean like this?
> >
> > mysql_query("select count(*) AS numfound from admins where
> > user='{$_SESSION['user']}' AND
> > pass='{$_SESSION['pass']}'",$db);
> >
> > BTW, it is much better to assign your query to a variable, eg $qry, then
> do
> >
> > mysql_query($qry, $db) or die('Error in $qry ' . mysql_error());
> >
> > That way if your query doesn't work you'll at least know why.
> >
> > --
> > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> > Open Source Software Systems Integrators
> > * Web Design & Hosting * Internet & Intranet Applications Development *
> >
> > /*
> > Perhaps the biggest disappointments were the ones you expected anyway.
> > */
> >
>
>
attached mail follows:
Hi all,
I was hoping to find some code examples or tutorials on using PHP/MySQL with Japanese text. The site I've built is very close, but apparently a very small subset of the characters become garbage when pulled from the database into a form to be modified and resubmit to the database. Text in <textarea> tags seems immune -- it's only the text pulled into <input> tags.
I've tried to follow the PHP documentation on handling multibyte characters but without practical examples it really just doesn't make a lot of sense to me.
I'm not currently using encoding or output buffering at all -- I've just set the language to be "shift_jis" in a meta tag.
Thanks in advance, -Step
attached mail follows:
Hello,
"Step Schwarz" <step
closethipster.com> wrote:
> Hi all, > > I was hoping to find some code examples or tutorials on using PHP/MySQL with > Japanese text. The site I've built is very close, but apparently a very
I'm not sure about tutorials in English but if you know Japanese, I'm sure you can just google for them. :)
> small subset of the characters become garbage when pulled from the database > into a form to be modified and resubmit to the database. Text in <textarea> > tags seems immune -- it's only the text pulled into <input> tags.
I'm not really sure if I understand what you meant here--perhaps you can post some sample codes?
> I've tried to follow the PHP documentation on handling multibyte characters > but without practical examples it really just doesn't make a lot of sense to > me. > > I'm not currently using encoding or output buffering at all -- I've just set > the language to be "shift_jis" in a meta tag.
You mean in your html pages? That wouldn't really work unless you've configured php to handle multi-byte characters. (Maybe not necessary in 4.3.x versions...) Besides, you also need to configure MySQL to handle the Japanese characters. You need to check your configuration/settings in your my.cnf and php.ini.
Without any code snippets and environment info, it'll be hard for anybody to help out...
- E
attached mail follows:
I have php (as an apache module) and mysql up and running on Windows in the same computer, but they seem to be unconnected. How do I configure php.ini, my.ini, etc for a php script to find and query a database in the mysql server? Thanks for any help
Alberto Brea
attached mail follows:
I'm very new to PHP/mySQL and am working through the "PHP and mySQL for Dummies" examples. Unfortunately, these were all written with register_globals on and the system I'm using has register_globals off.
I'm having trouble converting the examples to use the $_POST() expression.
Specifically, the examples use a POST with a form variable to run a query and then unset this variable as such:
if (
$form == "yes")
{
unset($form);
}
I'm trying to convert this to use $_POST() as such:
if (
$_POST['form'] == "yes")
{
unset($_POST['form']);
}
However, this does not work. It appears that you can't unset the $_POST['form'] array element.
Does anyone have any suggestions on how to fix this? I know I'm probably missing a few very obvious things here... but I am a newbie.
/Mark
-- Mark H. Spohr email: mspohrnnk.com
attached mail follows:
At 21:05 12.11.2002, Mark Spohr said:
--------------------[snip]--------------------
>I'm trying to convert this to use $_POST() as such:
>
> if (
$_POST['form'] == "yes")
>{
>unset($_POST['form']);
>}
>
>However, this does not work. It appears that you can't unset the
>$_POST['form'] array element.
--------------------[snip]--------------------
unset() works for any variable - also for the superglobals like $_POST. Try this:
--------------------[cut here]-------------------- <xmp> <?php print_r($_POST); echo 'F1 = ', $_POST['f1'], "\nF2 = ", $_POST['f2'], "\n"; unset($_POST['f2']); print_r($_POST); ?> </xmp> <form method="POST"> <input type="text" name="f1" value="<?php echo $_POST['f1'];?>"> <br> <input type="text" name="f2" value="<?php echo $_POST['f2'];?>"> <br> <input type="submit"> </form> --------------------[/cut here]--------------------
What error do you get? Make sure you're using the correct case - PHP is case sensitive in variable names and associative index keys...
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
All, Does anyone know where I can find information on generating MS Excel files, with PHP?
I was able to generate the Excel file (so I thought), but Excel cannot open the file. Can someone point me to some references, tutorials and/or samples?
Please help.
-john
attached mail follows:
> Does anyone know where I can find information on generating MS Excel > files, with PHP? > > I was able to generate the Excel file (so I thought), but Excel cannot > open the file. Can someone point me to some references, tutorials and/or > samples?
Easiest way is to just create an HTML table and send it with Excel headers. Exel will open it right up as a spreadsheet.
There are some classes that allow you to do more complex things, too, but I can't remember any URLs.
Google is your friend.
---John Holmes...
attached mail follows:
Hello,
On 11/12/2002 06:06 PM, [-^-!-%- wrote: > Does anyone know where I can find information on generating MS Excel > files, with PHP? > > I was able to generate the Excel file (so I thought), but Excel cannot > open the file. Can someone point me to some references, tutorials and/or > samples?
Here you may find several solutions to generate Excel files:
http://www.phpclasses.org/excel
--Regards, Manuel Lemos
attached mail follows:
November 12, 2002 RELEASE ANNOUNCEMENT phpDocumentor version 1.1.0 http://www.phpdoc.org Download: http://phpdocu.sourceforge.net/downloads.php
The phpDocumentor Development team would like to announce the release of phpDocumentor version 1.1.0. This exciting release is a stable release of phpDocumentor.
phpDocumentor is the most advanced auto-documentation system available for PHP. Similar to the auto-documentor included with PEAR, phpDocumentor parses documentation comments in the PHP source to create hyperlinked API references for projects. Unlike the PEAR auto-documentor, phpDocumentor is extremely fast, has excellent documentation included, and the ability to parse any legal PHP syntax.
phpDocumentor is the only auto-documentor written specifically for PHP that supports output to formats other than HTML. Through the use of "Converters" similar to JavaDoc's doclets, phpDocumentor can interface parsing output to any template with minimal coding. In addition, a pre-alpha Converter to PDF output is included along with 8 choices of HTML output and a pre-alpha CHM converter
Other features include: --parsing any php file, with multiple classes and functions in the same file --fully compliant with even the most esoteric php syntax ($string = <<< EOF, for example) --error/warnings by line number and file to allow for debugging of documentation tags --extensive documentation of the package, including a detailed specification for tags and templates --open source, GPL
Changes since 1.1.0rc2 include: --VAST improvement in the PDF Converter --stabilization of the Smarty Converter --a new default HTML template, phphtmllib
Changes since 1.0.0 include: --addition of a converter that uses the Smarty template engine --addition of a PDF Converter --addition of a CHM Converter
PHPDocumentor is already used by several PHP projects including PostNuke Content Management (http://www.postnuke.com), phpHtmlLib (http://phphtmllib.newsblob.com) , and phpRPC (http://phprpc.sourceforge.net/)
To Download, go to http://phpdocu.sourceforge.net/downloads.php
The PHPDocumentor development team Joshua Eichorn Gregory Beaver
attached mail follows:
Hi all,
I came back from vacations and forgot some things about queries... can anyone tell me what is wrong with this? of all the error messages I set up in the script, none comes back on the page but the record is not saved...
<?
$db = mysql_connect("www.icaam.com.ar", "icaam", "********"); if (!$db) { die("No se pudo abrir la base de datos"); }
$ok = mysql_select_db("icaam"); if(!$ok) { die("No se pudo acceder a la base de datos"); }
$borndate = $bornd . $bornm . $borny; $phonenumber = $phone;
$query = "INSERT INTO mararegistro (visitorid, fname, lname, borndate, address, city, country, phone, how) VALUES (null, 'c', 'c', 12, 'c', 'c', 'c', 12, 'c')"; $result = mysql_query($query) or die (mysql_errno()); if (mysql_affected_rows() != 1) { die("Fallo al guardar datos"); }
echo "Gracias por administrarnos su información.";
?>
Any thiughts? Thanks in advance,
Cesar
attached mail follows:
In your php.ini file you can turn on all the errors have have them displayed...
I would suggest doing that and you should see some errors if there are any.
Have you verified that dates in the database via mysql command line or gui application.
On Tue, 2002-11-12 at 21:27, Cesar Aracena wrote: > Hi all, > > I came back from vacations and forgot some things about queries... can > anyone tell me what is wrong with this? of all the error messages I set up > in the script, none comes back on the page but the record is not saved... > > <? > > $db = mysql_connect("www.icaam.com.ar", "icaam", "********"); > if (!$db) > { > die("No se pudo abrir la base de datos"); > } > > $ok = mysql_select_db("icaam"); > if(!$ok) > { > die("No se pudo acceder a la base de datos"); > } > > $borndate = $bornd . $bornm . $borny; > $phonenumber = $phone; > > $query = "INSERT INTO mararegistro (visitorid, fname, lname, borndate, > address, city, country, phone, how) VALUES (null, 'c', 'c', 12, 'c', 'c', > 'c', 12, 'c')"; > $result = mysql_query($query) or die (mysql_errno()); > if (mysql_affected_rows() != 1) > { > die("Fallo al guardar datos"); > } > > echo "Gracias por administrarnos su información."; > > ?> > > Any thiughts? Thanks in advance, > > Cesar
-- .: B i g D o g :.
attached mail follows:
The problem is that I have a remote "rented" server and I don't have access to these configurations
any other ideas are welcome. Thanks
any ot
----- Original Message -----
From: "BigDog" <bigdog
venticon.com>
To: "Cesar Aracena" <icaam
icaam.com.ar>
Cc: "PHP General" <php-general
lists.php.net>
Sent: Tuesday, November 12, 2002 11:51 AM
Subject: Re: [PHP] Query problem
> In your php.ini file you can turn on all the errors have have them > displayed... > > I would suggest doing that and you should see some errors if there are > any. > > Have you verified that dates in the database via mysql command line or > gui application. > > > On Tue, 2002-11-12 at 21:27, Cesar Aracena wrote: > > Hi all, > > > > I came back from vacations and forgot some things about queries... can > > anyone tell me what is wrong with this? of all the error messages I set up > > in the script, none comes back on the page but the record is not saved... > > > > <? > > > > $db = mysql_connect("www.icaam.com.ar", "icaam", "********"); > > if (!$db) > > { > > die("No se pudo abrir la base de datos"); > > } > > > > $ok = mysql_select_db("icaam"); > > if(!$ok) > > { > > die("No se pudo acceder a la base de datos"); > > } > > > > $borndate = $bornd . $bornm . $borny; > > $phonenumber = $phone; > > > > $query = "INSERT INTO mararegistro (visitorid, fname, lname, borndate, > > address, city, country, phone, how) VALUES (null, 'c', 'c', 12, 'c', 'c', > > 'c', 12, 'c')"; > > $result = mysql_query($query) or die (mysql_errno()); > > if (mysql_affected_rows() != 1) > > { > > die("Fallo al guardar datos"); > > } > > > > echo "Gracias por administrarnos su información."; > > > > ?> > > > > Any thiughts? Thanks in advance, > > > > Cesar > -- > .: B i g D o g :. > > >
attached mail follows:
$query = "INSERT INTO mararegistro (visitorid, fname, lname, borndate, address, city, country, phone, how) VALUES (null, 'c', 'c', '12', 'c', 'c', 'c', '12', 'c')";
I think you should put quotes around all of these values 12 exept null or change null to '' ///
----- Original Message -----
From: "Cesar Aracena" <icaam
icaam.com.ar>
To: "PHP General" <php-general
lists.php.net>
Sent: Wednesday, November 13, 2002 8:27 AM
Subject: [PHP] Query problem
> Hi all, > > I came back from vacations and forgot some things about queries... can > anyone tell me what is wrong with this? of all the error messages I set up > in the script, none comes back on the page but the record is not saved... > > <? > > $db = mysql_connect("www.icaam.com.ar", "icaam", "********"); > if (!$db) > { > die("No se pudo abrir la base de datos"); > } > > $ok = mysql_select_db("icaam"); > if(!$ok) > { > die("No se pudo acceder a la base de datos"); > } > > $borndate = $bornd . $bornm . $borny; > $phonenumber = $phone; > > $query = "INSERT INTO mararegistro (visitorid, fname, lname, borndate, > address, city, country, phone, how) VALUES (null, 'c', 'c', 12, 'c', 'c', > 'c', 12, 'c')"; > $result = mysql_query($query) or die (mysql_errno()); > if (mysql_affected_rows() != 1) > { > die("Fallo al guardar datos"); > } > > echo "Gracias por administrarnos su información."; > > ?> > > Any thiughts? Thanks in advance, > > Cesar > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Hi Cesar,
> Hi all, > > I came back from vacations and forgot some things about > queries... can anyone tell me what is wrong with this? of all > the error messages I set up in the script, none comes back on > the page but the record is not saved...
Dont we all forget 'things' after vacations eh? ;-) I think you forgot a ' somewhere...
$query = "INSERT INTO mararegistro (visitorid, fname, lname, borndate, address, city, country, phone, how) VALUES (null, 'c', 'c', '12', 'c', 'c', 'c', 12, 'c')";
You forgot to put single qoutes around 12. Now it should work
Best regards,
Davy Obdam
mailto:info
davyobdam.com
attached mail follows:
At 23:35 12.11.2002, Cesar Aracena said:
--------------------[snip]--------------------
>The problem is that I have a remote "rented" server and I don't have access
>to these configurations
>
>any other ideas are welcome. Thanks
>
>any ot
>
>----- Original Message -----
>From: "BigDog" <bigdog
venticon.com>
>
>> In your php.ini file you can turn on all the errors have have them
>> displayed...
--------------------[snip]--------------------
You may always do two things to spot any error like this:
a) set error_reporting to a value where the error will be shown, e.g. "error_reporting(E_ALL | ~E_NOTICE);" This will override the INI file for the script instance
b) cluster your code with "echo" statements to see the value of certain variables.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
error_reporting() ;
1 E_ERROR 2 E_WARNING 4 E_PARSE 8 E_NOTICE 16 E_CORE_ERROR 32 E_CORE_WARNING 64 E_COMPILE_ERROR 128 E_COMPILE_WARNING 256 E_USER_ERROR 512 E_USER_WARNING 1024 E_USER_NOTICE
----- Original Message -----
From: "Cesar Aracena" <icaam
icaam.com.ar>
To: "PHP General" <php-general
lists.php.net>
Sent: Wednesday, November 13, 2002 9:35 AM
Subject: Re: [PHP] Query problem
> The problem is that I have a remote "rented" server and I don't have
access
> to these configurations
>
> any other ideas are welcome. Thanks
>
> any ot
>
> ----- Original Message -----
> From: "BigDog" <bigdog
venticon.com>
> To: "Cesar Aracena" <icaam
icaam.com.ar>
> Cc: "PHP General" <php-general
lists.php.net>
> Sent: Tuesday, November 12, 2002 11:51 AM
> Subject: Re: [PHP] Query problem
>
>
> > In your php.ini file you can turn on all the errors have have them
> > displayed...
> >
> > I would suggest doing that and you should see some errors if there are
> > any.
> >
> > Have you verified that dates in the database via mysql command line or
> > gui application.
> >
> >
> > On Tue, 2002-11-12 at 21:27, Cesar Aracena wrote:
> > > Hi all,
> > >
> > > I came back from vacations and forgot some things about queries... can
> > > anyone tell me what is wrong with this? of all the error messages I
set
> up
> > > in the script, none comes back on the page but the record is not
> saved...
> > >
> > > <?
> > >
> > > $db = mysql_connect("www.icaam.com.ar", "icaam", "********");
> > > if (!$db)
> > > {
> > > die("No se pudo abrir la base de datos");
> > > }
> > >
> > > $ok = mysql_select_db("icaam");
> > > if(!$ok)
> > > {
> > > die("No se pudo acceder a la base de datos");
> > > }
> > >
> > > $borndate = $bornd . $bornm . $borny;
> > > $phonenumber = $phone;
> > >
> > > $query = "INSERT INTO mararegistro (visitorid, fname, lname, borndate,
> > > address, city, country, phone, how) VALUES (null, 'c', 'c', 12, 'c',
> 'c',
> > > 'c', 12, 'c')";
> > > $result = mysql_query($query) or die (mysql_errno());
> > > if (mysql_affected_rows() != 1)
> > > {
> > > die("Fallo al guardar datos");
> > > }
> > >
> > > echo "Gracias por administrarnos su información.";
> > >
> > > ?>
> > >
> > > Any thiughts? Thanks in advance,
> > >
> > > Cesar
> > --
> > .: B i g D o g :.
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
atta