[PHP] PHP/MySQL offline
Hi all I have a project where I'm using PHP/Mysql. The client wants to run that project to a cd. Does anyone know of a trick either by using javascript, XML or an automated script that creates a static site that will allow me to do that? Many Thanks M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Scary nonsense form submissions
Hi all - I have forms on a number of unrelated web sites that just send me an email for one purpose or another. There are 2 to 6 fields: name, email, comment, etc. No big deal. Recently I've been getting a lot of weird submissions. I'll receive half a dozen at a time, with all the fields filled with some kind of garbage contents. Here is one example from a form on my americansubstandard.com site: ---snip--- COMMENT: [EMAIL PROTECTED] NAME: [EMAIL PROTECTED] ---/snip--- Other times one of the fields will contain a complete multipart submission, like this: ---snip--- COMMENT: [EMAIL PROTECTED] NAME: [EMAIL PROTECTED] Content-Type: multipart/mixed; boundary=\"===1655480186==\" MIME-Version: 1.0 Subject: e8df6b7 To: [EMAIL PROTECTED] bcc: [EMAIL PROTECTED] From: [EMAIL PROTECTED] This is a multi-part message in MIME format. --===1655480186== Content-Type: text/plain; charset=\"us-ascii\" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit xqofli --===1655480186==-- ---/snip--- I wonder if this is some kind of automated attack attempt. Does anyone recognize this type of thing, and is it potentially dangerous? Should I do something about it? - Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/MySQL offline
This is maybe what you want: http://www.indigostar.com/ http://www.indigostar.com/microweb.htm Runs an apache server, php & all, from a CD. (windows app.) John Mario netMines wrote: Hi all I have a project where I'm using PHP/Mysql. The client wants to run that project to a cd. Does anyone know of a trick either by using javascript, XML or an automated script that creates a static site that will allow me to do that? Many Thanks M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Scary nonsense form submissions
For badness, you could have an automated gif with a couple of numbers the user has to authenticate the form. If not complete or correct, add a header and send them to http://localhost/404.htm. Real nasty and will tie up their machine long enough. John Brian Dunning wrote: Hi all - I have forms on a number of unrelated web sites that just send me an email for one purpose or another. There are 2 to 6 fields: name, email, comment, etc. No big deal. Recently I've been getting a lot of weird submissions. I'll receive half a dozen at a time, with all the fields filled with some kind of garbage contents. Here is one example from a form on my americansubstandard.com site: ---snip--- COMMENT: [EMAIL PROTECTED] NAME: [EMAIL PROTECTED] ---/snip--- Other times one of the fields will contain a complete multipart submission, like this: ---snip--- COMMENT: [EMAIL PROTECTED] NAME: [EMAIL PROTECTED] Content-Type: multipart/mixed; boundary=\"===1655480186==\" MIME-Version: 1.0 Subject: e8df6b7 To: [EMAIL PROTECTED] bcc: [EMAIL PROTECTED] From: [EMAIL PROTECTED] This is a multi-part message in MIME format. --===1655480186== Content-Type: text/plain; charset=\"us-ascii\" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit xqofli --===1655480186==-- ---/snip--- I wonder if this is some kind of automated attack attempt. Does anyone recognize this type of thing, and is it potentially dangerous? Should I do something about it? - Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FTP Chmod problem
Hello everyone. I have a script where I am using FTP functions to chmod files/folders. I'm running into a problem with the ftp_chmod() function when trying to change the permissions of a directory. Here is the code I'm using: ftp_chmod($connId, 0777, $folder); The function almost works, but when I check the permission of the folder after it's run, the folder has 410 for permissions instead of 777. So, it is changing the permissions, but not to the correct value. Now when I use the following code, it seems to work fine: $chmodCmd = "CHMOD 0777 ".$file; ftp_site($connId, $chmodCmd); This properly changes the folder permissions to 777. Does anyone know why the ftp_chmod() function doesn't work correctly? As a side note, the ftp_chmod() function works correctly on a file, but not a directory. Any help is appreciated. Thanks, Matt Palermo http://sweetphp.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fread and fgets (network streams)
Sorry for the bump, but please anyone? :P Quoting The Gimper <[EMAIL PROTECTED]>: > On the php.net you can read the following about fread: > > "fread() reads up to length bytes from the file pointer referenced by > handle. > Reading stops when length bytes have been read, EOF (end of file) is > reached, > or (for network streams) when a packet becomes available, whichever > comes > first." > > Is this true with fgets also? The "when a packet becomes available" part > that > is. I´m guessing "for network streams" means when the handler is not a > local > file but a remote file, right? > > Why i´m i asking this? Well because i have a script wich now uses fread > to get > a remote file and would like to change this to fgets but i´m afraid i > will bump > into truble if i do since the part about waiting for a packed to become > available sounds pretty important when dealing with remote files, right? > > Thanks! > > > > > - > FREE E-MAIL IN 1 MINUTE! > - [EMAIL PROTECTED] - http://www.pc.nu > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > - FREE E-MAIL IN 1 MINUTE! - [EMAIL PROTECTED] - http://www.pc.nu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Generating images on the fly, linking via symlink?
Dan Trainor <[EMAIL PROTECTED]> writes: > Hello, all - > > This is a question that could depend on a completely different (yet, > relayed) subject, so I'm sending this email to both php-general@ and > [EMAIL PROTECTED] I thank you in advance for your understanding. > > I am currently generating some images on the fly using some of PHP's > image generation and rendering functions. I'm having loads of > success, and like the results that I see. > > What I'd like this script to do is, to create symlinks to the > origional image, and then when the script is done running, the > symlinks are deleted. Basically trying to make it so that the > origional image is not known to the client or browser. In your page where you display the image, put in the tag , where imagenerator.php is your script which creates the images. You can add tests in your imagenerator.php script to make sure that the user has some session variables set and the user is not calling the imgenerator directly. That way you will not have to worry about the browser knowing about the original image. However, the user will still be able to save the image to his hard disk. -- Raj Shekhar blog : http://rajshekhar.net/blog home : http://rajshekhar.net Disclaimer : http://rajshekhar.net/disclaimer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Filter based on ctype_print()
I have a function that retrieves data from a database and prints it as XML. I have a page that loads the data into simple_xml and outputs it in the browser. Certain data causes simple_xml to display a parse error (I have no control over the data that goes into the database). I've been able to determine which data will cause the problem using the ctype_print() function on the element contents, and replace it with "This remark contains non-printable characters" so that simple_xml doesn't fail, something like this: $xmlOutput .= ''; if (ctype_print($remarks['Remark'])) { $xmlOutput .= htmlentities($remarks['Remark']); } else { $xmlOutput .= 'This remark contained non-printable characters'; } $xmlOutput .= ''; What I really want to do is replace the non-printable character(s) with printable character(s) (maybe a question mark, or a space), but haven't been able to find a function that will do it. Maybe something like: $xmlOutput .= ''; $xmlOutput .= ctype_print_replace($remarks['Remark'], ''); $xmlOutput .= ''; where the function would replace any non-printable characters with the empty string. If something doesn't exist, I could probably write one myself using preg_replace, but would need a regular expression to find non-printable characters; I'm terrible at regular expressions. Any ideas? Thanks in advance. Rick -- Rick Emery "When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for there you have been, and there you will always long to return" -- Leonardo Da Vinci -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] online/offline...but on a list of users
Hi, I have a profiles page where next to the username I have a icon that says "Online" or "Offline" if the persons whose profile you are browsing signed in or clicked anything in the last 3 minutes (I am also using a meta refresh to call a script every 2 1/2 mins) this is how i am doing it: $check_if_member_online="select NOW() < DATE_ADD( last_online, INTERVAL 3 MINUTE ) as j_is_online FROM `".$prefix."members_online` WHERE cno ='".$jno."' and member_name='".$username."' LIMIT 1"; This is the table it calls _members_online ( cno bigint(20) NOT NULL default '0', member_name varchar(30) default NULL, last_online datetime default NULL, KEY member_name (member_name), KEY cno (cno), ) and its working fine. I want to add this same functionality to a forum on the same site (the forum was custom programmed from scratch and not any of the popular ones), but since in a single thread there can be a lot of different people/usernames that answer I would prefer _not_ to do a select lookup for each username... any ideas on how else it can be done? Thanks, Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] online/offline...but on a list of users
Ryan A wrote: Hi, I have a profiles page where next to the username I have a icon that says "Online" or "Offline" if the persons whose profile you are browsing signed in or clicked anything in the last 3 minutes (I am also using a meta refresh to call a script every 2 1/2 mins) this is how i am doing it: $check_if_member_online="select NOW() < DATE_ADD( last_online, INTERVAL 3 MINUTE ) as j_is_online FROM `".$prefix."members_online` WHERE cno ='".$jno."' and member_name='".$username."' LIMIT 1"; This is the table it calls _members_online ( cno bigint(20) NOT NULL default '0', member_name varchar(30) default NULL, last_online datetime default NULL, KEY member_name (member_name), KEY cno (cno), ) and its working fine. I want to add this same functionality to a forum on the same site (the forum was custom programmed from scratch and not any of the popular ones), but since in a single thread there can be a lot of different people/usernames that answer I would prefer _not_ to do a select lookup for each username... any ideas on how else it can be done? Thanks, Ryan I'd say start with a query that pulls the online users into an array, then do an array_key_exists() or in_array() against that. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] online/offline...but on a list of users
> I want to add this same functionality to a forum on the same site (the forum > was custom programmed > from scratch and not any of the popular ones), but since in a single thread > there can be a lot of different > people/usernames that answer I would prefer _not_ to do a select lookup for > each username... > any ideas on how else it can be done? I'd say start with a query that pulls the online users into an array, then do an array_key_exists() or in_array() against that. Thanks! Thats a really good idea and one that i didnt think of. For now it should be okay as there are just a few hundred users, but if it gets really big then it might be a bit of a problem... if you any other ideas please feel free to reply till then I'll try your idea out. Thanks, Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php