|
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: Wed Sep 18 2002 - 17:18:56 CDT
php-general Digest 18 Sep 2002 22:18:56 -0000 Issue 1593
Topics (messages 116710 through 116802):
Need some help please.
116710 by: Simon Angell
116713 by: Simon Angell
116744 by: Simon Angell
Re: Dependent Dropdown Boxes
116711 by: lallous
Re: replacing mail()
116712 by: lallous
116715 by: Liam MacKenzie
116738 by: lallous
116796 by: Rick Widmer
Urgent Installation Question
116714 by: César Aracena
116716 by: John Holmes
116718 by: César Aracena
116720 by: John Holmes
116722 by: Marek Kilimajer
Image resolution and php
116717 by: dsfljsdfklj kljvdskljfsdkl
116726 by: Jome
116729 by: Mark Charette
116754 by: Eric C. Pollitt
116759 by: pan
Re: Auto-increment value
116719 by: Faisal Abdullah
116723 by: Marek Kilimajer
116724 by: Faisal Abdullah
116725 by: Leonid Mamtchenkov
116727 by: Faisal Abdullah
116728 by: bob parker
116730 by: Marek Kilimajer
116731 by: Jon Haworth
116733 by: bob parker
116736 by: Justin French
116740 by: bob parker
116799 by: Leonid Mamtchenkov
Re: Help.....still stuck after 3 days :/
116721 by: Rudolf Visagie
Oracle connection release
116732 by: Rasmus Sellberg
116737 by: Thies C. Arntzen
Re: PHP and Microsoft Office
116734 by: Steve Bradwell
extension_dir
116735 by: Ivo
Re: PHP function for searching words in a string?
116739 by: yasin inat
MySQL Current Row??
116741 by: Beeman
116742 by: Cal Evans
Re: adding unix account via system command
116743 by: Henrik Hudson
Re: Problems with php and qmail
116745 by: Michael J Humphries
Join - problem
116746 by: Henning
116747 by: John Wards
116748 by: John Holmes
116750 by: Henning
Time Stamp
116749 by: Chuck Payne
116751 by: John Holmes
header() and POST
116752 by: dsfljsdfklj kljvdskljfsdkl
Re: Large uploads
116753 by: Rickard Dahlstrand
116787 by: Paul Nicholson
Re: Please, Help dynamicaly creating an Array
116755 by: Max Sullivan
Re: mid-level PHP/MySQL people in Los Angeles?
116756 by: Eric C. Pollitt
Join in MySQL-select doesn't work
116757 by: Henning
Difficult MIME question
116758 by: C.F. Scheidecker Antunes
Re: PHP and Flash
116760 by: timo stamm
Stripping specific tags
116761 by: Alexis Antonakis
Global Vars
116762 by: Sascha Braun
116795 by: David Eggler
Re: time() problem
116763 by: Savaidis
116765 by: Adam Voigt
Loop through POST-result
116764 by: Michelle
Date(), adjusted for one year
116766 by: Support . Fourthrealm.com
116767 by: Robert Cummings
116768 by: Jacob Miller
116769 by: Robert Cummings
Unserialize stopped working after php & db upgrade
116770 by: Geoff Caplan
116788 by: Paul Nicholson
116794 by: Geoff Caplan
116798 by: Paul Nicholson
Sessions /Cross Domain
116771 by: David Buerer
116773 by: Robert Cummings
116774 by: Sascha Braun
116775 by: Jacob Miller
116776 by: David Buerer
116777 by: Robert Cummings
116778 by: Sascha Braun
116779 by: Sascha Braun
116781 by: James E Hicks III
PHP Installation
116772 by: Sascha Braun
Re: Date-format
116780 by: Support . Fourthrealm.com
116782 by: Jacob Miller
116786 by: Chuck Payne
Re: Conditionally include file based on document location
116783 by: Eric C. Pollitt
PHP4 Oracle SELECT statement ERROR
116784 by: notoriousvic_ca
116789 by: notoriousvic_ca
Installation
116785 by: Sascha Braun
116792 by: Dan Ostrowski
Help Fatal Error
116790 by: James E Hicks III
test
116791 by: Ryan A
Re: imagettftext function does not handle combining character properly
116793 by: Ziying Sherwin
Efficiency
116797 by: Support . Fourthrealm.com
116801 by: Rick Widmer
Friend of function??
116800 by: Anup
116802 by: Kevin Stone
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:
Hi.
I am having trouble with a PHP script. I am not the one who made this and my
knowledge on php is very little.
I came across this php script www.canberra-wx.com/bomonster/bomonster01.php
which is weather forecasting for a place called Mildura.
The file that the PHP gets its info from is here...
http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDV17001.txt and if you look down
the page you will see the Mildura forecast that the PHP draws its info
output from.
My Problem is that i want it to work for this file...
http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDN10035.txt and i cant work out
how to get it going.
i have got this far www.canberra-wx.com/bomonster/bomonster1.php (look at
the code, the actual outpot doesn't work..thats my problem). The part I want
the PHP to do its info output is from A.C.T FORECAST (like from the Mildura
in IDV17001.txt)
Any help on how to get it to work would be great.
Cheers
---------------------------------------------------------
Simon Angell
Canberra ACT
www.canberra-wx.com
---------------------------------------------------------
Member of:
Australian Severe Weather Association.
www.severeweather.asn.au
---------------------------------------------------------
This email is virus free.
Scanned before leaving my mailbox
using Norton Antivirus 2002 for Win2k
Scanned with the latest definition File.
attached mail follows:
just thought i should add the source
MILDURA (working)
<?php
//weather("Mildura","http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDV17001.txt"
,"bomonster.htm");
weather("Mildura","http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDV17001.txt","
bomonster.htm");
function weather($placename, $inputfilename, $templatefilename){
//
############################################################################
#
// # BOMonster 0.1
// # Author: Matthew Cook (mattax
yahoo.com)
// #
// # How to use:
// # <$placename> is the place you want to find the forecasts for
// # <$inputfilename> is the file you want to grab the data from
// # <$templatefilename> is the file you want to put the forecasts into
// # Details are in readme.txt
// #
// # Released under the GNU GPL (http://www.gnu.org/copyleft/gpl.html)
//
############################################################################
#
//try to connect to target - IDV60035
if(!$fp=fopen($inputfilename ,"r")) {
echo "Can't Open Weather File" ;
}
else {
//initalise $content variable
$content = "";
// read content
while(!feof($fp)){
$content.=fgets($fp,1024);
}
//close connection
fclose($fp);
//create new string containing data for selected place
preg_match("|$placename.*?\\n\\n.*?\\n\\n|s", $content, $temp);
//turn the first element of the temp array into a variable
$temp_content = $temp[0];
//split place_content into an array by multiple spaces and single [NL]s
$temp_array = preg_split ("/[\s]{2,}|[\n]/", $temp_content);
//clean out all the "Min" and "Max"
$temp_array = str_replace("Min", "", $temp_array);
$temp_array = str_replace("Max", "", $temp_array);
//trim entries
for ($counter = 0; $counter <= count($temp_array)-1; $counter++){
trim($temp_array[$counter]);
}
//check for today's description > 80 char
if (is_numeric($temp_array[3]) == FALSE){
$temp_array[2] = $temp_array[2]." ".$temp_array[3];
for ($counter = 3; $counter <= count($temp_array)-2; $counter++) {
$temp_array[$counter] = $temp_array[$counter+1];
}
}
//print_r($temp_array);
//determine if it's the afternoon/evening variant or not
if (preg_match("/Tonight/", $temp_array[1])){
$arvomod = 1;
$temp_array = str_replace("Tonight and ", "", $temp_array);
} else {
$arvomod = 0;
}
//convert $temp_array into $place_array
$place_array["name"][0] = $temp_array[0];
$place_array["name"][1] = $temp_array[1];
$place_array["name"][2] = $temp_array[6+$arvomod];
$place_array["name"][3] = $temp_array[10+$arvomod];
$place_array["name"][4] = $temp_array[14+$arvomod];
$place_array["description"][1] = $temp_array[2];
$place_array["description"][2] = $temp_array[7+$arvomod];
$place_array["description"][3] = $temp_array[11+$arvomod];
$place_array["description"][4] = $temp_array[15+$arvomod];
if ($arvomod = 1){
$place_array["min_temp"][1] = $temp_array[3];
}
$place_array["min_temp"][2] = $temp_array[8+$arvomod];
$place_array["min_temp"][3] = $temp_array[12+$arvomod];
$place_array["min_temp"][4] = $temp_array[16+$arvomod];
$place_array["max_temp"][1] = $temp_array[3+$arvomod];
$place_array["max_temp"][2] = $temp_array[9+$arvomod];
$place_array["max_temp"][3] = $temp_array[13+$arvomod];
$place_array["max_temp"][4] = $temp_array[17+$arvomod];
$place_array["precip"][1] = $temp_array[5+$arvomod];
//determine the appropriate images and alt tags
for ($counter = 1; $counter <= 4; $counter++){
if (stristr($place_array["description"][$counter], "thunderstorm")){
$place_array["image"][$counter] = "thunder";
$place_array["alt_tag"][$counter] = "Thunderstorms";
} elseif (stristr($place_array["description"][$counter], "shower")){
$place_array["image"][$counter] = "shower";
$place_array["alt_tag"][$counter] = "Showers";
} elseif (stristr($place_array["description"][$counter], "fine")){
$place_array["image"][$counter] = "fine";
$place_array["alt_tag"][$counter] = "Fine";
} else {
$place_array["image"][$counter] = "unknown";
$place_array["alt_tag"][$counter] = "Unknown";
}
}
//create short names
for ($counter = 0; $counter <= 4; $counter++){
$place_array["short_name"][$counter] =
substr($place_array["name"][$counter], 0, 3);
}
}
//declare template
$template = "";
//open template
if(!$fp=fopen($templatefilename ,"r")) {
echo "Can't Open Template File" ;
} else {
// read template
while(!feof($fp)){
$template.=fgets($fp,1024);
}
//close connection
fclose($fp);
//replace some strings
$patterns = array(
"/(\%Name\[)(.*?)(\]\%)/se",
"/(\%Description\[)(.*?)(\]\%)/se",
"/(\%Min_Temp\[)(.*?)(\]\%)/se",
"/(\%Max_Temp\[)(.*?)(\]\%)/se",
"/(\%Precip\[)(.*?)(\]\%)/se",
"/(\%Image\[)(.*?)(\]\%)/se",
"/(\%Alt_Tag\[)(.*?)(\]\%)/se",
"/(\%Short_Name\[)(.*?)(\]\%)/se"
);
$replace = array(
'$place_array["name"]["\\2"]',
'$place_array["description"]["\\2"]',
'$place_array["min_temp"]["\\2"]',
'$place_array["max_temp"]["\\2"]',
'$place_array["precip"]["\\2"]',
'$place_array["image"]["\\2"]',
'$place_array["alt_tag"]["\\2"]',
'$place_array["short_name"]["\\2"]'
);
$template = preg_replace ($patterns, $replace, $template);
print($template);
}
}
?>
AND What i have done for A.C.T FORECAST...
<?php
//weather("A.C.T.
FORECAST","http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDN10035.txt","bomonste
r.htm");
weather("A.C.T.
FORECAST","http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDN10035.txt","bomonste
r.htm");
function weather($placename, $inputfilename, $templatefilename){
//
############################################################################
#
// # BOMonster 0.1
// # Author: Matthew Cook (mattax
yahoo.com)
// #
// # How to use:
// # <$placename> is the place you want to find the forecasts for
// # <$inputfilename> is the file you want to grab the data from
// # <$templatefilename> is the file you want to put the forecasts into
// # Details are in readme.txt
// #
// # Released under the GNU GPL (http://www.gnu.org/copyleft/gpl.html)
//
############################################################################
#
//try to connect to target - IDN10035
if(!$fp=fopen($inputfilename ,"r")) {
echo "Can't Open Weather File" ;
}
else {
//initalise $content variable
$content = "";
// read content
while(!feof($fp)){
$content.=fgets($fp,1024);
}
//close connection
fclose($fp);
//create new string containing data for selected place
preg_match("|$Canberra.*?\\n\\n.*?\\n\\n|s", $content, $temp);
//turn the first element of the temp array into a variable
$temp_content = $temp[0];
//split place_content into an array by multiple spaces and single [NL]s
$temp_array = preg_split ("/[\s]{2,}|[\n]/", $temp_content);
//clean out all the "Min" and "Max"
$temp_array = str_replace("Min", "", $temp_array);
$temp_array = str_replace("Max", "", $temp_array);
//trim entries
for ($counter = 0; $counter <= count($temp_array)-1; $counter++){
trim($temp_array[$counter]);
}
//check for today's description > 80 char
if (is_numeric($temp_array[3]) == FALSE){
$temp_array[2] = $temp_array[2]." ".$temp_array[3];
for ($counter = 3; $counter <= count($temp_array)-2; $counter++) {
$temp_array[$counter] = $temp_array[$counter+1];
}
}
//print_r($temp_array);
//determine if it's the afternoon/evening variant or not
if (preg_match("/tonight/", $temp_array[1])){
$arvomod = 1;
$temp_array = str_replace("Tonight and ", "", $temp_array);
} else {
$arvomod = 0;
}
//convert $temp_array into $place_array
$place_array["name"][0] = $temp_array[0];
$place_array["name"][1] = $temp_array[1];
$place_array["name"][2] = $temp_array[6+$arvomod];
$place_array["name"][3] = $temp_array[10+$arvomod];
$place_array["name"][4] = $temp_array[14+$arvomod];
$place_array["description"][1] = $temp_array[2];
$place_array["description"][2] = $temp_array[7+$arvomod];
$place_array["description"][3] = $temp_array[11+$arvomod];
$place_array["description"][4] = $temp_array[15+$arvomod];
if ($arvomod = 1){
$place_array["min_temp"][1] = $temp_array[3];
}
$place_array["min_temp"][2] = $temp_array[8+$arvomod];
$place_array["min_temp"][3] = $temp_array[12+$arvomod];
$place_array["min_temp"][4] = $temp_array[16+$arvomod];
$place_array["max_temp"][1] = $temp_array[3+$arvomod];
$place_array["max_temp"][2] = $temp_array[9+$arvomod];
$place_array["max_temp"][3] = $temp_array[13+$arvomod];
$place_array["max_temp"][4] = $temp_array[17+$arvomod];
$place_array["precip"][1] = $temp_array[5+$arvomod];
//determine the appropriate images and alt tags
for ($counter = 1; $counter <= 4; $counter++){
if (stristr($place_array["description"][$counter], "thunderstorm")){
$place_array["image"][$counter] = "thunder";
$place_array["alt_tag"][$counter] = "Thunderstorms";
} elseif (stristr($place_array["description"][$counter], "shower")){
$place_array["image"][$counter] = "shower";
$place_array["alt_tag"][$counter] = "Showers";
} elseif (stristr($place_array["description"][$counter], "fine")){
$place_array["image"][$counter] = "fine";
$place_array["alt_tag"][$counter] = "Fine";
} else {
$place_array["image"][$counter] = "unknown";
$place_array["alt_tag"][$counter] = "Unknown";
}
}
//create short names
for ($counter = 0; $counter <= 4; $counter++){
$place_array["short_name"][$counter] =
substr($place_array["name"][$counter], 0, 3);
}
}
//declare template
$template = "";
//open template
if(!$fp=fopen($templatefilename ,"r")) {
echo "Can't Open Template File" ;
} else {
// read template
while(!feof($fp)){
$template.=fgets($fp,1024);
}
//close connection
fclose($fp);
//replace some strings
$patterns = array(
"/(\%Name\[)(.*?)(\]\%)/se",
"/(\%Description\[)(.*?)(\]\%)/se",
"/(\%Min_Temp\[)(.*?)(\]\%)/se",
"/(\%Max_Temp\[)(.*?)(\]\%)/se",
"/(\%Precip\[)(.*?)(\]\%)/se",
"/(\%Image\[)(.*?)(\]\%)/se",
"/(\%Alt_Tag\[)(.*?)(\]\%)/se",
"/(\%Short_Name\[)(.*?)(\]\%)/se"
);
$replace = array(
'$place_array["name"]["\\2"]',
'$place_array["description"]["\\2"]',
'$place_array["min_temp"]["\\2"]',
'$place_array["max_temp"]["\\2"]',
'$place_array["precip"]["\\2"]',
'$place_array["image"]["\\2"]',
'$place_array["alt_tag"]["\\2"]',
'$place_array["short_name"]["\\2"]'
);
$template = preg_replace ($patterns, $replace, $template);
print($template);
}
}
?>
-- Cheers --------------------------------------------------------- Simon Angell Canberra ACT www.canberra-wx.com --------------------------------------------------------- Member of: Australian Severe Weather Association. www.severeweather.asn.au --------------------------------------------------------- This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File.
attached mail follows:
I Have now got it kinda working, but not fully, i changed something i shouldn't have, but fixed that.. //create new string containing data for selected place preg_match("|$placename.*?\\n\\n.*?\\n\\n|s", $content, $temp); (i had it //create new string containing data for selected place preg_match("|$canberra.*?\\n\\n.*?\\n\\n|s", $content, $temp); by accident), but as you see it doesn't get all the forecast.... Mildura (works) http://www.canberra-wx.com/bomonster/bomonster01.php Canberra (kinda works) http://www.canberra-wx.com/bomonster/bomonster1.php
The Problem now is displaying the full description of the forecast and the forecast temps for the next few days...also noticed that the Mildura Forecast is not fully displayed, it is missing 1 work at the end of the forecast description...
So How do i change the php to display the Whole description and the next few days of temps. Remember the layout of the source of the info is different http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDV17001.txt is the Mildura forecast... http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDN10035.txt is the Canberra/A.C.T Forecast that i want to use.
-- Cheers --------------------------------------------------------- Simon Angell Canberra ACT www.canberra-wx.com --------------------------------------------------------- Member of: Australian Severe Weather Association. www.severeweather.asn.au --------------------------------------------------------- This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File."Simon Angell" <seangell
iprimus.com.au> wrote in message news:20020918101058.30945.qmail
pb1.pair.com... > Hi. > > I am having trouble with a PHP script. I am not the one who made this and my > knowledge on php is very little. > I came across this php script www.canberra-wx.com/bomonster/bomonster01.php > which is weather forecasting for a place called Mildura. > The file that the PHP gets its info from is here... > http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDV17001.txt and if you look down > the page you will see the Mildura forecast that the PHP draws its info > output from. > > My Problem is that i want it to work for this file... > http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDN10035.txt and i cant work out > how to get it going. > i have got this far www.canberra-wx.com/bomonster/bomonster1.php (look at > the code, the actual outpot doesn't work..thats my problem). The part I want > the PHP to do its info output is from A.C.T FORECAST (like from the Mildura > in IDV17001.txt) > > Any help on how to get it to work would be great. > > Cheers > --------------------------------------------------------- > Simon Angell > Canberra ACT > www.canberra-wx.com > --------------------------------------------------------- > Member of: > Australian Severe Weather Association. > www.severeweather.asn.au > --------------------------------------------------------- > This email is virus free. > Scanned before leaving my mailbox > using Norton Antivirus 2002 for Win2k > Scanned with the latest definition File. > > >
attached mail follows:
it is all .js right, but there are the js_products and the js_categories javascript variables which are server-side generated. They are dumped from the database and encode '|' seperated values.
Btw, what you are achieving is heavily JavaScript...otherwise you can it almost all in PHP w/o javascript...which is reload the page everytime he chooses a new category.
something like: panel Categories | panel subCats
generate categories as: select * from categories generate subCats as: select * from subcats where cat={selected Cat}
add an event to the categories listbox as: onchange="this.form.submit();"
this will cause the form to reload and refill your subCats accordingly.
Elias
"Roger Lewis" <re.lewis
attbi.com> wrote in message
news:NDBBJIHLJGGJEBMGGKCDMEJPCNAA.re.lewis
attbi.com...
> Thanks Elias,
>
> I took a look at the code and there are indeed many things to learn;
> however, it's all in js.
> I'm trying to have php write the js, but I don't know enough about arrays
> and manipulating their elements.
>
> Roger
>
> -----Original Message-----
> From: lallous [mailto:phplist
lgwm.org]
> Sent: Wednesday, September 11, 2002 2:02 AM
> To: php-general
lists.php.net
> Subject: [PHP] Re: Dependent Dropdown Boxes
>
> Hi,
>
> Try to learn many things from the test code i created below:
>
> http://lgwm.org/ozone/dynatable.htm
>
> Good luck,
>
> Elias
>
attached mail follows:
There is something you can set in php.ini afaik. search for 'sendmail' in that file.
Elias,
"Liam" <phplist
operationenigma.com> wrote in message
news:php.general-116689
news.php.net...
> Yeah, mail() again...
>
> I want to disable the default mail command and replace it with my own.
> I've written a function that talks directly to my SMTP server, however,
I'd
> rather not go thru every single script on my server and change all the
> mail() functions.
>
> Any ideas?
>
> Cheers,
> Liam
>
>
attached mail follows:
I've spent over 6 months trying to get sendmail to work to my liking, don't talk to me about sendmail! :-P
eXtremail does the job real good ;-) www.extremail.com
Is there any way of EASILY rewriting PHP's mail() function?
Cheers, Liam
----- Original Message -----
From: "lallous" <phplist
lgwm.org>
To: <php-general
lists.php.net>
Sent: Wednesday, September 18, 2002 9:25 PM
Subject: [PHP] Re: replacing mail()
There is something you can set in php.ini afaik. search for 'sendmail' in that file.
Elias,
"Liam" <phplist
operationenigma.com> wrote in message
news:php.general-116689
news.php.net...
> Yeah, mail() again...
>
> I want to disable the default mail command and replace it with my own.
> I've written a function that talks directly to my SMTP server, however,
I'd
> rather not go thru every single script on my server and change all the
> mail() functions.
>
> Any ideas?
>
> Cheers,
> Liam
>
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Afaik, PHP on Unix does not use internal functions but instead it uses Sendmail therefore you can configure it in PHP.INI to not use sendmail,
as for win32, PHP mails via direct SMTP connections...
"Liam Mackenzie" <phplist
operationenigma.com> wrote in message
news:002a01c25f00$54a01050$0b00a8c0
enigma...
> I've spent over 6 months trying to get sendmail to work to my liking,
don't
> talk to me about sendmail!
> :-P
>
> eXtremail does the job real good ;-)
> www.extremail.com
>
> Is there any way of EASILY rewriting PHP's mail() function?
>
> Cheers,
> Liam
>
>
> ----- Original Message -----
> From: "lallous" <phplist
lgwm.org>
> To: <php-general
lists.php.net>
> Sent: Wednesday, September 18, 2002 9:25 PM
> Subject: [PHP] Re: replacing mail()
>
>
> There is something you can set in php.ini afaik.
> search for 'sendmail' in that file.
>
> Elias,
> "Liam" <phplist
operationenigma.com> wrote in message
> news:php.general-116689
news.php.net...
> > Yeah, mail() again...
> >
> > I want to disable the default mail command and replace it with my own.
> > I've written a function that talks directly to my SMTP server, however,
> I'd
> > rather not go thru every single script on my server and change all the
> > mail() functions.
> >
> > Any ideas?
> >
> > Cheers,
> > Liam
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
>
attached mail follows:
>"Liam Mackenzie" <phplist
operationenigma.com> wrote in message
>news:002a01c25f00$54a01050$0b00a8c0
enigma...
> I've spent over 6 months trying to get sendmail to work to my liking,
>don't
> talk to me about sendmail!
> :-P
I know the feeling. I use qmail now.
> > > > eXtremail does the job real good ;-) > > www.extremail.com > > > > Is there any way of EASILY rewriting PHP's mail() function?
No. Qmail provides a sendmail wrapper that replaces the sendmail program and injects mail onto the qmail queue. I just replaced the /sbin/sendmail program with a link to /var/qmail/bin/sendmail and all programs on the server, including PHP send mail through it.
Rick
attached mail follows:
Hi all,
I know this has been answered a lot in this list, but I'm not at my computer where I have fast access to my e-mails. I'm about to make my first PHP - MySQL installation under Win2K + IIS 5.0 and really don't have a clue of what to do (also sleepy). I've downloaded the 4.2.3 version of PHP and the version 3.23.52 of MySQL for Windows... what now?
I'll leave the PDF, GD, and other libraries for another PHP compilation for now. I just need to test my Win2K + IIS configuration.
Thanks in advance,
César Aracena
attached mail follows:
Have you tried the chapter in the PHP manual on installation? It walks you right through it.
MySQL is just a simple unzip and go, there's no real setup to it at all other than changing the root password...
---John Holmes...
> -----Original Message-----
> From: César Aracena [mailto:icaam
icaam.com.ar]
> Sent: Wednesday, September 18, 2002 5:39 AM
> To: php-general
lists.php.net
> Subject: [PHP] Urgent Installation Question
>
> Hi all,
>
> I know this has been answered a lot in this list, but I'm not at my
> computer where I have fast access to my e-mails. I'm about to make my
> first PHP - MySQL installation under Win2K + IIS 5.0 and really don't
have
> a clue of what to do (also sleepy). I've downloaded the 4.2.3 version
of
> PHP and the version 3.23.52 of MySQL for Windows... what now?
>
> I'll leave the PDF, GD, and other libraries for another PHP
compilation
> for now. I just need to test my Win2K + IIS configuration.
>
> Thanks in advance,
>
> César Aracena
attached mail follows:
Thanks. I installed PHP first and will install MySQL (once the download finishes) hoping they'll work together just fine. One thing's missing... the phpinfo.php file, which should be here... but isn't... Should I grab it from somewhere else?
Thanks again, C.
----- Original Message -----
From: "John Holmes" <holmes072000
charter.net>
To: "'César Aracena'" <icaam
icaam.com.ar>; <php-general
lists.php.net>
Sent: Wednesday, September 18, 2002 7:57 AM
Subject: RE: [PHP] Urgent Installation Question
> Have you tried the chapter in the PHP manual on installation? It walks
> you right through it.
>
> MySQL is just a simple unzip and go, there's no real setup to it at all
> other than changing the root password...
>
> ---John Holmes...
>
> > -----Original Message-----
> > From: César Aracena [mailto:icaam
icaam.com.ar]
> > Sent: Wednesday, September 18, 2002 5:39 AM
> > To: php-general
lists.php.net
> > Subject: [PHP] Urgent Installation Question
> >
> > Hi all,
> >
> > I know this has been answered a lot in this list, but I'm not at my
> > computer where I have fast access to my e-mails. I'm about to make my
> > first PHP - MySQL installation under Win2K + IIS 5.0 and really don't
> have
> > a clue of what to do (also sleepy). I've downloaded the 4.2.3 version
> of
> > PHP and the version 3.23.52 of MySQL for Windows... what now?
> >
> > I'll leave the PDF, GD, and other libraries for another PHP
> compilation
> > for now. I just need to test my Win2K + IIS configuration.
> >
> > Thanks in advance,
> >
> > César Aracena
>
>
attached mail follows:
There should be a php-ini.dist that you can rename to PHP.ini
---John Holmes...
> -----Original Message-----
> From: César Aracena [mailto:icaam
icaam.com.ar]
> Sent: Wednesday, September 18, 2002 6:03 AM
> To: holmes072000
charter.net; php-general
lists.php.net
> Subject: Re: [PHP] Urgent Installation Question
>
> Thanks. I installed PHP first and will install MySQL (once the
download
> finishes) hoping they'll work together just fine. One thing's
missing...
> the
> phpinfo.php file, which should be here... but isn't... Should I grab
it
> from
> somewhere else?
>
> Thanks again, C.
>
> ----- Original Message -----
> From: "John Holmes" <holmes072000
charter.net>
> To: "'César Aracena'" <icaam
icaam.com.ar>;
<php-general
lists.php.net>
> Sent: Wednesday, September 18, 2002 7:57 AM
> Subject: RE: [PHP] Urgent Installation Question
>
>
> > Have you tried the chapter in the PHP manual on installation? It
walks
> > you right through it.
> >
> > MySQL is just a simple unzip and go, there's no real setup to it at
all
> > other than changing the root password...
> >
> > ---John Holmes...
> >
> > > -----Original Message-----
> > > From: César Aracena [mailto:icaam
icaam.com.ar]
> > > Sent: Wednesday, September 18, 2002 5:39 AM
> > > To: php-general
lists.php.net
> > > Subject: [PHP] Urgent Installation Question
> > >
> > > Hi all,
> > >
> > > I know this has been answered a lot in this list, but I'm not at
my
> > > computer where I have fast access to my e-mails. I'm about to make
my
> > > first PHP - MySQL installation under Win2K + IIS 5.0 and really
don't
> > have
> > > a clue of what to do (also sleepy). I've downloaded the 4.2.3
version
> > of
> > > PHP and the version 3.23.52 of MySQL for Windows... what now?
> > >
> > > I'll leave the PDF, GD, and other libraries for another PHP
> > compilation
> > > for now. I just need to test my Win2K + IIS configuration.
> > >
> > > Thanks in advance,
> > >
> > > César Aracena
> >
> >
attached mail follows:
If you mean phpinfo.php which calls just phpinfo(), here it is: <? phpinfo(); ?>
César Aracena wrote:
>Thanks. I installed PHP first and will install MySQL (once the download
>finishes) hoping they'll work together just fine. One thing's missing... the
>phpinfo.php file, which should be here... but isn't... Should I grab it from
>somewhere else?
>
>Thanks again, C.
>
>----- Original Message -----
>From: "John Holmes" <holmes072000
charter.net>
>To: "'César Aracena'" <icaam
icaam.com.ar>; <php-general
lists.php.net>
>Sent: Wednesday, September 18, 2002 7:57 AM
>Subject: RE: [PHP] Urgent Installation Question
>
>
>
>
>>Have you tried the chapter in the PHP manual on installation? It walks
>>you right through it.
>>
>>MySQL is just a simple unzip and go, there's no real setup to it at all
>>other than changing the root password...
>>
>>---John Holmes...
>>
>>
>>
>>>-----Original Message-----
>>>From: César Aracena [mailto:icaam
icaam.com.ar]
>>>Sent: Wednesday, September 18, 2002 5:39 AM
>>>To: php-general
lists.php.net
>>>Subject: [PHP] Urgent Installation Question
>>>
>>>Hi all,
>>>
>>>I know this has been answered a lot in this list, but I'm not at my
>>>computer where I have fast access to my e-mails. I'm about to make my
>>>first PHP - MySQL installation under Win2K + IIS 5.0 and really don't
>>>
>>>
>>have
>>
>>
>>>a clue of what to do (also sleepy). I've downloaded the 4.2.3 version
>>>
>>>
>>of
>>
>>
>>>PHP and the version 3.23.52 of MySQL for Windows... what now?
>>>
>>>I'll leave the PDF, GD, and other libraries for another PHP
>>>
>>>
>>compilation
>>
>>
>>>for now. I just need to test my Win2K + IIS configuration.
>>>
>>>Thanks in advance,
>>>
>>>César Aracena
>>>
>>>
>>
>>
>
>
>
>
attached mail follows:
I have the following problem:
I need to get resolution information (dpi) from any image of jpg, gif or png formats.
It would be sufficient to obtain pixel and inches dimension of such images and calculate resolution by simply dividing but I haven't found any function that gets effective dimensions in inches.
I have PHP 4.1.2 with GD libs installed
Thanks Rik
______________________________________________________________________ Mio Yahoo!: personalizza Yahoo! come piace a te http://it.yahoo.com/mail_it/foot/?http://it.my.yahoo.com/
attached mail follows:
> I need to get resolution information (dpi) from any > image of jpg, gif or png formats. > > It would be sufficient to obtain pixel and inches > dimension of such images and calculate resolution by > simply dividing but I haven't found any function that > gets effective dimensions in inches.
http://www.php.net/manual/en/function.getimagesize.php
I'm sligthly confused about what you're looking for, but the above URL *could* be something.
Jome
attached mail follows:
Images don't have a resolution per se; display devices have a resolution. Images (the formats you're talking about, anyway) are measured in pixel width and height. The height and width in any units other than pixels of course necessitates conversion - for an easy example, a 300x300 image on a 1200x1200dpi printer will be exactly one quarter the size of the same image printed on a 300x300 dpi printer.
-----Original Message-----
From: Jome [mailto:jome
emoj.net]
Sent: Wednesday, September 18, 2002 8:11 AM
To: php-general
lists.php.net
Subject: [PHP] Re: Image resolution and php
> I need to get resolution information (dpi) from any > image of jpg, gif or png formats. > > It would be sufficient to obtain pixel and inches > dimension of such images and calculate resolution by > simply dividing but I haven't found any function that > gets effective dimensions in inches.
http://www.php.net/manual/en/function.getimagesize.php
I'm sligthly confused about what you're looking for, but the above URL *could* be something.
Jome
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I believe that image files on the Mac platform contain metadata that does in fact include this information. Sherlock on Mac OS 9 is not capable of finding this information. However, I did find the following information for Adobe Photoshop 7 for Mac OS X on how you can achieve this. I don't know if Adobe Photoshop 7 for Windows can do this.
From: http://www.apple.com/macosx/applications/photoshop/
You have thousands of digital pictures and graphics stored on your hard disk. Wouldn¹t it be cool to be able to verify what¹s in an image file before you click on it? Adobe thought so too, which is why the new File Browser in Photoshop 7.0 lets you do just that. The File Browser lets you view your thumbnails and image metadata ‹ like color profile, date modified, and the Exchangeable Image File (EXIF) information generated by digital cameras ‹ to make sure the images are what you¹re looking for before you open them. As an added convenience, Photoshop lets you add ranking to your file criteria. You can have your own ranking system for identifying images with, for example, rankings such as ³Proof² and ³Final.² You can also sort images by file name, file width and height, file size, file type, resolution, color profile, date created, date modified and copyright. The File Browser also gives you the added advantage of being able to search for images visually rather than just by file name.
Eric C. Pollitt, Founder 401 E. Illinois Ave. Peoria, IL 61603 Global Hemp - Portal to the hemp community http://www.globalhemp.com/
"Prohibition will work great injury to the cause of temperance. It is a species of intemperance within itself, for it goes beyond the bounds of reason in that it attempts to control a man's appetite by legislation, and makes a crime out of things that are not crimes. A Prohibition law strikes a blow at the very principles upon which our government was founded."
Abraham Lincoln in a speech to the Illinois House of Representatives on December 18, 1840.
> From: "Jome" <jome
emoj.net>
> Date: Wed, 18 Sep 2002 14:10:58 +0200
> To: php-general
lists.php.net
> Subject: [PHP] Re: Image resolution and php
>
>> I need to get resolution information (dpi) from any
>> image of jpg, gif or png formats.
>>
>> It would be sufficient to obtain pixel and inches
>> dimension of such images and calculate resolution by
>> simply dividing but I haven't found any function that
>> gets effective dimensions in inches.
>
> http://www.php.net/manual/en/function.getimagesize.php
>
> I'm sligthly confused about what you're looking for, but the above URL
> *could* be something.
>
> Jome
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
> I need to get resolution information (dpi) from any > image of jpg, gif or png formats. > > It would be sufficient to obtain pixel and inches > dimension of such images and calculate resolution by > simply dividing but I haven't found any function that > gets effective dimensions in inches. >
As Jome wrote - getimagesize.
Those image formats don't carry any printing format information. The number of inches an image will be depends on what is doing the presentation. You need to calculate your own inches depending on your own printing or display environment.
If you want to learn about image file formats. http://www.wotsit.org/
attached mail follows:
Would a "select last_value from sequence_name" do any good? Is there a possibility that I get a value from the outcome of a nextval by another session?
Meaning, I do an insert 1, 2, 3, 4 A 'select last_value from sequence_name' should give me '4'.
But what if another user/session does another insert/nextval(), before my select statement finishes processing? Would I get a 5?
Sincerely, Faisal
-----Original Message-----
From: Faisal Abdullah [mailto:faisal
magnifix.com.my]
Sent: Wednesday, September 18, 2002 6:37 PM
To: PHP
Subject: RE: [PHP] Auto-increment value
I tried that. It gives me 24807, instead of 5. Or is oid is a reference to something else, which would lead me to the '5' i'm looking for?
-- snip snip --
if($result = pg_exec($db, $sql)) { $query = "success"; echo "oid : " .pg_last_oid($result); }
-- snip snip --
Sincerely, Faisal
-----Original Message-----
From: Marek Kilimajer [mailto:kilimajer
webglobe.sk]
Sent: Wednesday, September 18, 2002 5:42 PM
To: PHP
Subject: Re: [PHP] Auto-increment value
As he uses postgresql, he should use *pg_last_oid()*
Scott Houseman wrote:
> Hi there. > > You can use the function mysql_insert_id( [link id] ). > > regards > > Scott > > Faisal Abdullah wrote: > >> Hi people, >> >> I have a table with a column called ID (auto-increment). >> Is it possible to know the value of ID, right after inserting a row? >> I'm using postgresql. >> >> Thanks. >> >> Sincerely, >> Faisal >> >> ______________________________________ >> >> > >
-- 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:
MySQL has |LAST_INSERT_ID() function, try it ("SELECT ||LAST_INSERT_ID()")|
Faisal Abdullah wrote:
>Would a "select last_value from sequence_name" do any good?
>Is there a possibility that I get a value from the outcome of
>a nextval by another session?
>
>Meaning, I do an insert 1, 2, 3, 4
>A 'select last_value from sequence_name' should give me '4'.
>
>But what if another user/session does another insert/nextval(),
>before my select statement finishes processing? Would I get
>a 5?
>
>Sincerely,
>Faisal
>
>-----Original Message-----
>From: Faisal Abdullah [mailto:faisal
magnifix.com.my]
>Sent: Wednesday, September 18, 2002 6:37 PM
>To: PHP
>Subject: RE: [PHP] Auto-increment value
>
>
>I tried that. It gives me 24807, instead of 5.
>Or is oid is a reference to something else, which would
>lead me to the '5' i'm looking for?
>
>-- snip snip --
>
>if($result = pg_exec($db, $sql))
> {
> $query = "success";
> echo "oid : " .pg_last_oid($result);
> }
>
>-- snip snip --
>
>Sincerely,
>Faisal
>
>-----Original Message-----
>From: Marek Kilimajer [mailto:kilimajer
webglobe.sk]
>Sent: Wednesday, September 18, 2002 5:42 PM
>To: PHP
>Subject: Re: [PHP] Auto-increment value
>
>
>As he uses postgresql, he should use *pg_last_oid()*
>
>Scott Houseman wrote:
>
>
>
>>Hi there.
>>
>>You can use the function mysql_insert_id( [link id] ).
>>
>>regards
>>
>>Scott
>>
>>Faisal Abdullah wrote:
>>
>>
>>
>>>Hi people,
>>>
>>>I have a table with a column called ID (auto-increment).
>>>Is it possible to know the value of ID, right after inserting a row?
>>>I'm using postgresql.
>>>
>>>Thanks.
>>>
>>>Sincerely,
>>>Faisal
>>>
>>>______________________________________
>>>
>>>
>>>
>>>
>>
>>
>
>
>
>
attached mail follows:
Thanks for your reply, but I'm using postgresql. Mysql is irrelevant for me.
-----Original Message-----
From: Marek Kilimajer [mailto:kilimajer
webglobe.sk]
Sent: Wednesday, September 18, 2002 7:41 PM
To: PHP
Subject: Re: [PHP] Auto-increment value
MySQL has |LAST_INSERT_ID() function, try it ("SELECT ||LAST_INSERT_ID()")|
Faisal Abdullah wrote:
>Would a "select last_value from sequence_name" do any good?
>Is there a possibility that I get a value from the outcome of
>a nextval by another session?
>
>Meaning, I do an insert 1, 2, 3, 4
>A 'select last_value from sequence_name' should give me '4'.
>
>But what if another user/session does another insert/nextval(),
>before my select statement finishes processing? Would I get
>a 5?
>
>Sincerely,
>Faisal
>
>-----Original Message-----
>From: Faisal Abdullah [mailto:faisal
magnifix.com.my]
>Sent: Wednesday, September 18, 2002 6:37 PM
>To: PHP
>Subject: RE: [PHP] Auto-increment value
>
>
>I tried that. It gives me 24807, instead of 5.
>Or is oid is a reference to something else, which would
>lead me to the '5' i'm looking for?
>
>-- snip snip --
>
>if($result = pg_exec($db, $sql))
> {
> $query = "success";
> echo "oid : " .pg_last_oid($result);
> }
>
>-- snip snip --
>
>Sincerely,
>Faisal
>
>-----Original Message-----
>From: Marek Kilimajer [mailto:kilimajer
webglobe.sk]
>Sent: Wednesday, September 18, 2002 5:42 PM
>To: PHP
>Subject: Re: [PHP] Auto-increment value
>
>
>As he uses postgresql, he should use *pg_last_oid()*
>
>Scott Houseman wrote:
>
>
>
>>Hi there.
>>
>>You can use the function mysql_insert_id( [link id] ).
>>
>>regards
>>
>>Scott
>>
>>Faisal Abdullah wrote:
>>
>>
>>
>>>Hi people,
>>>
>>>I have a table with a column called ID (auto-increment).
>>>Is it possible to know the value of ID, right after inserting a row?
>>>I'm using postgresql.
>>>
>>>Thanks.
>>>
>>>Sincerely,
>>>Faisal
>>>
>>>______________________________________
>>>
>>>
>>>
>>>
>>
>>
>
>
>
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php______________________________________
attached mail follows:
Dear Faisal Abdullah,
Once you wrote about "RE: [PHP] Auto-increment value": > Thanks for your reply, > but I'm using postgresql. > Mysql is irrelevant for me.
There is a similar one for postgresql as well: pg_last_oid() .
> -----Original Message-----
> From: Marek Kilimajer [mailto:kilimajer
webglobe.sk]
> Sent: Wednesday, September 18, 2002 7:41 PM
> To: PHP
> Subject: Re: [PHP] Auto-increment value
>
> MySQL has |LAST_INSERT_ID() function, try it ("SELECT ||LAST_INSERT_ID()")|
-- Best regards, Leonid Mamtchenkov, RHCE System Administrator Francoudi & Stephanou Ltd.BOFH: HTTPD Error 666 : BOFH was here
attached mail follows:
> There is a similar one for postgresql as well: pg_last_oid() .
I tried that. It gives me 24807, instead of 5. Or is oid is a reference to something else, which would lead me to the '5' i'm looking for?
-- snip snip --
if($result = pg_exec($db, $sql)) { $query = "success"; echo "oid : " .pg_last_oid($result); }
-- snip snip --
Sincerely, Faisal
______________________________________
attached mail follows:
SELECT idno ORDER BY idno DESC LIMIT 1; assuming idno is what gets auto incremented bob
attached mail follows:
You encounter a race condition
bob parker wrote:
>SELECT idno ORDER BY idno DESC LIMIT 1; >assuming idno is what gets auto incremented >bob > > >
attached mail follows:
Hi Bob,
> SELECT idno ORDER BY idno DESC LIMIT 1; > assuming idno is what gets auto incremented
That's not the best idea - what happens if two users are inserting records into the table at nearly-but-not-quite the same time?
1. Insert A goes through 2. Insert B goes through 3. LastID A returns the ID of B 4. LastID B returns the ID of B
Whoever did insert A would receive the wrong ID.
Cheers Jon
attached mail follows:
If there is a possibilty of that then
BEGIN
INSERT ... whatever
SELECT idno ORDER BY (idno) DESC LIMIT 1;
END;
It works, I just tried it in postgresql, the last idno is
visible to the user making the transaction, and will be
unavailable to others.
From php-general-return-116731-bob_parker=dodo.com.au
lists.php.net Wed Sep 18 22:34:13 2002
Envelope-to: bob
localhost
Mailing-List: contact php-general-help
lists.php.net; run by ezmlm
Precedence: bulk
list-help: <mailto:php-general-help
lists.php.net>
list-unsubscribe: <mailto:php-general-unsubscribe
lists.php.net>
list-post: <mailto:php-general
lists.php.net>
Delivered-To: mailing list php-general
lists.php.net
From: Jon Haworth <jhaworth
witanjardine.co.uk>
To: 'bob parker' <bob_parker
dodo.com.au>, php-general
lists.php.net
Date: Wed, 18 Sep 2002 13:27:56 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
charset="ISO-8859-1"
Subject: RE: [PHP] Auto-increment value
X-UIDL: *ab"!\-5!!-$7!!nk~!!
Hi Bob,
> SELECT idno ORDER BY idno DESC LIMIT 1; > assuming idno is what gets auto incremented
That's not the best idea - what happens if two users are inserting records into the table at nearly-but-not-quite the same time?
1. Insert A goes through 2. Insert B goes through 3. LastID A returns the ID of B 4. LastID B returns the ID of B
Whoever did insert A would receive the wrong ID.
Cheers Jon
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
bob
attached mail follows:
I tend to (if I can't use mysql_last_id) insert a unique key into the row, and pull the row out that matches that key, in order to get the ID... ensures that it was the right row... then you can delete the unique key.
Justin
on 18/09/02 10:27 PM, Jon Haworth (jhaworth
witanjardine.co.uk) wrote:
> Hi Bob, > >> SELECT idno ORDER BY idno DESC LIMIT 1; >> assuming idno is what gets auto incremented > > That's not the best idea - what happens if two users are inserting records > into the table at nearly-but-not-quite the same time? > > 1. Insert A goes through > 2. Insert B goes through > 3. LastID A returns the ID of B > 4. LastID B returns the ID of B > > Whoever did insert A would receive the wrong ID. > > Cheers > Jon
attached mail follows:
From: Marek Kilimajer <kilimajer
webglobe.sk>
To: PHP <php-general
lists.php.net>
Subject: Re: [PHP] Auto-increment value
You encounter a race condition
bob parker wrote:
>SELECT idno ORDER BY idno DESC LIMIT 1; >assuming idno is what gets auto incremented >bob
To avoid the race it is necessary to do the whole thing in a transaction, for postgresql this works BEGIN; INSERT ... whatever SELECT ... the last idno END; The last idno is available to the user inside the transaction. I beleive the terminating ';' are not needed in php generated sql statements but they don't hurt either. bob
attached mail follows:
Dear Faisal Abdullah,
Once you wrote about "RE: [PHP] Auto-increment value": > > There is a similar one for postgresql as well: pg_last_oid() . > > I tried that. It gives me 24807, instead of 5. > Or is oid is a reference to something else, which would > lead me to the '5' i'm looking for?
I'd bet that 24807 is your oid. Check the difference between "SELECT * FROM table;" and "SELECT oid,* FROM table;".
HTH.
> -- snip snip -- > > if($result = pg_exec($db, $sql)) > { > $query = "success"; > echo "oid : " .pg_last_oid($result); > } > > -- snip snip --
-- Best regards, Leonid Mamtchenkov, RHCE System Administrator Francoudi & Stephanou Ltd.BOFH: somebody was calculating pi on the server
attached mail follows:
Hi,
The solution I posted:
echo '<OPTION VALUE="'.$alphabetical[$i][0].'">'.$alphabetical[$i].'</OPTION>'."\n";
did indeed take the first letter of $squads[1] as option value. I wondered at the time why Chad would want the first letter of the name as option value (that was his original code); I didn't realise that he wanted the id as option value.
This code works fine:
$fd = fopen ($teams, "r"); while (!feof ($fd)) { $list = fgets($fd, 4096); $squads = explode("|", $list); $alphabetical[$squads[1]] = $squads[0]; } fclose ($fd); ksort ($alphabetical); echo "<select>"; foreach ($alphabetical as $name => $id) { echo '<OPTION VALUE="'.$id.'">'.$name.'</OPTION>'."\n"; } echo "</select>";
(I think it is Marek's code - I added the <select>).
Building on the above code and if you you wanted to have every column in an array: Instead of having squad_compares, usorts and the like, why not just link on id to associative arrays for each column, e.g.
$fd = fopen ($teams, "r"); while (!feof ($fd)) { $list = fgets($fd, 4096); $squads = explode("|", $list); $alphabetical[$squads[1]] = $squads[0]; $stadium[$squads[0]] = $squads[2]; $city[$squads[0]] = $squads[3]; } fclose ($fd); ksort ($alphabetical); echo "<select>"; foreach ($alphabetical as $name => $id) { echo '<OPTION VALUE="'.$id.'">'.$name." - ".$stadium[$id].'</OPTION>'."\n"; } echo "</select>";
If you wanted to access the appropriate data you would use $stadium[$id] if you had the id, or $stadium[$alphabetical[$name]] if you had the name.
Cheers
Rudolf Visagie
Principal Software Developer
Digital Healthcare Solutions
<mailto:rudolf
dhsolutions.co.za>
Tel: 011 6901019
Cell: 082 895 1598
-----Original Message-----
From: Ford, Mike [LSS] [mailto:M.Ford
lmu.ac.uk]
Sent: Wednesday, September 18, 2002 12:21 PM
To: 'Chad Winger'; php-general
lists.php.net
Subject: RE: [PHP] Help.....still stuck after 3 days :/
> -----Original Message-----
> From: Chad Winger [mailto:cwinger
callistonet.com]
> Sent: 18 September 2002 02:32
>
> however there is a little problem with the end result.
>
> your code:
>
> <?php
>
> include ("C:\Program
> Files\EasyPHP\www\florentiaviola.com\control\config.php");
>
> $fd = fopen ($teams, "r");
> while (!feof ($fd))
> {
> $list = fgets($fd, 4096);
> $squads = explode("|", $list);
> $alphabetical[] = $squads[1];
> }
>
> sort ($alphabetical);
> reset ($alphabetical);
>
> for ($i = 0; $i <= count($alphabetical) - 1; $i++)
> {
> echo '<OPTION VALUE="'.
> $alphabetical[$i][0].'">'.$alphabetical[$i].'</OPTION>'."\n";
> }
> fclose ($fd);
>
>
> ?>
The problem with this script is it only sorts the team names, without re-ordering the other columns of your array to match. And the notation $alphabetical[$i][0] is actually accessing the first character of the string (tema name) in $alphabetical[$i] -- hence the result you see.
What you need to do is create an array or arrays containing all the content you need to sort, and then sort them in parallel based on the team names.
My instinct would be to build a nested array of your values thusly:
while (!feof ($fd)) { $list = fgets($fd, 4096); $squads[] = explode("|", $list); }
which would build an array like this:
$squads[0][0] => 01 $squads[0][1] => Brescello $squads[0][2] => stadium $squads[0][3] => city $squads[1][0] => 02 $squads[1][1] => Aglianese $squads[1][2] => stadium $squads[1][3] => city $squads[2][0] => 03 $squads[2][1] => Casteldisangro $squads[2][2] => stadium $squads[2][3] => city
etc.
However, a little research in the PHP online manual looking for sorting functions reveals that there's no simple function to sort this array the way you want. There are two ways around this:
1. Build your arrays differently; whilst this is possible, it needs more work and is not nearly as elegant (unless you need them this way for other stuff in your script). I'll leave this as an exercise for the reader, as there at least 2 possible answers, but the sorting functions you might use are asort() or array_multisort().
2. Use a more complex sorting method that sorts the above array as you want. This is not actually as hard as it sounds, as there are several user notes in the online manual under the entry for usort() that address exactly this problem. Basically, you need to define a function that says how to compare two $squads[] rows for sorting -- in this case, by comparing the $squads[][1] entries, so:
123456789*123456789*123456789*123456789*123456789*123456789*123456789*123456 function squad_compare($a, $b) // $a, $b each passed a $squads[] row { return strcasecmp($a[1], $b[1]); // returns <0 if $a sorts first, // 0 if equal, >0 if $b sorts first // (case-INsensitive comparison) }
and then use this in a usort() (sort with user-defined comparison) call:
usort($squads, 'squad_compare');
I've broken this down into component steps for easier understanding, but you can actually do it all-in-one if you don't need to use the compare function elsewhere; again, this is adapted from a user note on the usort() manual page:
usort($squads, create_function('$a,$b', 'return strcasecmp($a[1], $b[1])'));
Finally, you can iterate through the results and generate your form:
foreach($squads as $squad_info): echo '<OPTION VALUE="'.$squad_info[0].'">'.$squad_info[1].'</OPTION>'."\n"; endforeach;
Hope this helps somewhat!
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
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Does PHP release the Oracle connection if I run PHP from the command line? If not, how can I release the connection if the OCILogoff is empty as stated on the comments of its documentation page?
//rasmus
------------------------------------------------------------
Rasmus Sellberg Inventive Business Technology
Associate Consultant Södermälarstrand 29, 6tr
rasmus
inventive.se 118 25 Stockholm
Sweden
+46 70 478 34 41
+46 8 616 99 46 www.inventive.se
attached mail follows:
On Wed, Sep 18, 2002 at 02:48:13PM +0200, Rasmus Sellberg wrote: > Does PHP release the Oracle connection if I run PHP from the command line?
yes
tc
attached mail follows:
Yes you can,
check http://www.php.net/manual/en/ref.com.php for examples.
HTH, Steve.
-----Original Message-----
From: Matthew Tapia [mailto:tapia
comcast.net]
Sent: Tuesday, September 17, 2002 9:43 PM
To: php-general
lists.php.net
Subject: [PHP] PHP and Microsoft Office
Can you use PHP to add appts to my microsoft outlook calendar or open up a document in ms word?
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi
I had problems with extension_dir on windows. I followed the news and found out that there are more question that answers about it.
I accidentally found a solution and would like to share it, hoping it could be useful for others looking for help.
I tried in vain to set up the extension_dir as c:\php, c:\php\extensions, c:\winnt\system32 (on w2k).
Finally before to give up I made an desperation action putting all dlls I needed into the c:\php\dlls dir
What a happiness! All messages stating that this and that dll cannot be found disappeared!
Enjoy!
Ivo
attached mail follows:
Example 1. Find the string of text "php"
// the "i" after the pattern delimiter indicates a case-insensitive search if (preg_match ("/php/i", "PHP is the web scripting language of choice.")) { print "A match was found."; } else { print "A match was not found."; }
Example 2. find the word "web"
// the \b in the pattern indicates a word boundary, so only the distinct // word "web" is matched, and not a word partial like "webbing" or "cobweb" if (preg_match ("/\bweb\b/i", "PHP is the web scripting language of choice.")) { print "A match was found."; } else { print "A match was not found."; } if (preg_match ("/\bweb\b/i", "PHP is the website scripting language of choice.")) { print "A match was found."; } else { print "A match was not found."; }
Example 3. Getting the domain name out of a URL
// get host name from URL preg_match("/^(http:\/\/)?([^\/]+)/i", "http://www.php.net/index.html", $matches); $host = $matches[2]; // get last two segments of host name preg_match("/[^\.\/]+\.[^\.\/]+$/",$host,$matches); echo "domain name is: ".$matches[0]."\n";
This example will produce: domain name is: php.net
See also preg_match_all(), preg_replace(), and preg_split().
attached mail follows:
What function/array index should I use to determine the current row of a MySQL query when outputting using a do..while.. Loop?
attached mail follows:
In (most) SQL servers there is no concept of 'row number'. Most DA's design tables with a unique primary key. This can be used to identify the row form all of the other rows but it is not the same as a 'row number'.
Since you are using PHP you can set a counter to 1 before your loop and then increment it at each loop. This will give you the semblance of a row number but be aware it is not the same. These are row numbers within the cursor you are looking at. If your cursor is a subset of the table's data then the numbers you are counting do not correspond to the data in the table.
HTH, =C=
* * Cal Evans * The Virtual CIO * http://www.calevans.com *
-----Original Message-----
From: Beeman [mailto:dharvell
dbh3.com]
Sent: Wednesday, September 18, 2002 8:30 AM
To: php
Subject: [PHP] MySQL Current Row??
What function/array index should I use to determine the current row of a MySQL query when outputting using a do..while.. Loop?
attached mail follows:
Personally, running a script directly from a website to add users is asking for security trouble.. I would have it write a "adduser" request to a file and then have a cron job parse that file everyt 5, 10 or 30 minutes or something looking for new users to add. This gets you around the SUID problem and also allows you to do some more sanity checks, etc... on the user being added.
Of course your script is checking to make sure that a webuser isn't submitting root, admin, nobody or any of the "system" names as a user, correct?
On Tuesday 17 September 2002 19:55, tim tom wrote: > php4.2.3 apache mod > linux rh7.2 > ------------------- > > I am trying to add unix system account user via a simple php and shell > script <? > system("/usr/bin/add.sh timtom752002 timtom752002 /home/timtom752002",$r) > or die (" $r user creation fail"); > > print "success"; > ?> > > when i ran add.php on my browser, i get > 254 user creation fail > > I created my add.sh file in /usr/bin and I have setuid it: > -rwsr-xr-x 1 root devel 216 Sep 18 08:54 add.sh > > It looks like: > #!/bin/sh > > username=$1 > password=$2 > homedir=$3 > # create user > /usr/sbin/useradd -m -d $homedir $username > > > # change the password > ( > echo $password > sleep 1 > echo $password > sleep 1 > echo $password > )|passwd $username > > When I ran the add.sh from the command line, it works ok: > $ /usr/bin/add.sh nnnnn nnnnn /home/nnnnn > Changing password for user nnnnn > passwd: all authentication tokens updated successfully > (i tried login in with uid=nnnnn and passwd=nnnnn and it was ok) > > What's wrong with those scripts. It DOESN'T even create the user > timtom752002. Please help
--Henrik Hudson lists
rhavenn.net
Note: Beware of Dragons - Thou art crunchy and taste good with ketchup.
attached mail follows:
I have installed the QMQP server end and configured with tcpserver but am unclear from the docs if I need to install Qmail 1.03 on the Bulletin Board server or just copy over the files it mentions in the docs. If this is not the place to discuss this please let me know but you seem to have knowledge of this product so I am hoping you can help
Michael Humphries
Alphacomm.net
Network Administrator
906-639-3500
877-450-3500
adminmjh
alphacomm.net
www.alphacomm.net
-----Original Message-----
From: Rick Widmer [mailto:php3
developersdesk.com]
Sent: Monday, September 16, 2002 8:36 PM
To: Michael J Humphries; php-general
lists.php.net
Subject: Re: [PHP] Problems with php and qmail
At 03:20 PM 9/16/02 -0500, Michael J Humphries wrote: >I am running a Bulletin Board system with the following >RH 7.2 >Apache >VBulletin (which is all coded in PHP) >PHP4 > >But my qmail Server is on another physical server and I need to ask how >to configure php to recognize the second server for SMTP mail out >functions.
http://cr.yp.to/qmail/mini.html
Be sure to link (ln -s) /sbin/sendmail to /var/qmail/bin/sendmail and set your sendmail path to /sbin/sendmail. You could set the sendmail path to /var/qmail/bin/senamil, but there may be other programs on the web server that expect a sendmail program at /sbin/sendmail. Some systems use /usr/sbin/sendmail instead of /sbin/sendmail. Follow the standard convention for your distribution.
Rick
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hello I'm using PHP4 and MySQL on Apache webserver. I have a table valled "liste" with names of some people, and a table called "postnummer" with zip-codes and citynames. My select should join the adress and zip from one table with the cityname from the other table. But my join-line does not work. =:(
My code results in this line:
Warning: Supplied argument is not a valid MySQL result resource in /var/www/html/find/resultat.php on line 27
The code is: mysql_select_db("adresser"); $query = ("SELECT fornavn, efternavn, gade, liste.postnummer, postnummer.postbynavn FROM liste left join postnummer on liste.postnummer = postnummer.postnummer WHERE MATCH (fornavn, efternavn) AGAINST ('$search');"); $result = mysql_query($query); while(list( $fornavn, $efternavn, $gade, $postnummer, $postbynavn) = mysql_fetch_row($result)) print("<TR><TD>$fornavn</TD><TD>$efternavn</TD><TD>$gade</TD><TD>$postnummer</TD><TD>$postbynavn</TD></TR>\n");
What is going on? The select is ok if I do not join, but then I'm not able to get the field "postbynavn" from the other table.
PLEASE HELP!
Henning
attached mail follows:
not having the time to look at your code I am not sure but do this to see if its mysql causeing the errors
$result = mysql_query($query) or die(mysql_error());
----- Original Message -----
From: "Henning" <henningolsen36
netscape.net>
To: <php-general
lists.php.net>
Sent: Wednesday, September 18, 2002 5:12 PM
Subject: [PHP] Join - problem
> Hello > I'm using PHP4 and MySQL on Apache webserver. > I have a table valled "liste" with names of some people, and a table > called "postnummer" with zip-codes and citynames. > My select should join the adress and zip from one table with the > cityname from the other table. > But my join-line does not work. =:( > > My code results in this line: > > Warning: Supplied argument is not a valid MySQL result resource in > /var/www/html/find/resultat.php on line 27 > > The code is: > mysql_select_db("adresser"); > $query = ("SELECT fornavn, efternavn, gade, liste.postnummer, > postnummer.postbynavn FROM liste > left join postnummer on liste.postnummer = postnummer.postnummer > WHERE MATCH (fornavn, efternavn) AGAINST ('$search');"); > $result = mysql_query($query); > while(list( $fornavn, $efternavn, $gade, $postnummer, $postbynavn) = > mysql_fetch_row($result)) > print("<TR><TD>$fornavn</TD><TD>$efternavn</TD><TD>$gade</TD><TD>$postnummer </TD><TD>$postbynavn</TD></TR>\n"); > > > What is going on? > The select is ok if I do not join, but then I'm not able to get the > field "postbynavn" from the other table. > > PLEASE HELP! > > Henning > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Don't include the ; in your query, for one thing.
---John Holmes...
----- Original Message -----
From: "John Wards" <j.wards
sportnetwork.net>
To: "Henning" <henningolsen36
netscape.net>
Cc: <php-general
lists.php.net>
Sent: Wednesday, September 18, 2002 11:26 AM
Subject: Re: [PHP] Join - problem
> not having the time to look at your code I am not sure but do this to see
if
> its mysql causeing the errors
>
> $result = mysql_query($query) or die(mysql_error());
> ----- Original Message -----
> From: "Henning" <henningolsen36
netscape.net>
> To: <php-general
lists.php.net>
> Sent: Wednesday, September 18, 2002 5:12 PM
> Subject: [PHP] Join - problem
>
>
> > Hello
> > I'm using PHP4 and MySQL on Apache webserver.
> > I have a table valled "liste" with names of some people, and a table
> > called "postnummer" with zip-codes and citynames.
> > My select should join the adress and zip from one table with the
> > cityname from the other table.
> > But my join-line does not work. =:(
> >
> > My code results in this line:
> >
> > Warning: Supplied argument is not a valid MySQL result resource in
> > /var/www/html/find/resultat.php on line 27
> >
> > The code is:
> > mysql_select_db("adresser");
> > $query = ("SELECT fornavn, efternavn, gade, liste.postnummer,
> > postnummer.postbynavn FROM liste
> > left join postnummer on liste.postnummer = postnummer.postnummer
> > WHERE MATCH (fornavn, efternavn) AGAINST ('$search');");
> > $result = mysql_query($query);
> > while(list( $fornavn, $efternavn, $gade, $postnummer, $postbynavn) =
> > mysql_fetch_row($result))
> >
>
print("<TR><TD>$fornavn</TD><TD>$efternavn</TD><TD>$gade</TD><TD>$postnummer
> </TD><TD>$postbynavn</TD></TR>\n");
> >
> >
> > What is going on?
> > The select is ok if I do not join, but then I'm not able to get the
> > field "postbynavn" from the other table.
> >
> > PLEASE HELP!
> >
> > Henning
> >
> >
> > --
> > 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:
Oh dear - I forgot the rights in the new table:
select command denied to user: 'henning
localhost' for table 'postnummer'
Thanks for helping, John!
Henning
John Wards wrote:
> not having the time to look at your code I am not sure but do this to see if
> its mysql causeing the errors
>
> $result = mysql_query($query) or die(mysql_error());
> ----- Original Message -----
> From: "Henning" <henningolsen36
netscape.net>
> To: <php-general
lists.php.net>
> Sent: Wednesday, September 18, 2002 5:12 PM
> Subject: [PHP] Join - problem
>
>
>
>>Hello
>>I'm using PHP4 and MySQL on Apache webserver.
>>I have a table valled "liste" with names of some people, and a table
>>called "postnummer" with zip-codes and citynames.
>>My select should join the adress and zip from one table with the
>>cityname from the other table.
>>But my join-line does not work. =:(
>>
>>My code results in this line:
>>
>>Warning: Supplied argument is not a valid MySQL result resource in
>>/var/www/html/find/resultat.php on line 27
>>
>>The code is:
>>mysql_select_db("adresser");
>>$query = ("SELECT fornavn, efternavn, gade, liste.postnummer,
>>postnummer.postbynavn FROM liste
>>left join postnummer on liste.postnummer = postnummer.postnummer
>>WHERE MATCH (fornavn, efternavn) AGAINST ('$search');");
>>$result = mysql_query($query);
>>while(list( $fornavn, $efternavn, $gade, $postnummer, $postbynavn) =
>>mysql_fetch_row($result))
>>
>
> print("<TR><TD>$fornavn</TD><TD>$efternavn</TD><TD>$gade</TD><TD>$postnummer
> </TD><TD>$postbynavn</TD></TR>\n");
>
>>
>>What is going on?
>>The select is ok if I do not join, but then I'm not able to get the
>>field "postbynavn" from the other table.
>>
>>PLEASE HELP!
>>
>>Henning
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hi,
I have a form that I am using to update a mysql table but I can get timestamp to update. How can I pass that information to pass on. I have "READ" all books and feel I have correct systax but it just not working...
<input type="text" name="lastupdate" value="<? echo date('D M d, Y H:i:s', time()); ?>">
This should pass the time right?
Chuck Payne Magi Design and Support
attached mail follows:
MySQL syntax is YYYYMMDDHHMMSS or "YYYY-MM-DD HH:MM:SS"
---John Holmes...
----- Original Message -----
From: "Chuck Payne" <payne
magidesign.com>
To: <php-general
lists.php.net>
Sent: Wednesday, September 18, 2002 11:25 AM
Subject: [PHP] Time Stamp
> Hi, > > I have a form that I am using to update a mysql table but I can get > timestamp to update. How can I pass that information to pass on. I have > "READ" all books and feel I have correct systax but it just not working... > > <input type="text" name="lastupdate" value="<? echo date('D M d, Y H:i:s', > time()); ?>"> > > This should pass the time right? > > Chuck Payne > Magi Design and Support > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
I have the following problem:
a php page receives POST data from a form, it needs to elaborate the data and send it to another page again in POST automatically, without the user noticing.
Is it possible to use the header() function to send a POST request? If yes how? And how do I send the post data?
Thanx Rik
______________________________________________________________________ Mio Yahoo!: personalizza Yahoo! come piace a te http://it.yahoo.com/mail_it/foot/?http://it.my.yahoo.com/
attached mail follows:
Hi again,
Is there anyone in this group that has successfully uploaded a file large than 10 MB?
Regards, Rickard.
"Rickard Dahlstrand" <rd.nospam
tilde.se> wrote in message
news:20020916152333.49934.qmail
pb1.pair.com...
> Hi,
>
> I have been trying to upload files using PHP 4.1.2. Everything works OK
> until the filesize gets above 10MB. I have set all the paramaters upload
> filesize and max postsize in PHP and Apache ini-files but it still doesn't
> work. The server seems to just drop the connection since IE just tells me
> that the server didn't respond.
>
> Please help.
>
> Rickard.
>
>
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hey, You might want to check the archives......I know this came up before. Anyway, you didn't say if you checked your memory limit....that has to be larger than the post_max_size. HTH! ~Pauly
On Wednesday 18 September 2002 11:54 am, you wrote:
> Hi again,
>
> Is there anyone in this group that has successfully uploaded a file large
> than 10 MB?
>
> Regards, Rickard.
>
>
> "Rickard Dahlstrand" <rd.nospam
tilde.se> wrote in message
> news:20020916152333.49934.qmail
pb1.pair.com...
>
> > Hi,
> >
> > I have been trying to upload files using PHP 4.1.2. Everything works OK
> > until the filesize gets above 10MB. I have set all the paramaters upload
> > filesize and max postsize in PHP and Apache ini-files but it still
> > doesn't work. The server seems to just drop the connection since IE just
> > tells me that the server didn't respond.
> >
> > Please help.
> >
> > Rickard.
- --
~Paul Nicholson
Design Specialist
WebPower Design
"The web....the way you want it!"
paul
webpowerdesign.net
"It said uses Windows 98 or better, so I loaded Linux!" Registered Linux User #183202 using Register Linux System # 81891 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org
iD8DBQE9iM1yDyXNIUN3+UQRAgDXAJ9HFJ0GCINrupusBPM/Eq+LkyRCNQCcCAIc A5PpKLPaYaRVEb2SHPqmzms= =Ou2V -----END PGP SIGNATURE-----
attached mail follows:
Thanks Marek, That's exactly what I was looking for. I also found another solution, which was to build a second array with the information I want and merge the two arrays together with +. I like eval better :) thanks again.
For anyone that is interested this works too.
$a = "'THREE'"; $b = "3";
$data1 = array('ONE'=>1,'TWO'=>2); $data2[$a] = $b;
$test = $data1 + $data2;
-----Original Message-----
From: Marek Kilimajer [mailto:kilimajer
webglobe.sk]
Sent: Wednesday, September 18, 2002 1:54 AM
To: PHP
Subject: Re: [PHP] Please, Help dynamicaly creating an Array
Try eval(), like this:
$str= "'THREE'=>3, 'FOUR'=>4";
eval("\$data2 = array('ONE'=>1,'TWO'=>2,$str);");
Max Sullivan wrote:
>I am trying to populate array values and keys from a variable with no >luck. > >Lets say I have the following array. > >$data1 = array('ONE'=>1,'TWO'=>2,'THREE'=>3,'FOUR'=>4); > >And I want to create part of the array with the string below: > >$str= "'THREE'=>3, 'FOUR'=>4"; >$data2 = array('ONE'=>1,'TWO'=>2,$str); > > >How can I create $data2 to work the same as $data1. When I try the >above for $data2 a new key is created ([0]) for $str. And I end up with
>...'TWO'=>2, [0] => 'THREE'=>3, 'FOUR'=>4. It doesn't "interpret" the >variable how I expect it to, instead it see's $str as a value. I guess
>the question is how can I make php use the string literally. > >I've tried everything I can think of and I think my head is about to >explode :). Is it possible to create an Array this way? Any help is >appreciated!! > > >print_r($data1): >Array >( > [ONE] => 1 > [TWO] => 2 > [THREE] => 3 > [FOUR] => 4 >) > > >print_r($data2): >Array >( > [ONE] => 1 > [TWO] => 2 > [0] => 'THREE'=>3, 'FOUR'=>4 >) > > > >
attached mail follows:
I recommend checking out websites such as Elance for freelance workers and employers to find one another.
There are several others out there that are similar as well...try searing <http://dmoz.org/Business/Business_Services/Consulting/Marketplaces/Remotely _Provided_Services/> to find more.
PS I am not affiliated with Elance, just a suggestion.
Eric C. Pollitt, Founder 401 E. Illinois Ave. Peoria, IL 61603 Global Hemp - Portal to the hemp community http://www.globalhemp.com/
Create like a god. Command like a king. Work like a slave! -- Constantin Brancusi
> From: PHP freak <php
hitmedia.com>
> Date: Tue, 17 Sep 2002 22:44:30 -0700
> To: php-general
lists.php.net
> Subject: [PHP] mid-level PHP/MySQL people in Los Angeles?
>
> I'm looking for 1 or 2 people with good PHP/MySQL experience in the Los
> Angeles area.
>
> I have a few steady projects that pay $20/hr.
> (All of them 100% PHP/MySQL. All of them fun/non-corporate music-based
> sites.)
>
> If interested, please email my personal address: "dereksivers
yahoo.com"
> Include your contact info & any sites/projects you've worked on.
>
> Thanks!
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Hello I'm using PHP4 and MySQL on Apache webserver. I have a table valled "liste" with names of some people, and a table called "postnummer" with zip-codes and citynames. My select should join the adress and zip from one table with the cityname from the other table. But my join-line does not work. =:(
My code results in this line:
Warning: Supplied argument is not a valid MySQL result resource in /var/www/html/find/resultat.php on line 27
The code is: mysql_select_db("adresser"); $query = ("SELECT fornavn, efternavn, gade, postnummer.postnummer, postnummer.postbynavn FROM liste left outer join postnummer on liste.postnummer = postnummer.postnummer WHERE MATCH (fornavn, efternavn) AGAINST ('$search');"); $result = mysql_query($query); while(list($cpr, $fornavn, $efternavn, $gade, $postnummer, $postbynavn) = mysql_fetch_row($result))
What is going on? The select is ok if I do not join, but then I'm not able to get the field "postbynavn" from the other table.
PLEASE HELP!
Henning
attached mail follows:
Hello all,
I have one situation other than the normal that I cannot extract/save the MIME content of an e-mail which Content-type is different than the normal.
When I get attachments that have the following normal structure:
=============================== Content-Type: application/x-zip-compressed; name="file1.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="file1.zip" ===============================
It works perfectly. But I some e-mail clients e-mail me somthing like bellow:
=============================== Content-Type: application/octet-stream; name="file2.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="file2.zip" X-MailScanner: Found to be clean Status: ===============================
Then, it does not work and the system thinks that the e-mail has NO ATTACHMENTS.
This is weird. Since the only difference here is the Content-Type besides the X-MailScanner and Status in the last lines, could anyone help me handle it?
Also, is there anyway to get arrays for each of then separately like : Content-Type, Content-Transfer-Encoding and Content-Disposition?
A regular mail client like Netscape and OutlookExpress can easily see the attachment but I cannot do it with PHP imap.
This is a difficult question. Does anyone know how to answer it?
Thanks,
Carlos Fernando Scheidecker Antunes Linux User #207984
attached mail follows:
Or let Flash take over the active part.
You can retrieve data from PHP scripts in Flash and build dynamic menus, for example. Pretty much everything is possible.
Timo
Am Mittwoch den, 18. September 2002, um 06:11, schrieb Rasmus Lerdorf:
> php.net/ming
>
> On Wed, 18 Sep 2002, icaam
icaam.com.ar wrote:
>
>> Hi all,
>>
>> I've never combined PHP with Flash, but I do know there's some
>> possibilities. I'm wondering if I can make a dynamic-PHP-site which
>> controls Flash. I need the administrator to be able to upload
>> a new product
>> to a DB, and then be seen by the visitors in Flash... is this
>> possible?
>>
>> I want to do something like www.rolex.com but don't want to
>> make new pages
>> every time a new product is added... Is this possble? Where
>> can I find the
>> documentation?
>>
>> Thanks in advance,
>>
>> César Aracena
>> On Dial-Up
>>
>> --------------------------------------------------------------------
>> mail2web - Check your email from the web at
>> http://mail2web.com/ .
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Hi,
I was wondering is there a way to strip ONLY the tags that you specify from a page, rather than having to include all the tags you do want (using strip_tags() )
Cheers Alexis
attached mail follows:
Hi Everone,
for my newest projekt i started to use global var like $_REQUEST['varname'] and so on.
But in some cases i started again to use old var mode.
Finally i have read some about there is need to define the vars, before I'm going to create the source for my webpages.
But how can i make definitions like <form action="test.php?action=update" method="post"> working without usage of hidden fields.
Or links like test.php?action=update and so on.
Please gimme a hint
Sascha
attached mail follows:
In article <004b01c25f36$961fbbd0$6200a8c0
squitta>,
saschabraun
gmx.de (Sascha Braun) wrote:
> But how can i make definitions like <form action="test.php?action=update" > method="post">
Those variables can be accesd via the global $_POST['varname']
> working without usage of hidden fields. > > Or links like test.php?action=update and so on.
These can be reached vie $_GET['varname'] > Please gimme a hint > > Sascha Thats what works for me.
greets David
attached mail follows:
Hello all!
I use time() to keep UNIX seconds from 1970 to a timestamp(14) MySQL field. But when I read it (Dt_last) it is TO big compearing with "today=time()" in a php script that is only some seconds later. today : 1032350421 Dt_last: 20001101165838
What can I do? Thanks! Makis
Makis
attached mail follows:
Change it to an INT or a VARCHAR datatype, the mysql timestamp field uses MySQL's date/time formmating. If you decide to let MySQL use it's own date time format, use UNIX_TIMESTAMP(fieldname) to get the unix timestamp from that date field.
Adam Voigt
adam.voigt
cryptocomm.com
On Wed, 2002-09-18 at 13:19, Savaidis wrote: > > > Hello all! > > I use time() to keep UNIX seconds from 1970 to a timestamp(14) MySQL field. > But when I read it (Dt_last) it is TO big compearing with "today=time()" in > a php script that is only some seconds later. > today : 1032350421 Dt_last: 20001101165838 > > What can I do? > Thanks! > Makis > > > > Makis > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
I would like to get all the data from a POST-result into an array.
Is there a function like that adds all the vars from the post into an array where Key is the name of the form-field and Value is the value entered in this field.
Like this: array('firstname' => 'fname', 'lastname' => 'lname');
Thanks, // Michelle
attached mail follows:
Hi guys,
What is the easiest way to get the date of one year from today? Accommodating for leap years is not essential (but would be a nice bonus).
Thanks, Peter
- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
pbechard
fourthrealm.com
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -
attached mail follows:
"Support
Fourthrealm.com" wrote:
>
> Hi guys,
>
> What is the easiest way to get the date of one year from today?
> Accommodating for leap years is not essential (but would be a nice bonus).
Without leap year adjustment...
date( "your format string here", time() + 60 * 60 * 24 * 365 );
HTH, Rob.
-- .-----------------. | Robert Cummings | :-----------------`----------------------------. | Webdeployer - Chief PHP and Java Programmer | :----------------------------------------------: | Mail : mailto:robert.cummingswebmotion.com | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------'
attached mail follows:
With leap year adjustment...
strtotime("+1 year", <timestamp>);
will return a unix timestamp.
- Jacob
At 01:49 09/19/2002, Robert Cummings wrote:
>"Support
Fourthrealm.com" wrote:
> >
> > Hi guys,
> >
> > What is the easiest way to get the date of one year from today?
> > Accommodating for leap years is not essential (but would be a nice bonus).
>
>Without leap year adjustment...
>
>date( "your format string here", time() + 60 * 60 * 24 * 365 );
>
>HTH,
>Rob.
>--
>.-----------------.
>| Robert Cummings |
>:-----------------`----------------------------.
>| Webdeployer - Chief PHP and Java Programmer |
>:----------------------------------------------:
>| Mail : mailto:robert.cummings
webmotion.com |
>| Phone : (613) 731-4046 x.109 |
>:----------------------------------------------:
>| Website : http://www.webmotion.com |
>| Fax : (613) 260-9545 |
>`----------------------------------------------'
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Jacob Miller wrote: > > With leap year adjustment... > > strtotime("+1 year", <timestamp>); > > will return a unix timestamp.
Nice, don't think I've ever used that function :)
Cheers, Rob.
-- .-----------------. | Robert Cummings | :-----------------`----------------------------. | Webdeployer - Chief PHP and Java Programmer | :----------------------------------------------: | Mail : mailto:robert.cummingswebmotion.com | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------'
attached mail follows:
Hi folks
Bit of a major panic - any help MUCH appreciated.
I have been storing serialized arrays in MySQL Gemini tables without any problems.
But with Gemini looking more and more like a dead duck, I decided to take the server down and port from Gemini to InnoDB. I also took the opportunity to upgrade from php 4.1 to php 4.2.2
Now, when I run unserialize( ) on the serialized arrays, the strings are being returned unchanged. No error - they are simply passing through unserialize( ) without being altered.
It is not a backslash issue, as there are no escaped characters in the strings affected, nor are the strings urlencoded.
I have no idea how to go about fixing this and I am under serious pressure to get the server back up ASAP - so I am very much hoping that to get a response from the list.
--Geoff Caplan Advantae Ltd
mailto:geoff
advantae.com http://www.advantae.com
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hey, There must be an error in the serialized strings....would you mind posting one for us to look at? How about posting some code? ~Pauly
On Wednesday 18 September 2002 02:02 pm, you wrote: > Hi folks > > Bit of a major panic - any help MUCH appreciated. > > I have been storing serialized arrays in MySQL Gemini tables without > any problems. > > But with Gemini looking more and more like a dead duck, I decided to > take the server down and port from Gemini to InnoDB. I also took the > opportunity to upgrade from php 4.1 to php 4.2.2 > > Now, when I run unserialize( ) on the serialized arrays, the strings > are being returned unchanged. No error - they are simply passing > through unserialize( ) without being altered. > > It is not a backslash issue, as there are no escaped characters in the > strings affected, nor are the strings urlencoded. > > I have no idea how to go about fixing this and I am under serious > pressure to get the server back up ASAP - so I am very much hoping > that to get a response from the list.
- --
~Paul Nicholson
Design Specialist
WebPower Design
"The web....the way you want it!"
paul
webpowerdesign.net
"It said uses Windows 98 or better, so I loaded Linux!" Registered Linux User #183202 using Register Linux System # 81891 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org
iD8DBQE9iM4vDyXNIUN3+UQRAmhGAJ9jAX88mO1F7MvFPTy/cB0jNf5d0ACeIaDb jOLego6+k2mIcplJ3y9uUNs= =a4Br -----END PGP SIGNATURE-----
attached mail follows:
Paul,
PN> There must be an error in the serialized strings....would you mind PN> posting one for us to look at? How about posting some code?
This is all very strange. The code has been working in production for months. Since the upgrade of PHP and the DB, some are working and some not. I can't see any pattern.
Where can I find info of the serialize format so I can look for damage?
Here is one of the strings that is not unserializing - sorry it is so long.
s:1745:"s:1735:"s:1725:"s:1715:"s:1705:"s:1695:"s:1685:"s:1675:"s:1665:"s:1655:"s:1645:"s:1635:"s:1625:"s:1615:"a:2:{s:10:"attributes";a:32:{s:13:"attribute_204";s:1:"4";s:13:"attribute_205";s:1:"5";s:13:"attribute_206";s:3:"Yes";s:13:"attribute_207";s:3:"Yes";s:13:"attribute_208";s:3:"Yes";s:13:"attribute_209";s:3:"Yes";s:13:"attribute_210";s:2:"No";s:13:"attribute_211";s:2:"No";s:13:"attribute_212";s:1:"2";s:13:"attribute_213";s:2:"No";s:13:"attribute_214";s:2:"No";s:13:"attribute_215";s:2:"No";s:13:"attribute_216";s:3:"Yes";s:13:"attribute_217";s:2:"No";s:13:"attribute_218";s:2:"No";s:13:"attribute_219";s:2:"No";s:13:"attribute_220";s:2:"No";s:13:"attribute_221";s:2:"No";s:13:"attribute_222";s:2:"No";s:13:"attribute_223";s:2:"No";s:13:"attribute_224";s:15:"Residual drying";s:13:"attribute_225";s:3:"Yes";s:13:"attribute_226";s:2:"No";s:13:"attribute_227";s:2:"12";s:13:"attribute_228";s:2:"53";s:13:"attribute_229";s:5:"White";s:13:"attribute_230";s:3:"651";s:13:"attribute_231";s:3:"555";s:13:"attribute_232";s:3:"460";s:13:"attribute_233";s:1:"C";s:13:"attribute_234";s:1:"B";s:13:"attribute_235";s:1:"C";}s:5:"lists";a:20:{s:14:"list_2_1_label";s:0:"";s:17:"list_2_1_man_code";s:0:"";s:13:"list_2_1_code";s:0:"";s:13:"list_2_1_sort";s:0:"";s:14:"list_2_2_label";s:0:"";s:17:"list_2_2_man_code";s:0:"";s:13:"list_2_2_code";s:0:"";s:13:"list_2_2_sort";s:0:"";s:14:"list_2_3_label";s:0:"";s:17:"list_2_3_man_code";s:0:"";s:13:"list_2_3_code";s:0:"";s:13:"list_2_3_sort";s:0:"";s:14:"list_2_4_label";s:0:"";s:17:"list_2_4_man_code";s:0:"";s:13:"list_2_4_code";s:0:"";s:13:"list_2_4_sort";s:0:"";s:14:"list_2_5_label";s:0:"";s:17:"list_2_5_man_code";s:0:"";s:13:"list_2_5_code";s:0:"";s:13:"list_2_5_sort";s:0:"";}}";";";";";";";";";";";";";"; -- Geoff Caplan Advantae Ltd
mailto:geoff
advantae.com
http://www.advantae.com
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Geoff, It looks like that string has been serialized multiple times. Update your serialized string to: - ----- a:2:{s:10:"attributes";a:32:{s:13:"attr ibute_204";s:1:"4";s:13:"attribute_205";s:1:"5";s:13:"attribute_206";s:3:"Ye s";s:13:"attribute_207";s:3:"Yes";s:13:"attribute_208";s:3:"Yes";s:13:"attri bute_209";s:3:"Yes";s:13:"attribute_210";s:2:"No";s:13:"attribute_211";s:2:" No";s:13:"attribute_212";s:1:"2";s:13:"attribute_213";s:2:"No";s:13:"attribu te_214";s:2:"No";s:13:"attribute_215";s:2:"No";s:13:"attribute_216";s:3:"Yes ";s:13:"attribute_217";s:2:"No";s:13:"attribute_218";s:2:"No";s:13:"attribut e_219";s:2:"No";s:13:"attribute_220";s:2:"No";s:13:"attribute_221";s:2:"No"; s:13:"attribute_222";s:2:"No";s:13:"attribute