RE: [PHP] search.php
John, since you're looking to modify this script and not build your own or search for another, here's some tips on how one might go about doing this. 1) set $which_one to the directory you want to search. 2) create a recursive funtion (many on php.net) to get all subdirectories under it and build an array with their paths as the elements. 3) now, take that arrary and add a foreach before the line $directory = opendir($which_one); replacing $which_one with your foreach array element. This is the *easy* way that I can think to do this - just do it for each subdir in the array. It probably is far from the most elegant way, but offers the least amount of real editing/manipulation. I welcome any/all flaming for my suggestion :) -M -Original Message- From: John Taylor-Johnston [mailto:[EMAIL PROTECTED] Sent: Sunday, February 01, 2004 12:09 AM To: [EMAIL PROTECTED] Cc: John Taylor-Johnston Subject: [PHP] search.php I found this script. I would like to modify it so it searches in not just the current directory, but also any other subdirectories. There are maybe better scripts out there, but I like this one for its simplicity. Can anyone lend a hand please? John ?php $counter=1; $not_found=0; $which_one=.; // use a . to search in this directory, or type in the folder name $link = www.glquebec.org; // this is your base url //$search_for=Search for something here!!!; // comment this whole line out if you are using a form to search $search_for=nice word; $directory = opendir($which_one); while($file = readdir( $directory)){$file_ar[] = $file;} foreach( $file_ar as $file ) { $type= strrchr($file,'.'); $name=$which_one; $name.=/; $name.=$file; $file_name=fopen($name,r); $bleh =; #if ($type==.php || $type==.txt || $type==.html) #if ($type==.htm || $type==.txt || $type==.html) if ($type==.htm || $type==.html) { while ((!feof($file_name))) { $bleh .= fgets($file_name , 2); } $bleh = strtolower($bleh); $bleh = stripslashes($bleh); $bleh = str_replace(br, , $bleh); if (stristr($bleh,$search_for)) { echo $counter .) a href=$link.$name..$link.$name./abr; echo \...; $bingo = strstr($bleh, $search_for); $bingo = explode ( , $bingo); echo b$bingo[0]/b; for ($x=1;$x15;$x++) echo $bingo[$x] ; echo ...\brBr; $counter++; $not_found=2; } else{} } fclose($file_name); } if ($not_found==0) { echo Sorry... $search_for was not found!!!Br a href=javascript:history.go(-1)Search Again/a; } ? -- 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] Comparing multiple Mysql tables to find duplicates
My first thought was to load the output from the tables into an array and they use a foreach and in_array to create a list of dups, but I wanted to see if there was an easier way. -- If you're not using MySQL 4, then yeah, that's probably the best way. Just realize that this isn't going to be the fastest script in the world. If it's a one-off or very infrequently run script, then that's not a big deal. -M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] dynamicly generating a transparent truecolor image
PNG's support transparency as well as GIFs. The short answer is that you'll create your image and also specify a color that will be made transparent. I don't see why imagecreatetruecolor making a default black image is a problem? If it is, just set black to be the transparent color and go from there. This is your friend: http://us4.php.net/manual/en/function.imagecolortransparent.php Regards Michael Brum -Original Message- From: Peter Vertes [mailto:[EMAIL PROTECTED] Sent: Saturday, January 17, 2004 1:48 AM To: php Subject: Re: [PHP] dynamicly generating a transparent truecolor image If you want to create a transparent image don't forget it must be a GIF. At least that's what my graphics guys have been telling me all these years :) -Pete On Jan 16, 2004, at 04:41, Michel van der Breggen wrote: hi, i have a problem, i would like to dynamicly generete a transparent truecolor image in php. The problem is that imagecreatetruecolor standard creates a black image. Does anybody have a solution for this? Thanks in advance, Michel van der Breggen [EMAIL PROTECTED] -- 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] Form validation: client- or server-side?
Yes, it's considered best practice to do as much client-side validation as you can as to save your server time and load. This doesn't mean you still shouldn't do full validation on the server-side, but the fewer times the form is posted to your site the better. You might want to recheck what Javascript can do now - it's pretty extensive for a client-side scripting language. -M -Original Message- From: Matt Grimm [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:08 PM To: [EMAIL PROTECTED] Subject: [PHP] Form validation: client- or server-side? Is there a distinct advantage to doing form validation / error checking on the server side using PHP? That's how I've always done it because I know PHP better than JavaScript, but wouldn't it make sense to validate as much of your form as possible using JavaScript before the form was ever posted? I'm just talking about the basics, like empty required fields, illegal characters, string lengths, etc. What are your preferred methods? I do an awful lot of content management with HTML forms, so it's not an entirely spurious question. -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org -- 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] picturing webpage
I can tell you this much, .cfm is ColdFusion. And CF is somewhat similar to PHP in it's embedded-in style of scripting. It could be similar to how you can build a PDF. They could just take your HTML and then use that to build a .JPG. I'm sure it's a very *expensive* process (server CPU -wise) though. -M -Original Message- From: Jake McHenry [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:11 PM To: 'Ryan A' Cc: 'Php-general' Subject: RE: [PHP] picturing webpage -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:55 PM To: David T-G Cc: [EMAIL PROTECTED] Subject: Re: [PHP] picturing webpage Hey, These sons of bitches at top--sites have done this, I call them that coz I regularly get spam from them. Try this URL: http://top--sites.com/update.htm?d=spamcop.come=p change spamcop to any other url... Cheers, -Ryan On 1/9/2004 4:28:33 PM, David T-G ([EMAIL PROTECTED]) wrote: Eli -- ...and then Eli Hen said... % % Hello All, Hi! % % I wanted to know if it is possible to picture a webpage via PHP. % By picturing I mean that the program can generate a picture, a view, out Hmmm... An interesting concept. % of the page URL given. (Like sometimes you have in search engines, that you % see the site URL and besides is the picture of the first page of the site). Can you provide an example? I know I've never seen this feature, and I'm not sure I follow what you mean. % What technologies I use for that? Is it possible with PHP? Dunno and dunno, but let's find out :-) % % -thanks, Eli HTH HAND Happy New Year :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This is where I saw it! They're using a script, pic.cfm on a windows box which somehow grabs a screenshot of the url. Any clues how this is done? Thanks, Jake McHenry Nittany Travel MIS Coordinator http://www.nittanytravel.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Image Resizing with GD
There are some really good user notes in the function description for imagecopyresized and imagecopymerge: http://us3.php.net/manual/en/function.imagecopymerge.php http://us3.php.net/manual/en/function.imagecopyresized.php You might also want to do some searching with google for thumbnail functions since most applications of GD image resizing is for creating thumbnails. -M _ From: Peter Vertes [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:21 AM To: [EMAIL PROTECTED] Subject: [PHP] Image Resizing with GD Hello List, I've tried googling but couldn't come up with anything useful so I'm turning to the list. Could anyone send me a link to a tutorial on how to resize images with GD ? Thanks in advance... -Pete -- perl -e 'print pack(H*, 70766572746573406E79632E72722E636F6D0A)'
RE: [PHP] End slash, small problem.
Do you want code to be handled differently if it's there or do you want it to be a certain way (e.g. always with trailing slash or never w/ trailing slash)? If you want it to always be a certain way, why not grab the last character of the path, check if it's a slash and then if it's not how you want it to be, either add the slash or remove it accordingly and then proceed with your logic. This will keep your code more precise as you're always acting on a path of a certain format and you can do your check before that code is executed. Regards -M -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Friday, January 02, 2004 8:08 PM To: [EMAIL PROTECTED] Subject: [PHP] End slash, small problem. Hi, Small problem, I am asking my users to enter a path for something in a textbox.. eg: /home/blah/something am confused as to how I can see if the entered path has an ending slash, if it has a end slash: $hasSlash=1 else $hasSlash=0 then i can carry on with my output... Thanks in advance. Cheers, -Ryan -- 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] End slash, small problem.
substr() http://us2.php.net/manual/en/function.substr.php Regards -M -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Friday, January 02, 2004 8:23 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP] End slash, small problem. Hi, Thanks for replying. Basically after that path I am adding a file ryanFile.php so I need that ending slash to always be in the path My question was exactly that...how do I grab the last character? Thanks, -Ryan On 1/3/2004 2:14:10 AM, Mike Brum ([EMAIL PROTECTED]) wrote: Do you want code to be handled differently if it's there or do you want it to be a certain way (e.g. always with trailing slash or never w/ trailing slash)? If you want it to always be a certain way, why not grab the last character of the path, check if it's a slash and then if it's not how you want it to be, either add the slash or remove it accordingly and then proceed with your logic. This will keep your code more precise as you're always acting on a path of a certain format and you can do your check before that code is executed. Regards -M -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Friday, January 02, 2004 8:08 PM To: [EMAIL PROTECTED] Subject: [PHP] End slash, small problem. Hi, Small problem, I am asking my users to enter a path for something in a textbox.. eg: /home/blah/something am confused as to how I can see if the entered path has an ending slash, if it has a end slash: $hasSlash=1 else $hasSlash=0 then i can carry on with my output... Thanks in advance. Cheers, -Ryan -- 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] Printing out html
1. if you have index.php, then just get rid of index.html and print your content via print or echo statements. 2. $ip = getenv(REMOTE_ADDR); print tdIP Address: . $ip . /td; (there's a few ways you can do that - this is just the standard I use) Regards -M -Original Message- From: Labunski [mailto:[EMAIL PROTECTED] Sent: Saturday, December 27, 2003 9:47 PM To: [EMAIL PROTECTED] Subject: [PHP] Printing out html Hello, I have just entered PHP world and I have many questions. I have already made PHP script that send's htm form values via e-mail. Now I want to build PHP based web page.. 1.question For example I have index.php file, but I want HTML (index.html) file to be printed out. How php code should look like? 2.question I know that code for IP address ($ip) is: $ip = getenv (REMOTE_ADDR); For example I have Index.php file, and I want an IP adders to be viewed in the TD: td IP address /td How should I write it? Sorry for my dumb questions and bad english, Regards, Lab. -- 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] Re: Where and how do i use $_post etc
Let's make some assumptions - 1) having register_globals on is bad 2) we all like to write scripts as secure as possible Given #1 and #2, if you stop referencing variables directly (e.g. as $firstName in the script below) since register_globals is off, it immediately adds a degree of security to your script if you're aware of the difference between GET and POST requests. GET requests are quite easy to fake (just add the variables and values to the URL) and unless you have checks against it, a malicious user could take advantage of this. POST requests are a bit more tricky to fake, but not difficult in the grand scheme of things. Either way, in the examples that Piet wrote, there's no extra coding. Writing the variable names is a bit more key strokes, but given the advantages of having even a slightly more secure script, it's a good thing and worth a bit more typing. -M -Original Message- From: Piet [mailto:[EMAIL PROTECTED] Sent: Friday, December 26, 2003 6:41 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Where and how do i use $_post etc Why would i do this long coding in the second page script.php the variables values is already available in script.php when i do a post or get, if i use $_POST or $_GET to define a variable already available, that seems like a lot of extra coding for no reason. Al [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Piet [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi I am trying to find examples of how and where to use $_POST, $_GET etc. I searched a lot of places, but cant seem to find decent examples or a tutorial or something. $_POST and $_GET are associative arrays containing the form data sent by a user to a page. Whether your user's submitted form data is in $_POST or $_GET depends on what method attribute you've specified in the form tag in your HTML code. Take a look at the following HTML example: form method=get action=script.php input type=text name=firstName input type=text name=lastName input type=submit /form Now in the file script.php you can access the submitted form values in the $_GET array, using the form field names as array keys. e.g: ?php $firstName = $_GET['firstName']; $lastName = $_GET['lastName']; echo 'The user submitted the name'.$firstName.' '.$lastName; ? If you had set the form method=post in your HTML, then you could have accessed the form values from the $_POST array within PHP. Hope that helps, Al -- 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] Maths dumbass
Basically, have an array of # of days per month. Do a quick compare given the month for the # of days. For the sake of example, we'll assume the month in question has 31 days. So, here's some givens: $month_days = 31; $former_plan_days = $current_date; $new_plan_days = ($current_date - $month_days); Now, to get the values: $former_plan_bill = ($full_former_price * ($former_plan_days / $month_days)); $new_plan_bill = ($full_new_price * ($new_plan_days / $month_days)); $total_month_bill = ($former_plan_bill + $new_plan_bill); There you have it. This should work no matter if they get an upgrade or downgrade in service because it just takes the ratio of days to get the percentage of the price that's owed and then multiplies the full price to get the percentage that's owed. Make sense? :) -M -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Friday, December 26, 2003 11:09 PM To: [EMAIL PROTECTED] Subject: [PHP] Maths dumbass Hi guys, Its not 5am here and have started on a blasted problem where am feeling like a maths dumbass...the old noodle is just not working, any help appreciated. Problem, selling 4 packages rangeing from $27.50-$99.00 a month...the subscriber can change anytime he wants from one package to the other (upgrade), if so I have to calculate how many days he has is with us and then he just pays the balance... eg: if he is on the smallest package ($27.50) and the month has 30 days, and 15 days are up, (means 50% is used and that translates to 13.75$) and he wants to upgrade to the next higher package ($43.00) he just has to pay $29.25 Can you give me a clue on how to calculate that depending on the 12 months and 4 packages? Thanks in advance, -Ryan -- 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] problem sending variables with forms
Some code samples would be really helpful. You also said an error occurred but failed to mention any details about that error. That aside, I'll make a guess at some possible problems: 1) You're trying at access the wrong super global (e.g. GET when you should be looking for POST). 2) You're trying to access the variable directly but do not have register_globals enabled. 3) You're spelling something wrong (we all do it from time to time). -M -Original Message- From: Abdullah Teke [mailto:[EMAIL PROTECTED] Sent: Thursday, December 25, 2003 8:55 AM To: [EMAIL PROTECTED] Subject: [PHP] problem sending variables with forms I have a problem that i cant send variable over a form. Because of that when i watn to echo the variable next page an error occured...i use redhat 9.0, apache 2 and php 4.3.4. Please help me Abdullah Teke _ Telephone : +90 555 337 21 89 Messenger : [EMAIL PROTECTED] Web: http://abdullahteke.cjb.net Icq : 164500674 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How can i count time it taked to render the page?
Grab the time at the beginning of the page execution and then grab the time at the very end. Subtract the two and you have the amount of time the page took to execute. -M -Original Message- From: Bas [mailto:[EMAIL PROTECTED] Sent: Sunday, October 26, 2003 11:50 AM To: [EMAIL PROTECTED] Subject: [PHP] How can i count time it taked to render the page? Any help appreciated. Regards, Bas -- 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
Either confirm that you have php_dbg.dll in your extensions directory or comment out that line in your php.ini file. -M -Original Message- From: Amanda Lau [mailto:[EMAIL PROTECTED] Sent: Thursday, October 16, 2003 4:20 AM To: [EMAIL PROTECTED] Subject: [PHP] php Hi. I have a question. I receive this message three times every time I boot my computer: Unknown(): Could not load dynamic library 'extensions\php_dbg.dll- 4.3.2' - The specified module could not be found. Is there a way I can fix this problem? Amanda -- 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] Sessions Question
One quick note - if you're starting a session then you can't user the header() function afterwards. You'll get the lovel headers already sent error. Be sure to use an alternate method of redirection if you're starting a session before your redirect logic takes place. -M -Original Message- From: Chris Hubbard [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 14, 2003 9:24 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Sessions Question Jake, it would be helpful if we could see your code. That said... first you need to identify what information you need to track in the sessions, and whether you're going to use php sessions (the $_SESSIONS array) or build your own mysql based session tracker. to use php sessions: you will need some place where you set up/create the sessions. typically this is the login page. let's assume you'll use the login page. The logic for the login page goes something like this: 1. present a form for logging in (usually username/password) 2. on post, clean the posted data (remove html, special characters, etc) 3. check the cleaned username/password against the data in the database 4. if the username/password is valid, create your session and assign variables to it like this: session_start(); //create the session $id = session_id(); // create a unique session id session_register(id); // register id as a session variable session_register(name); // register name as a session variable session_register(email); // register email as a session variable $_SESSION[id] = $id; // assign the unique session id to session array $_SESSION[name] = $data[name]; // assign the username to session array $_SESSION[email] = $data[email]; // assign additional values (after regisering them) to session array 5. now either redirect to your main application page, or create another page with links to that main applicaiton page. In either case every page where you want to use sessions has to start with: session_start(); for example: ?php session_start(); the rest of your code. 6. I recommend that you add a check to your pages to make sure that the session is still the right one and it's intact, something like this: if (!$_SESSION[id]) // if no session id, return to the login page { header (Refresh: 0; url=login.php); //or // header (location:http://www.mydomain.com/login.php;); }else{ // the body of your code goes here. } 7. so with all that the pages you want to access session in should have a structure similar to: ?php session_start(); if (!$_SESSION[id]) { header (Refresh: 0; url=login.php); }else{ // do all kinds of nifty time card things here } ? Hope this is helpful. Chris -Original Message- From: Jake McHenry [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 14, 2003 4:00 PM To: [EMAIL PROTECTED] Subject: [PHP] Sessions Question Hi everyone, I've been trying to set up sessions, but have been having problems. I created an online time clock for my company using php and a mysql database. It's everything that my boss wanted. The only problem is, he told me today that he is planning on selling it to our partners. The actual software and database will reside on my server, but I will give them their own database. I started designing it about 2 years ago, and the machine that I was working on at the time had register_globals=on, so I built my scripting around that. I didn't know much about php at the time, but have learned an immense amount since then. Since a people are now going to be accessing the time clock from outside my company, I need to turn register_globals off, and turn sessions on. My problem is that all my variables are declared locally in the individual files, and are being passed by forms to $PHP_SELF, and all of the variables and their values can be seen in the address bar. This never concerned me while being inside my firewall, since it was only my employees and I. I knew what was going on. I've read a lot of documents on the net concerning sessions, but still can't get it to work right. Whenever I try to go to another page, or submit a time, it either doesn't work at all, or it works, but the value that's in the variable is stuck there, and I can't change it without closing the browser and starting over. Can someone point me in the right direction here? Thanks, Jake McHenry Nittany Travel MIS Coordinator http://www.nittanytravel.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Encryption question
I think it all falls under the cryptography category, but you're right - it doesn't fall into the encryption/decryption scheme since it is only one-way. -M -Original Message- From: Brad Pauly [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 10:43 PM To: php-gen Subject: Re: [PHP] Encryption question md5 is a one-way hash function. It is great for passwords. (I'm not sure if that technically qualifies as encryption because it is nearly impossible to decrypt..hmm) Anyway, I would recommend using it. - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Newbie
Did you try to browse to it on your machine such as: http://localhost/phpinfo.php This is what they're referring to. PHP doesn't interpret pages when you just double-click on them since they're not being run through the web server (Apache) which will trigger PHP to parse the file. -M -Original Message- From: John Hicks [mailto:[EMAIL PROTECTED] Sent: Sunday, October 05, 2003 1:29 PM To: [EMAIL PROTECTED] Subject: [PHP] Newbie Hi list, I have just installed PHP4.3.3-Win32. I have a book that said create a phpinfo.php ( ? phpinfo(); ? ) file and place it in my Apache 2 htdocs file. I did this and when I run it opens in a blank page of DreamweaverMX. I tried to open with Internet Explorer and it does nothing. My question is what file would tell it to open in DWMX or how do I get to the opening set-up page of PHP. I used php4.3.3-installer.exe but I got the message that it would have to be installed manually. Any help or direction would be appreciated. John H. -- 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 .htaccess question
I think I know the answer to this, but want some confirmation from someone a bit more knowledgable about Apache and .htaccess files. My webhost has the default 404 page set to 404.html. For the sake of consistancy on a number of levels, I prefer a PHP file for this (404.php). So to do this, I created a basic .htaccess file for this very purpose and it sits in the root dir. Now, does this .htaccess file get read for EVERY resource request on my site - even when the page is found? Aside from a META redirect from 404.html to 404.php, is there a less server-intensive way to set my 404 in Apache when I don't have root access? Thanks -M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] IIS Ports
Well, any service that listens for external access requires certain ports to be open. Basic web traffic is listened for on port 80 for example. If you get a personal (software) firewall application (ZoneAlarm for example), then you can block access to these ports. I'm not sure how well the XP firewall software works, but I'm assuming that if it's just bundled with MS then it's not great but functional. Also realize that IIS is a big security hole to begin with (as well as most Windows-default servers. Make sure your OS is fully patched updated and also remember to disable any servers that you're not using. If you're extremely paranoid, you can always get a hardware firewall to put between your machine and the rest of the network - though a software firewall should suit your needs. I hope this answers your questions, though you've already taken the first major step by having some sort of firewall in place. -M -Original Message- From: Stephen Craton [mailto:[EMAIL PROTECTED] Sent: Saturday, September 27, 2003 4:31 PM To: PHP List Subject: [PHP] IIS Ports This is kind of off topic but kind of not, it's your call. My brother came home this weekend from college this weekend acting all cool since he has been learning to hack. He was telling us (the family) how he did random port penetration on the home network and he said my computer was the most vulnerable with around 25 ports open. I didn't really care until about an hour later he hacked into my computer and then reset it causing me to loose all my important information. I told my dad and my brother promptly lied about anything of the sort. What I want to know.since I know the majority of my ports open are from IIS.is how I can close these. I only need my local server accessible by just my computer but the entire network too.just not the network. I thought the ports would just be open on my computer and not the hardware firewall and everything. I went ahead and turned on the Windows XP firewall but I've heard it really sucks. So is there any way of closing the IIS ports so my brother, and any other hacker, can't get in here and cause havoc? Thanks, Stephen Craton http://www.melchior.us -- http://www.melchior.us/portfolio -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] IIS Ports
Yes and no - even with Linux you still need to know HOW to lock down the machine and without doing so, there are still exploits that can be as, or more, dangerous than some Windows exploits (take the SSH exploit recently found that can give an intruder root access!). Bottom line is that any OS has vulnerability if you don't have the know-how to lock it down - it's not a Windows-specific problem. The Linux vs. Windows issue is moot. -M -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Saturday, September 27, 2003 4:38 PM To: Stephen Craton Cc: PHP List Subject: Re: [PHP] IIS Ports The short answer (and a good way to start a flamewar ;) install linux :) Cheers, Rob. On Sat, 2003-09-27 at 16:31, Stephen Craton wrote: This is kind of off topic but kind of not, it's your call. My brother came home this weekend from college this weekend acting all cool since he has been learning to hack. He was telling us (the family) how he did random port penetration on the home network and he said my computer was the most vulnerable with around 25 ports open. I didn't really care until about an hour later he hacked into my computer and then reset it causing me to loose all my important information. I told my dad and my brother promptly lied about anything of the sort. What I want to know.since I know the majority of my ports open are from IIS.is how I can close these. I only need my local server accessible by just my computer but the entire network too.just not the network. I thought the ports would just be open on my computer and not the hardware firewall and everything. I went ahead and turned on the Windows XP firewall but I've heard it really sucks. So is there any way of closing the IIS ports so my brother, and any other hacker, can't get in here and cause havoc? Thanks, Stephen Craton http://www.melchior.us -- http://www.melchior.us/portfolio -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | a | powerful, scalable system for accessing system services | such as | forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- 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] How to accept file through http from curl c program??
I don't really know much about Curl, but what it -sounds- like is that Curl isn't sending the proper headers/MIME types to the PHP script and PHP isn't putting the input into the $_FILES array. You might want to look in your $_GET or $_POST array for existance of the file to see if it's being sent there. Good luck. -M -Original Message- From: Brian Moynihan [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 6:44 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] How to accept file through http from curl c program?? Thanks Chris but I don't think that is the issue as the file is being created and the script is running through. It's just that $_FILES contains no data which it should?? I is confused as they say because it works perfectly using the browser ... - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, September 26, 2003 12:29 PM Subject: RE: [PHP] How to accept file through http from curl c program?? At a first glance: $fp=fopen(brianLog1, w+); brianlog1 should either be in quotes if that's the name of the file and the file doesn't have an extension. Or maybe it's a variable in which case you'll need to put the $ in front of it.. Hope that helps Regards Chris -Original Message- From: Brian Moynihan [mailto:[EMAIL PROTECTED] Sent: 26 September 2003 10:25 To: [EMAIL PROTECTED] Subject: [PHP] How to accept file through http from curl c program?? Hi there, Hopefully someone can shed some light for us on this. We have a client who is sending us a file through a C program which uses Curl. At our end we have a php script to accept the file passed through the form. This php script works fine using a browser however, it does not pick up what the C program sends to us. Our php is below, $_FILES contains zilch!! Any ideas?: foreach( $_FILES as $varname = $fileinfo ){ $filename = $fileinfo[name]; $tmpname = $fileinfo[tmp_name]; } $uploaddir = '/usr/local/nameofdir/; $uploadfile = $uploaddir. $_FILES['filename']['name']; if (move_uploaded_file($_FILES['filename']['tmp_name'], $uploadfile)) { $fp=fopen(brianLog1, w+); $string = HTTPS POST of Purchase Order SUCCESSFUL. File Name: .$_FILE['filename']['name'].\n; fwrite($fp, $string); } else { $fp=fopen(brianLog2, w+); $string = HTTPS POST Failed !* File Name: .$_FILES['filename']['name'].\nTmp Name: .$_FILES['filename']['tmp_name']; fwrite($fp, $string); } ? If you are not the intended recipient of this e-mail, please preserve the confidentiality of it and advise the sender immediately of any error in transmission. Any disclosure, copying, distribution or action taken, or omitted to be taken, by an unauthorised recipient in reliance upon the contents of this e-mail is prohibited. Somerfield cannot accept liability for any damage which you may sustain as a result of software viruses so please carry out your own virus checks before opening an attachment. In replying to this e-mail you are granting the right for that reply to be forwarded to any other individual within the business and also to be read by others. Any views expressed by an individual within this message do not necessarily reflect the views of Somerfield. Somerfield reserves the right to intercept, monitor and record communications for lawful business purposes. -- 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 on a .NET enviroment machine: Conflicts?
I've had to use CF and .Net on the same machines before and have had only minor issues with it. I've never had an issue mixing PHP and any other language before since it's pretty stand-alone, whereas CF and .Net want to own a lot of Windows functionalities as servers. I don't forsee any real problems with PHP and .Net, but I've never implimented both on the same machine unfortunately. You might also want to discuss the possibility of having a dedicated PHP server or two. That way, you can bring your code to those machines and leave all .Net machines as-is. If you can pursuade them that the PHP elements are a valuable addition to site and that it'd be less effective in PHP, you might have a chance. Good luck. -M -Original Message- From: Jay Paulson [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2003 5:03 PM To: PHP List Subject: [PHP] PHP on a .NET enviroment machine: Conflicts? Quick question to the community here. The company I work for got bought out and now they are wanting to migrate all the web sites that I have created in PHP to their Windows, IIS, .NET enviroment. I have been trying to talk to the people at corporate about putting PHP on their Windows machines but they are reluctant saying the following: An additional complication we discussed here is the fact that our servers are set up as pure a .NET environment. While we could add PHP to it. It could create conflicts that would effect the entire system. We have had this problem with Cold Fusion in the past. My question is... has anyone put both PHP and .NET in a Windows enviroment at the same time and had any conflicts? I have done it several times before and have not run into any problems. I really want to continue to run some of the PHP things that I have on the sites (i.e. message forums, chats etc) but I really need to know if anyone has run into any conflicts. As far as I know they are running Windows 2000 and IIS 6 on their machines. Thanks for any feedback! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] game in php
Another way you can do it if you don't have that much access to the machine is to record the last time it was updated and when someone loads the page, you take the amount of time between the last incriment and now(). You then find out how many sets of 10 minutes have passed and incriment it that many times (if it's less than 10 minutes, you'll be incrimenting zero times). The only problem with this is that if 100 people load the script in a 10 minute period, only one will be updating the database - the other 99 are wasted traffic on the DB. But if you have no other options... -Original Message- From: Jon Haworth [mailto:[EMAIL PROTECTED] Sent: Sunday, September 07, 2003 6:10 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] game in php Hi, I have this database with this fields; id and number_attacks. And every 10 minutes number_attack to be increased by 1. You'll need to set up some sort of scheduled task (if you're on unix, your best bet is probably cron) - this task should call a script that connects to your database and updates the field. If you like, you can write the script in PHP and use something like lynx or wget to access it. Cheers Jon -- 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] is the list getting virus spammed?
Yes, it's Sobig-F: http://www.sophos.com/virusinfo/analyses/w32sobigf.html Just don't run the attachment and everyone will be fine. It's just one of those viruses that spoofs the from address from somebody that it finds in the infected user's address book or their out/inbox. Hopefully the site that manages the list will update it's virus definitions soon and we won't have to deal with it. -M -Original Message- From: Matt Babineau [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 3:21 PM To: [EMAIL PROTECTED] Subject: [PHP] is the list getting virus spammed? Hmmwondering why I keep receiving email sent to the list, that has this stupid attachment...anyone else getting these? Matt -- 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] executing a shell command within a function
Why don't you try to use mkdir() instead of shell commands? http://us2.php.net/manual/en/function.mkdir.php -M -Original Message- From: Sævar Öfjörð [mailto:[EMAIL PROTECTED] Sent: Friday, August 15, 2003 8:19 PM To: [EMAIL PROTECTED] Subject: [PHP] executing a shell command within a function Hi, Im coding a function that will create a set of directories using execution of shell commands within the function. Then the function saves different sizes of images in each directory. Later in the function I open one of these directories to list the content in them. The problem is that the directoris dont exist when the function is trying to list the content in them. When I execute the function again with exactly the same parameters there is no problem, then the directories exist! Im thinking that the shell commands are somehow set in some kind of buffer or queue and are not executed until the rest of the php code is executed? Could this be true? If anyone has anything to say on this Id appreciate it. BTW I'm using RH8.0 and PHP 4.2.2 Kveðja, Sævar Öfjörð [EMAIL PROTECTED] þetta reddast - hönnunarlausnir www.reddast.is -- 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] Screen Resoultion
You can do so with JavaScript and have that pass the information onto your PHP scripts to do whatever it is that you want. -M -Original Message- From: Uma Shankari T. [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 12:12 AM To: PHP Subject: [PHP] Screen Resoultion Hello, Can anyone pls tell me is it possible to get the screen resoultion using php script ?? Regards, Uma -- 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] [Newbie Guide] For the benefits of new members
While sometimes a new perspective is extremely useful on a topic, I think the problem is that a huge percentage of people don't try for themselves. If they've done all the steps in the proposed message, then it tells you to send a message explaining where you're at to the list. While it can be pretentious to send someone to the manual if they say I read the manual, I can't figure it out, if they haven't even tried doing it for themselves yet, then it's a very viable first recommendation. Not to mention that there's MANY different points of views on many different topics in the list archives that very few people seem to search. Someone should always try to help themselves first before they start asking other people to do the work for them. It's just laziness to not even try before asking. My suggestion would be to have that message sent to a person just after signing up once, instead of to everyone on a regular basis though. my $.02 -M -Original Message- From: Van Andel, Robbert [mailto:[EMAIL PROTECTED] Sent: Monday, August 11, 2003 1:08 PM To: PHP Mailing List Subject: RE: [PHP] [Newbie Guide] For the benefits of new members Personally, I think one of the worst replies someone on the list can do when someone new asks a question is send only a link to the manual. It's presumption that everyone will understand the way the manual is worded. There have been times when it's confused me and I needed another perspective on the topic. If you find the question juvenile or unworthy of anything more than a link to the manual, don't reply to it. Robbert van Andel -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, August 11, 2003 5:44 AM To: PHP Mailing List Subject: [PHP] [Newbie Guide] For the benefits of new members I have been following this list for the past 1 year. I find it very useful. Just by following the discussions for a couple of months one can understand a great deal about PHP. What I proposed to do is to send this mail to the list every week. Those who do not want to be bothered just filter out the [Newbie Guide] mails. Please feel free to add more points and send to the list. 1. If you have any queries/problems about PHP try http://www.php.net/manual first. You can download a copy and use it offline also. 2. If you can not get answer here try http://www.google.com next. Try searching for php YOUR QUERY and you may be lucky to get an answer within the first 10 results. 3. Glancing through the list archive at http://www.php.net/archives, should answer almost all common problems. 4. If you are stuck with a script and do not understand what is wrong, instead of posting the whole script, try doing some research yourself. One useful trick is to print the variable, sql query using print or echo command and check whether you get what you expected. After diagnosing the problem, send the details of your efforts (following steps 1,2 3) and ask for help in the list. 5. Provide a clear descriptive subject line. Avoid general subjects like Help!!, A Question etc. 6. When you want to start a new topic, open a new mail and enter the mailing list address [EMAIL PROTECTED] instead of replyting to an existing thread and replacing the subject and body with your message. Hope you have a good time programming with PHP. Best regards, -- Ma Siva Kumar, INTEGRATED MANAGEMENT TOOLS FOR LEATHER INDUSTRY BSG LeatherLink, Chennai. Ph: +91 44 55191757 URL : http://www.leatherlink.net -- 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] Mail
To expand on Curt's suggestion (which is a very good one), add your local network IP (192.168.#.#), the external IP the machine has (if any) and localhost (127.0.0.1) to the Only the list below box. If you have to add any other machines in your network to relay mail through this server, try to only add their internal IP's, and relay the mail internally. Not only will you get better performance (speeds across an internal network are generally faster than having to be routed over the internet), but you'll have a better chance of making sure that those that are attempting to connect to your mail server are who they say they are. -Mike -Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: Sunday, August 10, 2003 11:50 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Mail * Thus wrote Sean ([EMAIL PROTECTED]): Got it if anyone else has trouble. In the IIS SMTP properties go to the Access Tab. Click the Relay button at the bottom and change the selection from Only the list below to All except the list below I have no idea if this is a security risk it works that's all I care about for now. Um, if I read that right you just set your mail server as an open relay. This is bad. I would strongly encourge you to put it back on 'Only the list below' and add your own hostname to the list instead. Curt -- I used to think I was indecisive, but now I'm not so sure. -- 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] [Newbie Guide] For the benefits of new members
And don't forget, the user-added notes at the bottom of the functions pages are extremely useful to see actual code usage along with tips or potential conflicts on various systems! Those alone offer countless user-generated examples that are usually similar to content that people on the list might generate. -M -Original Message- From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 5:23 AM To: 'Van Andel, Robbert'; PHP Mailing List Subject: RE: [PHP] [Newbie Guide] For the benefits of new members snip If I respond with a link to the manual, it's usually because I think the manual says it as well as (or better than) I can -- not through laziness. But, yes, I have over 20 years' experience of reading (and writing!) manuals, and sometimes I may overestimate the usefulness of a manual page to a beginner -- so I won't be offended if you come back from RTFM-ing and say something like I read that, but I don't understand x because y -- could you explain a bit further, please?. Cheers! Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail
Do you have an SMTP server installed on your machine? If not, add one to IIS (probably the simplest way to do it in Win2k). -M -Original Message- From: Sean [mailto:[EMAIL PROTECTED] Sent: Friday, August 08, 2003 11:11 PM To: [EMAIL PROTECTED] Subject: [PHP] Mail I cannot get mail() to work any idea's I get a server error. Windows 2000 the SMTP port is 25. No default values have being changed from the original PHP installation. In it's simplest form mail([EMAIL PROTECTED], My Subject, Test); Gives the error as do more complicated scripts that I copied. Thanks Sean -- 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] OOP, PHP4 PHP5
I've been using PHP for a few years now and I'm quite familiar and comfortable with it. I'd like to start to seriously do some OOP coding and take things to the next level. But as I understand it, PHP5 is going to make quite a few changes/improvements to PHP4's current handling of OOP. Given that the PHP5 beta has been out for approx. 1 month, do you think it makes sense to try to get into OOP with PHP4 right now when things could change in a fairly short while (not sure how long it'll be until PHP5 is released) and then have to re-learn certain aspects of OOP after getting comfortable with it? Or do you think that the change from 4 to 5 won't really be that big of a deal? I know that many people ask OOP-related questions a lot on the board, but I was just wondering what everyone thought of the jump from 4 to 5 and about trying to start learning OOP *right now*. Thanks -M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] do i need to output headers on parsed CSS files?
Justin, when you echo/print your CSS info, you can add tabs /t and newlines /n to your documents for indentation and organization in the source if that's what you're after. Otherwise, when you output it to the browser it's going to print it to a few lines with no discernable order. -M -Original Message- From: Justin French [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 10:42 PM To: php Subject: [PHP] do i need to output headers on parsed CSS files? Hi all, I'm forcing my style sheets (.css) though the PHP parser, so that they can take advantage of some color variables and global config settings via include files, eg: body { background-color: #?=$col['1']?; } however, I've noticed that when viewing the CSS file in a browser now, it looks more like a HTML document int he browser (variable width fonts, no newlines, etc) rather than other css files (wich look like they have pre tags aroun them (newlines visible, fixed-width font, etc). So, my assumption is that pushing the .css file through PHP is putting the wrong header on the file (text/html) rather than text/css -- or perhaps something else -- my header knowledge is poor. Anyway, the pages and linked CSS files *work* but do not validate any more, witha warning You can't import an HTML document. What/how should I force the correct headers on these PHP-parsed CSS files? TIA 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: [PHP] How to use ph to set meta tags ?
You're close but instead of ? mAuthor() ? try ?php print mAuthor(); ? That will print the return value of your function - which by example is Daniel Szasz. -M -Original Message- From: Daniel Szasz [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 15, 2003 3:07 PM To: [EMAIL PROTECTED] Subject: [PHP] How to use ph to set meta tags ? Hello I wish to create be able to put in the meta tags value from functions. How can be done ? Here is part of the code : ?php function mAuthor() { $Author = Daniel Szasz; return $Author; }; ? ? ? HTML HEAD META http-equiv=Content-Type content=text/html; charset=windows-1252 META NAME=mAuthor CONTENT= ? mAuthor() ? /HEAD /HTML Thanks a lot for the help Daniel -- 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] HTML email with Outlook
By the context, I'm sure it should read ...not all email clients support HTML. (I got a laugh out of it though ;) -Original Message- From: Johnny Martinez [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 15, 2003 7:21 PM To: 'Curt Zirzow'; [EMAIL PROTECTED] Subject: RE: [PHP] HTML email with Outlook Remember not all email clients support email. Did I read that right or is it a typo? J -Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 15, 2003 4:17 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] HTML email with Outlook Tim Thorburn [EMAIL PROTECTED] wrote: Hi, I've made a PHP script that sends out an automatic email through my servers cron system, it works well, but I thought I'd try to do some HTML email to get things to line up a little better. To do so, I added the following line in my mail() command: -Type: text/html; charset=iso-8859-1 When I check the messages sent out with Eudora, the HTML email comes in perfectly. However, when I check with Outlook Express 6 - I get the actual HTML code rather than the nicely formatted email that I had created. Should I be using another line in my mail() command? I've recieved HTML email before with Outlook Express on my machine without changing any settings at all. Also, I had sent an email from my script to hotmail and the HTML email worked fine there too. there are different ways to send html in an email and also very wrong ways to send html in an email; very debatable topic from what I've seen. I think your best bet is to use something like: http://phpmailer.sourceforge.net/ You can send both plain/text and html. Remember not all email clients support email. And a lot of people dont like it at all. Of course if this is only for you to see I guess you can ignore all that i said :) Curt -- -- 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] linking with home directory
First, I'd create a simple test to see what the value of $newDir = $HomeDir.themes/.$ThemeFolder; print $newDir; And see what that yields. You might have a problem with your slashes. I find it extremely useful to have test variables print to the screen along the way to ensure that each new part of my code is receiving the correct information. It helps isolate where the problem data or logic lies. (becomes increasingly useful as you use many functions, classes, includes or just generally large scripts). -M -Original Message- From: mpalermo [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 11:37 AM To: [EMAIL PROTECTED] Subject: [PHP] linking with home directory is evaluating to with the string addition: // Path to script files (absolute file path) $HomeDir = c:/inetpub/wwwroot/MyScript/; // Name of style folder $ThemeFolder = default; //--- Then later in the page, I link the style sheet like this ---// echo link rel='stylesheet' type='text/css' href='.$HomeDir.themes/.$ThemeFolder./style.css' ; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] linking with home directory
Maybe you should try to reference it from http://localhost/MyScript/default/style.css ? -M -Original Message- From: Matt Palermo [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 12:02 PM To: Matt Matijevich; php-general Subject: RE: [PHP] linking with home directory I am testing it from the same machine for right now. = Original Message From Matt Matijevich [EMAIL PROTECTED] = I mean, when you actually call the script on the XP machine, where do you test it at? Do you use a browser that is on the XP machine that is running IIS, or do you do it from a different machine? Matt Palermo [EMAIL PROTECTED] 07/09/03 10:52AM The XP and 2000 are two different machines. -- 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] Good PHP Books
Mark, One thing that you might want to consider is to just get the book you think is best and has the most solid content and then build your ciriculum around certain chapters. It shouldn't be hard to have a student read a chapter a night or even two chapters over the course of a week. Most of the Teach Yourself... books are designed to have a chapter read at one time and strengthen one particular concept. If your students will be purchasing their books, having the extra reference info will be good for them as well. While you probably won't want to discuss a chapter on GD if your course is intro-level, I'm sure that a lot of students will be interested in creating graphics dynamically and will benefit from having a more comprehensive reference book instead of having to go out and buy one or two more books after the course than having a book that covers everything from the beginning - even if the course doesn't cover every chapter. Just my $.02 -Mike -Original Message- From: Mark McCulligh [mailto:[EMAIL PROTECTED] Sent: Monday, June 16, 2003 10:25 AM To: [EMAIL PROTECTED] Subject: [PHP] Good PHP Books Hi Other PHP Users, I have been asked to teach an introduction course on PHP/MySQL at my local College. I am looking for a good beginner book for the course. Like most people I learned PHP from php.net and online tutorials. But I need a book for the course. I am looking for a book that is not too long also. Around 500-600 pages would be great. I can't give my students 150 pages every night to read, for books like PHP and MySQL Web Development by Luke Welling, Laura Thomson even know they are great they are just to long. It is only a 35 hour course for only can cover the basics. Plus something that covers version 4.2 or greater. I don't want to teach them old syntax. If anyone knows for a good beginner book, please let me know, thanks. Mark. -- 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] How do I delete a mySQL table?
DROP TABLE `tablename` -Original Message- From: zavaboy [mailto:[EMAIL PROTECTED] Sent: Monday, June 16, 2003 5:22 PM To: [EMAIL PROTECTED] Subject: [PHP] How do I delete a mySQL table? How do I delete a mySQL table? (Just what's in the subject) -- - Zavaboy [EMAIL PROTECTED] www.zavaboy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Hosting Sites
I've had good experiences with www.phpwebhosting.com for smaller sites (virtual hosting). I haven't had any super-high traffic sites hosted on them though. Full support of PHP mySQL and fairly inexpensive. -M -Original Message- From: Martin, Stanley G [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 10:33 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP Hosting Sites Anybody have any GOOD experience with PHP Web Hosting sites? I found a list at http://www.zend.com/hosting_sites/phphosting.php?CID=484 but don't know enough about them to make a safe decision. Stanley G. Martin System Administrator Sprint - EIS3 Customer Care [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Warning Spammer
What I've done is created a separate account for the PHP mySQL mailing lists for that purpose. If the spam count gets crazy on this address, it's simple to just create a new account and send all of that mail to the trash. -M -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 11:13 AM To: Ben Houlton Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Warning Spammer Just as well I didnt bother looking it up. LOL Thanks, and now that I realize that this list is archived and any idiot can get my email them ...sigh... too bad. - Quoting Ben Houlton [EMAIL PROTECTED]: taken straight from google.com translation page... ( i'm not really portuguese ;)) ei myphp Well-taken care of with what it speaks the Cellular one... it tb has heard... to remove [EMAIL PROTECTED] of our list he answers this email and he places to remove in them pardons the upheaval... ok? -- 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] RE: Characters
Addslashes() http://us3.php.net/manual/en/function.addslashes.php -M -Original Message- From: Steve Marquez [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 4:28 PM To: MySQL List; PHP eMail List Subject: Characters I am inserting a file via a PHP form. It works great, however, if there is a word that has quotes in it, then it does not work at all. Is there a way to make it so that MySQL will receive a word with quotes? Thanks -Steve Marquez [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Imagerotate() Problems
I'm having some problems with imagerotate() - e.g. it won't work. I've tried many different ways to get it to work, but I have yet to see it do anything at all. I'm using PHP 4.3.1 on XP. I know that GD is working properly because I can do other image-manipulation with it without error. Plus, I installed PHP manually, not with the Windows installer (which I've had problems getting GD to work properly on in the past). I've added the last attempt at getting the code to work. Note that the imagecopy() works fine and the new image displayed always ends up being an exact copy of the destination image. Any help would be greatly appreciated! if (($degrees == 90) || ($degrees == 180) || ($degrees == 270)){ foreach($image_check as $temp_file){ $src_img = imagecreatefromjpeg($inbox_dir\\$temp_file); $new_img = imagecreatetruecolor(imagesx($src_img),imagesy($src_img)); imagecopy($new_img,$src_img,0,0,0,0,imagesx($new_img),imagesy($new_img)); if (function_exists(imagerotate)){ if(imagerotate($new_img, $degrees, 0)){ print Image Rotated Successfullybr; } else { print Error Rotating Imagebr; } } imagejpeg($new_img, $inbox_dir\\new_image_path.jpg); imagedestroy($src_img); imagedestroy($new_img); *code left off that's not important - though there's no syntax/compile errors -- 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
Realize that when you see error line... it doesn't mean that the error is definately on that line. PHP is only *so* smart. You'll find that making mistakes on line X will result in errors being reported on line X+1 or further down in your code. Don't take the errors at face value all the time - they're an amazingly useful tool, but it's only a machine and is forced by a set of rules. -Mike -Original Message- From: Andy [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 9:17 AM To: [EMAIL PROTECTED] Subject: [PHP] Help needed Hi all Can someone help? I am new to PHP and need some help, i have tried to build a members only section to my website but i am finding it very hard. I get this error when i go to the login page: Parse error: parse error in /home/.sites/112/site***/web/Members/Login.php on line 201 But the only thing on line 201 is: default: I don't understand? I get the feeling i will need more help even if someone solves this for me :o) Thank you -- 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] possible?
How I deal with images and resizing is by uploading the image to the server, and at that time creating a thumbnail. I have the /images folder with a /thumbs folder inside it for the thumbnails. The database simply refers to the name of the image and it's ID and other associations. This is optimal for most web uses for many reason: * Shorter DB access time * Not processing expensive GD functions on every image load * Don't have to worry about passing the proper content header As for printing the HTML size of the image, if you pass width=300 to your script, simply create your print statement similar to: print img src='image.php?id=1' width='$width'; Though if image ID 1 is a LARGE image, then you'll still load the entire image, even though it's being resized to 300px wide. It's not overly bandwidth friendly if you have large images that are still being sent from your server (another reason that keeping local thumbnails are a good idea). Disk space is relatively cheap. Bandwidth is still more of a commodity. -Mike -Original Message- From: Sebastian [mailto:[EMAIL PROTECTED] Sent: Saturday, March 29, 2003 12:58 AM To: php list Subject: [PHP] possible? hello, I have some images in mysql, currently the images aren't resize, and this displays the image, like: image.php?id=1 But i'd like to resize the image with html tags: e.g. width=300 and print/echo it. since Content-type is for image is it even possible? If not then how about dynamically resizing them such as: image.php?id=1width=300 is that possible? If so, please let me know how. Thanks in advanced. cheers, Sebastian ?php $conn = mysql_connect(host, root, pass) OR DIE (mysql_error()); @mysql_select_db(images, $conn) OR DIE (mysql_error()); $sql = (SELECT * FROM images WHERE id = '$_GET[id]'); $result = mysql_query($sql, $conn); if (mysql_num_rows ($result ) 0) { $row = @mysql_fetch_array($result); $image_type = $row['type']; $image = $row[image]; header (Content-type: $image_type); print $image; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with imagerotate()
I'm having some problems with imagerotate() - e.g. it won't work at all. I've tried many different ways to get it to work, but I have yet to see it do anything at all. I'm using PHP 4.3.1 on XP. I know that GD is working properly because I can do other image-manipulation with it without error. Plus, I installed PHP manually, not with the Windows installer (which I've had problems getting GD to work properly on in the past). I've added the last attempt at getting the code to work. Note that the imagecopy() works fine and the new image displayed always ends up being an exact copy of the destination image. Any help would be greatly appreciated! if (($degrees == 90) || ($degrees == 180) || ($degrees == 270)){ foreach($image_check as $temp_file){ $src_img = imagecreatefromjpeg($inbox_dir\\$temp_file); $new_img = imagecreatetruecolor(imagesx($src_img),imagesy($src_img)); imagecopy($new_img,$src_img,0,0,0,0,imagesx($new_img),imagesy($new_img)); if (function_exists(imagerotate)){ if(imagerotate($new_img, $degrees, 0)){ print Image Rotated Successfullybr; } else { print Error Rotating Imagebr; } } imagejpeg($new_img, $inbox_dir\\new_image_path.jpg); imagedestroy($src_img); imagedestroy($new_img); *code left off that's not important - though there's no syntax/compile errors -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cookie or Session??
It really depends on what you want to do. Cookies are client-side information and thus you can run into issues where clients don't allow cookies, have cookie-blocking apps or have outdated software that doesn't support them (though the latter continues to become less of an option as time passes). Sessions are server-side information that allows you a lot more control of the information and allows better manipulation of it. PHP has really nice session management and makes using them quite painless. The only downside really is that it adds more load to your servers. If you have a machine that's not under insane load all the time, you might want to give sessions a try. Once everything's configged properly (which shouldn't be hard at all - and it might even be turned on already!), to get a user to log in, all you'll need to do is perform the DB password authentication and then pass the session information from script to script. Good luck. -Mike -Original Message- From: Awlad Hussain [mailto:[EMAIL PROTECTED] Sent: Friday, March 21, 2003 11:00 AM To: [EMAIL PROTECTED] Subject: [PHP] Cookie or Session?? Managing user login Whats the best option to use.. cookie?? or session?? Currently i am using cookies and sometime user complain they can't login, what would you suggest? -awlad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Imagerotate() Problems
I'm having some problems with imagerotate() - e.g. it won't work. I've tried many different ways to get it to work, but I have yet to see it do anything at all. I'm using PHP 4.3.1 on XP. I know that GD is working properly because I can do other image-manipulation with it without error. Plus, I installed PHP manually, not with the Windows installer (which I've had problems getting GD to work properly on in the past). I've added the last attempt at getting the code to work. Note that the imagecopy() works fine and the new image displayed always ends up being an exact copy of the destination image. Any help would be greatly appreciated! if (($degrees == 90) || ($degrees == 180) || ($degrees == 270)){ foreach($image_check as $temp_file){ $src_img = imagecreatefromjpeg($inbox_dir\\$temp_file); $new_img = imagecreatetruecolor(imagesx($src_img),imagesy($src_img)); imagecopy($new_img,$src_img,0,0,0,0,imagesx($new_img),imagesy($new_img)); if (function_exists(imagerotate)){ if(imagerotate($new_img, $degrees, 0)){ print Image Rotated Successfullybr; } else { print Error Rotating Imagebr; } } imagejpeg($new_img, $inbox_dir\\new_image_path.jpg); imagedestroy($src_img); imagedestroy($new_img); *code left off that's not important - though there's no syntax/compile errors -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Zero Fill - Number Format
This is what I did for a dynamic zero-fill for renaming batches of files: // Get Zero Padding For New Image Names $zero_padding = strlen(count($image_array)); foreach($image_array as $temp){ $n++; $n_length = strlen($n); for($i = 0; $i ($zero_padding - $n_length); $i++){ $n = 0 . $n; } $new_name = $image_inbox . / . $newName . - . $n . .jpg; rename($image_inbox/$temp, $new_name); } I'm not sure if this will be applicable to your situation, but it works perfectly for me since it will zero-fill for any length of numbers and pad the shorter numbers appropriately. -M -Original Message- From: Harry.de [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 6:09 PM To: [EMAIL PROTECTED] Subject: [PHP] Zero Fill - Number Format How can I put out a Zero Fill for numbers The result should be $something=26; echo $something; e.g. 026 I didn't found a solution with number format. Is there any other way? -- 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