[PHP] PHP License Agreement
Hello all, I have an issue with an application I have developed that has Macromedia Director interfacing with MySql via PHP. I am told by our legal representation that under the PHP license agreement, the PHP html source code must be available. It was my understanding that only the compiler source code need be made available. Am i way off track or should I out asking for PHP website source code?? ;-) The product is for sale and uses php/mysql for administration. I have a software licence for Director and have just purchased the MySql license. Is there anyone else who has experienced the same situation or could refer me to an appropriate information source. thanks Daniel Cozzolino -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php string match problem
have you tried printing them out with surrounding characters, like echo 'row8=(',$row[8],') LOGINNAME=(',$LOGINNAME,')'; to see if there are leading or trailing spaces? On Mon, 19 Aug 2002, Pafo wrote: > heh,, is it just me or can anyone see whats wrong with this code... > > $query = "SELECT * FROM logininfo WHERE loginname = '$LOGINNAME'"; > if ($result = mysql_query($query)){ > while ($row = mysql_fetch_row($result)){ > $temp = $row[8]; > $temp2 = $LOGINNAME; > if ($temp == $temp2) { <-- this dosent work > $ierror = "Loginnamnet är redan upptaget!" . $ierror; } > } > } else { print "error"; } > mysql_close($db); > > i have tried: > if ($row[8] == $LOGINNAME) { > > dosent work either, and when i write: > > while ($row = mysql_fetch_row($result)){ > print $row[8] . "-" . $LOGINNAME; > > it shows the exact same information > > anyone got any idea? > > patrick > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php string match problem
oops again, please ignore my last two posts :( -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Monday, August 19, 2002 3:38 PM To: 'Pafo'; [EMAIL PROTECTED] Subject: RE: [PHP] php string match problem oh, just realised, one of them needs to go below the "else" line, to end the "while" loop -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Monday, August 19, 2002 3:37 PM To: 'Pafo'; [EMAIL PROTECTED] Subject: RE: [PHP] php string match problem You've got too many closing braces... if ($temp == $temp2) { $ierror = "Loginnamnet är redan upptaget!" . $ierror; } <--- Here's one } <--- Here's the other } else { print "error"; } <--- And a third one You only need one of them... HTH Martin -Original Message- From: Pafo [mailto:[EMAIL PROTECTED]] Sent: Monday, August 19, 2002 3:21 PM To: [EMAIL PROTECTED] Subject: [PHP] php string match problem heh,, is it just me or can anyone see whats wrong with this code... $query = "SELECT * FROM logininfo WHERE loginname = '$LOGINNAME'"; if ($result = mysql_query($query)){ while ($row = mysql_fetch_row($result)){ $temp = $row[8]; $temp2 = $LOGINNAME; if ($temp == $temp2) { <-- this dosent work $ierror = "Loginnamnet är redan upptaget!" . $ierror; } } } else { print "error"; } mysql_close($db); i have tried: if ($row[8] == $LOGINNAME) { dosent work either, and when i write: while ($row = mysql_fetch_row($result)){ print $row[8] . "-" . $LOGINNAME; it shows the exact same information anyone got any idea? patrick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php string match problem
oh, just realised, one of them needs to go below the "else" line, to end the "while" loop -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Monday, August 19, 2002 3:37 PM To: 'Pafo'; [EMAIL PROTECTED] Subject: RE: [PHP] php string match problem You've got too many closing braces... if ($temp == $temp2) { $ierror = "Loginnamnet är redan upptaget!" . $ierror; } <--- Here's one } <--- Here's the other } else { print "error"; } <--- And a third one You only need one of them... HTH Martin -Original Message- From: Pafo [mailto:[EMAIL PROTECTED]] Sent: Monday, August 19, 2002 3:21 PM To: [EMAIL PROTECTED] Subject: [PHP] php string match problem heh,, is it just me or can anyone see whats wrong with this code... $query = "SELECT * FROM logininfo WHERE loginname = '$LOGINNAME'"; if ($result = mysql_query($query)){ while ($row = mysql_fetch_row($result)){ $temp = $row[8]; $temp2 = $LOGINNAME; if ($temp == $temp2) { <-- this dosent work $ierror = "Loginnamnet är redan upptaget!" . $ierror; } } } else { print "error"; } mysql_close($db); i have tried: if ($row[8] == $LOGINNAME) { dosent work either, and when i write: while ($row = mysql_fetch_row($result)){ print $row[8] . "-" . $LOGINNAME; it shows the exact same information anyone got any idea? patrick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php string match problem
You've got too many closing braces... if ($temp == $temp2) { $ierror = "Loginnamnet är redan upptaget!" . $ierror; } <--- Here's one } <--- Here's the other } else { print "error"; } <--- And a third one You only need one of them... HTH Martin -Original Message- From: Pafo [mailto:[EMAIL PROTECTED]] Sent: Monday, August 19, 2002 3:21 PM To: [EMAIL PROTECTED] Subject: [PHP] php string match problem heh,, is it just me or can anyone see whats wrong with this code... $query = "SELECT * FROM logininfo WHERE loginname = '$LOGINNAME'"; if ($result = mysql_query($query)){ while ($row = mysql_fetch_row($result)){ $temp = $row[8]; $temp2 = $LOGINNAME; if ($temp == $temp2) { <-- this dosent work $ierror = "Loginnamnet är redan upptaget!" . $ierror; } } } else { print "error"; } mysql_close($db); i have tried: if ($row[8] == $LOGINNAME) { dosent work either, and when i write: while ($row = mysql_fetch_row($result)){ print $row[8] . "-" . $LOGINNAME; it shows the exact same information anyone got any idea? patrick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php string match problem
heh,, is it just me or can anyone see whats wrong with this code... $query = "SELECT * FROM logininfo WHERE loginname = '$LOGINNAME'"; if ($result = mysql_query($query)){ while ($row = mysql_fetch_row($result)){ $temp = $row[8]; $temp2 = $LOGINNAME; if ($temp == $temp2) { <-- this dosent work $ierror = "Loginnamnet är redan upptaget!" . $ierror; } } } else { print "error"; } mysql_close($db); i have tried: if ($row[8] == $LOGINNAME) { dosent work either, and when i write: while ($row = mysql_fetch_row($result)){ print $row[8] . "-" . $LOGINNAME; it shows the exact same information anyone got any idea? patrick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: html parser
Roman, Please direct your question to the list, no to me personally. When I have time on the list, I answer what I can... if I start answering questions off list: a) others don't benefit b) others can't join in c) I consider it a billable, personalised service to you Parsing HTML is pretty complex stuff, and I haven't finished anything yet. For me, I wanted to get all tags, then get all the elements out of it, change some, and glue it all back together, AND insert it back into the HTML page in the right spot. Not easy! However it does help if you know exactly what you want, and can limit the requirements. HTML is a bitch to parse. There are tonnes options for attributes of a link, like: href=http://foo.com href="http://foo.com"; href='http://foo.com' href = "http://foo.com"; href = 'http://foo.com' Then there's the different methods... http, ftp, mailto, javascript, etc etc. Then there's the fact that you may only want to search for links within your own domain, or only those outside your domain, and will you want to keep query strings, port numbers, etc etc intact? In your case, you might only want an array with a list of all the http:// URLs found in the page... eg: $urls[1] => 'http://www.indent.com.au/home.php'; $urls[2] => 'http://www.indent.com.au/about.php'; $urls[3] => 'http://google.com'; OR, you might also want the mailto: ftp:// file:/// javascript: ...and whatever else in there as well. OR you might want the whole hyperlink ''. It's not up to us to *guess* what you want to achieve. It's up to you to CLEARLY SPECIFY the requirements. 1. what is your source? a string? a HTML file on disk? a http:// URL on the web? 2. what specifically do you want to search for? 3. what do you want to do with the matches? You need to be a LOT more specific. Justin French on 19/08/02 5:49 AM, Roman Belonohy´ ([EMAIL PROTECTED]) wrote: > Hi man, > > I'd need to do a script which return all hyperlinks found on some webpage. > > You wrote about the similar script you're writing. > > Could you show me it or advice some approach ? > > thank you, > > Roman > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] max_execute_time does not work on infinitely loop
Hi all, I have set the max_execute_time in php.ini to 300 (5 mins). And i found that if my script have a infinitely loop( caused by careless programming), the script still executing even 5 mins is passed and uses up all my cpu resourse. Even i "stop" and close the browser, the script seen still running on the background. (I found the apache.exe is used up 99% of cpu resourse in window task manager) What i can do is restart the apache server. I use the following script to test the situation. So is there any way to stop execution of php script? Since i have make a server for my friend to test his php script, sometime if his script have such a bad looping, the apache would hanged. I dont want to restart the server everytime since i;m not sitting in front my pc anytime. Thanks in advance Nowhereman from HK -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How Can I Generate an Email List from a MySQL Table
On Sat, 17 Aug 2002 20:10:02 -0700 "Roger Lewis" <[EMAIL PROTECTED]> wrote: > My problem is how do you create the variable, $to, from the MySQL table so > that it contains all of the addresses separated by commas. Daren Cotter [mailto:[EMAIL PROTECTED]] responded Saturday, August 17, 2002 8:42 PM > // Query database > $result = mysql_query("SELECT email_address FROM users > WHERE is_subscribed = 'Y'", $link); > while ($row = mysql_fetch_array($result)) { > mail($row["email_address"], $SUBJECT, $BODY, > $HEADER); > } > mysql_free_result($result); Darren, Thanks a lot. This works fine. Please have a virtual beer on me! :) To Chris Knipe [mailto:[EMAIL PROTECTED]] who responded > $to = ''; > while ($blah = mysql_fetch_row($ref)) { > $to =+ $blah['address']; > }; I tried this, but I got an index error. It doesn't understand 'address' and I couldn't figure out what was going on. To Kevin Waterson who responded > simply create your array and use implode. > There is an example of comma seperated lists in the manual > http://www.php.net/manual/en/function.implode.php I like this method because it seems more elegant than above, but I don't seem to be able to create the array properly. I tried the following as well as many other combinations, but couldn't get anything to work: $sql = "SELECT email_address FROM users WHERE is_subscribed = 1"; $result = mysql_query($sql); $to = implode(",", mysql_fetch_array($result)); Thanks again everyone for your help Roger Lewis > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail/variable help needed..
On Monday 19 August 2002 07:23, eriol wrote: > I understand that PHP will retain the file in a temporary directory (/tmp/) > until it is stored to the path I've specified (/uploaded/), but I don't > understand how to get it to print the new file name within the email it > sends to me.. Currently, it only prints the temporary file name as shown > above.. That's because at the point that you're assigning $body that is what $file contains ... > As you can see, to the last $body variable, I've added both $info & $file > as a test, but $info returns null and $file returns the temp path/name > only.. However, within the returned php/html page, the $file variable > actually does echo the actual file name the user chose to upload.. ..., move it to after you have redefined $file and $info. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* They're only trying to make me LOOK paranoid! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Resetting the timeout
set_time_limit() -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: Monday, August 19, 2002 12:05 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Resetting the timeout On Monday 19 August 2002 10:06, Mike Mannakee wrote: > Is there any way to set the timeout (max length of time the script has to > execute) from within a script, just for its own execution? ini_set() -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Sometimes love ain't nothing but a misunderstanding between two fools. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Resetting the timeout
On Monday 19 August 2002 10:06, Mike Mannakee wrote: > Is there any way to set the timeout (max length of time the script has to > execute) from within a script, just for its own execution? ini_set() -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Sometimes love ain't nothing but a misunderstanding between two fools. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Resetting the timeout
Is there any way to set the timeout (max length of time the script has to execute) from within a script, just for its own execution? Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 19 Aug 2002 01:31:13 -0000 Issue 1533
php-general Digest 19 Aug 2002 01:31:13 - Issue 1533 Topics (messages 113133 through 113168): Sort multidimensional array using Natural-Order 113133 by: Hessu 113135 by: Hessu Re: Help needed about queries with MySQL, thanks. 113134 by: Craig Vincent 113136 by: Carsten Mohr 113137 by: Chris Knipe Secure connection with MySQL database 113138 by: Chris Schoeman 113141 by: Edwin . 113147 by: Edwin . problems with php.ini 113139 by: Andy Re: array's 113140 by: Pafo xml and a big script 113142 by: Pafo 113143 by: Pafo XP home install question 113144 by: Jonathan Goulding 113146 by: Jonathan Goulding newbie php image importing problems 113145 by: Brian & Shannon Windsor 113159 by: hugh danaher Web Based Mail 113148 by: Chill 113149 by: MET 113150 by: Andy 113151 by: The Doctor 113152 by: Dan Hardiker Re: hyperlink parser - a bit new view :) 113153 by: Roman 113154 by: MET 113157 by: Roman 113163 by: DL Neil sorting multiple-dimensional arrays 113155 by: Evan Nemerson 113156 by: Rasmus Lerdorf 113162 by: Evan Nemerson save all vars in a url to a var? 113158 by: Hawk 113160 by: Evan Nemerson 113161 by: Joachim Krebs Find rows by 1st letter in MySQL 113164 by: Tony Harrison 113165 by: DL Neil 113166 by: Chris Kay mail/variable help needed.. 113167 by: eriol XML XSL Issue 113168 by: karthikeyan Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- --- Begin Message --- Hi, I have following filename/date array Array ( [0] => Array ( [0] => 1.jpg [1] => 10.jpg [2] => 11.jpg [3] => 12.jpg [4] => 2.jpg [5] => 3.jpg [6] => 4.jpg [7] => 5.jpg [8] => 6.jpg [9] => 7.jpg [10] => 8.jpg [11] => 9.jpg ) [1] => Array ( [0] => 1026502301 [1] => 1026502312 [2] => 1026502313 [3] => 1026502550 [4] => 1026502302 [5] => 1026502304 [6] => 1026502305 [7] => 1026502619 [8] => 1026502585 [9] => 1026502308 [10] => 1026502310 [11] => 1026502311 ) ) I'm trying to sort the array by filename in Natural-Order. Array_multisort(filelist[0]),SORT_ASC,$filelist[1]) don't sort in Natural-Order usort($filelist[0],"strnatcmp"); Sorts only filenames, any ideas how to get dates also sorted? -Hessu- --- End Message --- --- Begin Message --- Hi, I have following filename/date array Array ( [0] => Array ( [0] => 1.jpg [1] => 10.jpg [2] => 11.jpg [3] => 12.jpg [4] => 2.jpg [5] => 3.jpg [6] => 4.jpg [7] => 5.jpg [8] => 6.jpg [9] => 7.jpg [10] => 8.jpg [11] => 9.jpg ) [1] => Array ( [0] => 1026502301 [1] => 1026502312 [2] => 1026502313 [3] => 1026502550 [4] => 1026502302 [5] => 1026502304 [6] => 1026502305 [7] => 1026502619 [8] => 1026502585 [9] => 1026502308 [10] => 1026502310 [11] => 1026502311 ) ) I'm trying to sort the array by filename in Natural-Order. Array_multisort(filelist[0]),SORT_ASC,$filelist[1]) don't sort in Natural-Order usort($filelist[0],"strnatcmp"); Sorts only filenames, any ideas how to get dates also sorted? -Hessu- --- End Message --- --- Begin Message --- > I have a MySQL database (called "sessions") with a auto-increment > INT field called "sessionID". I try to check if there is already > a record in this database with a given sessionID, which is called > $sessionID in PHP. I use this query, which must be wrong (but I > cannot find out why !!!) : > >SELECT * FROM sessions WHERE sessionID = $sessionID Although this may or may not help depending on your code (please post it if you still haven't found a solution...it's the best way for us to help. Try SELECT * FROM sessions WHERE sessionID = '$sessionID' Although if $sessionID contains an integer (which I assume is would) the quotes aren't needed, you never know. Some OSes are quirky. Also you may want to add an echo mysql_error(); line after your initial mysql_query to see if perhaps there's a problem with PHP communicating with MySQL. Sincerely, Craig Vincent --- End Message --- --- Begin Message --- Hallo, I don't know if it helps you, but normally you have to quote the variable in the SQL-Statement like: SELECT * FROM sessions WHERE sessionID = '$sessionID' Otherwise I always get an SQL-Error Jean-Marc Godart wrote: > Hello everyone, > > I am a new PHP user, from Belgium. I am trying to manage a MySQL database with PHP, >and I kindly request your help to solve a little (probably very stupid) problem I >have been dealing with for a while already ... > > I have a MySQL database (called "sessions") with a auto-increment INT field called >"sessionID". I try to check if there is already a record in this database with a >given
[PHP] XML XSL Issue
Hi All, I have an XML file. I want to display a count of unique record(surname, forename) using XSL. In the below example there are 3 records out of which 1 is duplicate in that case I want to display using XSL [Total = 2] This is my xml file -- Coates Arnold TL103080D Applicant Active Crowe Stephen NB305054C Applicant Active Coates Arnold AB403869A Confirmed Lead Active - Can anyone type a sample code of XSL for my requirement. Looking forward for yours response. Have a great day. karthikeyan. - Judge not, that ye be not Judged - Abraham Lincoln's favorite quote -
[PHP] mail/variable help needed..
The following is the partial source for an upload form.. I'm having trouble with the mail() function including the actual file name the user is sending instead of "/tmp/phpIkRjHq".. I understand that PHP will retain the file in a temporary directory (/tmp/) until it is stored to the path I've specified (/uploaded/), but I don't understand how to get it to print the new file name within the email it sends to me.. Currently, it only prints the temporary file name as shown above.. As you can see, to the last $body variable, I've added both $info & $file as a test, but $info returns null and $file returns the temp path/name only.. However, within the returned php/html page, the $file variable actually does echo the actual file name the user chose to upload.. I'm a newbie, so hopefully I'm making sense.. Any ideas to help me fix this problem would be appreciated.. Thanks in advance.. Take care.. peace.. eriol0){ $allowed_types = array("text/plain","text/html"); $size_limit = "524288"; $file = $_FILES["file"]["name"]; $type = $_FILES["file"]["type"]; $size = $_FILES["file"]["size"]; $temp = $_FILES["file"]["tmp_name"]; $path_info = pathinfo($PATH_TRANSLATED); $write_path = $path_info["dirname"] . "$uppath$uptime" . $file; if ($file){ if ($size < $size_limit){ if (in_array($type,$allowed_types)){ if(move_uploaded_file($temp,$write_path)){ $info = "$file has been uploaded successfully.."; if(!mail($email,$subject,$body,"Return-Path: \r\n" ."From: me \r\n" ."Reply-To: me@$SERVER_NAME\n" ."X-Mailer: $SERVER_NAME")){ echo "uh.."; } a few else statements ... } } ?> Upload: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Find rows by 1st letter in MySQL
Try Select blah from blah where blah like '$letter%' % is wildcard after first letter Regards. --- Chris Kay Technical Support - Techex Communications Website: www.techex.com.au Email: [EMAIL PROTECTED] Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102 Platinum Channel Partner of the Year - Request DSL - Broadband for Business --- > -Original Message- > From: DL Neil [mailto:[EMAIL PROTECTED]] > Sent: Monday, 19 August 2002 8:43 AM > To: Tony Harrison > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Find rows by 1st letter in MySQL > > > Tony, > > > How would I go about selecting rows from a MySQL table > where the first > > letter of a certain field is $letter ? > > > Depends upon the MySQL tbl's schema. > The MySQL online manual discusses wildcards (full text). > Alternatively see LEFT() and other string functions that can > be used in SELECT and WHERE clauses. > > Regards, > =dn > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Find rows by 1st letter in MySQL
Tony, > How would I go about selecting rows from a MySQL table where the first > letter of a certain field is $letter ? Depends upon the MySQL tbl's schema. The MySQL online manual discusses wildcards (full text). Alternatively see LEFT() and other string functions that can be used in SELECT and WHERE clauses. Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Find rows by 1st letter in MySQL
How would I go about selecting rows from a MySQL table where the first letter of a certain field is $letter ? -- - [EMAIL PROTECTED] http://www.cool-palace.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hyperlink parser - a bit new view :)
Hi Roman, > But on those phpbuilder's page there are also similar questions but answered > scripts don't work, for example: > ... > preg_match_all("|href=\"?([^\"' >]+)|i(+[ >])", $text,$ar); >... > I really don't know :( There's definitely something wrong with the RegEx above. The string commences with |, so therefore the last characters of the string must be |a - where "a" is a letter, in this case "i" meaning case-insensitive. For some reason the |i is not at the end of the string - either you miscopied or they misprinted. However the RegEx doesn't strike me as correct HTML anyway, because there can be spaces between elements, eg between "href" and "=", eg ]*)(['\" >])/i"; if ( DEBUG ) echo "RegEx=$RegEx~"; $bValidity = $iFound = preg_match_all( $RegEx, $HTML, $aRegExOut ); An improvement might be for the closing quotes to refer back to (any) opening quotes. I am willing to watch, listen, and learn, if anyone can offer improvements/wisdom. Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sorting multiple-dimensional arrays
Thanks Rasmus. On Sunday 18 August 2002 02:37 pm, you wrote: > usort(), uasort() or uksort(). uasort() has a nice little example in the > user comment. > > On Sun, 18 Aug 2002, Evan Nemerson wrote: > > I have an array that looks like > > > > $array = Array( > > Array($var1, $var2, $var3), > > Array($var1, $var2, $var3), > > Array($var1, $var2, $var3) > > ); > > > > I want to sort the arrays within $array by $var3 (although if it helps i > > can easily change that to $var1). $var1 and $var2 are strings, $var3 is a > > number (in form of ([0-9]{3}\.[0-9]) ) > > > > I know i could put something together that would make a new, > > single-dimensional array that looks like Array(var3, var3, var3...), sort > > that, then use that as a reference point, but that's a really sloppy > > approach, and I'm thinking probably not the best way. > > > > I have a feeling someone is just going to reply with only > > "php.net/somefunction" in the body of their message, and I'll feel > > stupid, but oh well. I can't find anything in the man. > > > > Any input would be appreciated. > > > > > > -Evan > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] save all vars in a url to a var?
For a list of common system variables, refer to: http://cs-people.bu.edu/stevec/cs101/02s/php5_system.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] save all vars in a url to a var?
take a look at $QUERY_STRING. If that's not what you want, you should be able to find something in phpinfo(); On Sunday 18 August 2002 02:53 pm, you wrote: > is there some way to save all the info that is after the .php? in a var? > need that for a function on my page, but I have no idea what to look for > > Håkan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie php image importing problems
>From reading your post, I believe you've successfully gotten the file upload to work and now you're interested in using uploaded files (but with smaller dimensions) on your webpage. What you'll need to do is create a separate file named resize.php which includes only the following code. On your webpage you will call this file using the following: "; ?> To see the error messages you'll need to substitute the above with: Click here"; ?> Once you've deloused it you can revert to the img tag. "resize.php" contains only the code below--with no blank line before the php tag! "resize.php" will create a smaller image with a maximum dimension of 200 pixels. Obviously, you can change this to some other method to get the size you want. Finally, the images generated aren't the best looking I've seen, and if you've got a newer version of php than I've got access to, you could change from imagecopyresized() to imagecopyresampled(). Hope this helps, Hugh $width) { $nheight=$max; $nwidth=$width/($height/$max); } else { $nwidth=$max; $nheight=$height/($width/$max); } $image=imagecreatefromjpeg($picture); $image1=imagecreate($nwidth,$nheight); imagecopyresized( $image1, $image,0,0, 0,0, $nwidth, $nheight,$width,$height); header("content-type: image/jpeg"); imagejpeg($image1); ImageDestroy($image); ImageDestroy($image1); ?> - Original Message - From: "Brian & Shannon Windsor" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, August 18, 2002 10:48 AM Subject: [PHP] newbie php image importing problems > Hello, > > I got some great help from this newsgroup a few days ago, and I'm 90% > complete with my project, but I have one snag. I'm building a web page that > allows a business to import pictures of their products and then display them > on their page along ith other information. > > My problem is getting in an image but displaying a thumbnail, and if > clicked, the original image. The client only wants to load one image. I'm > stuck at how to take the one image, copy it to the host server, and then > display a thumbnail of the image. I can make the thumbnail linkable to the > larger image, and I can display the original image on my home PC, but that's > all local. > > Please help. > > Thanks, > > Brian > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] save all vars in a url to a var?
is there some way to save all the info that is after the .php? in a var? need that for a function on my page, but I have no idea what to look for Håkan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] hyperlink parser - a bit new view :)
Hi Mat, I would not please for help if I would not read those texts. Of course I've read them both. But on those phpbuilder's page there are also similar questions but answered scripts don't work, for example: $text="http://aaa\";>ttrtert"; preg_match_all("|href=\"?([^\"' >]+)|i(+[ >])", $text,$ar); print_r($ar); returns this: Warning: Unknown modifier '(' in test.php on line 5 [line 5 is that line with preg_match_all] Array ( ) I really don't know :( Roman -Original Message- From: MET [mailto:[EMAIL PROTECTED]] Look up Regular Expressions. Basically they allow you to search out Check out these links: http://www.php.net/manual/en/ref.regex.php http://www.phpbuilder.com/columns/dario19990616.php3 ~ Matthew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sorting multiple-dimensional arrays
usort(), uasort() or uksort(). uasort() has a nice little example in the user comment. On Sun, 18 Aug 2002, Evan Nemerson wrote: > I have an array that looks like > > $array = Array( > Array($var1, $var2, $var3), > Array($var1, $var2, $var3), > Array($var1, $var2, $var3) > ); > > I want to sort the arrays within $array by $var3 (although if it helps i can > easily change that to $var1). $var1 and $var2 are strings, $var3 is a number > (in form of ([0-9]{3}\.[0-9]) ) > > I know i could put something together that would make a new, > single-dimensional array that looks like Array(var3, var3, var3...), sort > that, then use that as a reference point, but that's a really sloppy > approach, and I'm thinking probably not the best way. > > I have a feeling someone is just going to reply with only > "php.net/somefunction" in the body of their message, and I'll feel stupid, > but oh well. I can't find anything in the man. > > Any input would be appreciated. > > > -Evan > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sorting multiple-dimensional arrays
I have an array that looks like $array = Array( Array($var1, $var2, $var3), Array($var1, $var2, $var3), Array($var1, $var2, $var3) ); I want to sort the arrays within $array by $var3 (although if it helps i can easily change that to $var1). $var1 and $var2 are strings, $var3 is a number (in form of ([0-9]{3}\.[0-9]) ) I know i could put something together that would make a new, single-dimensional array that looks like Array(var3, var3, var3...), sort that, then use that as a reference point, but that's a really sloppy approach, and I'm thinking probably not the best way. I have a feeling someone is just going to reply with only "php.net/somefunction" in the body of their message, and I'll feel stupid, but oh well. I can't find anything in the man. Any input would be appreciated. -Evan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] hyperlink parser - a bit new view :)
Look up Regular Expressions. Basically they allow you to search out matches in strings such as and any variable amount of letters between the open and closed tags. So you'd need to read in the entire file into a string, chop out all the pesky page returns ('\n') and then run your function using regular expressions inside of a loop of some sort. Check out these links: http://www.php.net/manual/en/ref.regex.php http://www.phpbuilder.com/columns/dario19990616.php3 ~ Matthew -Original Message- From: Roman [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 18, 2002 4:20 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] hyperlink parser - a bit new view :) I think there is no message about the same idea. I would need to parse html file and get all within href="" or href=''. So I don't want to get all texts which could be links, but only content of href variable within tag. Is there any easy way ? I have read hundreds of messages in this list today but without any possitive idea found :( Roman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] hyperlink parser - a bit new view :)
I think there is no message about the same idea. I would need to parse html file and get all within href="" or href=''. So I don't want to get all texts which could be links, but only content of href variable within tag. Is there any easy way ? I have read hundreds of messages in this list today but without any possitive idea found :( Roman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Based Mail
www.squirrelmail.org -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software & Systems Engineer First Creative Ltd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Based Mail
On Sun, Aug 18, 2002 at 08:54:45PM +0200, Andy wrote: > Horde is really great. I can definatelly recommend it to. > > But why not stick with sendmail? It does a great job and is easier to > install with horde. > > Andy > Try http://www.openwebamil.org . > > -- > -- > http://www.globosapiens.net > Worldwide Travel Community > > > > "Met" <[EMAIL PROTECTED]> schrieb im Newsbeitrag > 000f01c246e7$ce853020$6901a8c0@SURVIVAL">news:000f01c246e7$ce853020$6901a8c0@SURVIVAL... > > IMP and SquirrelMail both do the job for me. > > > > IMP = http://www.horde.org/imp/ > > > > SquirrelMail = http://www.squirrelmail.org/ > > > > ~ Matthew > > > > > > -Original Message- > > From: Chill [mailto:[EMAIL PROTECTED]] > > Sent: Sunday, August 18, 2002 2:35 PM > > To: [EMAIL PROTECTED] > > Subject: [PHP] Web Based Mail > > > > > > Can anyone recommend a good Web-Based Mail System for php? I know that > > there are a few out there but I was wondering which was the best (and > > easiest to setup) > > > > -- > > 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 > -- Member - Liberal International On 11 Sept 2001 the WORLD was violated. This is [EMAIL PROTECTED] Ici [EMAIL PROTECTED] Society MUST be saved! Extremists must dissolve. Beware of defining as intelligent only those who share your opinions -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Based Mail
Horde is really great. I can definatelly recommend it to. But why not stick with sendmail? It does a great job and is easier to install with horde. Andy -- -- http://www.globosapiens.net Worldwide Travel Community "Met" <[EMAIL PROTECTED]> schrieb im Newsbeitrag 000f01c246e7$ce853020$6901a8c0@SURVIVAL">news:000f01c246e7$ce853020$6901a8c0@SURVIVAL... > IMP and SquirrelMail both do the job for me. > > IMP = http://www.horde.org/imp/ > > SquirrelMail = http://www.squirrelmail.org/ > > ~ Matthew > > > -Original Message- > From: Chill [mailto:[EMAIL PROTECTED]] > Sent: Sunday, August 18, 2002 2:35 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Web Based Mail > > > Can anyone recommend a good Web-Based Mail System for php? I know that > there are a few out there but I was wondering which was the best (and > easiest to setup) > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Web Based Mail
IMP and SquirrelMail both do the job for me. IMP = http://www.horde.org/imp/ SquirrelMail = http://www.squirrelmail.org/ ~ Matthew -Original Message- From: Chill [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 18, 2002 2:35 PM To: [EMAIL PROTECTED] Subject: [PHP] Web Based Mail Can anyone recommend a good Web-Based Mail System for php? I know that there are a few out there but I was wondering which was the best (and easiest to setup) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Web Based Mail
Can anyone recommend a good Web-Based Mail System for php? I know that there are a few out there but I was wondering which was the best (and easiest to setup) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Secure connection with MySQL database
True. But I think you missed the point of the original question--there's no "non-web directory"... - E > >To take it to another level, place the PHP file you >are including in a non-web directory. That way, just >in case the web server mucks up, there's no chance of >PHP outputting the contents of the script, since the >directory you place it in would not be readable by the >web server. > >--- "Edwin @" <[EMAIL PROTECTED]> wrote: > > Well, I'm not sure if this is what you're looking > > for but... if you name the > > file with a .php extension (instead of .txt or .inc) > > then your password is > > "protected". > > > > For example, you have a password declared like this: > > > > $my_db_username = 'MyUserName'; > > $my_db_password = 'MyPassWord'; > > > > And it's inside a file named "myfile.inc.php", then, > > even if somebody try to > > access the file using their browser like this: > > > > http://aaa.bbb.ccc/myfile.inc.php > > > > Nothing will appear... > > > > - E > > > > > > > >How can I protect my username and password for my > > connection > > >with a mysql server. I can't place a file outside > > the root by the > > >provider I use. > > > > > >Thankx > > > > > >-- > > >PHP General Mailing List (http://www.php.net/) > > >To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > >_ > > Charle con sus amigos online usando MSN Messenger: > > http://messenger.msn.com > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > >__ >Do You Yahoo!? >HotJobs - Search Thousands of New Jobs >http://www.hotjobs.com _ $B:G?7$N%U%!%$%J%s%9>pJs$H%i%$%U%W%i%s$N%"%I%P%$%9(B MSN $B%^%M!<(B http://money.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] XP home install question
I receive the following error msg when trying to load a php page: "This PHP CGI binary was compiled with force-cgi-redirect enabled..." So, I have changed the php.ini file in both c:\windows and c:\php to no avail. The same error msg is given. Any suggestions would be greatly appreciated! Jonathan Goulding [EMAIL PROTECTED]
[PHP] newbie php image importing problems
Hello, I got some great help from this newsgroup a few days ago, and I'm 90% complete with my project, but I have one snag. I'm building a web page that allows a business to import pictures of their products and then display them on their page along ith other information. My problem is getting in an image but displaying a thumbnail, and if clicked, the original image. The client only wants to load one image. I'm stuck at how to take the one image, copy it to the host server, and then display a thumbnail of the image. I can make the thumbnail linkable to the larger image, and I can display the original image on my home PC, but that's all local. Please help. Thanks, Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] XP home install question
Hello all, I receive the following error msg when trying to load a php page after installing php and a web server on XP home: "This PHP CGI binary was compiled with force-cgi-redirect enabled..." So, I have changed the php.ini file in both c:\windows and c:\php to no avail. The same error msg is given after a reboot. Any suggestions would be greatly appreciated! I'm a novice at this stuff... -Jonathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: xml and a big script
this line is only for debugging: print $val located within these tags in startElement case "NAME": $da_relicname=$val;print $val;break; case "TYPE": $da_relictype=$val;break; "Pafo" <[EMAIL PROTECTED]> skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > i was almost done with everything :) and ofcourse i find a problem with > the xml parser... > the parser is not collection some vital information, and i dont know why... > the xmlsite is: http://www.camelotherald.com/xml/servers.xml > > the problem is market with a <-- : > > 1707 > Up > - > <--, the parser dosent retrive this line,, it gets every > line except this. > Midgard > > - > Hibernia > > - > Midgard > > - > Hibernia > > - > Midgard > > - > Hibernia > > ... > > if u run this script, it prints out everything except that. > > // ** Settings > $ServerToPrint = "Guinevere"; > > // *** > // > // START OF THE CODE > $printedserver = false; > $printedrelic = false; > $printedkeep = false; > $depth = array(); > $insideitem = false; > $insidekeep = false; > $tag = ""; > $server = false; > $crelic = new RelicInfo; > $cserver = new ServerInfo; > $ckeep = new KeepInfo; > > class KeepInfo { > var $KeepName = Array(); > var $KeepOwner = Array(); > var $KeepRealm = Array(); > var $KeepClaimant = Array(); > > > function PrintInfo() { >for ($i = 0; $i < count($this->KeepName); $i++) { > print "{$this->KeepName[$i]}"; > print "{$this->KeepRealm[$i]}"; > print "{$this->KeepOwner[$i]}"; > print "{$this->KeepClaimant[$i]}\n"; > >} > } > > function SetName($name) { > $this->KeepName[] = $name; > } > > function SetOwner($owner) { >$this->KeepOwner[] = $owner; > } > > function SetRealm($realm) { >$this->KeepRealm[] = $realm; > } > > function SetClaimant($claim) { >$this->KeepClaimant[] = $claim; > } > } > > class RelicInfo { > > var $RelicName = Array(); > var $RelicType = Array(); > var $RelicRealm = Array(); > var $RelicOwner = Array(); > > function PrintInfo() { >for ($i = 0; $i < count($this->RelicName); $i++) { > print "{$this->RelicName[$i]}"; > print "{$this->RelicType[$i]}"; > print "{$this->RelicRealm[$i]}"; > print "{$this->RelicOwner[$i]}\n"; >} > } > > function SetName($name) { > $this->RelicName[] = $name; > } > > function SetType($type) { >$this->RelicType[] = $type; > } > > function SetRealm($realm) { >$this->RelicRealm[] = $realm; > } > > function SetRelicOwner($owner) { >$this->RelicOwner[] = $owner; > } > > } > > class ServerInfo { > var $ServerName = Array(); > var $ServerPopulation = Array(); > var $ServerType = Array(); > var $ServerStatus = Array(); > var $Totalpop = 0; > function PrintInfo() { >for ($i = 0; $i < count($this->ServerName); $i++) { > print "{$this->ServerName[$i]}"; > if ($this->ServerType[$i]) { print > "({$this->ServerType[$i]})"; } > print ""; > print "{$this->ServerStatus[$i]}"; > print "{$this->ServerPopulation[$i]}\n"; >} > } > > function PrintTotal() { >print $this->Totalpop; > } > > function SetServer($server) { > $this->ServerName[] = $server; > } > > function SetType($type) { >$this->ServerType[] = $type; > } > > function SetStatus($status) { >$this->ServerStatus[] = $status; > } > > function SetPopulation($pop) { >$this->ServerPopulation[] = $pop; >$this->Totalpop += $pop; > } > > } > > function startElement($parser, $tagName, $attrs) { > global $ServerToPrint, $server, $depth, $insideitem, $insidekeep, $tag, > $da_server, $da_type, $da_relicname, $da_relictype, $da_relicrealm, > $da_keepname, $da_keeprealm; > if ($insideitem) { > $tag = $tagName; > } elseif ($tagName == "RELIC") { > $insideitem = true; > while (list ($key, $val) = each ($attrs)) { > switch($key) { > case "NAME": $da_relicname=$val;print $val;break; > case "TYPE": $da_relictype=$val;break; > case "REALM": $da_relicrealm=$val;break; > } // end case > } // end while > > } elseif($tagName == "SERVER") { >$depth[$parser]++; > $insideitem = true; > while (list ($key, $val) = each ($attrs)) { > if ($key == "NAME") { $da_server=$val; if($val == $ServerToPrint) { > $server = true; } else { $server = false; } } > if ($key == "TYPE") { $da_type=$val; } > } // end while > } elseif($tagName == "KEEP") { > $insideitem = true; > $insidekeep = true; > while (list ($key, $val) = each ($attrs)) { > switch($key) { > case "NAME": $da_keepname=$val;break; > case "REALM": $da_keeprealm=$val;break; > } // end case > } // end while > } > } > > > function characterData($parser, $data) { > global $insideitem, $insidekeep, $tag, $da_server, $da_population, $d
[PHP] xml and a big script
i was almost done with everything :) and ofcourse i find a problem with the xml parser... the parser is not collection some vital information, and i dont know why... the xmlsite is: http://www.camelotherald.com/xml/servers.xml the problem is market with a <-- : 1707 Up - <--, the parser dosent retrive this line,, it gets every line except this. Midgard - Hibernia - Midgard - Hibernia - Midgard - Hibernia ... if u run this script, it prints out everything except that. KeepName); $i++) { print "{$this->KeepName[$i]}"; print "{$this->KeepRealm[$i]}"; print "{$this->KeepOwner[$i]}"; print "{$this->KeepClaimant[$i]}\n"; } } function SetName($name) { $this->KeepName[] = $name; } function SetOwner($owner) { $this->KeepOwner[] = $owner; } function SetRealm($realm) { $this->KeepRealm[] = $realm; } function SetClaimant($claim) { $this->KeepClaimant[] = $claim; } } class RelicInfo { var $RelicName = Array(); var $RelicType = Array(); var $RelicRealm = Array(); var $RelicOwner = Array(); function PrintInfo() { for ($i = 0; $i < count($this->RelicName); $i++) { print "{$this->RelicName[$i]}"; print "{$this->RelicType[$i]}"; print "{$this->RelicRealm[$i]}"; print "{$this->RelicOwner[$i]}\n"; } } function SetName($name) { $this->RelicName[] = $name; } function SetType($type) { $this->RelicType[] = $type; } function SetRealm($realm) { $this->RelicRealm[] = $realm; } function SetRelicOwner($owner) { $this->RelicOwner[] = $owner; } } class ServerInfo { var $ServerName = Array(); var $ServerPopulation = Array(); var $ServerType = Array(); var $ServerStatus = Array(); var $Totalpop = 0; function PrintInfo() { for ($i = 0; $i < count($this->ServerName); $i++) { print "{$this->ServerName[$i]}"; if ($this->ServerType[$i]) { print "({$this->ServerType[$i]})"; } print ""; print "{$this->ServerStatus[$i]}"; print "{$this->ServerPopulation[$i]}\n"; } } function PrintTotal() { print $this->Totalpop; } function SetServer($server) { $this->ServerName[] = $server; } function SetType($type) { $this->ServerType[] = $type; } function SetStatus($status) { $this->ServerStatus[] = $status; } function SetPopulation($pop) { $this->ServerPopulation[] = $pop; $this->Totalpop += $pop; } } function startElement($parser, $tagName, $attrs) { global $ServerToPrint, $server, $depth, $insideitem, $insidekeep, $tag, $da_server, $da_type, $da_relicname, $da_relictype, $da_relicrealm, $da_keepname, $da_keeprealm; if ($insideitem) { $tag = $tagName; } elseif ($tagName == "RELIC") { $insideitem = true; while (list ($key, $val) = each ($attrs)) { switch($key) { case "NAME": $da_relicname=$val;print $val;break; case "TYPE": $da_relictype=$val;break; case "REALM": $da_relicrealm=$val;break; } // end case } // end while } elseif($tagName == "SERVER") { $depth[$parser]++; $insideitem = true; while (list ($key, $val) = each ($attrs)) { if ($key == "NAME") { $da_server=$val; if($val == $ServerToPrint) { $server = true; } else { $server = false; } } if ($key == "TYPE") { $da_type=$val; } } // end while } elseif($tagName == "KEEP") { $insideitem = true; $insidekeep = true; while (list ($key, $val) = each ($attrs)) { switch($key) { case "NAME": $da_keepname=$val;break; case "REALM": $da_keeprealm=$val;break; } // end case } // end while } } function characterData($parser, $data) { global $insideitem, $insidekeep, $tag, $da_server, $da_population, $da_type, $da_status,$da_totalpop, $da_relicowner, $da_keepowner, $da_keepclaimant; if ($insideitem) { if ($insidekeep) { switch($tag) { case "OWNER" : $da_keepowner .= $data; break; case "CLAIMANT" : $da_keepclaimant .= $data; break; } } else { switch ($tag) { case "POPULATION": $da_population .= $data; $da_totalpop += $data; break; case "STATUS": $da_status .= $data; break; case "OWNER": $da_relicowner .= $data; break; } } } } function endElement($parser, $tagName) { global $cserver, $ckeep, $crelic, $printedserver, $server, $depth, $insideitem, $insidekeep, $tag, $da_server, $da_population, $da_type, $da_status, $da_relicname, $da_relictype, $da_relicrealm, $da_relicowner, $da_keepowner, $da_keepclaimant, $da_keepname, $da_keeprealm; $depth[$parser]--; if ($tagName == "SERVER") { if ($server) { //if (!$printedserver) { print "ServerStatusUsers\n"; $printedserver=true; } $cserver->SetServer($da_server); $cserver->SetType($da_type); $cserver->SetStatus($da_status); $cserver->SetPopulation($da_population); } $da_server = ""; $da_population = ""; $da_status = ""; $da_type = ""; $insideitem = false; } elseif ($tagName == "RELIC") { if ($server) { $crelic->SetName($da_relicname); $crelic->SetType($da_relictype); $crelic->SetRe
Re: [PHP] Secure connection with MySQL database
Well, I'm not sure if this is what you're looking for but... if you name the file with a .php extension (instead of .txt or .inc) then your password is "protected". For example, you have a password declared like this: $my_db_username = 'MyUserName'; $my_db_password = 'MyPassWord'; And it's inside a file named "myfile.inc.php", then, even if somebody try to access the file using their browser like this: http://aaa.bbb.ccc/myfile.inc.php Nothing will appear... - E > >How can I protect my username and password for my connection >with a mysql server. I can't place a file outside the root by the >provider I use. > >Thankx > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php _ Charle con sus amigos online usando MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] array's
now it works, thx alot :) regards patrick "Jason Wong" <[EMAIL PROTECTED]> skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Sunday 18 August 2002 12:25, Pafo wrote: > > anyone that can find the problem..? > > description below. > > > > > function PrintInfo() { > >for ($this->i = 0; $this->i < count($this->RelicName); $this->i++) { > >print "$this->RelicName[$this->i] : $this->RelicType[$this->i] : > > $this->RelicRealm[$this->i] : $this->RelicOwner[$this->i]"; > >} > > } > > Not sure why you're defining your counter as $this->i. I would just use $i. > Your problem is that inside double quotes the expression: > > $this->RelicName[$this->i] > > is ambiguous. In this case what the interpreter has done is to print > $this->RelicName, which is an array, so your output contains 'Array'. It then > prints a literal bracket '[', then the value of $this-i, then another literal > bracket ']', and thus that is what you see. > > To remove the ambiguity to need to state exactly what you mean and enclose > your expression in {} : > > print "{$this->RelicName[$this->i]} ..." > > > > the function PrintInfo prints out this: > > '***' OUTPUT > > '**' > > > > Array[0] : Array[0] : Array[0] : Array[0] > > Array[1] : Array[1] : Array[1] : Array[1] > > Array[2] : Array[2] : Array[2] : Array[2] > > > > heh,, not exacly what i wanted :/ > > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Argue for your limitations, and sure enough, they're yours. > -- Messiah's Handbook : Reminders for the Advanced Soul > */ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problems with php.ini
Hi everybody: I am trying to switch register_argc_argv to on. So I did edit php.ini located where phpinfo() told me. I switched it to on and uncommented the line. Then I restarted apache. phpinfo() still tells me that the fallue is off. What am I doing wrong? Can anybody give me a hint on how to tern this on? Thanx, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Secure connection with MySQL database
How can I protect my username and password for my connection with a mysql server. I can't place a file outside the root by the provider I use. Thankx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Help needed about queries with MySQL, thanks.
Same here... Even though allot of people say it's not necessary... - Original Message - From: "Carsten Mohr" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, August 18, 2002 5:22 PM Subject: [PHP] Re: Help needed about queries with MySQL, thanks. > Hallo, > > I don't know if it helps you, but normally you have to quote the > variable in the SQL-Statement like: > SELECT * FROM sessions WHERE sessionID = '$sessionID' > Otherwise I always get an SQL-Error > > Jean-Marc Godart wrote: > > Hello everyone, > > > > I am a new PHP user, from Belgium. I am trying to manage a MySQL database with PHP, and I kindly request your help to solve a little (probably very stupid) problem I have been dealing with for a while already ... > > > > I have a MySQL database (called "sessions") with a auto-increment INT field called "sessionID". I try to check if there is already a record in this database with a given sessionID, which is called $sessionID in PHP. I use this query, which must be wrong (but I cannot find out why !!!) : > > > >SELECT * FROM sessions WHERE sessionID = $sessionID > > > > Even though there is already a record with the right sessionID, my program does not find it (I always get 0 when using mysql_num_rows() after the query). Though, if I replace "$sessionID" by, for example 4, then that works and it says there is already a record with that ID. > > > > I guess the problem comes from comparing two different kinds of variables, but I can't fix it ... Could anyone please help ? By advance, thank you !!! > > > > Best regards from Belgium, > > > > > > Jean-marc > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help needed about queries with MySQL, thanks.
Hallo, I don't know if it helps you, but normally you have to quote the variable in the SQL-Statement like: SELECT * FROM sessions WHERE sessionID = '$sessionID' Otherwise I always get an SQL-Error Jean-Marc Godart wrote: > Hello everyone, > > I am a new PHP user, from Belgium. I am trying to manage a MySQL database with PHP, >and I kindly request your help to solve a little (probably very stupid) problem I >have been dealing with for a while already ... > > I have a MySQL database (called "sessions") with a auto-increment INT field called >"sessionID". I try to check if there is already a record in this database with a >given sessionID, which is called $sessionID in PHP. I use this query, which must be >wrong (but I cannot find out why !!!) : > >SELECT * FROM sessions WHERE sessionID = $sessionID > > Even though there is already a record with the right sessionID, my program does not >find it (I always get 0 when using mysql_num_rows() after the query). Though, if I >replace "$sessionID" by, for example 4, then that works and it says there is already >a record with that ID. > > I guess the problem comes from comparing two different kinds of variables, but I >can't fix it ... Could anyone please help ? By advance, thank you !!! > > Best regards from Belgium, > > > Jean-marc > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sort multidimensional array using Natural-Order
Hi, I have following filename/date array Array ( [0] => Array ( [0] => 1.jpg [1] => 10.jpg [2] => 11.jpg [3] => 12.jpg [4] => 2.jpg [5] => 3.jpg [6] => 4.jpg [7] => 5.jpg [8] => 6.jpg [9] => 7.jpg [10] => 8.jpg [11] => 9.jpg ) [1] => Array ( [0] => 1026502301 [1] => 1026502312 [2] => 1026502313 [3] => 1026502550 [4] => 1026502302 [5] => 1026502304 [6] => 1026502305 [7] => 1026502619 [8] => 1026502585 [9] => 1026502308 [10] => 1026502310 [11] => 1026502311 ) ) I'm trying to sort the array by filename in Natural-Order. Array_multisort(filelist[0]),SORT_ASC,$filelist[1]) don't sort in Natural-Order usort($filelist[0],"strnatcmp"); Sorts only filenames, any ideas how to get dates also sorted? -Hessu- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help needed about queries with MySQL, thanks.
> I have a MySQL database (called "sessions") with a auto-increment > INT field called "sessionID". I try to check if there is already > a record in this database with a given sessionID, which is called > $sessionID in PHP. I use this query, which must be wrong (but I > cannot find out why !!!) : > >SELECT * FROM sessions WHERE sessionID = $sessionID Although this may or may not help depending on your code (please post it if you still haven't found a solution...it's the best way for us to help. Try SELECT * FROM sessions WHERE sessionID = '$sessionID' Although if $sessionID contains an integer (which I assume is would) the quotes aren't needed, you never know. Some OSes are quirky. Also you may want to add an echo mysql_error(); line after your initial mysql_query to see if perhaps there's a problem with PHP communicating with MySQL. Sincerely, Craig Vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sort multidimensional array using Natural-Order
Hi, I have following filename/date array Array ( [0] => Array ( [0] => 1.jpg [1] => 10.jpg [2] => 11.jpg [3] => 12.jpg [4] => 2.jpg [5] => 3.jpg [6] => 4.jpg [7] => 5.jpg [8] => 6.jpg [9] => 7.jpg [10] => 8.jpg [11] => 9.jpg ) [1] => Array ( [0] => 1026502301 [1] => 1026502312 [2] => 1026502313 [3] => 1026502550 [4] => 1026502302 [5] => 1026502304 [6] => 1026502305 [7] => 1026502619 [8] => 1026502585 [9] => 1026502308 [10] => 1026502310 [11] => 1026502311 ) ) I'm trying to sort the array by filename in Natural-Order. Array_multisort(filelist[0]),SORT_ASC,$filelist[1]) don't sort in Natural-Order usort($filelist[0],"strnatcmp"); Sorts only filenames, any ideas how to get dates also sorted? -Hessu- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 18 Aug 2002 11:43:43 -0000 Issue 1532
php-general Digest 18 Aug 2002 11:43:43 - Issue 1532 Topics (messages 113097 through 113132): Re: preg_match help? 113097 by: Bas Jobsen 113098 by: vic 113099 by: vic 113115 by: Jason Wong How Can I Generate an Email List from a MySQL Table 113100 by: Roger Lewis 113101 by: Chris Knipe 113103 by: Roger Lewis 113105 by: Justin French 113112 by: Manuel Lemos yesterday's day of week 113102 by: Kenton Letkeman 113106 by: Jason Wong 113107 by: Justin Garrett 113108 by: Justin French array's 113104 by: Pafo 113110 by: Jason Wong 113111 by: robert mischke Random Passwords Generator 113109 by: César Aracena 113114 by: Manuel Lemos 113116 by: Liam MacKenzie Re: quick ereg() question 113113 by: Jason Wong Re: PHP - mail() function problem 113117 by: N. Pari Purna Chand 113118 by: N. Pari Purna Chand ICQ interface? 113119 by: Justin French 113123 by: Justin French pop-up 113120 by: Mantas Kriauciunas 113121 by: Justin French 113122 by: Mantas Kriauciunas 113124 by: Jason Soza 113127 by: Justin French Re: Cleanup script 113125 by: Julio Nobrega Help needed about queries with MySQL, thanks. 113126 by: Jean-Marc Godart 113128 by: Jason Wong 113129 by: Jean-Marc Godart 113130 by: Jason Wong Installing PHP... ASAP 113131 by: Konstantin Sort multidimensional array using Natural-Order 113132 by: Hessu Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- --- Begin Message --- preg_match("/.*]+>(.*).*/", $contents,$story); echo $story[1]; preg_match always return a array. The first element ($array[0])contains your complete regexp. The next ($array[1])one the first match between () etc. Don't use ! but / Op zondag 18 augustus 2002 01:27, schreef Jason Soza: > I seriously need some help trying to make a match here. Obligatory > disclaimer: yes, I've searched google.com, I've read the PHP manual section > on preg_match(), and I've sat here for 3 hours trying to resolve this on my > own. :) Any help would be great: > > I need to match everything between: > > $headline > > Where $headline is a variable that will be filled out of a foreach() loop. > The pattern should return everything until it hits: > > > > The text file this is taken out of looks like: > > Headline here > > News story, blah, blah, blah... > > Another headline > > More news, blah, blah... > > ... > > The contents of the text file echo correctly before the preg_match, but the > preg_match I've tried: > > preg_match("!]+>(.*)!", $contents, > $story); > > Returns array(), so no matches are made. Any suggestions? > > TIA, > > Jason Soza --- End Message --- --- Begin Message --- Ok, since I've been trying to get this working forever, how wold you get something like this working I need, to get everything between these 2 tags: and Someone gave me this code: preg_match('!]+>(.*)!Uis',$str,$regs); with the ! in front, and !Uis at the end, what does that mean? And when i try it with your script: preg_match('/.*]+>(.*).*/',$str,$regs); $good = $regs[1]; echo $good; I get: Warning: Unknown modifier 'd' in /home/victor/argilent-www/sites/malibu_place_2/main.php on line 197 197 is the preg_match code line. - Vic -Original Message- From: Bas Jobsen [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 17, 2002 6:49 PM To: Jason Soza; PHP-General Subject: Re: [PHP] preg_match help? preg_match("/.*]+>(.*).*/", $contents,$story); echo $story[1]; preg_match always return a array. The first element ($array[0])contains your complete regexp. The next ($array[1])one the first match between () etc. Don't use ! but / Op zondag 18 augustus 2002 01:27, schreef Jason Soza: > I seriously need some help trying to make a match here. Obligatory > disclaimer: yes, I've searched google.com, I've read the PHP manual section > on preg_match(), and I've sat here for 3 hours trying to resolve this on my > own. :) Any help would be great: > > I need to match everything between: > > $headline > > Where $headline is a variable that will be filled out of a foreach() loop. > The pattern should return everything until it hits: > > > > The text file this is taken out of looks like: > > Headline here > > News story, blah, blah, blah... > > Another headline > > More news, blah, blah... > > ... > > The contents of the text file echo correctly before the preg_match, but the > preg_match I've tried: > > preg_match("!]+>(.*)!", $contents, > $story); > > Returns array(), so no matches are made. Any suggestions? > > TIA, > > Jason Soza -- PHP General Ma
[PHP] Sort multidimensional array using Natural-Order
Hi, I have following filename/date array Array ( [0] => Array ( [0] => 1.jpg [1] => 10.jpg [2] => 11.jpg [3] => 12.jpg [4] => 2.jpg [5] => 3.jpg [6] => 4.jpg [7] => 5.jpg [8] => 6.jpg [9] => 7.jpg [10] => 8.jpg [11] => 9.jpg ) [1] => Array ( [0] => 1026502301 [1] => 1026502312 [2] => 1026502313 [3] => 1026502550 [4] => 1026502302 [5] => 1026502304 [6] => 1026502305 [7] => 1026502619 [8] => 1026502585 [9] => 1026502308 [10] => 1026502310 [11] => 1026502311 ) ) I'm trying to sort the array by filename in Natural-Order. Array_multisort(filelist[0]),SORT_ASC,$filelist[1]) don't sort in Natural-Order usort($filelist[0],"strnatcmp"); Sorts only filenames, any ideas how to get dates also sorted? -Hessu- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Installing PHP... ASAP
Hello Guys I has FreeBSD4.3 I need help how install PHP under Apache2.0.35 when i compile PHP with apxs module support Apache say's Cannot load /usr/libexec/modules/libphp4.so into server: /usr/libexec/modules/libphp4.so: Undefined symbol "pthread_getspecific" I'm the begginer in Unix. Please if you can answer me how i can install apache with detailed descriptions i will be very happy :) -- Best regards, Konstantin mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help needed about queries with MySQL, thanks.
On Sunday 18 August 2002 17:59, Jean-Marc Godart wrote: > Thanks for your suggestion ... Yes, I tried to print $sessionID (using > echo()) and I get the right value (the one I am looking for) ... Though the > query does not work. Any other idea ??? Thanks again ! Please post your code so we can have a look. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Awright, which one of you hid my PENIS ENVY? */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help needed about queries with MySQL, thanks.
Thanks for your suggestion ... Yes, I tried to print $sessionID (using echo()) and I get the right value (the one I am looking for) ... Though the query does not work. Any other idea ??? Thanks again ! Jean-Marc - Original Message - From: "Jason Wong" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, August 18, 2002 11:53 AM Subject: Re: [PHP] Help needed about queries with MySQL, thanks. > On Sunday 18 August 2002 17:45, Jean-Marc Godart wrote: > > > I have a MySQL database (called "sessions") with a auto-increment INT field > > called "sessionID". I try to check if there is already a record in this > > database with a given sessionID, which is called $sessionID in PHP. I use > > this query, which must be wrong (but I cannot find out why !!!) : > > > >SELECT * FROM sessions WHERE sessionID = $sessionID > > > > Even though there is already a record with the right sessionID, my program > > does not find it (I always get 0 when using mysql_num_rows() after the > > query). Though, if I replace "$sessionID" by, for example 4, then that > > works and it says there is already a record with that ID. > > > > I guess the problem comes from comparing two different kinds of variables, > > but I can't fix it ... Could anyone please help ? By advance, thank you !!! > > Have you tried printing out $sessionID to see whether it contains what you > think it contains? > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Under capitalism, man exploits man. Under communism, it's just the opposite. > -- J.K. Galbraith > */ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help needed about queries with MySQL, thanks.
On Sunday 18 August 2002 17:45, Jean-Marc Godart wrote: > I have a MySQL database (called "sessions") with a auto-increment INT field > called "sessionID". I try to check if there is already a record in this > database with a given sessionID, which is called $sessionID in PHP. I use > this query, which must be wrong (but I cannot find out why !!!) : > >SELECT * FROM sessions WHERE sessionID = $sessionID > > Even though there is already a record with the right sessionID, my program > does not find it (I always get 0 when using mysql_num_rows() after the > query). Though, if I replace "$sessionID" by, for example 4, then that > works and it says there is already a record with that ID. > > I guess the problem comes from comparing two different kinds of variables, > but I can't fix it ... Could anyone please help ? By advance, thank you !!! Have you tried printing out $sessionID to see whether it contains what you think it contains? -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Under capitalism, man exploits man. Under communism, it's just the opposite. -- J.K. Galbraith */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] pop-up
Well, you're going to have limitations with passing things around in a URL. You need to post your JS function to comp.lang.javascript, and ask them how to modify the script so that it POSTs the form data to the new pop-up window. Justin French on 18/08/02 7:44 PM, Mantas Kriauciunas ([EMAIL PROTECTED]) wrote: > Hello Justin, > > i don't think that this thing will pass 300 simbols successfuly > i take $nw_text from and i need to pass it to pop-up (other > window) there it will generate preview of that text with some stuff... > but i need to pass also 2 more ...so total is 3 things...one text and > other ones is just like date and username > > > > > Sunday, August 18, 2002, 12:22:11 AM, you wrote: > > JF> You need to modify topWindow() so that you can pass a query string to it, > JF> which you can then use to add to the URL of the pop-up window. > > JF> > JF> > > JF> > > JF> > > JF> This would pop-up a window with the dimensions listed, and I pass a userid > JF> to it, which gets appended to the URL of the new window, passing a userid > JF> variable into the target script via GET. > > JF> I *think* all 's need to be in a form tag regardless... a better > way > JF> to test your script would be to take the input/form out of the equation, > get > JF> your javascript right with a simple tag: > > JF> > > JF> And since this is a JavaScript thing, not a PHP thing, you might want to > JF> address the issue(s) in comp.lang.javascript > > > JF> Justin French > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help needed about queries with MySQL, thanks.
Hello everyone, I am a new PHP user, from Belgium. I am trying to manage a MySQL database with PHP, and I kindly request your help to solve a little (probably very stupid) problem I have been dealing with for a while already ... I have a MySQL database (called "sessions") with a auto-increment INT field called "sessionID". I try to check if there is already a record in this database with a given sessionID, which is called $sessionID in PHP. I use this query, which must be wrong (but I cannot find out why !!!) : SELECT * FROM sessions WHERE sessionID = $sessionID Even though there is already a record with the right sessionID, my program does not find it (I always get 0 when using mysql_num_rows() after the query). Though, if I replace "$sessionID" by, for example 4, then that works and it says there is already a record with that ID. I guess the problem comes from comparing two different kinds of variables, but I can't fix it ... Could anyone please help ? By advance, thank you !!! Best regards from Belgium, Jean-marc
[PHP] Re: Cleanup script
> I just had a massive open house party... > > Is it possible to write a PHP script to collect all the bottles and > cans, mop the floor, fumigate the carpet and make me lunch? PHP is all. You need. -- Julio Nobrega Pode acessar: http://www.inerciasensorial.com.br "Liam Mackenzie" <[EMAIL PROTECTED]> escreveu na mensagem 001f01c24644$71cf59d0$0b00a8c0@enigma">news:001f01c24644$71cf59d0$0b00a8c0@enigma... > I just had a massive open house party... > > Is it possible to write a PHP script to collect all the bottles and > cans, mop the floor, fumigate the carpet and make me lunch? > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[2]: [PHP] pop-up
I just wrote something exactly like this today: function news_window (headline_str) { var headline_link = "/story.asp?headline=" + escape(headline_str); window.open(headline_link,'','scrollbars=yes,resizable=yes'); } Now, if I needed to pass along more variables, I'd just add them to the news_window () arguments, i.e. if I needed to pass along a text field and a user id, I'd go: function news_window (headline_str,text,user_id) Try it, then let us know how it goes. Don't use the tags - once you make a function like the one above, call it with . Also, try not to say things like "I don't think it will work" if you haven't given it a shot yet. I knew -nothing- of JavaScript before I needed to use the window.open() function today, but now I know enough about it to make some useful scripts. Try going to google.com and searching for 'javascript reference' - you will likely find the results handy. HTH Jason Soza -Original Message- From: Mantas Kriauciunas [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 18, 2002 1:44 AM To: Justin French Cc: [EMAIL PROTECTED] Subject: Re[2]: [PHP] pop-up Hello Justin, i don't think that this thing will pass 300 simbols successfuly i take $nw_text from and i need to pass it to pop-up (other window) there it will generate preview of that text with some stuff... but i need to pass also 2 more ...so total is 3 things...one text and other ones is just like date and username -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ICQ interface?
Sometimes the easiest solutions are the best!! http://web.icq.com/whitepages/online?icq=51362125&img=21";> Courtesy of the ICQ site :) Justin French on 18/08/02 5:06 PM, Justin French ([EMAIL PROTECTED]) wrote: > Has anyone built, or partially built an interface to ICQ? > > I'm not necessarily looking for full IM thru a web/PHP interface, but maybe > some small stuff, like finding out if a certain user is online? > > I did a google and found this on Zend.com, but can't get it working (it > returns "unknown" everytime, with any number): > > function get_status($uin) > { > /* > * Copyright © 2000 Scriptmakers.com * > * Feel free to edit, modify and* > * redistribute as long as this* > * message is kept intact.* > */ > > $fp = fsockopen("wwp.icq.com", 80, &$errno, &$errstr, 30); > if(!$fp) > { > > echo "$errstr($errno)\n"; > } > else > { > fputs($fp,"GET/scripts/online.dll?icq=$uin&img=5HTTP/1.0\n\n"); > $do='no'; > while(!feof($fp)) > { > $line=fgets($fp,128); > $do=($do=='yes')?'yes':(eregi("^GIF89",$line))?'yes':'no';; > if($do=='yes') > { > if(ereg("á7@ ±40",$line)) > { > return 'online'; > } > elseif(ereg("áw` ±40",$line)) > { > return 'offline'; > } > elseif(ereg("S3IѱèJ",$line)) > { > return 'disabled'; > } > } > } > fclose($fp); > } > return 'unknown'; > } > > /* usage -- > include('icq_status.php'); > $uin=51362125; > echoget_status($uin); > */ > ?> > > > ... and this, which spits out an error: > "Warning: file("http://wwp.icq.com/scripts/online.dll?icq=&img=1";) - > Undefined error: 0 in /usr/local/apache/htdocs/hinge/viewmember.php on line > 13" > > > $uin = "51362125"; > function ICQ_Status($uin) > { > $arr = file("http://wwp.icq.com/scripts/online.dll?icq=$uin&img=1";); > $len = strlen($arr[1]); > if ($len == "") return "ICQ: Local > Server"; > if ($len == 96) return "ICQ: Online"; > if ($len == 83) return "ICQ: Offline"; > if ($len == 1) return "ICQ: Disabled"; > } > echo ICQ_Status($uin); > > ?> > > > My guess is that these both DID work at one point, but if ICQ keeps changing > their methods, then the scripts become redundant. > > > Any links / guidance would be great! > > > Justin French > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] pop-up
Hello Justin, i don't think that this thing will pass 300 simbols successfuly i take $nw_text from and i need to pass it to pop-up (other window) there it will generate preview of that text with some stuff... but i need to pass also 2 more ...so total is 3 things...one text and other ones is just like date and username Sunday, August 18, 2002, 12:22:11 AM, you wrote: JF> You need to modify topWindow() so that you can pass a query string to it, JF> which you can then use to add to the URL of the pop-up window. JF> JF> > JF> JF> JF> This would pop-up a window with the dimensions listed, and I pass a userid JF> to it, which gets appended to the URL of the new window, passing a userid JF> variable into the target script via GET. JF> I *think* all 's need to be in a form tag regardless... a better way JF> to test your script would be to take the input/form out of the equation, get JF> your javascript right with a simple tag: JF> JF> And since this is a JavaScript thing, not a PHP thing, you might want to JF> address the issue(s) in comp.lang.javascript JF> Justin French -- Best regards, Mantasmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php