[PHP] Confusion with the $_name $_type $_size Variable Extensions
I am having a lot of trouble with the $_name, $_size, and $_type variable extensions. I have a basic file upload system however it is within a function. Sometimes when I declare the aforementioned variables in a global statement such as global $file_name I can get a value for _name, other times, I get nothing. Can someone clarify this because I was unable to find anything in the manual? Cheers, Lakario ModDev.netGet more from the Web. FREE MSN Explorer download : http://explorer.msn.com
Re: [PHP] Confusion with the $_name $_type $_size Variable Extensions
I know it has nothing to do with filesize because I am the server and I set the configuration. But lemme show you some code, maybe that'll help. Here we go: (please no ripping) function MyFiles() { global $username, $Upload, $Rename, $Delete, $PHP_SELF, $File, $File_size, $File_name, $File_type, $page, $src; echo " My Files"; $Folder = "article_files"; if(isset($src)) { FileDetails($src); Close(); } if ($Upload) { $File_name = strtolower($File_name); $File_name = ereg_replace(" ","_","$File_name"); $File_name = ereg_replace("#","hash","$File_name"); $upfile = "../$Folder/$File_name"; if($File_name == "$PHP_SELF" or $File_name == "resize_image.php" or $File_name == "login.php" or $File_name == "logout.php" or $File_name == "latest.txt" or eregi("index",$File_name)) { echo "For security reasons, your file could not be uploaded.\n"; } elseif(copy($File,$upfile)) { if(is_uploaded_file($File_name)) { echo "Your file, $File_name, was successfully uploaded.\n"; FileDetails($File_name); $time = time(); $query = "insert into article_files values(null,'$username','$File_name','$File_size','$File_type','$time')"; mysql_query($query); } else { echo "Your file was not copied.\n"; } } //unlink ($File); Close(); } if($Delete) { for($i=0; $i"; if(unlink("$Delete[$i]")) { echo "Your file, $Delete[$i], was successfully deleted.\n"; } else { echo "Your file, $Delete[$i], could not be deleted.\n"; } } Close(); } if($Rename) { // Handle file renaming for($n = 0; $n < count($Rename); $n++) { $OldFilename = $Rename[$n]; $NewName[$OldFilename] = strtolower($NewName[$OldFilename]); $NewName[$OldFilename] = ereg_replace(" ","_","$NewName[$OldFilename]"); $NewName[$OldFilename] = ereg_replace("#","number","$NewName[$OldFilename]"); $Old = "$OldFilename"; $New = "$NewName[$OldFilename]"; echo ""; if(rename($Old, $New)) { echo "Your file, $Rename[$n], was successfully renamed to $NewName[$OldFilename].\n"; } elseif($New=="manage.php" or $New=="index.php" or $New=="index.html" or $New=="index.htm" or $New=="index.shtml" or $New=="index.shtm" or $New=="index.asp" or $New=="login.php" or $New=="logout.php" or $New=="files.php" or $New=="resize_image.php" or $New=="latest.txt") { echo "Your file, $Rename[$n], could not be renamed.\n"; } else { echo "Your file, $Rename[$n], could not be renamed.\n"; } } Close(); } echo "\n File NameFile SizeAddedDeleteRename (Enter new name in the box)Details\n"; $query = "select * from article_files where owner='$username' order by filename asc"; $result = mysql_query($query); while($row = mysql_fetch_array($result)) { $Size = $row[filesize]; $Size = $Size/1023; if($Size < 1023){ $Size = number_format($Size, 2); $Size = $Size." kb"; } else { $Size = $Size/1023; $Size = number_format($Size, 2); $Size = $Size." mb"; } $type = GetExtension($row[filename]); if($type == "jpg" or $type == "gif" or $type == "png" or $type == "txt" or $type == "sql") $details = "Details"; else $details = "N/A"; $Date = date("m/d/y", $row[filedate]); echo " $row[filename] $Size $Date $details "; } echo " "; echo ""; echo " Upload a file: \n } All that is included within a main program and when you send data out from this it gets looped back into itself with the global statements, that's the idea anyway. However, $File_name always turns up null, (as well as the other operators) which makes uploading not possible. - Original Message - From: SenthilVelavan Sent: Friday, June 14, 2002 10:49 PM To: Nathan Taylor; php-general Subject: Re: [PHP] Confusion with the $_name $_type $_size Variable Extensions -Lakario, Please have a look on http://www.php.net/manual/en/features.file-upload.php for more information on fileuploads in php.Also check with the size of the files you have transferred.When file size is large, then your files won't get uploaded.This is due to the low execution time,If you don't mind please send your programs to dig more. regards, SenthilVelavan.P - Original Message - From: "Nathan Taylor" <[EMAIL PROTECTED]> To: "php-general" <[EMAIL PROTECTED]> Sent: Saturday, June 15, 2002 6:46 AM Subject: [PHP] Confusion with the $_name $_type $_size Variable Extensions I am having a lot of trouble with the $_name, $_size, and $_type variable extensions. I have a basic file upload system however it is within a function. Sometimes when I declare the aforementioned variables in a global statement such as global $file_name I can get a value for _name, other times, I get nothing. Can someone clarify this because I was unable to find anything in the manual? Cheers, Lakario ModDev.netGet more from the Web. FREE MSN Explorer download : http://explorer.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpGet more from the Web. FREE MSN Explorer download : http://explorer.msn.com
Re: [PHP] Downside to using login sessions?
As a general rule it is always good to store data that is secure in a encrypted format. My website for example uses a mysql database and I store the encrypted mysql password in the cookie so I get somethign like 435gcg34tsskhj57 to equal 123. It's far more secure because cookies are on the user's computer and anything there is not secure, regardless of who the owner is. - Original Message - From: Leif K-Brooks Sent: Saturday, June 15, 2002 5:53 AM To: Justin French Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Downside to using login sessions? I'm currently storing the username and password directly in cookies (the password isn't even md5()'d). I'm just wondering if there's security risks/whatever in sessions. I've seen that most sites seem to store the login data directly in the cookie (with the password md5()'d). Is that because there's something wrong with sessions, or did they just not use them for no reason? Thanks. Justin French wrote: >How is it currently storing it? > >Sessions are fine, depending on how the code is written, and the obviouse >downside to COOKIE based sessions is that they will break on non-cookie >browsers, so a smarter move is to use URL based sessions. > >A more focused question will of course result in a more focused answer :) > >Justin French > > >on 15/06/02 6:59 PM, Leif K-Brooks ([EMAIL PROTECTED]) wrote: > > > >>I am planning to change how my site stores logins to using sessions. >>Are there any reasons not to do this? Reasons against it I should >>know? Thanks for your input. >> >> >> > > > >Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
Re: [PHP] PHP timeout
Hmm, I haven't heard of such a thing. That's kinda weird though because just yesterday I modified my timeout settings for my script that parses logfiles that are several thousand lines long, and it worked. Did you perhaps forget to reboot the server? If you have my suggestion is perhaps taking a look at FoxServ, it is a very good server that auto configures itself on your machine with apache and the whole lot. www.foxserv.net - Original Message - From: Kim Bauters Sent: Saturday, June 15, 2002 5:55 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP timeout I'm running PHP script that check for the existance of certain pages on the web. The problem is that fopen to check for the existance of a page and this seems to consume time. It has to check for a nuber of pages, conforming to a certain pattern. This pattern is Ab# What I want to do is extend the time a script is allowed to run (because I can only check 10 pages, then need to change the code for the next pages) but I don't seem to be able to do this. I'm using Windows 2000 and PHP is installed on my IIS server. In the file php.ini, the 2 timeout settings are both changed from 30 to 300, but I keep on getting an error like "CGI script Timeout". Can anyone help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpGet more from the Web. FREE MSN Explorer download : http://explorer.msn.com
Re: [PHP] saving a jpeg via HTTP
Perhaps you could try a cURL or some other FTP approach? - Original Message - From: Jeff Bearer Sent: Saturday, June 15, 2002 11:16 AM To: [EMAIL PROTECTED] Subject: [PHP] saving a jpeg via HTTP What is the best way using only PHP to grab a image file off a website a d save it locally? I know I can use wget and this would be a piece of cake, but in this case I don't want to rely on external programs. I'm trying to read it with fsockopen and writing it with fopen to the file but the file is no good when it's saved, I saw that it saved the http headers in there so I cut those out but still, the image wan't viewable. I was using fsockopen instead of file because I want to use the timeout feature of fsockopen. any help is appriciated. -- Jeff Bearer, RHCE Webmaster, PittsburghLIVE.com 2002 EPpy Award, Best Online U.S. Newspaper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpGet more from the Web. FREE MSN Explorer download : http://explorer.msn.com
Re: [PHP] Can't set a cookie?
The 3rd parameter is an optional time to expire parameter, if you don't want to set it, leave it out. setcookie(cookiename,"value"); works fine - Original Message - From: Lazor, Ed Sent: Saturday, June 15, 2002 11:48 AM To: php-general Subject: [PHP] Can't set a cookie? Hi Everyone, Any idea why I'm getting this error? Warning: setcookie() expects parameter 3 to be long, string given in *my script* on line 2 Here's the entire script generating the error: The script doesn't work on a new hosting service I subscribed to, but it works on two other servers - 1 linux and 1 windows, both with Apache 1.3.24. I'm looking for what version the hosting service is using... their support page says "PHP4 with Zend Optimizer". The other two servers are using PHP 4.1.1. Any ideas of what's going on? -Ed This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpGet more from the Web. FREE MSN Explorer download : http://explorer.msn.com
Re: [PHP] Parsing Text File
This is all really straight forward stuff. Here's some code that will get the file parsed to an array, what you do from there is up to you. Note: if you have a precise structure for your lines you can say to read from point a to b using substr(). For example, let's say the first name is exactly 3 characters in from 0 and exactly 10 characters long so you could do substr($line_array[0], 3, 10); This is a really dirty way to handle this and I'm sure there are better ways so poke around a bit. Also if you have your phone number located down to a specific location you can use an explode statement to get both area code and main number seperated. - Original Message - From: Jason D. Williard Sent: Saturday, June 15, 2002 1:28 PM To: [EMAIL PROTECTED] Subject: [PHP] Parsing Text File I am trying to input data from a text file into a MySQL database and would like to be able to input the data using a single script. What's the easiest way to parse a line, such as below, and turn it into variables to be placed in the database. While I can simply place the data in by importing from a file, it's not quite so easy. I only need to place some of the data in, plus I would like to split one of the fields. Below is an example of a line from the file, and then the variables that I need to enter. Here is an example of a line from the file: Number,City,State,Country,Provider,Isdn,56K,CreateDate,Active,Timezone,ModDa te,ModNote 403 -770 -4904 ,CALGARY,AB,CAN,T2,Y,Y,Apr 29 2002 12:00:00:000AM,I,GMT-0700,, As for variables, I need the following: Split Number into $AreaCode & $Number > 403 & 770-4904 $City $State $Country Thanks for any help. Jason D. Williard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpGet more from the Web. FREE MSN Explorer download : http://explorer.msn.com
Re: [PHP] How do I hide download link ...
- Original Message - From: "Fargo Lee" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 12, 2002 4:14 PM Subject: [PHP] How do I hide download link ... > Hi, my customers go through a password authentication to access a link on my > site to download a file. I want to prevent the distribution of the location > of this file on my server by making it hidden. Is there any php function(s) > that could assist in doing this? > > All I can think of so far is storing the original file in a hard to guess > directory, when a authenticated customer goes to download it, send them to a > script that copys the original file to a temp directory, they download the > file in the temp directory and then run a cron every so many minutes to > clear out the files in the temp directory. > > If anyone has any ideas, examples or a way to improve on what I came up with > please respond. Thanks! > > > > -- > 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 hide download link ...
I don't believe it is possible to hide the physical link but it is plausibly easy enough to write a script that randomly changes the file name and location. Here's some psuedo code to get you started: //Step 1: Locate the file $query = "select * from file_locations where file_name='secure.zip'"; $result = mysql_query($query); //Step 2: Move the file This code is up to you, I'd be curious to think what routine you think up if any. My suggestions include using a routine to not only change the file name but copy it to a different directory, which also has a non specific name. //Step 3: Update Location (don't want to lose the location) $query = "update file_locations set location=$newlocation where file_name='secure.zip'"; mysql_query($query) Best of Luck to you, Nathan Taylor ModDev.net - Original Message - From: "Fargo Lee" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 12, 2002 4:14 PM Subject: [PHP] How do I hide download link ... > Hi, my customers go through a password authentication to access a link on my > site to download a file. I want to prevent the distribution of the location > of this file on my server by making it hidden. Is there any php function(s) > that could assist in doing this? > > All I can think of so far is storing the original file in a hard to guess > directory, when a authenticated customer goes to download it, send them to a > script that copys the original file to a temp directory, they download the > file in the temp directory and then run a cron every so many minutes to > clear out the files in the temp directory. > > If anyone has any ideas, examples or a way to improve on what I came up with > please respond. Thanks! > > > > -- > 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] Don't send the reciept
Please do not click yes when it asks you to send the reciept on the email about hiding a download link, I hadn't realized the reciept function was on and it's really getting annoying. Cheers, Lakario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I hide download link ...
> if (!session_is_registered("SESSION")){ > print ("You must Log-In to access this page\n"); > print (""); > print ("Click here to Log In"); > } print (""); should be: print("Sign-in"); // or something like that But anyways, I don't think that's quite what he wanted. I think the idea is to protect the link to a file so only special users can see it. Sure this code with protect the page from being viewed, but, download.php or whatever, if it is protected it still points to a physical file. If a user for some reason desires to leak the actual link then there could be a problem. This is why he probably should change the physical file data. - Original Message - From: "Bret L Conard" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 18, 2002 6:22 AM Subject: Re: [PHP] How do I hide download link ... > Start a session on the sign in page, and check for the session before > displaying the page with the link. The it does not matter if the link page > URL is distributed. In my situation; > 1. Sign in page goes to a validation script. > 2. Check for form fields. (1st of Nested loops) > if (isset($formField)){//check for form. > 3. If form, validate user and start session > $result = mysql_query("SELECT * FROM ok_users WHERE password = > $password AND user_ID = $user_ID"); > if (mysql_num_rows($result) < 1){// No user so exit > if (mysql_num_rows($result) > 1){// Too many users (bad data) so > exit > else{ //valid user > session_start(); >// register the variables you need or want > session_register("SESSION");. > 4. redirect to page with download >header ("Location: download.php"); > must be in the session start snippet or get too many headers errors > / > }//end start session code > }//end check for multiple match > }//end check for form (and other actions) > else{//if no form. > print ("You must login to access this page"); > } > 5. On download page check for session. > session_start(); > // *** session check*/ > if (!session_is_registered("SESSION")){ > print ("You must Log-In to access this page\n"); > print (""); > print ("Click here to Log In"); > } > else{ > body of page > } > > Now if you access the download page directly, you only get a link to sign > in... > > Does this help? > Bret > > > - Original Message - > From: "Fargo Lee" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, June 12, 2002 4:14 PM > Subject: [PHP] How do I hide download link ... > > > > Hi, my customers go through a password authentication to access a link on > my > > site to download a file. I want to prevent the distribution of the > location > > of this file on my server by making it hidden. Is there any php > function(s) > > that could assist in doing this? > > > > All I can think of so far is storing the original file in a hard to guess > > directory, when a authenticated customer goes to download it, send them to > a > > script that copys the original file to a temp directory, they download the > > file in the temp directory and then run a cron every so many minutes to > > clear out the files in the temp directory. > > > > If anyone has any ideas, examples or a way to improve on what I came up > with > > please respond. Thanks! > > > > > > > > -- > > 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] How do I hide download link ...
Open your browser, right click and hit properties on any page. - Original Message - From: "Brian McGarvie" <[EMAIL PROTECTED]> To: "Nathan Taylor" <[EMAIL PROTECTED]>; "Bret L Conard" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, June 18, 2002 6:46 AM Subject: RE: [PHP] How do I hide download link ... if you want to hide it fromthe browser you cound do: click here or you could over write the status text: click here or a combination... Also note... this has/had nowt to do with _PHP_ :) > -Original Message- > From: Nathan Taylor [mailto:[EMAIL PROTECTED]] > Sent: 18 June 2002 11:33 AM > To: Bret L Conard; [EMAIL PROTECTED] > Subject: Re: [PHP] How do I hide download link ... > > > > if (!session_is_registered("SESSION")){ > > print ("You must Log-In to access this page\n"); > > print (""); > > print ("Click here to Log In"); > > } > > print (""); > > should be: > > print("Sign-in"); // or something > like that > > > But anyways, I don't think that's quite what he wanted. I > think the idea is > to protect the link to a file so only special users can see > it. Sure this > code with protect the page from being viewed, but, > download.php or whatever, > if it is protected it still points to a physical file. If a > user for some > reason desires to leak the actual link then there could be a > problem. This > is why he probably should change the physical file data. > > - Original Message - > From: "Bret L Conard" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, June 18, 2002 6:22 AM > Subject: Re: [PHP] How do I hide download link ... > > > > Start a session on the sign in page, and check for the > session before > > displaying the page with the link. The it does not matter > if the link page > > URL is distributed. In my situation; > > 1. Sign in page goes to a validation script. > > 2. Check for form fields. (1st of Nested loops) > > if (isset($formField)){//check for form. > > 3. If form, validate user and start session > > $result = mysql_query("SELECT * FROM ok_users WHERE > password = > > $password AND user_ID = $user_ID"); > > if (mysql_num_rows($result) < 1){// No user so exit > > if (mysql_num_rows($result) > 1){// Too many users > (bad data) so > > exit > > else{ //valid user > > session_start(); > >// register the variables you need or want > > session_register("SESSION");. > > 4. redirect to page with download > >header ("Location: download.php"); > > must be in the session start snippet or get too many > headers errors > > / > > }//end start session code > > }//end check for multiple match > > }//end check for form (and other actions) > > else{//if no form. > > print ("You must login to access this page"); > > } > > 5. On download page check for session. > > > session_start(); > > // *** session check*/ > > if (!session_is_registered("SESSION")){ > > print ("You must Log-In to access this page\n"); > > print (""); > > print ("Click here to Log In"); > > } > > else{ > > body of page > > } > > > > Now if you access the download page directly, you only get > a link to sign > > in... > > > > Does this help? > > Bret > > > > > > - Original Message - > > From: "Fargo Lee" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Wednesday, June 12, 2002 4:14 PM > > Subject: [PHP] How do I hide download link ... > > > > > > > Hi, my customers go through a password authentication to > access a link > on > > my > > > site to download a file. I want to prevent the distribution of the > > location > > > of this file on my server by making it hidden. Is there any php > > function(s) > > > that could assist in doing this? > > > > > > All I can think of so far is storing the original file in > a hard to > guess > > > directory, when a authenticated customer goes to download > it, send them > to > > a > > > script that copys the original file to a temp directory, > they do
[PHP] Procedural Code Issue
Hey Guys, I am developing code that uses GD to create and store an image but it is giving me trouble with GetImageSize, maybe you guys can offer some ideas. Here's my code: echo "\n"; $img_data = GetImageSize($imgpath.$imgname_full); The first line creates and stores the image while the second line calls file information on it. Procedurally, the image exists at the point which GetImageSize is called, however, GetImageSize returns a false result on the pointer when it looks for the file. All the paths are fine but there is something going cock-eyed during the execution. Can anyone offer ideas? I have already tried both declaring an absolute path and checking the variables arlready. Thanks, Nathan Taylor
[PHP] Possible Bug With $_FILES Global
Hey Guys, I discovered a possible bug with the $_FILES super global and thought I'd pass it along to you guys to double check the accuracy of this being a bug before I reported it to the PHP team. So here goes.. The default format for $_FILES is $_FILES['variable']['element'] which of course works fine, following this format I would assume that the format for a variable inside an array would be $_FILES['array']['variable']['element'] but on the contrary it is in fact $_FILES['array']['element']['variable']. Somehow this doesn't seem quite right to me. Granted, it still works just as well but it sort of breaks the traditional naming structure for an array and really jumbles the logical flow of things. Do you think this is worth reporting? Regards, Nathan Taylor
Re: [PHP] dir size
Hey, I think I mis-understood you and my first version didn't do what you want, so I added what you needed. 0) { $open2 = opendir($directory); while($folders = readdir($open2)) { $folder = $directory."/".$folders; if($folders == ".." || $folders == ".") continue; if(is_dir($folder)) { echo DirStat($folder); } } closedir($open2); } closedir($open); } } function ByteSize($bytes) { $size = $bytes / 1024; if($size < 1024){ $size = number_format($size, 2); $size .= "kb"; } else { if($size / 1024 < 1024) { $size = number_format($size / 1024, 2); $size .= "mb"; } else { $size = number_format($size / 1024 / 1024, 2); $size .= "gb"; } } return $size; } $dir = getcwd(); DirStat("tmp", 0); chdir($dir); $FolderSize = ByteParse($FolderSize); echo $FileCount; echo "\n"; echo $FolderSize; ?> The DirStat() function is almost unchanged except that it now passes out the byte size of the directories read. I also threw in a chdir() to get you back to your working directory. The major addition here is the ByteSize() function. That function takes the integer which is your total size of the directory and converts it into a nice formatted number either in kb, mb, or gb accordingly. You'll find it uses true file size as well, not "industry standard" sizing. Enjoy, Nathan Taylor - Original Message - From: Ms Carlsson To: [EMAIL PROTECTED] Sent: Friday, October 03, 2003 2:44 PM Subject: [PHP] dir size is it possible to count a size of a dir and all sub dirs in php ? and if, how? thanx _ Lättare att hitta drömresan med MSN Resor http://www.msn.se/resor/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hotscripts style program
Are you looking to make a new HotScripts style website or just a similar menu system? - Original Message - From: Ryan A To: [EMAIL PROTECTED] Sent: Saturday, October 04, 2003 9:28 AM Subject: [PHP] hotscripts style program Hey, Anybody have any code or links to explain how to make a program like the one running on hotscripts? eg: when you visit there you have a couple of categories like : ASP, JAVA, PHP etc (if you select php) PHP --Scripts --Books --tutorials (if you select scripts) --Scripts category1(324) category2(24) category3(54) etc the number in brackets at the side of the category says how many records I downloaded PHPlinks but have been unable to understand it. Another good place that i visited was http://www.hotscripts.com/PHP/Scripts_and_Programs/Software_Repository/index.html and even searched on google but cant find much. Any help appreciated. Thanks, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] .htaccess - Still asking for login information although already sent through address bar
Does it continuously ask or just twice? I've found a weird issue with .htaccess where if the domain name is a mask for a subdomain host and you try to access an .htaccess protected page it will prompt you for the password, redirect you to the subdomain and then prompt you again. Nathan - Original Message - From: Mika Tuupola To: PHP Webmaster Cc: [EMAIL PROTECTED] Sent: Monday, October 06, 2003 7:12 AM Subject: Re: [PHP] .htaccess - Still asking for login information although already sent through address bar On Mon, 6 Oct 2003, PHP Webmaster wrote: > Iv'e got a .htaccess file protecting a site using HTTPS. I have tried using > a form to send the login details to the site through the address bar > (http://user:[EMAIL PROTECTED]) but the .htaccess password protection box That does not look like https. Try changing to https://user:[EMAIL PROTECTED]/ -- Mika Tuupola http://www.appelsiini.net/~tuupola/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Congratulations You Win
WTF is this? - Original Message - From: Francis Weeny To: [EMAIL PROTECTED] Sent: Wednesday, October 08, 2003 10:30 PM Subject: [PHP] Congratulations You Win SUNSWEETWIN PROMO LOTTERY,THE NETHERLANDS. ALFONSTRAAT B56, 1002 BS AMSTERDAM, THE NETHERLANDS. TO THE MANAGER FROM: THE DESK OF THE PROMOTIONS MANAGER, INTERNATIONAL PROMOTIONS/PRIZE AWARD DEPARTMENT, REF: OYL /26510460037/02 BATCH: 24/00319/IPD ATTENTION: RE/ AWARD NOTIFICATION; FINAL NOTICE We are pleased to inform you of the announcement today, 7th October2003 of winners of the SUNSWEETWIN PROMO LOTTERY,THE NETHERLANDS/ INTERNATIONAL, PROGRAMS held on 28th August 2003 Your company,is attached to ticket number 023-0148-790-459, with serial number 5073-11 drew the lucky numbers 43-11-44-37-10-43, and consequently won the lottery in the 3rd category. You have therefore been approved for a lump sum pay out of US$5,500.000.00 in cash credited to file REF NO. OYL/25041238013/02. This is from total prize money of US$80,400,000.00 shared among the seventeen international winners in this category. All participants were selected through a computer ballot system drawn form 25,000 names from Australia, New Zealand, America, Europe, North America and Asia as part of International Promotions Program, which is conducted annually. CONGRATULATIONS! Your fund is now deposited with a Security company insured in your name. Due to the mix up of some numbers and names, we ask that you keep this award strictly from public notice until your claim has been processed and your money remitted to your account. This is part of our security protocol to avoid double claiming or unscrupulous acts by participants of this program. We hope with a part of you prize, you will participate in our end of year high stakes US$1.3 billion International Lottery. To begin your claim, please contact your claim agent; Mr Francis weeny at this email address below. [EMAIL PROTECTED] For due processing and remittance of your prize money to a designated account of your choice. Remember, all prize money must be claimed not later than 17th October 2003. After this date, all funds will be returned as unclaimed. NOTE: In order to avoid unnecessary delays and complications, please remember to quote your reference and batch numbers in every one of your orrespondences with your agent. Furthermore, should there be any change of your address, do inform your claims agent as soon as possible. Congratulations again from all our staff and thank you for being part of our promotions program. Sincerely, Clark Wood THE PROMOTIONS MANAGER, SUNSWEETWIN PROMO LOTTERY,THE NETHERLANDS. NB. Any breach of confidentiality on the part of the winners will result to disqualification. SORRY FOR THE LATE INFORMATION THANKS CLARK WOOD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Credit Card Validation
Hey guys (and gals), I am sure this has been asked many times before, but I couldn't seem to find a recent PHP4-based thread in the logs at phpbuilder.com; so either I'm incompetent or it doesn't exist. My question is pretty obvious, I was wondering what the process for validating a credit cards with both preprocessing by the form to determine the pattern validity and post processing by a bank to confirm the actual card validity. Your help would be greatly appreciated. Best Wishes, Nathan Taylor
Re: [PHP] Credit Card Validation
The fact is I just pulled up google and typed in PHP-General Archives and clicked the first thing I came up with. Thanks for the link though. - Original Message - From: Becoming Digital To: php-general Sent: Wednesday, October 08, 2003 4:10 PM Subject: Re: [PHP] Credit Card Validation There are a few classes in the Repository. Check the link below. http://phpclasses.promoxy.com/browse.html/class/19.html Not to discount PHP Builder, but I generally find less useful info there than I do at DevShed.com, DevArticles.com, etc. The structure of the site certainly doesn't make the process any easier. Edward Dudlik Becoming Digital www.becomingdigital.com - Original Message - From: "Nathan Taylor" <[EMAIL PROTECTED]> To: "php-general" <[EMAIL PROTECTED]> Sent: Wednesday, 08 October, 2003 16:03 Subject: [PHP] Credit Card Validation Hey guys (and gals), I am sure this has been asked many times before, but I couldn't seem to find a recent PHP4-based thread in the logs at phpbuilder.com; so either I'm incompetent or it doesn't exist. My question is pretty obvious, I was wondering what the process for validating a credit cards with both preprocessing by the form to determine the pattern validity and post processing by a bank to confirm the actual card validity. Your help would be greatly appreciated. Best Wishes, Nathan Taylor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Credit Card Validation
I'll take a look through that and do as much further research as is possible. Thanks. - Original Message - From: Craig Lonsbury To: Nathan Taylor ; php-general Sent: Wednesday, October 08, 2003 4:04 PM Subject: RE: [PHP] Credit Card Validation this is a good explanation of the validation you can do. http://www.beachnet.com/~hstiles/cardtype.html if you are trying to validate client-side you'll need javascript, which is why there may not be anything on phpbuilder i have no idea about the bank side, but post any info you find out back here, it is coming up soon for me =) hth, Craig -Original Message- From: Nathan Taylor [mailto:[EMAIL PROTECTED] Sent: October 8, 2003 2:04 PM To: php-general Subject: [PHP] Credit Card Validation Hey guys (and gals), I am sure this has been asked many times before, but I couldn't seem to find a recent PHP4-based thread in the logs at phpbuilder.com; so either I'm incompetent or it doesn't exist. My question is pretty obvious, I was wondering what the process for validating a credit cards with both preprocessing by the form to determine the pattern validity and post processing by a bank to confirm the actual card validity. Your help would be greatly appreciated. Best Wishes, Nathan Taylor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] function to show time passed since event
Sure, this isn't tough at all as long as you keep track of your times. When the user logs in store the time() in a cookie or database. Then to check the time since do this \n"; echo "Then: ".date("m/d/y g:ia", $timesince)."\n"; ?> That should be right, I think... - Original Message - From: Chris W. Parker To: [EMAIL PROTECTED] Sent: Wednesday, October 08, 2003 7:34 PM Subject: [PHP] function to show time passed since event Hiya. Tried searching google with no luck on this one. I'd like a function that when passed a time will spit back in plain english how much time has passed. i.e. You logged in "one hour ago". Anyone got da hookup? Thanks, Chris. p.s. Now with signature! -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need Charting Utility
Look into JpGraph, it rocks my world. http://www.aditus.nu/jpgraph/ Nathan - Original Message - From: rick rice To: [EMAIL PROTECTED] Sent: Thursday, October 09, 2003 2:30 PM Subject: [PHP] Need Charting Utility Can anyone suggest a good charting utility for PHP running on a freeBSD box? We need to put line/bar charts on our web pages. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $PHP_SELF
$PHP_SELF is a variable that is a variable that has limited scope and as a rule of thumb should never be used. It is a very sloppy way to code. I advise you stick to $_SERVER['PHP_SELF']. - Original Message - From: Boris Sagadin To: [EMAIL PROTECTED] Sent: Monday, October 20, 2003 7:23 AM Subject: [PHP] $PHP_SELF I'm having problems with $PHP_SELF variable. Mostly it works, other times (about 10% of tries) it's just empty. Is this a known issue with Apache 2? If I use $_SERVER['PHP_SELF'], it always works fine, but still I'd like to know if this is a common bug or there's something wrong with my configuration. I'm using PHP 4.3.3 with Apache 2.0.43, Linux 2.4.21-grsec, register_globals is on Thanks, Boris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need help designing a job search agent
Are you looking for something that job listings are added to by companies or something that crawls the web for listings? Nathan
[PHP] Archives
Hey guys, Just a quickie: where are the archives for this list? What URL? Thanks, Nathan Taylor
Re: [PHP] Archives
Thanks John and and Chris. - Original Message - From: John Nichel To: [EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 2:26 PM Subject: Re: [PHP] Archives Nathan Taylor wrote: > Hey guys, > > Just a quickie: where are the archives for this list? What URL? > > Thanks, > Nathan Taylor Here... http://marc.theaimsgroup.com/?l=php-general&r=1&w=2 or here... http://news.php.net/group.php?group=php.general -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code optimization: single vs. double quotes?
I am a recent fan of the single-quotes. I used to use double only but when some gurus told me the disadvantages I converted my entire project over to single quotes. Single quotes are ideal because as far coding goes it greatly decreases the time of development when you don't have to worry about dropping in the escape character on your HTML values, etc. Granted, single quotes can be a nuisance in some instances (like when you need a new line character) but of course there is a way around. I simply define a constant and call that at the end of every line in order to substitute for the new line character. Horizontal Tab - define("T", chr(9)); New Line - define("NL", chr(10)); Cheers, Nathan - Original Message - From: Robert Cummings To: Shawn McKenzie Cc: PHP-General Sent: Thursday, October 23, 2003 10:30 PM Subject: Re: [PHP] Code optimization: single vs. double quotes? On Thu, 2003-10-23 at 20:43, Shawn McKenzie wrote: > I came across this post and was hoping to get a gurus opinion on the > validity. TIA > > -Shawn > > I remember reading somewhere re: PHP coding that it is a better coding > practice to use single quotes as much as possible vs. using double quotes in > scripts. When using double quotes, you are forcing PHP to look for variables > within them, even though there may not be any, thus slowing execution > time... > > For example it is better to code: > Code: > echo ' '; > > vs. > Code: > echo " "; Better is a very subjective question; however, style 1 will run faster since it won't look for variable interpolation. Personally I always use style 1 unless I specifically need variable interpolation or one of the special characters such as a newline. Also when doing HTML the double quotes fit nicely in the the single quote paradigm. On the other hand when I do SQL queries, I often allow interpolation just because it is more readable and because I usually use single quotes to wrap strings in my queries. HTH, Rob. -- .. | 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
Re: [PHP] HTTP request contents
Perhaps $_SERVER['REQUEST_URI'] in combination with $_SERVER['QUERY_STRING'] ? Nathan - Original Message - From: Hanuska Ivo To: [EMAIL PROTECTED] Sent: Friday, October 24, 2003 6:10 AM Subject: [PHP] HTTP request contents Hi everyone, I need to know, if there is a possibility to read full contents of HTTP request. I know, the response can be sent by header() function. But can I get the request of the client for server? Thank you, Ivo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] w3c-compliant form-action parameters
This problem should be handled by modifying the php.ini. In my experience W3C is a whiney bitch that always gets it's way. Just throw this code on all your pages (or better yet, in a header) and the problem will go away. // The communists at W3C don't like the ampersand, so let's make sure it isn't used. ini_set('arg_separator.output', '&'); Cheers, Nathan Taylor - Original Message - From: Burhan Khalid To: [EMAIL PROTECTED] ; [EMAIL PROTECTED] Sent: Friday, October 24, 2003 3:43 PM Subject: Re: [PHP] w3c-compliant form-action parameters Chris Shiflett wrote: > --- Timo Boettcher <[EMAIL PROTECTED]> wrote: > >>I am trying to get my pages through the w3c-validator for html. >>It doesn't like my >> >>Changing & to & got my page through the validator, but broke >>my app, which seems not to be getting any parameters over URL >>anymore. > > > I find that *very* hard to believe. I'm not aware of any browser that > mishandles HTML entities. Basically, when you say this: > > action="/mypage.php?para1=val1¶2=val2" > > Your browser's HTTP request line will appear as: > > /mypage.php?para1=val1¶2=val2 > > So, by the time PHP sees it, everything is the same either way. My guess is > that you have some other problem. I agree with Chris. This is not a browser problem. However, there is a php.ini setting that will allow you to set the separator for get requests, but I suggest you investigate this problem further. -- Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Handling Notices
Hey guys, I was checking over one of my sites the other day trying to weed out the elusive notices that E_ALL turned up and I got some notices that I'm not too sure how to handle. I know how to handle most of these errors however the ones that are snagging me up are the "Notice: Undefined index: _blah_ in _blah_." Most of these are array indices in super globals such a $_GET, $_SESSION, etc. How can I get rid of these little buggers? Thanks, Nathan Taylor
Re: [PHP] Re: IRC
Sure Jon, pimp Daeken's channel... BinaryPHP is not what he needs Nathan - Original Message - From: Jon Kriek To: [EMAIL PROTECTED] Sent: Friday, October 31, 2003 4:11 PM Subject: [PHP] Re: IRC server: irc.freenode.netchannels: #phpfreaks, #php, #binaryphp-- Jon Kriekhttp://phpfreaks.com"Jonathan Villa" <[EMAIL PROTECTED]> wrote in messagenews:[EMAIL PROTECTED]...> Are there any PHP IRC that anyone is aware of?-- PHP General Mailing List (http://www.php.net/)To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Applications and C++?
They tend to use dlls and the sort, but that question is rather inappropriate for this list... - Original Message - From: John Ryan To: [EMAIL PROTECTED] Sent: Saturday, November 01, 2003 12:33 PM Subject: [PHP] Web Applications and C++? I assume sites like Amazon and Ebay does not use PHP to generate its pages. Does it use CGI and C++?? If so, does that mean a C++ program is run each time I request a page. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] recursive acronym - PHP
Why must the powers that be create such mind-bendingly painful terms such as these? They are the sort of things that send my brain into an infinite loop. Nathan - Original Message - From: Joachim Krebs To: [EMAIL PROTECTED] Sent: Saturday, November 01, 2003 3:23 PM Subject: Re: [PHP] recursive acronym - PHP Or LAME for "Lame Ain't an MP3 Encoder" Larry E . Ullman wrote: >> Why PHP is a recursive acronym?, I know that before was called >> Personal Home Page, I now is Hypertext PreProcessor, but why is >> recursive?, I person told me that it could be wroten as Pre Hypertxt >> Processor, thanks. > > > PHP stands for "PHP: Hypertext Preprocessor". It's called a recursive > acronym because it uses itself in its definition. Another example: GNU, > for "GNU's Not Unix". > > Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] recursive acronym - PHP
Why must the powers that be create such mind-bendingly painful terms such as these? They are the sort of things that send my brain into an infinite loop. Nathan - Original Message - From: Joachim Krebs To: [EMAIL PROTECTED] Sent: Saturday, November 01, 2003 3:23 PM Subject: Re: [PHP] recursive acronym - PHP Or LAME for "Lame Ain't an MP3 Encoder" Larry E . Ullman wrote: >> Why PHP is a recursive acronym?, I know that before was called >> Personal Home Page, I now is Hypertext PreProcessor, but why is >> recursive?, I person told me that it could be wroten as Pre Hypertxt >> Processor, thanks. > > > PHP stands for "PHP: Hypertext Preprocessor". It's called a recursive > acronym because it uses itself in its definition. Another example: GNU, > for "GNU's Not Unix". > > Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text input truncated
Your html is very sloppy actually. Use: $xyz = 'Hello World'; echo ''; - Original Message - From: Daniel Clark To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, November 04, 2003 6:49 PM Subject: Re: [PHP] text input truncated > $xyz = "Hello World"; > > echo ""; > > ?> > > The text box shows up with "Hello" NOT "Hello World". How do I get the > entire variable? I would try single quotes here. $xyz = 'Hello World'; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Beveled text
Well, I'm speaking from imagination here but I imagine the effect could be obtained by creating a series of layers to one item in a loop, changing the alpha transparency slightly each time as well as shrinking the size of the image. You'd start with 75ish alpha level and then loop through one level at a time up a to 100 or something like that, shrinking the text gradually and building off the same center each time. Try it and tell me what happens, I am curious. Cheers, Nathan - Original Message - From: Siddhartha Lahiri To: [EMAIL PROTECTED] Sent: Saturday, November 08, 2003 8:45 AM Subject: [PHP] Beveled text Hi, is it possible to create a beveled text using GD. Going through all the classes I have not come across any algorithm which explains beveled text. Siddhartha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pausing in PHP
sleep() should do what you need. www.php.net/sleep Regards, Nathan - Original Message - From: Donpro To: php list Sent: Monday, November 10, 2003 12:49 PM Subject: [PHP] Pausing in PHP Hi, Is there a PHP function that would allow the script execution to pause 'N' seconds? This is analogous to the dBase inkey() function. Thanks, Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Who controls PHP?
Hello, Zend in no way dictates PHP, they are simply a major player in it's development and are just as important as the PHP community. Zend develops much of the core extensions for PHP but at the same time, they do not own or even run. Nathan - Original Message - From: John Smith To: [EMAIL PROTECTED] Sent: Saturday, November 15, 2003 11:59 AM Subject: [PHP] Who controls PHP? Hi, Please, can someone shed a little light on this subject: who controls PHP? How much Zend has the power to say what goes into PHP and what not? How much does the "community" actually have power? For example, there are practical reasons why one should be concerned about this: PHP doesn't have an opcode compiler/loader built in. I find this quite frustrating to have to use some additional software to do that, which for example Java and Python has built-in. Please, tell me that Zend is not the dictator here. John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include an encoder into PHP distribution?
Well that's all good and grand but why increase the size of the distribution when it's not necessary to? Nobody wants to download something they don't necessarily need included. Nathan - Original Message - From: John Smith To: [EMAIL PROTECTED] Sent: Saturday, November 15, 2003 12:24 PM Subject: Re: [PHP] Include an encoder into PHP distribution? Ok then, that's nice to hear. How about then the idea of including a reasonably good compiler/encoder into standard PHP distribution? For example Turck MMcache is one, gpl'd and comes as a php/zend extension. I don't think there are other free encoders as this, so there wouldn't even be a dispute over which to choose? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] .html extension PHP page be interpret
That's simple, just modify your Apache httpd.conf on the line where it says something along the lines of: AddType application/x-httpd-php .php4 .php .php3 .inc change it to: AddType application/x-httpd-php .php4 .php .html .php3 .inc - Original Message - From: BennyYim To: [EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 5:46 AM Subject: [PHP] .html extension PHP page be interpret I using WinXP + Apache 1.3.24 + PHP 4.3.3 My apache default will interpret .php extension file. (e.g. index.php) If I have a PHP page, but I want to use .html file extension (e.g. index.html). what I need to set to make those html extension page be interpret by server. I want those .html extension PHP page be interpret. Thank You ! .---. | Message Posted by NewsgroupXplorer| | http://www.newsgroupxplorer.com | | | | Your newsreader in your browser. | `---' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Prefilled forms
This shouldn't have anything to do with your server config, but rather the forms themselves. What method are you sending the form(s) with? Nathan - Original Message - From: b b To: Jay Blanchard ; [EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 4:24 PM Subject: RE: [PHP] Prefilled forms The Problem again: I have a form, I fill it, click submit and then hit back. Usually in other sites I see the data that I attempted to submit. Forms originating from my site are coming up blank. In respnonse to your reply: I am using mozilla 5 or netscape 7. Same result in both. However, this doesn't happen with other sites using the same borwser ... Actually this never happened with my last configuration. ONly now that I reinstalled apache/php and actually linux that I am getting this behaviour from my own server only. I am suspecting a php.ini setting that I have set or set off or an apache conf detail that is causing this. Bowser setting is a possibility but why then is it not behaving this way with other sites? --- Jay Blanchard <[EMAIL PROTECTED]> wrote: > [snip] > I don't think you understood my question. Off > course > you have to store data in a database or a session > var > if you want to retrieve them later on. > > My problem is not there. I hava a form, I click > submit and right after that I hit back. Usually in > most cases the form will be prefilled with what I > entered. In my case I am getting a totally blank > form. > This is only hapenning with forms from my server. > [/snip] > > This AFAIK is the expected behaviour. Once you have > submitted the form > all of the input values will be blank when you > return to the form unless > you do something to specifically reload the > variables into the form. > YMMV from OS to OS, browser to browser. There is > only one realiable way > to do it cross-platform and these were mentioned > above. You never > mentioned your server config, your browser, your OS, > so I am only making > a S.W.A.G. at it. There is nothing IIRC that you can > configure in the > php.ini, httpd.conf, or other configuration file. > You may have a browser > setting that affects this, but since we know not > your browser type it > would be hard to help you locate that. __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form with browse for file to upload "ftp"
There is nothing special to be done with the form itself for it to support file uploading aside from supply a browse field: As for uploading it, here's some untested code: if(!empty($_FILES['file']['tmp_name'])) { $name = strtolower(eregi_replace('#| |\?|!', '', $_FILES['file']['name'])); $destination = 'path/to/where/you/want/the/file/saved/'.$name; if(move_uploaded_file($_FILES['file']['tmp_name'], $destination)) { echo 'Successful'; } else { echo 'Failed'; } } - Original Message - From: PAUL FERRIE To: [EMAIL PROTECTED] Sent: Saturday, November 22, 2003 2:04 PM Subject: [PHP] Form with browse for file to upload "ftp" Getting bit of a regular on here :) I am hoping that someone can point me to a script that allows me to attach a file to be uploaded to a set dir. I have already got the form built, except for a browse file option. The form is part of this admin area http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html Instead of having a textfield displaying a url of the image and the admin having to upload it sepratly i thought that i could get the admin to upload the image via the form. keeps it altogether. I wouldnt know were to begin adding this to the form. i am pretty sure there a pre-built script that can do this. Can someone point me to one. i had a quick look but came up with very little. Cheers Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form with browse for file to upload "ftp"
There is nothing special to be done with the form itself for it to support file uploading aside from supply a browse field: As for uploading it, here's some untested code: if(!empty($_FILES['file']['tmp_name'])) { $name = strtolower(eregi_replace('#| |\?|!', '', $_FILES['file']['name'])); $destination = 'path/to/where/you/want/the/file/saved/'.$name; if(move_uploaded_file($_FILES['file']['tmp_name'], $destination)) { echo 'Successful'; } else { echo 'Failed'; } } - Original Message - From: PAUL FERRIE To: [EMAIL PROTECTED] Sent: Saturday, November 22, 2003 2:04 PM Subject: [PHP] Form with browse for file to upload "ftp" Getting bit of a regular on here :) I am hoping that someone can point me to a script that allows me to attach a file to be uploaded to a set dir. I have already got the form built, except for a browse file option. The form is part of this admin area http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html Instead of having a textfield displaying a url of the image and the admin having to upload it sepratly i thought that i could get the admin to upload the image via the form. keeps it altogether. I wouldnt know were to begin adding this to the form. i am pretty sure there a pre-built script that can do this. Can someone point me to one. i had a quick look but came up with very little. Cheers Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form with browse for file to upload "ftp"
Oh and also, don't forget to set: enctype="multipart/form-data" in the tag. Nathan - Original Message - From: Nathan Taylor To: PAUL FERRIE ; [EMAIL PROTECTED] Sent: Saturday, November 22, 2003 2:20 PM Subject: Re: [PHP] Form with browse for file to upload "ftp" There is nothing special to be done with the form itself for it to support file uploading aside from supply a browse field: As for uploading it, here's some untested code: if(!empty($_FILES['file']['tmp_name'])) { $name = strtolower(eregi_replace('#| |\?|!', '', $_FILES['file']['name'])); $destination = 'path/to/where/you/want/the/file/saved/'.$name; if(move_uploaded_file($_FILES['file']['tmp_name'], $destination)) { echo 'Successful'; } else { echo 'Failed'; } } - Original Message - From: PAUL FERRIE To: [EMAIL PROTECTED] Sent: Saturday, November 22, 2003 2:04 PM Subject: [PHP] Form with browse for file to upload "ftp" Getting bit of a regular on here :) I am hoping that someone can point me to a script that allows me to attach a file to be uploaded to a set dir. I have already got the form built, except for a browse file option. The form is part of this admin area http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html Instead of having a textfield displaying a url of the image and the admin having to upload it sepratly i thought that i could get the admin to upload the image via the form. keeps it altogether. I wouldnt know were to begin adding this to the form. i am pretty sure there a pre-built script that can do this. Can someone point me to one. i had a quick look but came up with very little. Cheers Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Form with browse for file to upload "ftp"
Glad to be of service. =) - Original Message - From: PAUL FERRIE To: [EMAIL PROTECTED] Sent: Saturday, November 22, 2003 3:52 PM Subject: [PHP] Re: Form with browse for file to upload "ftp" Got it working :) thanks for the help Paul "Paul Ferrie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Getting bit of a regular on here :) > > I am hoping that someone can point me to a script that allows me to attach a > file to be uploaded to a set dir. > I have already got the form built, except for a browse file option. > The form is part of this admin area > http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html > Instead of having a textfield displaying a url of the image and the admin > having to upload it sepratly i thought that i could get the admin to upload > the image via the form. keeps it altogether. > > I wouldnt know were to begin adding this to the form. i am pretty sure > there a pre-built script that can do this. Can someone point me to one. i > had a quick look but came up with very little. > > Cheers > Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML email enconding
There is a nice function called sendmail available in the comments on php.net/mail. I use that regularly as it inserts all the necessary headers and supports multiple attachments. It's well worth considering... Nathan - Original Message - From: Eugene Lee To: [EMAIL PROTECTED] Sent: Monday, November 24, 2003 5:19 AM Subject: Re: [PHP] HTML email enconding On Mon, Nov 24, 2003 at 03:33:57PM +0530, Binay wrote: : : So does it mean that if i don't encode the message then no need of : specifying the Content-Transfer-Encoding?? : And almost all mail client will interpret it correctly?? No. If your HTML message is guaranteed to be in the ISO-8859-1 range (e.g. only Latin-based languages), then you could likely get away with just these two headers. But you still need to specify both of them. : > Content-Type: text/html; charset="ISO-8859-1" : > Content-Transfer-Encoding: 7bit You need to follow the various RFCs to generate correct messsages. If you don't have time for that, I suggest you look at existing classes like PEAR's Mail_Mime package that does much of the work for you: http://pear.php.net/package/Mail_Mime -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP script that fills forms ?
You're not making any sense my friend. If you want to fill form field then supply them with a value="" value. There's nothing more to it. - Original Message - From: Anonymous To: [EMAIL PROTECTED] Sent: Wednesday, November 26, 2003 5:37 AM Subject: Re: [PHP] PHP script that fills forms ? Well, you see. I didn't mean it that way. I meant PHP to fetch a website. The website is password protected and you need to fill a form to access it. So I would like PHP to fill that form for me. Would that be possible? Are there any other solutions? "Sophie Mattoug" <[EMAIL PROTECTED]> skrev i melding news:[EMAIL PROTECTED] > Anonymous wrote: > > >I was just wondering if it's possible to get a PHP script to fill a form for > >you? You see, I'm trying to make PHP fetch a password protected website for > >me and there's a form with username and password that protects it. > > > >Can anyone help me? Perhaps give me another sollution? > > > > > > echo '"; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Accessing .bat file from PHP
I believe... that the .bat file MUST be on the server for PHP to execute it. Nathan - Original Message - From: Reidar Solberg To: [EMAIL PROTECTED] Sent: Sunday, November 30, 2003 1:10 PM Subject: [PHP] Accessing .bat file from PHP I want to start a .bat file on my local pc from my webpage - to download some .txt files. I run PHP in my webpage - how can I make contact with the .bat file? Anyone tried this? Reidar Solberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php2c
Hello, BinaryPHP is still at a dev state and is incomplete, if you're having specific problems try stopping by #binaryphp on freenode and talking to Daeken there regarding them. Best Wishes, Nathan - Original Message - From: Volvo To: [EMAIL PROTECTED] Sent: Friday, December 05, 2003 6:33 AM Subject: [PHP] php2c Hi, Is there any project going on transfering the PHP code into C++? I found http://binaryphp.sf.net/ but when I run the convert.php on Windows machine I get an error as below C:\servers\binaryPHP>convert.php --if examples/helloworld.php --of hello PHP Notice: Undefined index: argc in C:\servers\binaryPHP\convert.php on line 9 Content-type: text/html X-Powered-By: PHP/4.3.2 Notice: Undefined index: argc in C:\servers\binaryPHP\convert.php on line 9 Usage: convert.php --if --of [-v | --verbose] [-h | --h elp] Too Few Arguments any help? Volvo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] run a command on a remote host
When you say remote host do you mean the server executing the script or the person accessing it? If you mean the latter, it is not possible. - Original Message - From: Ivone Uribe To: [EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 5:44 PM Subject: [PHP] run a command on a remote host How can I run a command on a remote host wiht php? I'm trying this line but nothing happen. passthru("rsh rubella /export/dat0/users/augur-se/bin/.upnotify -s 1045073262-82425_net2.nextelinternational.com -u http://wap.peru.com -a -y D--- -i Location -n"); I try exec and system, too But if I run this from the command line of my machine the command run rightly. rsh rubella /export/dat0/users/augur-se/bin/.upnotify -s 1045073262-82425_net2.nextelinternational.com -u http://wap.peru.com -a -y D--- -i Location -n Thanks in advance, Ivone __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Calendar.
No, but HotScripts.com and PHPClasses.org (><) will have classes to do them. I'm a fan of BosDates (can be found on HotScripts.com), but I think it might cost something to get it. Cheers, Nathan Taylor - Original Message - From: Carles Xavier Munyoz Baldó To: [EMAIL PROTECTED] Sent: Thursday, January 15, 2004 9:27 AM Subject: [PHP] PHP Calendar. Hi, Is there any PHP function or set of PHP files that allows me to print the current month in calendar format ? Greetings. --- Carles Xavier Munyoz Baldó [EMAIL PROTECTED] http://www.unlimitedmail.net/ --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Debug code
Aye, PHP is compiled by the executable, nothing else- what are you using? - Original Message - From: Robin Kopetzky To: PHP General Sent: Monday, January 19, 2004 10:32 AM Subject: [PHP] Debug code Good morning! Is there any way to keep the compiler from adding 'debug code'? Example: if ($b_debug) { echo ... } Just trying to eliminate code bloat. Robin 'Sparky' Kopetzky Black Mesa Computers/Internet Service Grants, NM 87020 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php