|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Thu Oct 04 2001 - 03:22:49 CDT
php-general Digest 4 Oct 2001 08:22:49 -0000 Issue 914
Topics (messages 69820 through 69901):
Re: Best way to duplicate tables to another DB using PHP
69820 by: David Yee
69822 by: David Yee
chmod trouble
69821 by: Nikola Veber
69827 by: Dan Lowe
PHP Knowledge Base solution?
69823 by: Michael O'Neal
69832 by: Maxim Maletsky \(PHPBeginner.com\)
status of building both CGI and MODULE
69824 by: fx
69856 by: David Robley
file maniputation??
69825 by: Gerard Samuel
69834 by: Maxim Maletsky \(PHPBeginner.com\)
69897 by: Mukul Sabharwal
file reading and textarea problem
69826 by: Nikola Veber
69829 by: Philip Olson
69835 by: Maxim Maletsky \(PHPBeginner.com\)
69896 by: Mukul Sabharwal
cookie not set anymore by IE5 (localhost)
69828 by: Chris Hayes
69836 by: Maxim Maletsky \(PHPBeginner.com\)
69837 by: Richard Baskett
Re: How to simulate any browser
69830 by: Maxim Maletsky \(PHPBeginner.com\)
Re: Newlines in files
69831 by: Maxim Maletsky \(PHPBeginner.com\)
Re: Problem when displaying the $ character
69833 by: Maxim Maletsky \(PHPBeginner.com\)
Getting the right hour?
69838 by: Jay Paulson
69847 by: David Robley
This is SOOOO FREAKY!!! Laughed like HELL !!! :-)
69839 by: Maxim Maletsky \(PHPBeginner.com\)
69840 by: Rasmus Lerdorf
69841 by: Dan Harrington
69842 by: Maxim Maletsky \(PHPBeginner.com\)
69863 by: Ashley M. Kirchner
associative array syntax question
69843 by: Job Miller
69844 by: Maxim Maletsky \(PHPBeginner.com\)
69848 by: Job Miller
69850 by: Philip Olson
69851 by: Maxim Maletsky \(PHPBeginner.com\)
69852 by: Maxim Maletsky \(PHPBeginner.com\)
write to multiple sql tables
69845 by: sc
69846 by: Maxim Maletsky \(PHPBeginner.com\)
69866 by: Frank M. Kromann
69868 by: Maxim Maletsky \(PHPBeginner.com\)
Re: exec() system() passthru() problems. (S.u.S.E 7.2)
69849 by: David Robley
Re: Parsing a CSV file
69853 by: David Robley
Re: associative array syntax question - got it!
69854 by: Job Miller
69855 by: Maxim Maletsky \(PHPBeginner.com\)
69860 by: Matthew Loff
69861 by: Maxim Maletsky \(PHPBeginner.com\)
Add $String to $Num ???
69857 by: SilkWebDesign.aol.com
69858 by: Maxim Maletsky \(PHPBeginner.com\)
69859 by: SilkWebDesign.aol.com
69889 by: Alexander Skwar
Re: object references lose local variables
69862 by: Steve Strassmann
Unable to get a dot-decimal ip address from a decimal ip address
69864 by: dharana.dharana.net
69871 by: David Robley
php in css not working with IF's
69865 by: Jason Dulberg
69869 by: David Robley
69872 by: Rasmus Lerdorf
69873 by: Jason Dulberg
69874 by: Rasmus Lerdorf
69875 by: Jason Dulberg
69876 by: Maxim Maletsky \(PHPBeginner.com\)
69877 by: Rasmus Lerdorf
69879 by: Jack Dempsey
69880 by: Maxim Maletsky \(PHPBeginner.com\)
69881 by: Rasmus Lerdorf
69882 by: Maxim Maletsky \(PHPBeginner.com\)
69883 by: Jack Dempsey
69884 by: Maxim Maletsky \(PHPBeginner.com\)
69886 by: Jason Dulberg
69887 by: Jack Dempsey
69888 by: Maxim Maletsky \(PHPBeginner.com\)
69890 by: Maxim Maletsky \(PHPBeginner.com\)
69892 by: David Robley
69893 by: Rasmus Lerdorf
69895 by: Naintara Jain
69898 by: Jason Dulberg
69900 by: David Robley
Error: Unable to open *\index.php in Unknown on line 0
69867 by: Garth Dahlstrom
Re: A powerful editor!
69870 by: Garth Dahlstrom
69878 by: Michael A. Peters
69885 by: Chris Bailey
Re: passing object variable from page to page. Please disregard the previous!
69891 by: _lallous
venn diagram producer
69894 by: Jack Dempsey
Mirroring Website
69899 by: Jon Shoberg
Re: Sessions Variables and refresh pages
69901 by: Derek Mailer
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:
mysqldump would work pretty well if the source DB is mysql, but it's a DB I have to access via ODBC on a windows box instead. And this particular DB doesn't seem to have a command line interface to export a table that I can call from PHP.
David
----- Original Message -----
From: sagar N Chand
To: David Yee
Sent: Wednesday, October 03, 2001 6:09 AM
Subject: Re: [PHP] Best way to duplicate tables to another DB using PHP
use mysql statement mysql_dump thru php.
/sagar
----- Original Message -----
From: David Yee
To: php-general
lists.php.net
Sent: Wednesday, October 03, 2001 2:52 AM
Subject: [PHP] Best way to duplicate tables to another DB using PHP
Hi guys. What do you suggest is the best (fastest, most efficient) way to
duplicate a table from one database to another using PHP? I have a windows
machine setup with ODBC for this old school DB (Pervasive SQL 7) and I would
like to duplicate some of the tables into a Linux box with MySQL for some
datawarehousing purposes. The largest table is about 30K records. I'm not
sure if something like a "select *" and then doing a foreach record insert
into MySQL would be the best way. Thanks for any suggestions.
David
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
For additional commands, e-mail: php-general-help
lists.php.net
To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Nope- nothing useful yet anyways :-). I guess maybe the only thing to do is
to select different ranges for the table (if it's too big) instead of a
select with no where clause. Now to think of it I guess you can even select
one record at a time sequentially if the pk is integer based. Then you can
do something like:
for ($i=0; i++; i<$num_rows_in_table){
$q="select * from my_table where id = $i";
$result=odbc_exec($connect, $q);
etc. (e.g. insert into the target mysql DB/table)
}
David
----- Original Message -----
From: "Joseph Koenig" <joe
jwebmedia.com>
To: "David Yee" <david
coolcomputing.com>
Sent: Wednesday, October 03, 2001 6:47 AM
Subject: Re: [PHP] Best way to duplicate tables to another DB using PHP
> David,
>
> Did you get any responses on this post? I'm actually looking at a very
> similiar situation and thinking the exact same thing. I've done a
> "select *" and then a while loop before to accomplish this, but with dbs
> where the largest table was about 1K rows. Big difference. Please let me
> know if you get any responses or find anything out. Thanks,
>
> Joe
>
> David Yee wrote:
> >
> > Hi guys. What do you suggest is the best (fastest, most efficient) way
to
> > duplicate a table from one database to another using PHP? I have a
windows
> > machine setup with ODBC for this old school DB (Pervasive SQL 7) and I
would
> > like to duplicate some of the tables into a Linux box with MySQL for
some
> > datawarehousing purposes. The largest table is about 30K records. I'm
not
> > sure if something like a "select *" and then doing a foreach record
insert
> > into MySQL would be the best way. Thanks for any suggestions.
> >
> > David
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Hi !
What chmod value gives the read-only premission to the file ? (777 is the read-write)
Thanks
Nikola
attached mail follows:
Previously, Nikola Veber said:
>
> What chmod value gives the read-only premission to the file ? (777 is the
> read-write)
0400 would be read-only and visible only to the owner
0444 would be read-only, visible to anyone
0644 would be read-only to anyone but the owner (r/w to owner).
-dan
--
I didn't have time to write a short letter, so I wrote a long one instead.
-Mark Twain
attached mail follows:
Hi.
Anyone know of a Knowledge Base solution (Like you see from computer manufacturers on their websites) done in PHP/MySQL? Something where a user could search for entries on specific problems and such they might have?
Please email me at mike
thinkmango.com as I am on the digest.
Thanks,
mto
--Michael O'Neal Web Producer/ Autocrosser ST 28 '89 Civic Si --------------------- M A N G O B O U L D E R --------------------- http://www.thinkmango.com e- mike
thinkmango.com p- 303.442.1821 f- 303.938.8507
attached mail follows:
I think you can take just about any forum or other script and modify it on your own if you know how. And, what you're asking is relatively easy to do from scratch as well. You should try at least.
Maxim Maletsky www.PHPBeginner.com
-----Original Message-----
From: Michael O'Neal [mailto:mike
thinkmango.com]
Sent: mercoledi 3 ottobre 2001 22.53
To: "Php-General
Lists. Php. Net"
Subject: [PHP] PHP Knowledge Base solution?
Hi.
Anyone know of a Knowledge Base solution (Like you see from computer manufacturers on their websites) done in PHP/MySQL? Something where a user could search for entries on specific problems and such they might have?
Please email me at mike
thinkmango.com as I am on the digest.
Thanks,
mto
--Michael O'Neal Web Producer/ Autocrosser ST 28 '89 Civic Si --------------------- M A N G O B O U L D E R --------------------- http://www.thinkmango.com e- mike
thinkmango.com p- 303.442.1821 f- 303.938.8507
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hi
I've read various newsgroups about the possibility of building both CGI and MODULE at the time but haven't found a clear response ....
is it possible ?
if yes ... is it possible with the same configure script ? do some options make it impossible ?
TIA
please forward to fxbois
free.fr
attached mail follows:
On Thu, 4 Oct 2001 06:27, fx wrote: > Hi > > I've read various newsgroups about the possibility of building both CGI > and MODULE at the time but haven't found a clear response .... > > is it possible ?
Yes
> if yes ... > is it possible with the same configure script ?
No > do some options make it impossible ?
You'll need to do two configures and compiles. For the cgi version, leave out any reference to with-apache, with_apxs or any other webserver. The latter will produce an executable called php. This applies to *nix systems only - Windoze I won't go into :-)
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIALawyers: The larval form of politicians.
attached mail follows:
Hey all. I have a script that uses that creates/manipulates files, and it works great on my end. Thats no question. There is a small percentage of my users that when they try to run the file it cannot create or modify files. I suspected file ownership may be wrong on files and directories. Just in case Im wrong, what else could be the matter??
Example code. $file = "foo/bar/example.php"; $config = array("x", "y", "z"); if ($fp = fopen($config_file, "wb")) { foreach ($config as $line) { fwrite($fp, "$line\n"); }
Example error. Warning: fopen("foo/bar/example.php","wb") - Permission denied in /usr/local/psa/home/vhosts/httpsdocs/install.php on line 3429
Thanks
attached mail follows:
Not sure, but this 'wb' looks suspicious to me.
From the manual:
"The mode may contain the letter 'b'. This is useful only on systems which differentiate between binary and text files (i.e. Windows. It's useless on Unix). If not needed, this will be ignored. "
Can you ignore it as well?
Maxim Maletsky www.PHPBeginner.com
-----Original Message-----
From: Gerard Samuel [mailto:trini0
optonline.net]
Sent: mercoledi 3 ottobre 2001 23.08
To: PHP
Subject: [PHP] file maniputation??
Hey all. I have a script that uses that creates/manipulates files, and it works great on my end. Thats no question. There is a small percentage of my users that when they try to run the file it cannot create or modify files. I suspected file ownership may be wrong on files and directories. Just in case Im wrong, what else could be the matter??
Example code. $file = "foo/bar/example.php"; $config = array("x", "y", "z"); if ($fp = fopen($config_file, "wb")) { foreach ($config as $line) { fwrite($fp, "$line\n"); }
Example error. Warning: fopen("foo/bar/example.php","wb") - Permission denied in /usr/local/psa/home/vhosts/httpsdocs/install.php on line 3429
Thanks
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hi,
It looks most certainly like a file permission error, however if you have concurrent users maybe it's over riding the file contents, and screwing up something somewhere.
So use flock(), a tutorial :
http://www.paphe.com/php/tutorials/111000.php
===== ********************************* Know more about me: http://www.geocities.com/mimodit *********************************
__________________________________________________ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1
attached mail follows:
Hi !
I'm having a problem with the following : I have a log file on my site, that records date, time and the user's system. Each entry is placed in a new line. Now, I can only read the first line with fgets($filename, 4096). Is there another function, or the 4096 number should be changed in order to let me read the whole file.
Thanks Nikola
attached mail follows:
If you use fgets(), you can loop through it like the example does :
Or, consider the file() function which automagically assigns each line to an element of the array.
Or, you could open the file as a one string using fread(), see the example :
regards, Philip Olson
On Wed, 3 Oct 2001, Nikola Veber wrote:
> Hi !
>
> I'm having a problem with the following : I have a log file on my site, that records date,
> time and the user's system. Each entry is placed in a new line. Now, I can only read
> the first line with fgets($filename, 4096). Is there another function, or the 4096 number
> should be changed in order to let me read the whole file.
>
> Thanks
> Nikola
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Yup.
fread()
Read on
PHP.net/fread PHP.net/fgets
...to learn how to manipulate files.
Maxim Maletsky www.PHPBeginner.com
-----Original Message-----
From: Nikola Veber [mailto:veber
ptt.yu]
Sent: mercoledi 3 ottobre 2001 11.11
To: php forum
Subject: [PHP] file reading and textarea problem
Hi !
I'm having a problem with the following : I have a log file on my site, that records date, time and the user's system. Each entry is placed in a new line. Now, I can only read the first line with fgets($filename, 4096). Is there another function, or the 4096 number should be changed in order to let me read the whole file.
Thanks Nikola
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hi,
fopen let's you read the whole file. Try this tutorials on files for a more hands on approach :
http://www.paphe.com/php/tutorials/111000.php
===== ********************************* Know more about me: http://www.geocities.com/mimodit *********************************
__________________________________________________ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1
attached mail follows:
hi, i'm having a cookie problem. Maybe you know Postnuke, anyway it requires cookies for users and the admin.
At first it worked fine, i tried to add functionailty, testing it on postnuke. Then i deleted some cookies, even deleted the windows/cookies/index.dat , installed some extra versions of postnuke. All on localhost (PHP4 Apache WIN98 IE5 ZoneAlarm MySQL).
Now i see to my amazement that netscape 6.1 works, so maybe this is not a php problem after all...
Anyway so i cannot set a cookie anymore with IE with PHP setcookie.
I even made a simple file: <?PHP $info = 'cook infor'; setcookie("nogeen","$info",time() + 15552000); ?> But no cookie appears.
External sites happily add cookies.
Headers_sent confirms i did not send a header yet.
What can i do???? (except format c:....)
BTW it seems like Netscape also
Chris H.
--------------------------------------------------------------- ----- -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- --------------------------------------------------------------- -----
attached mail follows:
No formatting a developing station is a really stupid thing to do ;-)
Have you looked into your C:/docs/you/cookies? It should be there. Hey, why instead don't you try to remove it? Set it to nothing - that's it.
Logic: if at least a friend of yours sees it - means it works. Cookies could be a pain, a real pain when testing your apps.
Maxim Maletsky www.PHPBeginner.com
-----Original Message-----
From: Chris Hayes [mailto:chayes
antenna.nl]
Sent: mercoledi 3 ottobre 2001 23.29
To: php-general
lists.php.net
Subject: [PHP] cookie not set anymore by IE5 (localhost)
hi, i'm having a cookie problem. Maybe you know Postnuke, anyway it requires cookies for users and the admin.
At first it worked fine, i tried to add functionailty, testing it on postnuke. Then i deleted some cookies, even deleted the windows/cookies/index.dat , installed some extra versions of postnuke. All on localhost (PHP4 Apache WIN98 IE5 ZoneAlarm MySQL).
Now i see to my amazement that netscape 6.1 works, so maybe this is not a php problem after all...
Anyway so i cannot set a cookie anymore with IE with PHP setcookie.
I even made a simple file: <?PHP $info = 'cook infor'; setcookie("nogeen","$info",time() + 15552000); ?> But no cookie appears.
External sites happily add cookies.
Headers_sent confirms i did not send a header yet.
What can i do???? (except format c:....)
BTW it seems like Netscape also
Chris H.
--------------------------------------------------------------- ----- -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- --------------------------------------------------------------- -----
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
I wrote this cookie script to work with every platform and every browser.. since I was having the same cookie problems you were having and a lot of people have had in this forum. So far I have found it to work with everything. Give it a try, if anybody finds that it does not work with a platform/browser please tell me.
<?
function NextYear () { $today = gmdate("l, d-M-"); $today .= gmdate("Y")+1; $today .= gmdate(" H:i:s")." GMT"; return $today; }
$oneYear = NextYear(); header("Set-Cookie: VarName=$VarNameValue; path=/; expires=$oneYear");
?>
Rick
> No formatting a developing station is a really stupid thing to do ;-)
>
> Have you looked into your C:/docs/you/cookies? It should be there.
> Hey, why instead don't you try to remove it? Set it to nothing - that's
> it.
>
> Logic: if at least a friend of yours sees it - means it works. Cookies
> could be a pain, a real pain when testing your apps.
>
> Maxim Maletsky
> www.PHPBeginner.com
>
>
>
> -----Original Message-----
> From: Chris Hayes [mailto:chayes
antenna.nl]
> Sent: mercoledi 3 ottobre 2001 23.29
> To: php-general
lists.php.net
> Subject: [PHP] cookie not set anymore by IE5 (localhost)
>
>
> hi,
> i'm having a cookie problem. Maybe you know Postnuke, anyway it
> requires cookies for users and the admin.
>
> At first it worked fine, i tried to add functionailty, testing
> it on postnuke. Then i deleted some cookies, even deleted the
> windows/cookies/index.dat , installed some extra versions of
> postnuke. All on localhost (PHP4 Apache WIN98 IE5 ZoneAlarm
> MySQL).
>
> Now i see to my amazement that netscape 6.1 works, so maybe
> this is not a php problem after all...
>
> Anyway so i cannot set a cookie anymore with IE with PHP
> setcookie.
>
>
> I even made a simple file:
> <?PHP
> $info = 'cook infor';
> setcookie("nogeen","$info",time() + 15552000);
> ?>
> But no cookie appears.
>
> External sites happily add cookies.
>
> Headers_sent confirms i did not send a header yet.
>
>
> What can i do???? (except format c:....)
>
> BTW it seems like Netscape also
>
>
> Chris H.
>
>
> ---------------------------------------------------------------
> -----
> -- C.Hayes Droevendaal 35 6708 PB Wageningen the
> Netherlands --
> ---------------------------------------------------------------
> -----
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net To
> contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
So you need a browser of your own? You should be using
fosockopen() php.net/fsockopen
Maxim Maletsky www.PHPBeginner.com
-----Original Message-----
From: Kamil Nowicki [mailto:hilarion
elfin.pl]
Sent: mercoledi 3 ottobre 2001 17.47
To: PHP-list
Subject: [PHP] How to simulate any browser
Hello everyone!
I have a problem. My webpage (say webpage_1) needs to get some data presented on other webpage (wepage_2). I tried to use fopen("http://webpage_2?params","r") and got connection and stuff, but I suppose that webpage_2 uses some script checking what type of browser sent the request, and sends back an error message. I do not have cURL library installed (and I can't install it cause I'm not an administrator of the server and my administrator doesn't want to install it) so I can't use it to pretend my PHP request is from IE, Netscape or any other WWW browser. I was thinking abous using sockets to communicate directly and make a HTTP request manually, but I do not know the HTTP request specifications (how to send all needed info including browser id).
If You know how to send browser info to WWW server using standard PHP functions or some common libraries' functions, than PLEASE HELP ME.
Thanx in advance.
Kamil 'Hilarion' Nowicki
PS.: I can send phpinfo() of my server on Your request.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
It did.
Try opening that file with a text editor.
Maxim Maletsky www.PHPBeginner.com
-----Original Message-----
From: Big5ive [mailto:big5ive
gmx.net]
Sent: mercoledì 3 ottobre 2001 19.10
To: php-general
lists.php.net
Subject: [PHP] Newlines in files
My Code: $PW_LIST="../config/pw.txt"; $fp=fopen("$PW_LIST","a"); fputs($fp,"$username=$pw\n"); fclose($fp);
This should make a newline after printing $username=$pw, shouldn't it!? But it doesn't!!!
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
It is the same thing. trim() is enough to make it work.
Maxim Maletsky www.PHPBeginner.com
-----Original Message-----
From: Mauricio T?llez Jim?nez [mailto:mtellez
speedy.coacade.uv.mx] On
Behalf Of EDUMEXICO
Sent: mercoledì 3 ottobre 2001 19.53
To: Dominik
Cc: php-general
lists.php.net
Subject: Re: [PHP] Problem when displaying the $ character
Hi, try this:
<?
echo " <select name=\"menu\"> <option value=\"$item1\">Item 1</option> <option value=\"$item2\">Item 2</option> </select>";
?>
I hope this can help you. Cheers
On Wed, Oct 03, 2001 at 11:08:27AM -0700, Dominik wrote: > Through php, I run a function that creates a list of items in a select
> menu as follows:
>
> <select name="menu">
> <option value="<? echo "$item1"; ?>">Item 1</option>
> <option value="<? echo "$item2"; ?>">Item 2</option> </select>
>
> but here is how the source code looks:
>
> <select name="menu">
> <option value="
> item1">Item 1</option>
> <option value="
> item2">Item 2</option>
> </select>
>
> It looks like php takes the $ character and inserts a return for it.
> This though disrupts the value of the form element. Is there anyway
> to make this code appear like it should (with the option tag all on
> one line instead of 2)?
>
> Thanks!
> Dominik
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail:
php-list-admin
lists.php.net
-- Mauricio Téllez Jiménez Seguimiento Técnico EDUMEXICO edumexicospeedy.coacade.uv.mx edumexico
speedy.uv.mx edumexico
terra.com.mx Zamora No. 25, Col. Centro C.P. 91000, Xalapa, Ver. Tel. 52(28)17-86-87, 17-73-80 Fax. 52(28)18-64-13
attached mail follows:
I am trying to get the right hour using php's date() function. However, I don't know how to set the clock on my redhat machine via command prompt. I keep getting 18 for the hour and it should be 17. Anyone know how to set the time on the machine correctly?
Thanks, jay
attached mail follows:
On Thu, 4 Oct 2001 07:38, Jay Paulson wrote: > I am trying to get the right hour using php's date() function. > However, I don't know how to set the clock on my redhat machine via > command prompt. I keep getting 18 for the hour and it should be 17. > Anyone know how to set the time on the machine correctly? > > Thanks, > jay
man date ??
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIAAll dogs go to heaven. Cats watch them leave.
attached mail follows:
I hope I wasn't just left over by not knowing that.
Listen what I just came across on an Italian PHP mailing list (ok,
credit belongs to the founder of Italian largest PHP portal Michel
'ZioBudda' Morelli
www.ziobudda.net).
According to him, if you add '?=PHPE9568F36-D428-11d2-A769-00AA001ACF42' to any PHP page on your own server you will see one of the creators (?) of PHP ... looking a bit... pretty..?.. how do I express that.... fun? freaky? cool? You tell me :-)
Anyway, on all my servers it worked HA HA HA!!!
CHECK THAT OUT:
Try clicking here who's got PHP on Windows right now: http://localhost/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
Or here any of you want to see it on my site: http://maxim.cx/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
Or just add that damn '?=PHPE9568F36-D428-11d2-A769-00AA001ACF42' on any PHP page of your own site!
Is that you, Rasmus?
I laughed like hell. :-)
you're a funny man
Have fun guys :-)
Maxim Maletsky www.phpbeginner.com
-----Original Message-----
From: php-it-admin
ziobudda.net [mailto:php-it-admin
ziobudda.net] On
Behalf Of Michel 'ZioBudda' Morelli
Sent: mercoledì 3 ottobre 2001 17.34
To: php-it
ziobudda.net
Subject: [PHP]funzionalita' nascoste (da phpcenter.it)
_________________________SPONSOR________________________________________ _
Il tuo annuncio qui? michel
ziobudda.net
______________________________________________________________________
In PHP sono state rinvenute due funzionalità nascoste (Easter Egg - Uova di Pasqua). Infatti richiamando qualunque pagina in php e passandogli un particolare parametro è possibile ottenre la foto di uno degli sviluppatori di PHP in un atteggiamento strano (?=PHPE9568F36-D428-11d2-A769-00AA001ACF42) ovvero la lista dei dei crediti per PHP 4.0 (?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000). Per provare clicca in uno dei due link qui sotto: - http://www.phpcenter.it/?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000 - http://www.phpcenter.it/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
-- Se ti prendo ti apro come una cozza... -- Michel <ZioBudda> Morelli michelziobudda.net
ICQ UIN: 58351764 PR of Linux in Italy http://www.ziobudda.net http://www.linuxlab.it
______________________________________________ Info: http://www.ziobudda.net/mailman/listinfo/php-it
attached mail follows:
That would be Thies, and this isn't exactly a new thing. Has been there for a couple of years.
-Rasmus
On Thu, 4 Oct 2001, Maxim Maletsky (PHPBeginner.com) wrote:
>
> I hope I wasn't just left over by not knowing that.
>
> Listen what I just came across on an Italian PHP mailing list (ok,
> credit belongs to the founder of Italian largest PHP portal Michel
> 'ZioBudda' Morelli
www.ziobudda.net).
>
>
>
> According to him, if you add '?=PHPE9568F36-D428-11d2-A769-00AA001ACF42'
> to any PHP page on your own server you will see one of the creators (?)
> of PHP ... looking a bit... pretty..?.. how do I express that....
> fun? freaky? cool? You tell me :-)
>
> Anyway, on all my servers it worked HA HA HA!!!
>
> CHECK THAT OUT:
>
> Try clicking here who's got PHP on Windows right now:
> http://localhost/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
>
> Or here any of you want to see it on my site:
> http://maxim.cx/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
>
> Or just add that damn
> '?=PHPE9568F36-D428-11d2-A769-00AA001ACF42'
> on any PHP page of your own site!
>
> Is that you, Rasmus?
>
> I laughed like hell. :-)
>
> you're a funny man
>
>
> Have fun guys :-)
>
> Maxim Maletsky
> www.phpbeginner.com
>
>
>
>
>
> -----Original Message-----
> From: php-it-admin
ziobudda.net [mailto:php-it-admin
ziobudda.net] On
> Behalf Of Michel 'ZioBudda' Morelli
> Sent: mercoledì 3 ottobre 2001 17.34
> To: php-it
ziobudda.net
> Subject: [PHP]funzionalita' nascoste (da phpcenter.it)
>
>
> _________________________SPONSOR________________________________________
> _
>
> Il tuo annuncio qui? michel
ziobudda.net
>
>
> ______________________________________________________________________
>
> In PHP sono state rinvenute due funzionalità nascoste (Easter Egg - Uova
> di Pasqua). Infatti richiamando qualunque pagina in php e passandogli un
> particolare parametro è possibile ottenre la foto di uno degli
> sviluppatori di PHP in un atteggiamento strano
> (?=PHPE9568F36-D428-11d2-A769-00AA001ACF42) ovvero la lista dei dei
> crediti per PHP 4.0 (?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000).
> Per provare clicca in uno dei due link qui sotto:
> - http://www.phpcenter.it/?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000
> - http://www.phpcenter.it/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
>
>
>
attached mail follows:
The real question is . . . . what OTHER secret codes are out there?
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:rasmus
php.net]
> Sent: Wednesday, October 03, 2001 4:58 PM
> To: Maxim Maletsky (PHPBeginner.com)
> Cc: 'PHP'; php-it
ziobudda.net
> Subject: [PHP] Re: This is SOOOO FREAKY!!! Laughed like HELL !!! :-)
>
>
> That would be Thies, and this isn't exactly a new thing. Has been there
> for a couple of years.
>
> -Rasmus
>
> On Thu, 4 Oct 2001, Maxim Maletsky (PHPBeginner.com) wrote:
>
> >
> > I hope I wasn't just left over by not knowing that.
> >
> > Listen what I just came across on an Italian PHP mailing list (ok,
> > credit belongs to the founder of Italian largest PHP portal Michel
> > 'ZioBudda' Morelli
www.ziobudda.net).
> >
> >
> >
> > According to him, if you add '?=PHPE9568F36-D428-11d2-A769-00AA001ACF42'
> > to any PHP page on your own server you will see one of the creators (?)
> > of PHP ... looking a bit... pretty..?.. how do I express that....
> > fun? freaky? cool? You tell me :-)
> >
> > Anyway, on all my servers it worked HA HA HA!!!
> >
> > CHECK THAT OUT:
> >
> > Try clicking here who's got PHP on Windows right now:
> > http://localhost/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
> >
> > Or here any of you want to see it on my site:
> > http://maxim.cx/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
> >
> > Or just add that damn
> > '?=PHPE9568F36-D428-11d2-A769-00AA001ACF42'
> > on any PHP page of your own site!
> >
> > Is that you, Rasmus?
> >
> > I laughed like hell. :-)
> >
> > you're a funny man
> >
> >
> > Have fun guys :-)
> >
> > Maxim Maletsky
> > www.phpbeginner.com
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: php-it-admin
ziobudda.net [mailto:php-it-admin
ziobudda.net] On
> > Behalf Of Michel 'ZioBudda' Morelli
> > Sent: mercoledì 3 ottobre 2001 17.34
> > To: php-it
ziobudda.net
> > Subject: [PHP]funzionalita' nascoste (da phpcenter.it)
> >
> >
> > _________________________SPONSOR________________________________________
> > _
> >
> > Il tuo annuncio qui? michel
ziobudda.net
> >
> >
> > ______________________________________________________________________
> >
> > In PHP sono state rinvenute due funzionalità nascoste (Easter Egg - Uova
> > di Pasqua). Infatti richiamando qualunque pagina in php e passandogli un
> > particolare parametro è possibile ottenre la foto di uno degli
> > sviluppatori di PHP in un atteggiamento strano
> > (?=PHPE9568F36-D428-11d2-A769-00AA001ACF42) ovvero la lista dei dei
> > crediti per PHP 4.0 (?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000).
> > Per provare clicca in uno dei due link qui sotto:
> > - http://www.phpcenter.it/?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000
> > - http://www.phpcenter.it/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
I guessed so. But do really many know it? I've been coding PHP for a couple of years but never seen that :-)
Very cool! Should be expecting it from such dudes :-)
Cheers, Maxim Maletsky www.PHPBeginner.com
-----Original Message-----
From: Rasmus Lerdorf [mailto:rasmus
php.net]
Sent: giovedì 4 ottobre 2001 0.58
To: Maxim Maletsky (PHPBeginner.com)
Cc: 'PHP'; php-it
ziobudda.net
Subject: Re: This is SOOOO FREAKY!!! Laughed like HELL !!! :-)
That would be Thies, and this isn't exactly a new thing. Has been there for a couple of years.
-Rasmus
On Thu, 4 Oct 2001, Maxim Maletsky (PHPBeginner.com) wrote:
>
> I hope I wasn't just left over by not knowing that.
>
> Listen what I just came across on an Italian PHP mailing list (ok,
> credit belongs to the founder of Italian largest PHP portal Michel
> 'ZioBudda' Morelli
www.ziobudda.net).
>
>
>
> According to him, if you add
> '?=PHPE9568F36-D428-11d2-A769-00AA001ACF42'
> to any PHP page on your own server you will see one of the creators
(?)
> of PHP ... looking a bit... pretty..?.. how do I express that....
> fun? freaky? cool? You tell me :-)
>
> Anyway, on all my servers it worked HA HA HA!!!
>
> CHECK THAT OUT:
>
> Try clicking here who's got PHP on Windows right now:
> http://localhost/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
>
> Or here any of you want to see it on my site:
> http://maxim.cx/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
>
> Or just add that damn '?=PHPE9568F36-D428-11d2-A769-00AA001ACF42'
> on any PHP page of your own site!
>
> Is that you, Rasmus?
>
> I laughed like hell. :-)
>
> you're a funny man
>
>
> Have fun guys :-)
>
> Maxim Maletsky
> www.phpbeginner.com
>
>
>
>
>
> -----Original Message-----
> From: php-it-admin
ziobudda.net [mailto:php-it-admin
ziobudda.net] On
> Behalf Of Michel 'ZioBudda' Morelli
> Sent: mercoledì 3 ottobre 2001 17.34
> To: php-it
ziobudda.net
> Subject: [PHP]funzionalita' nascoste (da phpcenter.it)
>
>
> _________________________SPONSOR______________________________________
> __
> _
>
> Il tuo annuncio qui? michel
ziobudda.net
>
>
> ______________________________________________________________________
>
> In PHP sono state rinvenute due funzionalità nascoste (Easter Egg -
> Uova di Pasqua). Infatti richiamando qualunque pagina in php e
> passandogli un particolare parametro è possibile ottenre la foto di
> uno degli sviluppatori di PHP in un atteggiamento strano
> (?=PHPE9568F36-D428-11d2-A769-00AA001ACF42) ovvero la lista dei dei
> crediti per PHP 4.0 (?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000).
> Per provare clicca in uno dei due link qui sotto:
> - http://www.phpcenter.it/?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000
> - http://www.phpcenter.it/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
>
>
>
attached mail follows:
"Maxim Maletsky (PHPBeginner.com)" wrote:
> I guessed so. But do really many know it? > I've been coding PHP for a couple of years but never seen that :-)
Look in $PHP_SOURCE/ext/standard/info.h
-- H | "Life is the art of drawing without an eraser." - John Gardner +-------------------------------------------------------------------- Ashley M. Kirchner <mailto:ashleypcraft.com> . 303.442.6410 x130 Director of Internet Operations / SysAdmin . 800.441.3873 x130 Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave, #6 http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
attached mail follows:
why does: print $a[$b['b']] return:
parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'
but if I do it in two steps like:
$c=$b['b']; print $a[$c];
it works fine.
I have tried dozens of syntax combinations using quotes, no quotes, on one or both and can't get anything to work. any help would be greatly appreciated. The two step method is annoying.
Job
__________________________________________________ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1
attached mail follows:
Strange, I always though it should be working.
Have you tried $a[{$b['b']}] ?
What version of PHP are you running?
Maxim Maletsky www.PHPBeginner.com
-----Original Message-----
From: Job Miller [mailto:jobmiller
yahoo.com]
Sent: giovedi 4 ottobre 2001 1.41
To: php-general
lists.php.net
Subject: [PHP] associative array syntax question
why does: print $a[$b['b']] return:
parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'
but if I do it in two steps like:
$c=$b['b']; print $a[$c];
it works fine.
I have tried dozens of syntax combinations using quotes, no quotes, on one or both and can't get anything to work. any help would be greatly appreciated. The two step method is annoying.
Job
__________________________________________________ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
here is sample output from my script:
win98/Apache 1.3.19/php4.0.5
variable being displayed = value
$row[TICKER] = NTAP $test = NTAP $quotes[$test] = 8.30 $quotes[{$row[TICKER]}] = will not parse $quotes[$row[TICKER]] = will not parse
any ideas?
--- "Maxim Maletsky (PHPBeginner.com)"
<php-general
phpbeginner.com> wrote:
> Strange, I always though it should be working.
>
> Have you tried $a[{$b['b']}] ?
>
> What version of PHP are you running?
>
> Maxim Maletsky
> www.PHPBeginner.com
>
>
>
> -----Original Message-----
> From: Job Miller [mailto:jobmiller
yahoo.com]
> Sent: giovedi 4 ottobre 2001 1.41
> To: php-general
lists.php.net
> Subject: [PHP] associative array syntax question
>
>
> why does: print $a[$b['b']] return:
>
> parse error, expecting `T_STRING' or `T_VARIABLE' or
> `T_NUM_STRING'
>
> but if I do it in two steps like:
>
> $c=$b['b'];
> print $a[$c];
>
> it works fine.
>
> I have tried dozens of syntax combinations using
> quotes, no quotes, on one or both and can't get
> anything to work. any help would be greatly
> appreciated. The two step method is annoying.
>
> Job
>
>
> __________________________________________________
> Do You Yahoo!?
> NEW from Yahoo! GeoCities - quick and easy web site
> hosting, just
> $8.95/month. http://geocities.yahoo.com/ps/info1
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net To
> contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
>
__________________________________________________ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1
attached mail follows:
Hi Job. This works for me (and *should* always work) :
$a = array('foo' => 'bar'); $b = array('b' => 'foo');
print $a[$b['b']]; // prints bar
How _exactly_ are you calling it? (provide a short standalone ex) Does the above example work for you? What version of php?
regards, Philip Olson
On Wed, 3 Oct 2001, Job Miller wrote:
> why does: print $a[$b['b']] return:
>
> parse error, expecting `T_STRING' or `T_VARIABLE' or
> `T_NUM_STRING'
>
> but if I do it in two steps like:
>
> $c=$b['b'];
> print $a[$c];
>
> it works fine.
>
> I have tried dozens of syntax combinations using
> quotes, no quotes, on one or both and can't get
> anything to work. any help would be greatly
> appreciated. The two step method is annoying.
>
> Job
>
>
> __________________________________________________
> Do You Yahoo!?
> NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
> http://geocities.yahoo.com/ps/info1
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
What about adding a few quotes above the problem?
$row['TICKER'] = 'NTAP'; $test = 'NTAP'; $quotes[$test] = '8.30'; // $quotes[{$row[TICKER]}] = will that parse? $quotes[$row[TICKER]] = will that parse?
Maxim Maletsky www.PHPBeginner.com
-----Original Message-----
From: Job Miller [mailto:jobmiller
yahoo.com]
Sent: giovedi 4 ottobre 2001 2.21
To: php-general
lists.php.net
Subject: RE: [PHP] associative array syntax question
here is sample output from my script:
win98/Apache 1.3.19/php4.0.5
variable being displayed = value
$row[TICKER] = NTAP $test = NTAP $quotes[$test] = 8.30 $quotes[{$row[TICKER]}] = will not parse $quotes[$row[TICKER]] = will not parse
any ideas?
--- "Maxim Maletsky (PHPBeginner.com)" <php-general
phpbeginner.com>
wrote:
> Strange, I always though it should be working.
>
> Have you tried $a[{$b['b']}] ?
>
> What version of PHP are you running?
>
> Maxim Maletsky
> www.PHPBeginner.com
>
>
>
> -----Original Message-----
> From: Job Miller [mailto:jobmiller
yahoo.com]
> Sent: giovedi 4 ottobre 2001 1.41
> To: php-general
lists.php.net
> Subject: [PHP] associative array syntax question
>
>
> why does: print $a[$b['b']] return:
>
> parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'
>
> but if I do it in two steps like:
>
> $c=$b['b'];
> print $a[$c];
>
> it works fine.
>
> I have tried dozens of syntax combinations using
> quotes, no quotes, on one or both and can't get
> anything to work. any help would be greatly
> appreciated. The two step method is annoying.
>
> Job
>
>
> __________________________________________________
> Do You Yahoo!?
> NEW from Yahoo! GeoCities - quick and easy web site
> hosting, just
> $8.95/month. http://geocities.yahoo.com/ps/info1
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net To
> contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
>
__________________________________________________ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
-----Original Message-----
From: Maxim Maletsky (PHPBeginner.com)
[mailto:php-general
phpbeginner.com]
Sent: giovedi 4 ottobre 2001 2.02
To: 'Job Miller'
Subject: RE: [PHP] associative array syntax question
I tried on winXP/PHP4.0.6/Apache
<? $a = Array('print me'); $b = Array('b'=>0); print $a[$b['b']]
# prints: # print me ?>
Strange, should work though....
Maxim Maletsky www.PHPBeginner.com
-----Original Message-----
From: Job Miller [mailto:jobmiller
yahoo.com]
Sent: giovedi 4 ottobre 2001 1.57
To: Maxim Maletsky (PHPBeginner.com)
Subject: RE: [PHP] associative array syntax question
no luck with that either. I do the same thing in Perl all the time. can it have anything to do with the fact that the inner part is a fetch from a mySQL DB which returns an enumerated array, so b is actually a constant (drop the quotes) referring to an index in the result?
i tried $a[$b[b]] and $a[{$b[b]}], etc..
nothing works..
--- "Maxim Maletsky (PHPBeginner.com)" <php-general
phpbeginner.com>
wrote:
> Strange, I always though it should be working.
>
> Have you tried $a[{$b['b']}] ?
>
> What version of PHP are you running?
>
> Maxim Maletsky
> www.PHPBeginner.com
>
>
>
> -----Original Message-----
> From: Job Miller [mailto:jobmiller
yahoo.com]
> Sent: giovedi 4 ottobre 2001 1.41
> To: php-general
lists.php.net
> Subject: [PHP] associative array syntax question
>
>
> why does: print $a[$b['b']] return:
>
> parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'
>
> but if I do it in two steps like:
>
> $c=$b['b'];
> print $a[$c];
>
> it works fine.
>
> I have tried dozens of syntax combinations using
> quotes, no quotes, on one or both and can't get
> anything to work. any help would be greatly
> appreciated. The two step method is annoying.
>
> Job
>
>
> __________________________________________________
> Do You Yahoo!?
> NEW from Yahoo! GeoCities - quick and easy web site
> hosting, just
> $8.95/month. http://geocities.yahoo.com/ps/info1
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net To
> contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
__________________________________________________ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1
attached mail follows:
Hi;
Is there any easy way of writing to multiple mysql tables in the one database? ie. putting it all in the one query etc? instead of writing a heap of code...
Any help would be great...
thx.
-sc
attached mail follows:
PHP can only handle a query at a time. If the database in question allows you to construct a such query where you can write to multiple files then you can. Go to the manual of your DB and look for the answer there. For instance; look at the syntax of INSERT.
Maxim Maletsky www.PHPBeginner.com
-----Original Message-----
From: sc [mailto:sven
gstar.com.au]
Sent: giovedì 4 ottobre 2001 2.17
To: php-general
lists.php.net
Subject: [PHP] write to multiple sql tables
Hi;
Is there any easy way of writing to multiple mysql tables in the one database? ie. putting it all in the one query etc? instead of writing a heap of code...
Any help would be great...
thx.
-sc
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Some databsaes allows batches of sql statements. Thes can be passed to the db server in one query and the statements are usally separated by ;
If you are executing a batch of statements each returning a result you will have to process each result in your code. This is supported by ODBC, MS SQL and FrontBase (that I know of)
If you want to insert/update data in multiple tables you might also want to choose a database with support for transactions, as this will ensure the consistancy of your data.
- Frank
>
> PHP can only handle a query at a time. If the database in question
> allows you to construct a such query where you can write to multiple
> files then you can. Go to the manual of your DB and look for the answer
> there. For instance; look at the syntax of INSERT.
>
> Maxim Maletsky
> www.PHPBeginner.com
>
>
> -----Original Message-----
> From: sc [mailto:sven
gstar.com.au]
> Sent: giovedì 4 ottobre 2001 2.17
> To: php-general
lists.php.net
> Subject: [PHP] write to multiple sql tables
>
>
> Hi;
>
> Is there any easy way of writing to multiple mysql tables in the one
> database? ie. putting it all in the one query etc? instead of writing a
> heap of code...
>
> Any help would be great...
>
> thx.
>
> -sc
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net To
> contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>
attached mail follows:
You can't do it through PHP.
';' - won't work
Maxim Maletsky www.PHPBeginner.com
-----Original Message-----
From: Frank M. Kromann [mailto:frank
frontbase.com]
Sent: giovedì 4 ottobre 2001 6.24
To: Maxim Maletsky (PHPBeginner.com)
Cc: 'sc'; php-general
lists.php.net
Subject: Re: RE: [PHP] write to multiple sql tables
Some databsaes allows batches of sql statements. Thes can be passed to the db server in one query and the statements are usally separated by ;
If you are executing a batch of statements each returning a result you will have to process each result in your code. This is supported by ODBC, MS SQL and FrontBase (that I know of)
If you want to insert/update data in multiple tables you might also want to choose a database with support for transactions, as this will ensure the consistancy of your data.
- Frank
>
> PHP can only handle a query at a time. If the database in question
> allows you to construct a such query where you can write to multiple
> files then you can. Go to the manual of your DB and look for the
> answer there. For instance; look at the syntax of INSERT.
>
> Maxim Maletsky
> www.PHPBeginner.com
>
>
> -----Original Message-----
> From: sc [mailto:sven
gstar.com.au]
> Sent: giovedì 4 ottobre 2001 2.17
> To: php-general
lists.php.net
> Subject: [PHP] write to multiple sql tables
>
>
> Hi;
>
> Is there any easy way of writing to multiple mysql tables in the one
> database? ie. putting it all in the one query etc? instead of writing
> a heap of code...
>
> Any help would be great...
>
> thx.
>
> -sc
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net To
> contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net To
> contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>
attached mail follows:
On Wed, 3 Oct 2001 20:01, Edward Woodstarf wrote: > Hi, > I was wondering if someone could HELP!!!! I'm very new to php and I am > trying to get the application functions to start an instance of a > program. However no matter what I do the functions return -1. Even if I > add the absoulte path it still returns -1. nothing happens. I'm running > S.u.S.E 7.2 php4. I was wondering if I have missed something in a > config file. If i su to nobody (I think this is the user apache runs as > on S.u.S.E) and run ps it works fine as the user has permissions for > it. > I am completely baffled I have tried multiple examples from books that > all say it should work but I always get -1. could someone help before > my brain turns into a cabbage. >
Perhaps if you were to show the code you are trying to use?
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIADaddy, why doesn't this magnet pick up this floppy disk?
attached mail follows:
On Wed, 3 Oct 2001 21:25, Sharat Hegde wrote: > Hello, > > I am trying to parse a CSV (comma separated file) file to get the > separate elements. The format of each line of the file is as follows: > > R001,23,"2,5" > > Note that the 3rd field "2,5" is enclosed within quotes as it has > commas within the field itself. This is a standard file created when an > Excel file is saved as a CSV file. What I need after parsing this is an > array with the elements being: > Element 0 - R001 > Element 1 - 23 > Element 2 - 2,5 > > Standard split command gives 4 elements instead of 3. > > I know I can do this by some brute programming, but is there an elegant > way out. Note that I am not using PHP 4.0 and hence PHP4 specific > features are not available to me as yet! > > Regards, > Sharat
From the manual - may be what you want:
fgetcsv (PHP 3>= 3.0.8, PHP 4 >= 4.0.0)
Gets line from file pointer and parse for CSV fields
array fgetcsv (int fp, int length, string [delimiter])
Similar to fgets() except that fgetcsv() parses the line it reads for fields in CSV format and returns an array containing the fields read. The field delimiter is a comma, unless you specify another delimiter with the optional third parameter.
Fp must be a valid file pointer to a file successfully opened by fopen(), popen(), or fsockopen()
Length must be greater than the longest line to be found in the CSV file (allowing for trailing line-end characters).
fgetcsv() returns FALSE on error, including end of file.
N.B. A blank line in a CSV file will be returned as an array comprising a single NULL field, and will not be treated as an error.
Example 1. fgetcsv() example - Read and print entire contents of a CSV file
$row = 1; $fp = fopen ("test.csv","r"); while ($data = fgetcsv ($fp, 1000, ",")) { $num = count ($data); print "<p> $num fields in line $row: <br>"; $row++; for ($c=0; $c<$num; $c++) { print $data[$c] . "<br>"; } } fclose ($fp);
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIAThere is something to be said about me: "Wow!!"
attached mail follows:
Maxim,
I figured it out. Thanks for your help
PHP can't interpolate within string when nested associative array is used. the nested aa must be appended with dot notation, and if you try to print it within the outer quotes it balks!
print "<td>$a[B]<td>".$quotes[$a[B]]."<td>" ^^^^^ ^^^^^^^^^^^^^^ A B
This works, B switched with A won't work though.
Thanks again,
Job
--- "Maxim Maletsky (PHPBeginner.com)"
<php-general
phpbeginner.com> wrote:
>
>
> -----Original Message-----
> From: Maxim Maletsky (PHPBeginner.com)
> [mailto:php-general
phpbeginner.com]
> Sent: giovedi 4 ottobre 2001 2.02
> To: 'Job Miller'
> Subject: RE: [PHP] associative array syntax question
>
>
>
> I tried on winXP/PHP4.0.6/Apache
>
> <?
> $a = Array('print me');
> $b = Array('b'=>0);
> print $a[$b['b']]
>
> # prints:
> # print me
> ?>
>
>
> Strange, should work though....
>
> Maxim Maletsky
> www.PHPBeginner.com
>
>
>
> -----Original Message-----
> From: Job Miller [mailto:jobmiller
yahoo.com]
> Sent: giovedi 4 ottobre 2001 1.57
> To: Maxim Maletsky (PHPBeginner.com)
> Subject: RE: [PHP] associative array syntax question
>
>
> no luck with that either.
> I do the same thing in Perl all the time.
> can it have anything to do with the fact that the
> inner part is a fetch from a mySQL DB which returns
> an enumerated array,
> so b is actually a constant (drop the quotes)
> referring to an index in
> the result?
>
> i tried $a[$b[b]] and $a[{$b[b]}], etc..
>
> nothing works..
>
>
> --- "Maxim Maletsky (PHPBeginner.com)"
> <php-general
phpbeginner.com>
> wrote:
> > Strange, I always though it should be working.
> >
> > Have you tried $a[{$b['b']}] ?
> >
> > What version of PHP are you running?
> >
> > Maxim Maletsky
> > www.PHPBeginner.com
> >
> >
> >
> > -----Original Message-----
> > From: Job Miller [mailto:jobmiller
yahoo.com]
> > Sent: giovedi 4 ottobre 2001 1.41
> > To: php-general
lists.php.net
> > Subject: [PHP] associative array syntax question
> >
> >
> > why does: print $a[$b['b']] return:
> >
> > parse error, expecting `T_STRING' or `T_VARIABLE'
> or `T_NUM_STRING'
> >
> > but if I do it in two steps like:
> >
> > $c=$b['b'];
> > print $a[$c];
> >
> > it works fine.
> >
> > I have tried dozens of syntax combinations using
> > quotes, no quotes, on one or both and can't get
> > anything to work. any help would be greatly
> > appreciated. The two step method is annoying.
> >
> > Job
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > NEW from Yahoo! GeoCities - quick and easy web
> site
> > hosting, just
> > $8.95/month. http://geocities.yahoo.com/ps/info1
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail:
> > php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail:
> php-general-help
lists.php.net To
> > contact the list administrators, e-mail:
> > php-list-admin
lists.php.net
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail:
> > php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail:
> php-general-help
lists.php.net
> > To contact the list administrators, e-mail:
> > php-list-admin
lists.php.net
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> NEW from Yahoo! GeoCities - quick and easy web site
> hosting, just
> $8.95/month. http://geocities.yahoo.com/ps/info1
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
__________________________________________________ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1
attached mail follows:
Well, the actual problem wasn't that. It was you not posting your code entirely ;-) Often the bugs happen right where you don't except them, just like anything in this life ;-)
Maxim Maletsky www.PHPBeginner.com
-----Original Message-----
From: Job Miller [mailto:jobmiller
yahoo.com]
Sent: giovedi 4 ottobre 2001 2.44
To: Maxim Maletsky (PHPBeginner.com); php-general
lists.php.net
Subject: Re: [PHP] associative array syntax question - got it!
Maxim,
I figured it out. Thanks for your help
PHP can't interpolate within string when nested associative array is used. the nested aa must be appended with dot notation, and if you try to print it within the outer quotes it balks!
print "<td>$a[B]<td>".$quotes[$a[B]]."<td>" ^^^^^ ^^^^^^^^^^^^^^ A B
This works, B switched with A won't work though.
Thanks again,
Job
--- "Maxim Maletsky (PHPBeginner.com)" <php-general
phpbeginner.com>
wrote:
>
>
> -----Original Message-----
> From: Maxim Maletsky (PHPBeginner.com)
> [mailto:php-general
phpbeginner.com]
> Sent: giovedi 4 ottobre 2001 2.02
> To: 'Job Miller'
> Subject: RE: [PHP] associative array syntax question
>
>
>
> I tried on winXP/PHP4.0.6/Apache
>
> <?
> $a = Array('print me');
> $b = Array('b'=>0);
> print $a[$b['b']]
>
> # prints:
> # print me
> ?>
>
>
> Strange, should work though....
>
> Maxim Maletsky
> www.PHPBeginner.com
>
>
>
> -----Original Message-----
> From: Job Miller [mailto:jobmiller
yahoo.com]
> Sent: giovedi 4 ottobre 2001 1.57
> To: Maxim Maletsky (PHPBeginner.com)
> Subject: RE: [PHP] associative array syntax question
>
>
> no luck with that either.
> I do the same thing in Perl all the time.
> can it have anything to do with the fact that the
> inner part is a fetch from a mySQL DB which returns
> an enumerated array,
> so b is actually a constant (drop the quotes)
> referring to an index in
> the result?
>
> i tried $a[$b[b]] and $a[{$b[b]}], etc..
>
> nothing works..
>
>
> --- "Maxim Maletsky (PHPBeginner.com)" <php-general
phpbeginner.com>
> wrote:
> > Strange, I always though it should be working.
> >
> > Have you tried $a[{$b['b']}] ?
> >
> > What version of PHP are you running?
> >
> > Maxim Maletsky
> > www.PHPBeginner.com
> >
> >
> >
> > -----Original Message-----
> > From: Job Miller [mailto:jobmiller
yahoo.com]
> > Sent: giovedi 4 ottobre 2001 1.41
> > To: php-general
lists.php.net
> > Subject: [PHP] associative array syntax question
> >
> >
> > why does: print $a[$b['b']] return:
> >
> > parse error, expecting `T_STRING' or `T_VARIABLE'
> or `T_NUM_STRING'
> >
> > but if I do it in two steps like:
> >
> > $c=$b['b'];
> > print $a[$c];
> >
> > it works fine.
> >
> > I have tried dozens of syntax combinations using
> > quotes, no quotes, on one or both and can't get
> > anything to work. any help would be greatly
> > appreciated. The two step method is annoying.
> >
> > Job
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > NEW from Yahoo! GeoCities - quick and easy web
> site
> > hosting, just
> > $8.95/month. http://geocities.yahoo.com/ps/info1
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail:
> php-general-help
lists.php.net To
> > contact the list administrators, e-mail:
> > php-list-admin
lists.php.net
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail:
> php-general-help
lists.php.net
> > To contact the list administrators, e-mail:
> > php-list-admin
lists.php.net
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> NEW from Yahoo! GeoCities - quick and easy web site
> hosting, just
> $8.95/month. http://geocities.yahoo.com/ps/info1
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
__________________________________________________ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Have you tried using curly brackets?
print "<td>$a[B]<td>{$quotes[$a[B]]}<td>"
Does that work? Just cuious...
-----Original Message-----
From: Job Miller [mailto:jobmiller
yahoo.com]
Sent: Wednesday, October 03, 2001 8:44 PM
To: Maxim Maletsky (PHPBeginner.com); php-general
lists.php.net
Subject: Re: [PHP] associative array syntax question - got it!
Maxim,
I figured it out. Thanks for your help
PHP can't interpolate within string when nested associative array is used. the nested aa must be appended with dot notation, and if you try to print it within the outer quotes it balks!
print "<td>$a[B]<td>".$quotes[$a[B]]."<td>" ^^^^^ ^^^^^^^^^^^^^^ A B
This works, B switched with A won't work though.
Thanks again,
Job
--- "Maxim Maletsky (PHPBeginner.com)" <php-general
phpbeginner.com>
wrote:
>
>
> -----Original Message-----
> From: Maxim Maletsky (PHPBeginner.com)
> [mailto:php-general
phpbeginner.com]
> Sent: giovedi 4 ottobre 2001 2.02
> To: 'Job Miller'
> Subject: RE: [PHP] associative array syntax question
>
>
>
> I tried on winXP/PHP4.0.6/Apache
>
> <?
> $a = Array('print me');
> $b = Array('b'=>0);
> print $a[$b['b']]
>
> # prints:
> # print me
> ?>
>
>
> Strange, should work though....
>
> Maxim Maletsky
> www.PHPBeginner.com
>
>
>
> -----Original Message-----
> From: Job Miller [mailto:jobmiller
yahoo.com]
> Sent: giovedi 4 ottobre 2001 1.57
> To: Maxim Maletsky (PHPBeginner.com)
> Subject: RE: [PHP] associative array syntax question
>
>
> no luck with that either.
> I do the same thing in Perl all the time.
> can it have anything to do with the fact that the
> inner part is a fetch from a mySQL DB which returns
> an enumerated array,
> so b is actually a constant (drop the quotes)
> referring to an index in
> the result?
>
> i tried $a[$b[b]] and $a[{$b[b]}], etc..
>
> nothing works..
>
>
> --- "Maxim Maletsky (PHPBeginner.com)" <php-general
phpbeginner.com>
> wrote:
> > Strange, I always though it should be working.
> >
> > Have you tried $a[{$b['b']}] ?
> >
> > What version of PHP are you running?
> >
> > Maxim Maletsky
> > www.PHPBeginner.com
> >
> >
> >
> > -----Original Message-----
> > From: Job Miller [mailto:jobmiller
yahoo.com]
> > Sent: giovedi 4 ottobre 2001 1.41
> > To: php-general
lists.php.net
> > Subject: [PHP] associative array syntax question
> >
> >
> > why does: print $a[$b['b']] return:
> >
> > parse error, expecting `T_STRING' or `T_VARIABLE'
> or `T_NUM_STRING'
> >
> > but if I do it in two steps like:
> >
> > $c=$b['b'];
> > print $a[$c];
> >
> > it works fine.
> >
> > I have tried dozens of syntax combinations using
> > quotes, no quotes, on one or both and can't get
> > anything to work. any help would be greatly
> > appreciated. The two step method is annoying.
> >
> > Job
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > NEW from Yahoo! GeoCities - quick and easy web
> site
> > hosting, just
> > $8.95/month. http://geocities.yahoo.com/ps/info1
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail:
> php-general-help
lists.php.net To
> > contact the list administrators, e-mail:
> > php-list-admin
lists.php.net
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail:
> php-general-help
lists.php.net
> > To contact the list administrators, e-mail:
> > php-list-admin
lists.php.net
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> NEW from Yahoo! GeoCities - quick and easy web site
> hosting, just
> $8.95/month. http://geocities.yahoo.com/ps/info1
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
__________________________________________________ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Yes, that does for sure
Maxim Maletsky www.PHPBeginner.com
-----Original Message-----
From: Matthew Loff [mailto:matt
willetts.com]
Sent: giovedi 4 ottobre 2001 4.02
To: 'Job Miller'; 'Maxim Maletsky (PHPBeginner.com)';
php-general
lists.php.net
Subject: RE: [PHP] associative array syntax question - got it!
Have you tried using curly brackets?
print "<td>$a[B]<td>{$quotes[$a[B]]}<td>"
Does that work? Just cuious...
-----Original Message-----
From: Job Miller [mailto:jobmiller
yahoo.com]
Sent: Wednesday, October 03, 2001 8:44 PM
To: Maxim Maletsky (PHPBeginner.com); php-general
lists.php.net
Subject: Re: [PHP] associative array syntax question - got it!
Maxim,
I figured it out. Thanks for your help
PHP can't interpolate within string when nested associative array is used. the nested aa must be appended with dot notation, and if you try to print it within the outer quotes it balks!
print "<td>$a[B]<td>".$quotes[$a[B]]."<td>" ^^^^^ ^^^^^^^^^^^^^^ A B
This works, B switched with A won't work though.
Thanks again,
Job
--- "Maxim Maletsky (PHPBeginner.com)" <php-general
phpbeginner.com>
wrote:
>
>
> -----Original Message-----
> From: Maxim Maletsky (PHPBeginner.com)
> [mailto:php-general
phpbeginner.com]
> Sent: giovedi 4 ottobre 2001 2.02
> To: 'Job Miller'
> Subject: RE: [PHP] associative array syntax question
>
>
>
> I tried on winXP/PHP4.0.6/Apache
>
> <?
> $a = Array('print me');
> $b = Array('b'=>0);
> print $a[$b['b']]
>
> # prints:
> # print me
> ?>
>
>
> Strange, should work though....
>
> Maxim Maletsky
> www.PHPBeginner.com
>
>
>
> -----Original Message-----
> From: Job Miller [mailto:jobmiller
yahoo.com]
> Sent: giovedi 4 ottobre 2001 1.57
> To: Maxim Maletsky (PHPBeginner.com)
> Subject: RE: [PHP] associative array syntax question
>
>
> no luck with that either.
> I do the same thing in Perl all the time.
> can it have anything to do with the fact that the
> inner part is a fetch from a mySQL DB which returns
> an enumerated array,
> so b is actually a constant (drop the quotes)
> referring to an index in
> the result?
>
> i tried $a[$b[b]] and $a[{$b[b]}], etc..
>
> nothing works..
>
>
> --- "Maxim Maletsky (PHPBeginner.com)" <php-general
phpbeginner.com>
> wrote:
> > Strange, I always though it should be working.
> >
> > Have you tried $a[{$b['b']}] ?
> >
> > What version of PHP are you running?
> >
> > Maxim Maletsky
> > www.PHPBeginner.com
> >
> >
> >
> > -----Original Message-----
> > From: Job Miller [mailto:jobmiller
yahoo.com]
> > Sent: giovedi 4 ottobre 2001 1.41
> > To: php-general
lists.php.net
> > Subject: [PHP] associative array syntax question
> >
> >
> > why does: print $a[$b['b']] return:
> >
> > parse error, expecting `T_STRING' or `T_VARIABLE'
> or `T_NUM_STRING'
> >
> > but if I do it in two steps like:
> >
> > $c=$b['b'];
> > print $a[$c];
> >
> > it works fine.
> >
> > I have tried dozens of syntax combinations using
> > quotes, no quotes, on one or both and can't get
> > anything to work. any help would be greatly
> > appreciated. The two step method is annoying.
> >
> > Job
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > NEW from Yahoo! GeoCities - quick and easy web
> site
> > hosting, just
> > $8.95/month. http://geocities.yahoo.com/ps/info1
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail:
> php-general-help
lists.php.net To
> > contact the list administrators, e-mail:
> > php-list-admin
lists.php.net
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail:
> php-general-help
lists.php.net
> > To contact the list administrators, e-mail:
> > php-list-admin
lists.php.net
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> NEW from Yahoo! GeoCities - quick and easy web site
> hosting, just
> $8.95/month. http://geocities.yahoo.com/ps/info1
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
__________________________________________________ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hi,
I have a variable called $String which can contain 3 random numbers like so...
$String="12,94,423";
I then have $Num which is a single number from 1 - 20, I want to add $String and $Num together like this
$String$Num
So I would end up with $String1="12,94,423"; and then I can enter that value into my session....
session_register(String.$Num);
I have tried everyway I can think of but it never works
The reason for doing this is so I can store multiple $Strings in the session and use them later for a search.
Can anyone help?
Thanks Ade
attached mail follows:
$sess = $String.$Num; session_register($sess);
..is your answer :-)
...you're welcome :-)
Maxim Maletsky www.PHPBeginner.com
-----Original Message-----
From: SilkWebDesign
aol.com [mailto:SilkWebDesign
aol.com]
Sent: giovedi 4 ottobre 2001 2.53
To: php-general
lists.php.net
Subject: [PHP] Add $String to $Num ???
Hi,
I have a variable called $String which can contain 3 random numbers like so...
$String="12,94,423";
I then have $Num which is a single number from 1 - 20, I want to add $String and $Num together like this
$String$Num
So I would end up with $String1="12,94,423"; and then I can enter that value into my session....
session_register(String.$Num);
I have tried everyway I can think of but it never works
The reason for doing this is so I can store multiple $Strings in the session and use them later for a search.
Can anyone help?
Thanks Ade
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hi,
No that doesn't quite work, using your example it returned in my session file
!10,47,552|
If I change session_register($sess); to session_register(sess); it gives me
sess|s:9:"10,47,552";
And what I want is
String1(or 2,3,4,5 etc whatever the value of $Num is)|s:9:"10,47,552";
Ade
attached mail follows:
So sprach »SilkWebDesign
aol.com« am 2001-10-03 um 21:28:03 -0400 :
> String1(or 2,3,4,5 etc whatever the value of $Num is)|s:9:"10,47,552";
Try:
session_register(${$string . $num});
And read up on variable variables in the manual.
And maybe forget this idea and use arrays instead...
Alexander Skwar
-- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 0 hours 40 minutes
attached mail follows:
Hi, I'm the original author. I put my address in the body of the message to avoid spammers. To answer your question, nobody answered my question. However, after messing around, I found a change that did the trick. Coming from an OOP background (lisp, smalltalk, etc.) it sure seems to me that PHP has a seriously brain-damaged notion of objects and references. Nevertheless, if you're a guest in someone's house you have to play by their rules. In this case, the rules are to use "=& new" instead of "= new" to create the objects in the first place. The new code below works as intended:
$apple = & new Org("Apple"); $banana = & new Org("Banana"); $cherry = & new Org("Cherry");
Also, please note there's a funny line-wrap in prettyprint(), but you can remove the extra CR.
steve
orangeimagineering-no-spam-please.com
(but without the "-no-spam-please")
Joel Ricker wrote:
> I tried to ask this person if anybody answered his question personally or
> not but it appears the e-mail address isn't real (a
a.com). Understanable.
>
> Does anyone know about this or did anyone send em an e-mail about this?
> Just starting work on my first serious OOP project beyond a handful of basic
> classes and am interested in any information or problems associated with it.
>
> Joel
>
> : I'd like to ask your help to figure out why PHP objects are stripped of
> : their local variables when you add the objects to an array.
> : Shouldn't these be references, not shallow copies?
> :
> : The code below is a simple org chart.
> : I create three instances, each is added to a global array called orgs[].
> :
> : Each instance has a child, but when you add them to orgs[]
> : they lose their children.
> : I used & to create a reference, not a copy, but the problem remains.
> :
> : Please reply by email to steve
orangeimagineering-no-spam-please.com,
> : but without the "-no-spam-please".
> :
> : When run in PHP Version 4.0.6, I get this output.
> : Notice that $apple retains its local value of $children,
> : but the same object, pushed onto $orgs[0], loses its local value.
> :
> : --- output web page----
> :
> : <Apple has 1 children >
> : <Banana has 1 children >
> : <Cherry has 1 children >
> :
> : <Apple has 0 children >
> : <Banana has 0 children >
> : <Cherry has 0 children >
> :
> :
> : ----------- source code ------
> : <?php
> : // A simple (buggy) Org chart package
> : global $orgs;
> : $orgs = array();
> :
> : class Org {
> : var $name;
> : var $children;
> :
> : function Org ($iname) {
> : global $orgs;
> : $this->name = $iname;
> : $this->children = array();
> : $orgs[] = & $this; // Each Org is added to the array $orgs[]
> : }
> :
> : function prettyprint() {
> : return "<".$this->name." has ".count($this->children)."
> : children >";
> : }
> : } // end class Org
> :
> : // Create three Orgs
> : $apple = new Org("Apple");
> : $banana = new Org("Banana");
> : $cherry = new Org("Cherry");
> :
> : // Arrange them hierarchically
> : $apple->children[] = $banana;
> : $banana->children[] = $cherry;
> : $cherry->children[] = "none";
> : ?>
> :
> : <html>
> : <body bgcolor=white>
> : <?php
> :
> : echo($apple->prettyprint()."<br>");
> : echo($banana->prettyprint()."<br>");
> : echo($cherry->prettyprint()."<p>");
> :
> : echo($orgs[0]->prettyprint()."<br>");
> : echo($orgs[1]->prettyprint()."<br>");
> : echo($orgs[2]->prettyprint()."<br>");
> : ?>
> : </body>
> : </html>
> :
> :
> : --
> : PHP General Mailing List (http://www.php.net/)
> : To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> : For additional commands, e-mail: php-general-help
lists.php.net
> : To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hi,
decbin() is unable to handle decimal numers greater than 2147483647 and it's a problem. That's in the docs, ok. The situation is: I have a list of IPs in decimal format (ex: 3232235524) and I wanted to translate them into dot decimal. As far as I know the formula is:
[...]by converting the number to binary, breaking the binary number down into 4 octets and then converting each octet into a dotted-decimal number.
(got from http://www.montagar.com/~patj/ipmath.txt)
When I try to do this with PHP, I get just 1's because the IPs are greater than 2147483647. Anyone knows a workaround for this?
Thanks in advance.
-- dharana <dharanadharana.net> Black holes are where PGP KeyID: 0xC32A724 GOOD is dividing by zero
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org
iD8DBQE7u9ohe5f53cMqckYRAgTBAJ44IkM/E2L1HoWqD2mul1NiD29P2gCg1spO 6VeV2aZOCCaSGocZOcoBOR0= =iK7a -----END PGP SIGNATURE-----
attached mail follows:
On Thu, 4 Oct 2001 13:10, dharana
dharana.net wrote:
> Hi,
>
> decbin() is unable to handle decimal numers greater than 2147483647 and
> it's a problem. That's in the docs, ok. The situation is: I have a list
> of IPs in decimal format (ex: 3232235524) and I wanted to translate
> them into dot decimal. As far as I know the formula is:
>
> [...]by converting the
> number to binary, breaking the binary number down into 4 octets and
> then converting each octet into a dotted-decimal number.
>
> (got from http://www.montagar.com/~patj/ipmath.txt)
>
>
> When I try to do this with PHP, I get just 1's because the IPs are
> greater than 2147483647. Anyone knows a workaround for this?
>
> Thanks in advance.
I think the function ip2long might be what you want.
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIAKeyboard Not Found - Press [F1] to Continue
attached mail follows:
I have a common css file that is being used across several virtual hosts. Basically, what I am trying to do is use the same css file even though several text colors/sizes need to be changed depending on what site/platform its being used on.
I have my sql query (retrieves $site_style) in the file that includes the css file and a bunch of IF statements inside the css file itself. The only problem is that the css is not being generated properly.
For some reason, the IF statements are not being processed correctly/at all. I can echo the variables through the index.php and the variables are set to global. Its just that styles.php seems to almost bypass the IF and use the 1st set of variables even though it shouldn't be.
Here's an example from the css (styles.php) - there are about 5 IF statements in there but here's the basic idea of them all:
<?php //index.php creates platform and site style require("index.php");
if (($BROWSER_PLATFORM == "Win") && (($site_style!=="10") || ($site_style!=="9"))) { $pc8=8; $pc9=9; $pc10=10; $pc12=12; $pc13=13; $pc14=14; $text="#ffffff"; $heading="#2E4471"; } ?>
.standard { font-family:verdana, arial; font-size: <?=$pc10;?>pt; color:<?=$text;?>; }
The call from site style 10 <link rel="stylesheet" href="/styles.php">
If I go to a $site_style 10, it still uses the variables defined within the example IF statement even though it clearly shouldn't. If I type in the URL to styles.php from a $site_style 10, it shows the wrong tags.
Is it a problem with my IF statements or is something else going over my head?
Thanks again for any help - I've been trying to figure this out for days to no avail...
__________________ Jason Dulberg Extreme MTB http://extreme.nas.net
attached mail follows:
On Thu, 4 Oct 2001 13:49, Jason Dulberg wrote: > I have a common css file that is being used across several virtual > hosts. Basically, what I am trying to do is use the same css file even > though several text colors/sizes need to be changed depending on what > site/platform its being used on. > > I have my sql query (retrieves $site_style) in the file that includes > the css file and a bunch of IF statements inside the css file itself. > The only problem is that the css is not being generated properly. > > For some reason, the IF statements are not being processed correctly/at > all. I can echo the variables through the index.php and the variables > are set to global. Its just that styles.php seems to almost bypass the > IF and use the 1st set of variables even though it shouldn't be. > > Here's an example from the css (styles.php) - there are about 5 IF > statements in there but here's the basic idea of them all: > > <?php > //index.php creates platform and site style > require("index.php"); > > if (($BROWSER_PLATFORM == "Win") && (($site_style!=="10") ||
Any other problems aside, this is not how you do 'Not Equal'.
$site_style!="10"
is correct syntax.
> ($site_style!=="9"))) { > $pc8=8; > $pc9=9; > $pc10=10; > $pc12=12; > $pc13=13; > $pc14=14; > $text="#ffffff"; > $heading="#2E4471"; > } > ?> > > .standard { > font-family:verdana, arial; > font-size: <?=$pc10;?>pt; > color:<?=$text;?>; > } > > The call from site style 10 > <link rel="stylesheet" href="/styles.php"> > > If I go to a $site_style 10, it still uses the variables defined within > the example IF statement even though it clearly shouldn't. If I type in > the URL to styles.php from a $site_style 10, it shows the wrong tags. > > Is it a problem with my IF statements or is something else going over > my head? > > Thanks again for any help - I've been trying to figure this out for > days to no avail... > > __________________ > Jason Dulberg > Extreme MTB > http://extreme.nas.net
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIAThe first myth of management is that it exists.
attached mail follows:
> if (($BROWSER_PLATFORM == "Win") && (($site_style!=="10") || > ($site_style!=="9"))) {
Common logic mistake.
if ( A != 10 or A != 9 )
Which value of A would make that logic false?
-Rasmus
attached mail follows:
Thank you for your response. I changed my the code to the method that you suggested. Unfortunately, it still doesn't use the IF's properly.
For instance, if I open a $site_style 10, the IF statement for that is the following:
elseif (($BROWSER_PLATFORM == "Win") && ($site_style=="10")) { $pc8=8; $pc9=9; $pc10=10; $pc12=12; $pc13=13; $pc14=14; $text="#D1BAC6"; $link="#F8CC92"; $heading="#B38B9F"; }
It still reads the first IF statement as I have in the original message shown below.
Thanks again.
Jason.
> > if (($BROWSER_PLATFORM == "Win") && (($site_style!=="10") || > > Any other problems aside, this is not how you do 'Not Equal'. > > $site_style!="10" > > is correct syntax. > > > ($site_style!=="9"))) { > > $pc8=8; > > $pc9=9; > > $pc10=10; > > $pc12=12; > > $pc13=13; > > $pc14=14; > > $text="#ffffff"; > > $heading="#2E4471"; > > } > > ?>
attached mail follows:
> Any other problems aside, this is not how you do 'Not Equal'. > > $site_style!="10" > > is correct syntax.
No, !== is quite valid. It is the non-equality version of ===
See http://www.php.net/manual/en/language.operators.comparison.php
-Rasmus
attached mail follows:
Theoretically, either/or I'm assuming. If A isn't 10 or A isn't 9...
So I'm assumuming that my IF's are way off base?
This is definitely something that'll be helpful for my other work as well.
Thanks
__________________ Jason Dulberg Extreme MTB http://extreme.nas.net
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:rasmus
php.net]
> Sent: October 4, 2001 12:41 AM
> To: Jason Dulberg
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] php in css not working with IF's
>
>
> > if (($BROWSER_PLATFORM == "Win") && (($site_style!=="10") ||
> > ($site_style!=="9"))) {
>
> Common logic mistake.
>
> if ( A != 10 or A != 9 )
>
> Which value of A would make that logic false?
>
> -Rasmus
>
>
attached mail follows:
Without following your logic I can give an example of how style sheets on PHPBeginner.com work:
In the page we have <link rel="stylesheet" href="/styles.php">
And in the styles.php we have all the possible DB connections, browser checks by (PHP SNIFF) and so and so on.
You cold even try to call the class this way with Get: <link rel="stylesheet" href="/styles.php?foo=foo&bar=baz">
That will work as well.
But one thing you cannot do is defining variable on index.php hoping they would become available in styles.php - those are TOTALY separated processes. Something like if you would have a page with two frames.
So, here's another thing. The only reason of using external CSS file is to have it automatically cached by your browser so it loads once per session. By default it will not. You're gonna need to review your headers, adding cache control to it.
Hope it gave you an idea.
Maxim Maletsky www.PHPBeginner.com
-----Original Message-----
From: Jason Dulberg [mailto:jdulberg
nas.net]
Sent: giovedì 4 ottobre 2001 6.19
To: php-general
lists.php.net
Subject: [PHP] php in css not working with IF's
I have a common css file that is being used across several virtual hosts. Basically, what I am trying to do is use the same css file even though several text colors/sizes need to be changed depending on what site/platform its being used on.
I have my sql query (retrieves $site_style) in the file that includes the css file and a bunch of IF statements inside the css file itself. The only problem is that the css is not being generated properly.
For some reason, the IF statements are not being processed correctly/at all. I can echo the variables through the index.php and the variables are set to global. Its just that styles.php seems to almost bypass the IF and use the 1st set of variables even though it shouldn't be.
Here's an example from the css (styles.php) - there are about 5 IF statements in there but here's the basic idea of them all:
<?php //index.php creates platform and site style require("index.php");
if (($BROWSER_PLATFORM == "Win") && (($site_style!=="10") || ($site_style!=="9"))) { $pc8=8; $pc9=9; $pc10=10; $pc12=12; $pc13=13; $pc14=14; $text="#ffffff"; $heading="#2E4471"; } ?>
.standard { font-family:verdana, arial; font-size: <?=$pc10;?>pt; color:<?=$text;?>; }
The call from site style 10 <link rel="stylesheet" href="/styles.php">
If I go to a $site_style 10, it