[PHP] test
test -- c3f7bc9d7683857572da3d1fa3d31af17bde4ebbc5c0f0dc2b7f6f
Re: [PHP] Suggestion for IN()
you could try in_array() if (in_array(1,2,3,4,5), 6) On Thu, 2004-09-30 at 22:10, Daevid Vincent wrote: I'm sure I'll be flamed for this, but it seems to me that there should be a shortcut way to write: If ($a == 1 || $a == 4 || $a == 20 || ...) {} To something more like what SQL has... If ( $a IN(1,4,20,...) ) {} And same with the very helpful SQL BETWEEN 'function'. Instead of If ($a 1 $a 20) {} Why not If ($a BETWEEN (1,20)) {} -- http://cosminb.blogspot.com/ c3f7bc9d7683857572da3d1fa3d31af17bde4ebbc5c0f0dc2b7f6f
Re: [PHP] Suggestion for IN()
...sorry, that should have been if (in_array(array(1,2,3,4), 6)) On Thu, 2004-09-30 at 22:10, Daevid Vincent wrote: I'm sure I'll be flamed for this, but it seems to me that there should be a shortcut way to write: If ($a == 1 || $a == 4 || $a == 20 || ...) {} To something more like what SQL has... If ( $a IN(1,4,20,...) ) {} And same with the very helpful SQL BETWEEN 'function'. Instead of If ($a 1 $a 20) {} Why not If ($a BETWEEN (1,20)) {} -- c3f7bc9d7683857572da3d1fa3d31af17bde4ebbc5c0f0dc2b7f6f
Re: [PHP] Can't install PHP on Windows/Apache
Hello abrea, Monday, July 19, 2004, 7:58:15 PM, you wrote: Dear list, I am trying to install PHP 4.3.8 as a module of Apache 2.0.50 on a Windows 98 computer. Apache alone runs ok. After I installed PHP with the installer package, I added the following line at the end of the Apache httpd.conf together with the AddType statements: # LoadModule php4_module c:/php/php4apache.dll When I uncomment this line there is an error message saying that a resource is missing (or something like that, the DOS window disappears very quickly so I can't copy it). This line has worked ok on other computers I have installed with PHP 4.3.4 on Apache 1.3.29 and PHP 4.3.3 on Apache 1.3.27. I tried to install these programs but PHP does not run either, although Apache does. I have tried with both php4apache.dll and php4apache2.dll, but I still get the error message. The paths in the c:\windows\php.ini file point to the .dll file correctly. Could anybody please tell me what the problem could be? Thank you in advance Alberto Brea Hello. You might wanna check this: http://www.php.net/manual/en/installation.php -- Best regards, Cosminmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mixing $_POST with text in a variable
Hello Markus, Monday, July 19, 2004, 8:17:24 PM, you wrote: I'm changing my HTTP POST variable declarations from $variablename to $_POST['variablename'] to make my code more compliant with current best practices. However, I find that I cannot mix these new variable declarations into big variable strings like I used to. For example, this works: $message = Name: $Name Division: $Division Phone: $Phone Email: $Email; ...but when I change $Name and the other variables to $_POST['Name'], I get this error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /web/scd/vets/Vislab/eventrequest.php on line 94 Is there any clean way to avoid having to completely reconstruct all my form mail messages by constantly closing quotes, using . to connect text and variables within the larger variable. Markus $message = Name: $_POST['Name']\n; $message .= Division: $_POST['Division']\n; $message .= Phone: $_POST['Phone']\n; $message .= Email: $_POST['Email']\n; -- Best regards, Cosminmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Login Script
Hello Brian, Take a look at setcookie() in the PHP manual. The algorithm is pretty simple. Once the user submits the form, you compare form data with the data in the database. If the password matches, then set a cookie with the username (using setcookie()). Then you'll just have to check if the cookie is set - if(isset($_COOKIE['username'])) {...} - and if it's set, proceed to user page; if not, display the login form again. -- Best regards, Cosmin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] flash to image using PHP
Is it possible to convert a swf file(static, no animation) to an image format(jpeg or png preferably) using PHP? I have a flash script which chooses the colors for a logo and saves it a swf file and I need to transform it in an image file so I could I use it in a PDF file -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP-GTK mailing list
sorry for the off topic but i didn't knew where to ask this. does anyone know what's happening with the php-gtk mailing list. I haven't received a message for more than a month now and any message that i try to send comes back saying Hi. This is the qmail-send program at pb1.pair.com. I'm afraid I wasn't able to deliver your message to the following addresses. This is a permanent error; I've given up. Sorry it didn't work out. [EMAIL PROTECTED]: Unable to open .qmail-php-gtk-general: access denied. (#4.3.0) I'm not going to try again; this message has been in the queue too long. sorry again for the off topic but I hope that one of the persons who's in charge of the php-gtk mailing list will read this message and hopefully fix this problem -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OTP: Programming
On Mon, 2004-03-08 at 05:40, Phil Dowson wrote: Hi, I have been working with PHP for a few years now, and I feel very comfortable with it. I am considering branching out into windows application development, and I was wondering what language people would recommend for someone comfortable with PHP. I have heard that PHP can be used in this capacity, would PHP work for me to create applications with a GUI? Take a look at php-gtk: http://gtk.php.net/ -- Cosmin [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] XML Validate
Is there a function to validate a XML document(make sure tags are closed/nested)? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sockets - fine tunning
On Sun, 2003-10-26 at 15:30, Raditha Dissanayake wrote: are you getting any 1xx status codes from the web server? here are the full headers: HTTP/1.1 200 OK Date: Mon, 27 Oct 2003 06:15:30 GMT Server: Apache/1.3.27 (Unix) PHP/4.3.3 X-Powered-By: PHP/4.3.3 Transfer-Encoding: chunked Content-Type: text/xml Cosmin wrote: I'm trying to make an application using XML-RPC, and I have the following problem: I use fsockopen() to simulate a POST to my local web-server. All goes very well except it's very very slow. Here is my code maybe someone could tell me what I'm doing wrong: = $url= parse_url($this-serverURL); $requestString= POST .$url['path']. HTTP/1.1\r\nHost: .$url['host'].\r\nContent-type: application/x-www.form-urlencoded\r\nContent-length: .strlen($this-requestData).\r\n\r\n.$this-requestData;; $fp = fsockopen($url['host'], 80, $err_num, $err_msg, 5); if ($fp) { //make the request to the xml-rpc server fputs($fp, $requestString); //gets the result while (!feof($fp)) { $response .= fgets($fp, 1024); } fclose($fp); $this-rawResponse=$response; $this-error=false; } else { $this-error=true; $this-errorMessage=$err_msg; } This is the slowest part of my script(about 16 seconds). The server's execution time is only 0.00064206123352051 seconds. I don't know why it takes so much to write a string to the socket and then to read the response. Here are the execution times: Server StartServer Stop 1067090777.5339 1067090777.5346 Client StartClient Stop 1067090777.5303 1067090794.5286 If someone knows a way on how to speed this up please tell me how to do it. Thank you for your time -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha/megaupload/ Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sockets - fine tunning
I'm trying to make an application using XML-RPC, and I have the following problem: I use fsockopen() to simulate a POST to my local web-server. All goes very well except it's very very slow. Here is my code maybe someone could tell me what I'm doing wrong: = $url= parse_url($this-serverURL); $requestString= POST .$url['path']. HTTP/1.1\r\nHost: .$url['host'].\r\nContent-type: application/x-www.form-urlencoded\r\nContent-length: .strlen($this-requestData).\r\n\r\n.$this-requestData;; $fp = fsockopen($url['host'], 80, $err_num, $err_msg, 5); if ($fp) { //make the request to the xml-rpc server fputs($fp, $requestString); //gets the result while (!feof($fp)) { $response .= fgets($fp, 1024); } fclose($fp); $this-rawResponse=$response; $this-error=false; } else { $this-error=true; $this-errorMessage=$err_msg; } This is the slowest part of my script(about 16 seconds). The server's execution time is only 0.00064206123352051 seconds. I don't know why it takes so much to write a string to the socket and then to read the response. Here are the execution times: Server StartServer Stop 1067090777.5339 1067090777.5346 Client StartClient Stop 1067090777.5303 1067090794.5286 If someone knows a way on how to speed this up please tell me how to do it. Thank you for your time -- Cosmin [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sockets - fine tunning
On Sat, 2003-10-25 at 17:42, Curt Zirzow wrote: * Thus wrote Cosmin ([EMAIL PROTECTED]): I'm trying to make an application using XML-RPC, and I have the following problem: I use fsockopen() to simulate a POST to my local web-server. All goes very well except it's very very slow. Here is my code maybe someone could tell me what I'm doing wrong: = $url= parse_url($this-serverURL); $requestString= POST .$url['path']. HTTP/1.1\r\nHost: .$url['host'].\r\nContent-type: application/x-www.form-urlencoded\r\nContent-length: .strlen($this-requestData).\r\n\r\n.$this-requestData;; Have you tried to simulate this on a web browser? My guess is there might be some dns issue somewhere causing the webserver to take a while before even processing the request. Try and find out where the bottleneck is by echo'ing between steps to see where the problem is, for example: echo time(), \n; $fp = fsockopen($url['host'], 80, $err_num, $err_msg, 5); echo time(), \n; Curt -- My PHP key is worn out PHP List stats since 1997: http://zirzow.dyndns.org/html/mlists/ Here are the times: 1:1067092779.6042 2:1067092795.7176 And here is the code: echo '1:'.getmicrotime(),\n\n; while($data=fread($fp, 32768)) { $response.=$data; } echo '2:'.getmicrotime(),\n\n; I don't know what else to do ... I've changed the buffer length but it's still the same :(( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Object and properties
Is there a way to find out all the properties from an object? For instance if I have: --- class test { var $a; var $b; var $c; function test(){} } $example= new test(); --- , is there a function to tell me that the object example has the 'a','b',and 'c' properties. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unix time
Hello How can I compare Unix Time? As integer values? I take the unix time from database and I compare with the current time and something is not functioning. Can somebody show me how can I do this? Thank you , Cosmin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] comparing time
Hello, How can I compare time? So I have to check a difference of 12 or 24 hours this mean I have to compare the time between the days too.. How I can make this comparing just comparing hour with hou and then minute with minute or is possible all of them at the same time? Thanks Cosmin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] get ip of visitors
Hello, How can I take the IP of the visitator of my php page? not gethostbyname... I need the ip of any visitator not for the specified visitator. Thank you Cosmin
[PHP] Re: get ip of visitors
Ya I found $ip = gethostbyname($REMOTE_ADDR); Thanks anyway Cosmin Cosmin Vlasiu [EMAIL PROTECTED] wrote in message 007d01c1ea9d$9db78660$[EMAIL PROTECTED]">news:007d01c1ea9d$9db78660$[EMAIL PROTECTED]... Hello, How can I take the IP of the visitator of my php page? not gethostbyname... I need the ip of any visitator not for the specified visitator. Thank you Cosmin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: get ip of visitors
Thanks to all, very usefull samples Cosmin Cosmin Vlasiu [EMAIL PROTECTED] wrote in message 007d01c1ea9d$9db78660$[EMAIL PROTECTED]">news:007d01c1ea9d$9db78660$[EMAIL PROTECTED]... Hello, How can I take the IP of the visitator of my php page? not gethostbyname... I need the ip of any visitator not for the specified visitator. Thank you Cosmin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help - Variables
Could smbdy please help me I have a variable with the name $name(=the_name_of_the_variable) and I want to know if $the_name_of_the_variable is set. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Help - Variables
On Fri, 15 Mar 2002, Julio Nobrega Trabalhando wrote: :if (isset($var_name)) { :echo 'Isset!'; :} : : ? This I knew ... i don't know the variable's name untill I execute the script. I want to found out if a cookie is set who's name is $var1.$var2 and $var2 is the result of a function. : : : I have a variable with the name : $name(=the_name_of_the_variable) : : and I want to know if $the_name_of_the_variable : is set. : -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Help - Variables
On Fri, 15 Mar 2002, bvr wrote: :isset($_COOKIE[$var1 . $var2]) :isset($HTTP_COOKIE_VARS[$var1 . $var2]) // (for ancient PHP versions) : :http://www.php.net/manual/en/features.cookies.php : :or : :isset(${$var1 . $var2}) : :http://www.php.net/manual/en/language.variables.variable.php : :bvr. : Thanks a lot . I'll try it and tell you the result -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Driving me nuts, need one second of your time
? $query = SELECT * from mytable; $result = mysql_db_query(db, $query); while ($myarray = mysql_fetch_array($result)) { $title = $myarray[title]; echo $titlebr; } ? Can someone PLEASE tell me why the coding above gives the following error: Warning: Supplied argument is not a valid MySQL result resource in /var/web/somesite.com/html/index.php on line 5 It's absurd. It's driving me nuts. I'm about to introduce my computer to the pavement 40 feet below. Thanks in advance for whoever sees what I am sure is a glaring and obvious flaw in the coding. I've been looking at it for an hours and just can't get anything from where I'm standing, maybe a different perpective will help. _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Test - don't read just delete
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Image width??
Hi, Is there any function or command in PHP that will return the width an image (GIF)? Thanks. _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Updating Timestamps
I'm using timestamps (God bless the little things) to keep track of database updates, so to give users the latest updates by the second. Kinda neat. But anyway, the timestamps are in one table, and when something is that table is changed, it automatically updates. However, I have another table which I want to affect the timestamps. Is there a command for 'manually' updating a timestamp rather than by SQL's own logic? Thanks in advance. Cosmin Laslau _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Deleting from MySQL with more than one 'where' variable?
Ok, there's a table with 4 fields, I want to delete from it when two of the variables passed (through the function below) match up with the table's contents. However, I have only been able to get it to work with one 'where' clause, not two. Here's my code for one: function delete_one_sub($sel, $field, $update) { $query = delete from usr_stats where sel='$sel'; $result = mysql_db_query(f6, $query); } This was code for two variables: function delete_one_sub($sel, $field, $update) { $query = delete from usr_stats where sel='$sel' and spec='$field'; $result = mysql_db_query(f6, $query); } However, that doesn't work. Help? Thanks. _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP Backing up a Database?
Hi, Say I'm not really confident in the prowess of my server, and I want to download my database onto my computer. Can that be done? What can I look (FTP access) in the directory structure. I guess, where is it usually located? Thanks. Cosmin Laslau _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]