Re: [PHP] still have the same problem
Mecnun wrote: I have a form and a php file. I enter some values from the form and click to submit button. The values that I enter can't be seen on the output. I'm using Php php-4.0.5 and my register_global is set to Off. HTML file: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head title9.2/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body form action=listing9.3.php method=POST Name: br input type = text name=user br Address:br textarea name=address rows=5 cols=40/textarea br input type=submit value=Send /form /body /html PHP File: ?php print Welcome b $_POST[user] /b P\n\n; print Your address is:P\n\n b $_POST[address] /b; ? The output dont show the user value or address value. Thanks, Selim $_POST, $_GET, $_REQUEST, $_SERVER and $_FILES superglobals are available since php-4.1 http://www.php.net/variables.predefined -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] remote permissions on MySQL
I'm a newbie on MySQL. I just wanted to know whether there is the possibility to create a new user/psw remotely onto a server. That is, something related to command 'mysql_setpermissions', but acting from a remote host. Alessandro
[PHP] STUMPED: path/style vars in Windows with IIS
Hello. I am trying to get path/style variables working in windows with IIS on a hosted environment. What I mean by path/style variables is the following: Say I have a script test.php that can be accessed via: http://mydomain/controller.php ...I want to pass variables to it like: http://mydomain/controller.php/article/10 ...With IIS, I get a 404 Object Not Found error when I append anything after controller.php. In the past with Apache this has always just simply worked, even as a cgi module. What do I do to get this working with IIS? Thanks in advance, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] remote permissions on MySQL
On Monday 13 December 2004 16:48, Alessandro Rosa wrote: I'm a newbie on MySQL. www.mysql.com -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* BOFH Excuse #410: Electrical conduits in machine room are melting. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can I fix that
Hi there everyone... I did a form to add data to a database and it works fine. Once the data is entered its gives a thankyou message. But the problem is, if I refresh this thankyou page, the data is entered again into the database. Why is it doing so. I couldnt think of a way to fix it. Help... cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How can I fix that
Aalee wrote: Hi there everyone... I did a form to add data to a database and it works fine. Once the data is entered its gives a thankyou message. But the problem is, if I refresh this thankyou page, the data is entered again into the database. Why is it doing so. I couldnt think of a way to fix it. Help... cheers refreshing a page means resending the last request to the server. If by any chance that were a GET (usually this one) or POST request, it will resend that. Your php script notices those vars were sent, and (re-)adds the info to the db. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: STUMPED: path/style vars in Windows with IIS
Ck wrote: Hello. I am trying to get path/style variables working in windows with IIS on a hosted environment. What I mean by path/style variables is the following: Say I have a script test.php that can be accessed via: http://mydomain/controller.php ...I want to pass variables to it like: http://mydomain/controller.php/article/10 ...With IIS, I get a 404 Object Not Found error when I append anything after controller.php. In the past with Apache this has always just simply worked, even as a cgi module. What do I do to get this working with IIS? Thanks in advance, Chris this is a stupid IIS-issue :) I'd suggest asking this on a mailinglist that specialises in IIS, and not in PHP (*only*). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File upload problems using Apache 1.3 on Debian stable
Hi, I do indeed have the file upload code inside a class function. it's one of those little things about PHP hadn't fully realised yet. Thanks for the pointer! If I pass the relevant _FILE entry to that function and work off that it solves the problem right? Cheers, Tom Richard Lynch wrote: [EMAIL PROTECTED] wrote: Hi, I have been having problems trying to get file uploads working with PHP in a Debian Linux enviroment. I have ensured that both the temporary directory PHP uploads use has the appropriate permissions set, as well as the folder I am attempting to copy the images into. When I called phpinfo() from the page that the upload script is on it shows the contents of the _FILE array as containing the appropriate details, however when I try and access them from within my actual code, the variables appear to be unset, and no files appear in either the temporary folder or the folder I am trying to copy the file to. Anyone have any suggestions? Did you wrap your code up in a nice function? Perhaps you need: global $_FILES; inside that function. Or not. Still haven't worked out which $_XXX are super-global or not in which versions. Maybe someday. -- Working on webhosting Tel:01388 11 MTA handling, PHP Web:www.digital-data.co.uk scripting, and wireless Email:[EMAIL PROTECTED] networking, just for a change. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question: Repopulating form parameters
On Monday 13 December 2004 18:29, Stuart Felenstein wrote: I think you are missing the point Jason was trying to make, which is the difference between '$Ind' and $Ind. If you look again, you will see that those are handled differently. If you read the post Jason suggested I print out using both single and double quotes. Yes, I really do suggest that you re-read what was said in this thread. Regardless that has very little to do with my question. I believe that in the code you posted previously you was using '$Ind' in strcmp(), in which case it is extremely relevant, that is why I brought it up. Here is just another variation of my multiple select list. option value=?php echo $rsinds-Fields('CareerIDs')??php if ($rsinds-Fields('CareerIDs')== 5) {echo SELECTED;} ??php echo $rsinds-Fields('CareerCategories')?/option Here I was just testing with a specific value. the line == 5 will set the value SELECTED correctly. If I put in 5, 6, or '5,','6', etc, I get an error. However, I don't believe that line works for multiple values. What works is still a mystery to me. For heaven's sake, do you even know what the HTML *should* look like? Did you construct an example to look at? If you're unable to construct your own example just look at someone else's, go find a site that has multi-select listboxes with pre-selected values and examine the HTML source. Once you know what the HTML should look like it would be straightforward to recreate it using PHP. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* If you can count your money, you don't have a billion dollars. -- J. Paul Getty */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How can I fix that
I've just had this exact problem. The solution as far as I found is one of the following: 1. Keep a $_SESSION going and set a flag, then on a re-post you can check the flag to see if it's set and hopefully spot the re-post. 2. Check to see if what you're about to enter is already there, chances are it's a repost - this only works for certain sorts of applications though. 3. Divert the user to a different page using header() so that if they hit refresh they only refresh the thankyou page and not the post - this doesn't stop 'back' for screwing things though. 4. Use java to prevent the history, I've found this example (not tested it) script language=php history.forward(); /script Hope this helps Matthew -Original Message- From: Aalee [mailto:[EMAIL PROTECTED] Sent: 13 December 2004 09:50 To: [EMAIL PROTECTED] Subject: [PHP] How can I fix that Hi there everyone... I did a form to add data to a database and it works fine. Once the data is entered its gives a thankyou message. But the problem is, if I refresh this thankyou page, the data is entered again into the database. Why is it doing so. I couldnt think of a way to fix it. Help... cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This message has been checked for all known viruses by the CitC Virus Scanning Service powered by SkyLabs. For further information visit http://www.citc.it ___ This message has been checked for all known viruses by the CitC Virus Scanning Service powered by SkyLabs. For further information visit http://www.citc.it ___ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] record fetching error
hi i have a table in my database which i try to fetch rows from it here is the code i am using @ $db = mysql_connect ($server, $user, $pass); mysql_select_db($database); $test_tr = mysql_query(select * from art WHERE Game_ID = '$Game_ID' desc LIMIT 1); $record=mysql_fetch_array($test_tr); $ART_File_Name = $record['ART_File_Name']; $Art_Status = $record['Art_Status']; $Art_Creation_Date = $record['Art_Creation_Date']; $Art_ID = $record['Art_ID']; the problem is when there is no row with the given Game_ID, i get a mysql error. how can i get rid of that error -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question: Repopulating form parameters
On Monday 13 December 2004 19:00, Stuart Felenstein wrote: heaven's sake ? bit over dramatic. The code above is my created html. I've created a number of them, both from a table and just listing out some options. To repeat they all work . Yet all seem to have little in common when the values are dynamic and from an array. What works is still a mystery to me There are countless examples on the web of what works, the HTML specs will tell you what works, an example created from a competent HTML editor is what works. Now if you can recreate something what works, you will have something that works. Where's the mystery in that? I think will call it a day for this thread. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Toes, knees, NIPPLES. Toes, knees, nipples, KNUCKLES ... Nipples, dimples, knuckles, NICKLES, wrinkles, pimples!! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] allow_url_fopen ini directive not enough
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 10 December 2004 22:07, Richard Lynch wrote: This is a MUCH BIGGER PROBLEM than remote include working or not. You've *GOT* to get those files *OUT* of the web-tree. The only files that belong in the web tree are those that should be surfed to. 1000% hear hear to that. Maybe you'd say I'm taking this to ludicrous extremes, but the *only* surfable PHP files on my site look like this: ?php ini_set('include_path', ''); include('the_real_code.php.inc'); ? I don't even like having the explicit include_path setting there, but I don't currently have access on the server to set it any other way. One of these days I'll look to see if any of Chris Shifflet's resources on the subject are of use to me, but right now it suffices. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sql syntax problem
Hello everybody, I am trying to create a sql query with php and I do have a syntax problem with the mysql query. One row is called plz and I would like to search for a value inside that with a like statement. Problem is, the system takes the u.plz as a character not as a table element: LIKE %u.plz% Has anybody an idea how the correct sytnax is? I am lost here. Thank you in advance, Merlin PS: This is the complete statement: SELECT c.name AS city FROM geo_de.geodb_locations AS c, fix.user AS u WHERE u.user_id =4 AND c.plz LIKE %u.plz%; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP][SOLVED] Question: Repopulating form parameters
--- Jason Wong [EMAIL PROTECTED] wrote: I think will call it a day for this thread. As I suspected a loop was needed to make this work. In the event that there are other idiots, such as myself, that don't immediately figure out the exact logic I'll post the code: //The sql is Adodb syntax: while(!$rsinds-EOF){ ? option value=?php echo $rsinds-Fields('CareerIDs')? //I could test for $inds here, doesn't seem to make a //difference ?php foreach ($inds as $a) { ? ?php if ($rsinds-Fields('CareerIDs')== $a) {echo SELECTED;} } ? ?php echo $rsinds-Fields('CareerCategories') ? /option ?php $rsinds-MoveNext(); } $rsinds-MoveFirst(); Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Attempted to unsubscribe to no avail
GRR, I've tried in various and numerous ways to unsubscribe, even RTFM'd. How do I unsubscribe?! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question: Repopulating form parameters
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 12 December 2004 14:27, Stuart Felenstein wrote: --- Jason Wong [EMAIL PROTECTED] wrote: If in doubt, print it out (TM) echo '$Indbr', $Indbr, $Ind; $Ind '1','2','3','4' '1','2','3','4' Funny, they are both the same. Both? There are three things printed out there, so both cannot be right. 2 of the 3 can be the same, or all of them can be the same, but not both. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Text tools
Hello, I was just wondering how to build a text editing tool with php. I mean a tool that can help users to format their texts in the pages. I mean something like paste the text in a text box. Select some part of the text and hit a button to, for example, bold the selected part of the text. Or align the text to left or right side of the table. Little bit like you can see in a text editor progs like MS Word. I've seen a few applications like this but I have no idea how they are made and can this be done using php. Any ideas or guidelines how to get started? Thanks Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: : [PHP] empty() problem
There has already been a thread about this like 1-2 days ago. Check the archives On Mon, 13 Dec 2004 14:10:34 +0800, yangshiqi [EMAIL PROTECTED] wrote: Maybe this can help you. If (empty((string)$Game_rating)) -- : Ahmed Abdel-Aliem [mailto:[EMAIL PROTECTED] : 20041212 21:58 : [EMAIL PROTECTED] : [PHP] empty() problem Hi Group Members i have a problem with function empty() i use it to check if user entered the form fields and store it in array for example : if (empty($Game_rating)) $errors[] = You didn't enter the Online Status for the Game.; the problem when the user enters 0 in the form field the empty function returns the error. can i use another function that doesn't return false when the 0 is passes ? any help plz ? -- 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 -- Craig Slusher Web Programmer [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question: Repopulating form parameters
--- Ford, Mike [EMAIL PROTECTED] wrote: If in doubt, print it out (TM) echo '$Indbr', $Indbr, $Ind; $Ind '1','2','3','4' '1','2','3','4' Funny, they are both the same. Both? There are three things printed out there, so both cannot be right. 2 of the 3 can be the same, or all of them can be the same, but not both. Cheers! Mike I thought you were ignoring my posts ? The issue was the difference between double and single quotes. Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Text tools
[snip] I was just wondering how to build a text editing tool with php. I mean a tool that can help users to format their texts in the pages. [/snip] Have you looked at something like http://www.htmlarea.com/ ? Most apps like this use a lot of JavaScript to get the work done. You may want to look at the PHP-GTK http://gtk.php.net but other than that you have asked a really broad-scoped question. Have you ever done any basic application design before? It all starts with a proposed features list and then some flowcharts. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD functions don't delete temporary files
Steve wrote: I am using GD image function with PHP (PHP 4.3.9 on RedHat 9). Today I found that for all images I have created so far (using the ImageGIF() function), there is a temporary file in /tmp with that image. The name of the temp file is a 6 character combination of letters and digits, e.g. jvc5Ne. To be sure it's not a config problem, I compiled again with minumum options and minimum script ./configure --with-gd --with-zlib ?php $im = ImageCreate(20, 20); ImageGIF($im); ImageDestroy($im); ? But the problem is still there (CGI and CLI sapi tested). I used the -n option, so php.ini can't cause the problem, either. Has anyone else experienced that? Regards, Steve http://www.php.net/manual/en/function.imagegif.php - *Note: * Since all GIF support was removed from the GD library in version 1.6, this function is not available if you are using that version of the GD library. http://www.php.net/manual/en/function.imagecreatefromgif.php - *Note: * GIF support was removed from the GD library in Version 1.6, and added back in Version 2.0.28. This function is not available between these versions. Regards, Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Web Development Overnight!!!
Dear php-general#64;lists.php.net, Subj: Web Development Overnight!!! == That's right! A complete website done for you overnight! == You provide the text and the main images, and in less than 24 hrs you will have your finished website, complete with colors, links, buttons, forms, AND THE DOMAIN NAME!!! No Templates! No sub-domains! Everything is unique and tailor-made to suit your specific needs. -- Act now and we'll even give you your own domain name (www.yourdomain.com) for FREE!!! That's a $70 value at no extra charge! -- I would like more information http://www.mandpconcepts.com/overnight.htm -- Lets begin the development of my site http://www.mandpconcepts.com/overnight.htm --- |=| | | | You have received this email either because you have | | emiled us in the past or because you have expresssed | | an interest in our type of service from someone else. | | To be removed from this email Click on our address| | Input your email address and submit. | | http://www.all-the-domains.com | | | | You will be removed right away!| | | |=| -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Attempted to unsubscribe to no avail
look at the bottom of the emails you are getting. Specially the last paragraph may be of interest snip If you are receiving mail from one of the mailing lists, there should be absolutely no reason that you would be unable to unsubscribe yourself from the list, except for your ability to follow these directions. However, if you find yourself unable to unsubscribe from the mailing list, send an email to [EMAIL PROTECTED] Make sure to include the complete headers from one of the messages you have received from the mailing list. Keep in mind that there's a human being at the other end of that last email address, so you'll have to be patient. /snip -Oorspronkelijk bericht- Van: Scott Hamm [mailto:[EMAIL PROTECTED] Verzonden: maandag 13 december 2004 14:45 Aan: [EMAIL PROTECTED] Onderwerp: [PHP] Attempted to unsubscribe to no avail GRR, I've tried in various and numerous ways to unsubscribe, even RTFM'd. How do I unsubscribe?! -- 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] Text tools
This is not possible with PHP, you must do that with JavaScript. Hello, I was just wondering how to build a text editing tool with php. I mean a tool that can help users to format their texts in the pages. I mean something like paste the text in a text box. Select some part of the text and hit a button to, for example, bold the selected part of the text. Or align the text to left or right side of the table. Little bit like you can see in a text editor progs like MS Word. I've seen a few applications like this but I have no idea how they are made and can this be done using php. Any ideas or guidelines how to get started? Thanks Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Attempted to unsubscribe to no avail
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] GD functions don't delete temporary files
Jay Blanchard wrote: [snip] But the problem is still there (CGI and CLI sapi tested). I used the -n option, so php.ini can't cause the problem, either. Has anyone else experienced that? [/snip] Yes. You will have to write your own clean-up code for things like this. I don't mean any user generated temporary files, I mean files which are created by the PHP function ImageGIF(). How should I even know which temporary file name GD chose in each case, or whether it created a temp file at all in a particular case? Regards, Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD functions don't delete temporary files
http://www.php.net/manual/en/function.imagegif.php - *Note: * Since all GIF support was removed from the GD library in version 1.6, this function is not available if you are using that version of the GD library. http://www.php.net/manual/en/function.imagecreatefromgif.php - *Note: * GIF support was removed from the GD library in Version 1.6, and added back in Version 2.0.28. This function is not available between these versions. Well, that's not the problem. As noted, I use PHP 4.3.9 which is bundled with GD 2.0.28, which again includes the GIF functions. And... the functionality itself works fine (the GIF is written to STDOUT correctly, as it should). The only problem is that the function doesn't seem to clean up, and leaves the temporary file it had created undeleted. Regards, Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Byte Array
Hello All, I've hit a bit of a show stopper in a project I'm working on. I'm getting a 65 byte stream of data. 32 of those bytes are of the type Byte Array. Is there a way that I can covert that data into something useful? For the record, the data stream that I'm getting is in the format: |ascii|ascii|asciiX10|integerX4|byte arrayX32| The byte array looks like this: g..UA9x|%r9. Any ideas? Ian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Text tools
You maybe able to do this (and will eventually definitely be able to do this) with Winbinder on Windows platform with native GUI. He's still on what he calls pre-alpha but what's in there already is coming along very nicely. Check out the sourceforge pages: http://winbinder.sourceforge.net/ Documentation and functionality are still developing, but there are some examples to pick through and a discussion email list that you can get fairly quick answers from. Someone posted some links to an editor or two recently that may already do what you're trying to do if you want to implement something web-based though. Damn, I forget the name now but there was one recently that worked in IE, but not in Firefox. Someone mind re-posting that for Will? Good luck! -TG = = = Original message = = = Hello, I was just wondering how to build a text editing tool with php. I mean a tool that can help users to format their texts in the pages. I mean something like paste the text in a text box. Select some part of the text and hit a button to, for example, bold the selected part of the text. Or align the text to left or right side of the table. Little bit like you can see in a text editor progs like MS Word. I've seen a few applications like this but I have no idea how they are made and can this be done using php. Any ideas or guidelines how to get started? Thanks Will ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Development Overnight!!!
info wrote: Dear php-general#64;lists.php.net, Subj: Web Development Overnight!!! == That's right! A complete website done for you overnight! == Woo-Hoosign me up baby! -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] GD functions don't delete temporary files
[snip] Yes. You will have to write your own clean-up code for things like this. I don't mean any user generated temporary files, I mean files which are created by the PHP function ImageGIF(). How should I even know which temporary file name GD chose in each case, or whether it created a temp file at all in a particular case? [/snip] Before the image is created you can get an array of things in the temp file, then check for a new thing after the image is created. You can verify the file type and if all is kosher, delete it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Development Overnight!!!
you can't be signed - web site is still under constraction! he/she posted this a little bit to early! :) -afan John Nichel wrote: info wrote: Dear php-general#64;lists.php.net, Subj: Web Development Overnight!!! == That's right!A complete website done for you overnight! == Woo-Hoosign me up baby! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD functions don't delete temporary files
* Martin Holm [EMAIL PROTECTED]: Steve wrote: I am using GD image function with PHP (PHP 4.3.9 on RedHat 9). Today I found that for all images I have created so far (using the ImageGIF() function), there is a temporary file in /tmp with that image. The name of the temp file is a 6 character combination of letters and digits, e.g. jvc5Ne. To be sure it's not a config problem, I compiled again with minumum options and minimum script ./configure --with-gd --with-zlib ?php $im = ImageCreate(20, 20); ImageGIF($im); ImageDestroy($im); ? But the problem is still there (CGI and CLI sapi tested). I used the -n option, so php.ini can't cause the problem, either. Has anyone else experienced that? http://www.php.net/manual/en/function.imagegif.php - *Note: * Since all GIF support was removed from the GD library in version 1.6, this function is not available if you are using that version of the GD library. Umm... did you read the OP? He's not asking about GIF support -- he's asking why temporary files created by PHP + GD are not being deleted when imagedestroy() is issued. To the OP: from the manual, imagedestroy merely frees memory associated with an image resource; it doesn't remove the temp file associated with it. It's possible that PHP is either relying on the OS's /tmp cleanup routines or Apache's temp file cleanup, or has set a large garbage collection interval itself in its php.ini. -- Matthew Weier O'Phinney | mailto:[EMAIL PROTECTED] Webmaster and IT Specialist | http://www.garden.org National Gardening Association| http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] record fetching error
Ahmed Abdel-Aliem wrote: hi i have a table in my database which i try to fetch rows from it here is the code i am using @ $db = mysql_connect ($server, $user, $pass); mysql_select_db($database); $test_tr = mysql_query(select * from art WHERE Game_ID = '$Game_ID' desc LIMIT 1); http://php.net/mysql_num_rows $record=mysql_fetch_array($test_tr); Or, simply use something like: if ($record != false){ $ART_File_Name = $record['ART_File_Name']; $Art_Status = $record['Art_Status']; $Art_Creation_Date = $record['Art_Creation_Date']; $Art_ID = $record['Art_ID']; } Read http://php.net/mysql_fetch_array the problem is when there is no row with the given Game_ID, i get a mysql error. how can i get rid of that error -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] GD functions don't delete temporary files
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 13 December 2004 16:14, Steve wrote: Seems like this is something that either the GD lib or PHP should be doing and not the user. Shouldn't this be reported as a bug? Yes, I also consider this a bug, unless it's something specific to my system. To find out, I posted this here. This is in the NEWS file for PHP 4.3.10, due out any day now (currently in RC2): Fixed bug #30658 (Ensure that temporary files created by GD are removed). Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Development Overnight!!!
sorry, I know we shouldn't reply to this sorta crap, but: On Mon, Dec 13, 2004 at 03:21:01PM +0100, info wrote: Dear php-general#64;lists.php.net, -- Act now and we'll even give you your own domain name (www.yourdomain.com) for FREE!!! That's a $70 value at no extra charge! $70!???!? do they have a huge surcharge for .coms in the states? here in the uk i can register one for literally 10% of that. just my 2p -- Cats land on their feet. Toast lands jellyside down. A cat glued to some jelly toast will hover in quantum indecision perl -e'$_=q#: 13_2: 12/o{: 8_4) (_4: 6/2^-2; 3;-2^\2: 5/7\_/\7:\ 1 m m::#;y#:#\n#;s#(\D)(\d+)#$1x$2#ge;print' Yes, of course it's the right cabl [le0: NO CARRIER] pgp6mcjGhZGkJ.pgp Description: PGP signature
Re: [PHP] PHP Apache Upload file Permission denied
Michael Leung wrote: I have faced the upload file permission denied for weeks. I can't write a new file/create a directory. I did a test in PHP standalone (Linux shell). The operation is very normal. But what *USER* were you when you did that test?! Were you the same user PHP runs as, IE, the user Apache runs as? If not, your test is meaningless. If you were root, your test is beyond meaningless, bordering on the ridiculous :-) But in web environment, I got this error message: Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpjsLZfC' to '/var/www/htm/test/icons.zip' in /var/www/html/simple_upload.php on line 76. I think this is a problem bewteen Apache and PHP. The safe mode of PHP is off and test directory is changed to 777. Are you 100% certain you have the directory names correct? Can the PHP user *READ* /tmp/* files? Can the PHP user *WRITE* /var/www/htm/test/* files? -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Development Overnight!!!
Mat Harris wrote: snip Act now and we'll even give you your own domain name (www.yourdomain.com) for FREE!!! That's a $70 value at no extra charge! $70!???!? do they have a huge surcharge for .coms in the states? here in the uk i can register one for literally 10% of that. just my 2p Value is highly subjective. You can register domains in the States for less than $10 (per year). -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] allow_url_fopen ini directive not enough
KJ wrote: Ah OK. So the only only includes should be out of the web tree, or on a remote site? Nice one. I hope you're not being sarcastic, because this statement is actually 100% true. Your web-sites should have clearly-defined 'entry points' which are pages that you actually expect people to surf to. Everything else, which is to say your include files, do *NOT* belong in your web tree. You configure your server/PHP to find the include files from outside the web tree. Thoese files then cannot be surfed to. If you do *NOT* do this, you can pretty much guarantee that Bad Guys will surf to internal/include files directly, and use them to break into your server, inject SQL, cross-site 'include' their own code, etc. By all means, if you want to disable remote include, go ahead and change the PHP source to do so: But you're *NOT* solving your real problem. You will *still* have huge chunks of code in the web tree that Programmers, who probably already don't have their Security hat on enough, typed with absolutely NO THOUGHT for What if somebody surfs directly to this include file? They've never even tested it, as part of their web application testing, because they never expected it to happen. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Infinity and nested categories
Bruno B B Magalhães wrote: Hi again everybody, well, I've asked it before, but I couldn't work on this at all. As some knows I have a system witch has a category system. The generic part of the site is handled by a generic module called contents... generic like products, services, company, etc. Where the content layout and structure is quite the same. Well suppose that I have this: http://www.the_company.com/site/products/product_one/requirements/ requirements.html Where: site/ the controller products/ - alias module for content module product_one/ - top category requirements/- nested category -- as many nested categories as needed requirements.html - article is called searching using it without the .html, witch is used to know that it is an article and not a category. ('WHERE article_path='requirements' AND category_id='022') My problem is that how can I handle those categories! and build a three of it. Is it a true hierarchy, or is it a heterarchy? In other words, can sub_category_57 appear in *TWO* different branches in the tree? If *NOT*, then you really don't need all the nested categories in your URL: As soon as you have the bottom category, you've already got all the others in your database. Of course, you could simply walk through $_SERVER['PATH_INFO'] and build your category list: ?php $parts = explode('/', $_SERVER['PATH_INFO']; $controller = $parts[0]; $module = $parts[1]; unset($parts[0]); unset($parts[1]); $categories = array(); while (list(, $cat) = each($parts)){ if (!strstr($cat, '.html')){ $categories[] = $cat; } } ? -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sql syntax problem
Merlin wrote: SELECT c.name AS city FROM geo_de.geodb_locations AS c, fix.user AS u WHERE u.user_id =4 AND c.plz LIKE %u.plz%; I believe you want something not unlike this: WHERE u.user_id = 4 AND c.plz LIKE concat('%', u.plz, '%') -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD functions don't delete temporary files
Seems like this is something that either the GD lib or PHP should be doing and not the user. Shouldn't this be reported as a bug? Yes, I also consider this a bug, unless it's something specific to my system. To find out, I posted this here. Is nobody else out there using ImageGIF() with PHP 4.3.9? Can't believe it... Regards, Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] GD functions don't delete temporary files
[snip] Before the image is created you can get an array of things in the temp file, then check for a new thing after the image is created. You can verify the file type and if all is kosher, delete it. Seems like this is something that either the GD lib or PHP should be doing and not the user. Shouldn't this be reported as a bug? [/snip] Not necessarily. Several languages require that you write your own clean-up code for things like this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File upload problems using Apache 1.3 on Debian stable
[EMAIL PROTECTED] wrote: Hi, I do indeed have the file upload code inside a class function. it's one of those little things about PHP hadn't fully realised yet. Thanks for the pointer! If I pass the relevant _FILE entry to that function and work off that it solves the problem right? You didn't actually type $_FILE instead of $_FILES did you?... $_FILES is a superglobal (but $HTTP_POST_FILES is not) so you should *not* need to declare it global, nor pass it in. $_FILE ain't nothin' at all. :-) If you want to catch errors like this, *change* your error_reporting level. http://php.net/error_reporting I sure wish php.ini default were changed to E_ALL in some major release version along the way. Sooo many newbie problems would disappear overnight if this the default. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] STUMPED: path/style vars in Windows with IIS
Ck wrote: Hello. I am trying to get path/style variables working in windows with IIS on a hosted environment. What I mean by path/style variables is the following: Say I have a script test.php that can be accessed via: http://mydomain/controller.php ...I want to pass variables to it like: http://mydomain/controller.php/article/10 ...With IIS, I get a 404 Object Not Found error when I append anything after controller.php. In the past with Apache this has always just simply worked, even as a cgi module. What do I do to get this working with IIS? Switch to Apache :-) http://apache.org Actually, semi-seriously -- If you *can* switch, you'll be able to install, configure, and fix this issue in Apache faster than you can figure out how to fix this one issue in IIS. Much less fix all the other issues you're going to run into in IIS. YMMV. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Automaticly Play Sound when MySql Reach some Number
Sejati Opreker wrote: How do I make automaticly PHP playing a sound (Ogg, or MP3 format file) when MySql (in Table, or Coulom) reach a number (for example 5) Er. You'd have to write a query in MySQL/PHP such as: $query = select whatever = 5 from something; Or, perhaps: $query = select count(*) from something where whatever; Or maybe something entirely different. You've been so vague about the specification that we can't really say. Then, you need to use OBJECT and EMBED tags in your HTML printed out by PHP to make the sound play. You can count on a *LOT* of annoyed users when you automatically play an audio file, by the way. The exact format of the OBJECT and EMBED tags depends on what format you want, Ogg or MP3. Pretty much, there wasn't really any PHP in your question, when you get right down to it... -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Delivering large files via PHP (300MB)
Hi all, Just thought I would pick the collective brain on this one. I have a requirement to deliver a large EXE file to customers after they order. The file is just under 400 MB in size and, because they have just purchased it, I obviously cannot have this file in a public location on the web server that someone could browse to. I can push the file out quite easily using a modified header and a simple script to check if they can download it or not, but with such a large file a significant number of web browsers fail to obtain the entire EXE before closing - or any other number of factors kick into play (their PC resets, ISP disconnects, Windows crashes, etc). Some browsers support resuming download, but not when the file has been sent via the headers I use, also FTP is not an option as I cannot create and destroy FTP users on the server easily (or for that matter assume the customer knows how to perform FTP operations). I'm also aware that it's not such a hot idea to lock-up Apache for the time it takes to download the whole file, especially with a large number of users doing this. So I came up with an idea that I'd like your opinions on: I built a small but friendly Windows application (50KB in size) that will connect to the web server via HTTPS, check the download credentials and if all is ok, it then downloads the file via HTTP in 1MB chunks. The file is just a single EXE file sat outside of my web root, and the PHP script that serves the file uses fopen() to open the file, then fseeks to the required section of it, reads in 1MB worth of data, closes the file and then echos this out (after suitable headers of course, shown below) header('Content-Type: application/force-download'); header('Content-Transfer-Encoding: Binary'); header(Content-Length: $total_chunksize); header(Content-Disposition: attachment; filename=\$chunkname\); The Windows app performs various checks on the file segments as they download and eventually stitches the whole thing back together at the end (there is a resume download feature so you can come back to it at a later time if you need, or your ISP disconnects). A quick MD5 file integrity check with the server confirms the file has downloaded fully. I have tested this out on some massive files across a range of PCs and Windows installations and it works perfectly, so I'm happy that the Windows side of things is correct. But I would be interested to hear peoples views on the PHP side of the equation - would it be better for Apache to be running PHP scripts that shove out smaller 1MB chunks as opposed to doing a fpassthru on a 300MB+ file? Or do you think there is another more elegant solution? I'm aware my app is for Windows only (although I could easily port it to OS X), but the files they are downloading are PC games anyway, so it's no bad thing in this case. Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services I am not young enough to know everything. - Oscar Wilde -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Development Overnight!!!
John Nichel wrote: Mat Harris wrote: snip Act now and we'll even give you your own domain name (www.yourdomain.com) for FREE!!! That's a $70 value at no extra charge! $70!???!? do they have a huge surcharge for .coms in the states? here in the uk i can register one for literally 10% of that. just my 2p Value is highly subjective. You can register domains in the States for less than $10 (per year). Perhaps they found the most expensive registrar they could find, and based it on that. Or maybe they are registering it for 10 years, and holding onto the domain name in their own name, thus locking the customer into a 10-year nightmare. Or maybe... I really shouldn't have posted this. :-^ -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Development Overnight!!!
Spamming SOB. On 12/13/2004 3:21:01 PM, [EMAIL PROTECTED] wrote: Dear php-general#64;lists.php.net, Subj: Web Development Overnight!!! == That's right! A complete website done for you overnight! == You provide the text and the main images, and in less than 24 hrs you will have your finished website, complete with colors, links, buttons, forms, AND THE DOMAIN NAME!!! No Templates! No sub-domains! Everything is unique and tailor-made to suit your specific needs. -- Act now and we'll even give you your own domain name (www.yourdomain.com) for FREE!!! That's a $70 value at no extra charge! -- I would like more information http://www.mandpconcepts.com/overnight.htm -- Lets begin the development of my site http://www.mandpconcepts.com/overnight.htm --- |=| | -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.296 / Virus Database: 265.5.0 - Release Date: 12/9/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] url rewritting in php5
Hello! I'm solving one problem and I'd like to ask you for hints/advices or 'RTFM at link' answers. Problem is: I need special type of URL to be 'rewritten' in the way how the Apache does the URL rewritting. example: fopen('chrome://myfile.txt', 'r'); to have be internaly resolved for eaxample as fopen('/var/www/localhost/chrome/myfile.txt', 'r'); I know that there is the way how to register url wrapper in PHP5. It is the solution. But I do not need to implement whole API. Is there way to do something like this? class ChromeWrapper extends PHP_STD_FILE_WRAPPER { function stream_open($path,$mode,$opts,$opened_path) { $path=str_replace('chrome://', '/var/www/localhost/chrome/', $path); parent::stream_open($path, $mode, $opts, $opened_path); } } ... simply implement easily only the path rewritting instead of implementing all the functions that are already done in built-in api. Or is there some way how to register 'filter' that filters $path instead of the content? Thank you for sharing your knowledge Danny 'elixon' Sevcik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Byte Array
[snip] I'm getting a 65 byte stream of data. 32 of those bytes are of the type Byte Array. Is there a way that I can covert that data into something useful? For the record, the data stream that I'm getting is in the format: |ascii|ascii|asciiX10|integerX4|byte arrayX32| The byte array looks like this: g..UA9x|%r9. [/snip] You'd have to know the byte array encoding. Can you get that information?
Re: [PHP] PHP via DIAL-UP?
Police Trainee wrote: Hello. I have a computer at my office running Apache that I use to run PHP scripts with using http://localhost. Is there anyway I can set up my computer to allow me to dial-in from home and use the webserver and my php applications? It is a win 98 system with tcp/ip. Yes... But that's probably a bad idea, as your computer will then be subject to a zillion Bad People trying to break in. That means you'll need to turn yourself into a Security Expert overnight. It would be far far far wiser to move your PHP scripts onto a well-managed web-server, where somebody with the experience to manage it will keep it running. You will then be able to access your application from any networked computer, office or home. It's still not a PHP question, though, but I felt it better to give you this advice than have you running to Windows forums to find out how to do something that's a Bad Idea in the first place. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail
PHPDiscuss - PHP Newsgroups and mailing lists wrote: I have a dedicated Red Hat linux boxed leased from Interland and the php mail function does not work. I have found several articles on things to try and have tried everything I saw but to no avail. I set up a php script to mail and then print the return code and I get a 1 (success). But the mail never arrives. Is there any way I could get some help with this. I could post my phpinfo() information or anything else that may help. After doing all the other suggestions, su to the PHP user, and see if *that* user has permission to send email. If not, change that permission setup to allow that user to send email. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Delivering large files via PHP (300MB)
Am 2004-12-13 19:53:01, schrieb Richard Davey: Hi all, I can push the file out quite easily using a modified header and a simple script to check if they can download it or not, but with such a large file a significant number of web browsers fail to obtain the entire EXE before closing - or any other number of factors kick into play (their PC resets, ISP disconnects, Windows crashes, etc). Why not suggest your clients to use wget for Windows or DOS ? The 32-Bit Version of wget for DOS works perfectly in a DOS-Box of Win2003 Server, WinXP Pro+Home, Win2000, Win98 and Win95 But why not SPLIT the files on your Server already in 1 MB parts and the if the $USER connect with your small 50kB Application it sends a URL with the requird Data to the Server which responds via shttp and a file, where alle the parts are listet with there md5sums... Then your application can download all parts from e hidden directory check the md5sums and if they are complete, it will join the parts to the big_game.exe. This is what I do :-) And yes, I have used the Source-Code of WGET but you can make your implementation. WGET is perfect, because it can resum broken downloads, no matter where the $USER has stoped the Download. Best regards, Richard Davey Greetings Michelle -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSM LinuxMichi 0033/3/8845235667100 Strasbourg/France IRC #Debian (irc.icq.com) signature.pgp Description: Digital signature
Re: [PHP] Multiple Inheritance
Greg Beaver wrote: Greg Donald wrote: with it, but I will go grab a PEAR module if it fits my needs. Code re-use may be the only redeeming quality of OO programming, and honestly I can re-use your code from a non-OO include file just as easily. yep, unless the function names happen to conflict with ones you've already written. Then, you run into the oh-crap-I-should-have-planned-to-use-other-code-oh-well-I-guess-I'll-rename-everything-and-waste-hours problem. Class names occasionally conflict, but this tends to be a much smaller and simpler search-and-replace. Changing a function name in all my files is a one-line global search and replace. That assumes you write good code to start with, of course. I would challenge anyone advocating functions: how many of you have had to modify your function-based program to do a similar thing and been forced to rewrite? Even with well-designed functions, you end up with this problem - code modification is impossible. This is why I hardly ever use static methods or functions. Notice - I do use these things, but you have to know when it is appropriate to do so. Classes aren't a magic bullet -- You'll still need to write more code. It's even quite likely that you'll need to go back and change code in the original class to accommodate some weird thing in the new code / requirements. Then you need to re-test everything everywhere that relies on that class. A little forethought in your functions (or classes, for that matter) can often avoid this. I often have functions with code to handle situations my client hasn't realized they are going to need some day. Sometimes I even tell them about it, so they'll know that we're prepared. :-) functions and static methods should be used for code that you can guarantee you *don't* want to change - ever (well, at least almost never). Anything that you may need to extend or modify functionality must be implemented with something more flexible, or you're going to get screwed at some point. Static methods should be used for any functions that are re-distributable so that others can plug them in without risk of name conflicts. Invariably, the other guy who wrote the class I want to use (in C++ now) decided to make something static/private that I actually don't *WANT* to be static/private to make my code work. Not fun. If you're writing the code for Yahoo like Rasmus, you're going to write the fastest code imaginable, and you will also be working on the C code to do things. Since most Readers of this forum aren't writing code for Yahoo... If you're writing the code for podunk.com, or even for a mid-level traffic site, it is extremely unlikely that you will notice even the slightest difference between OO and non-OO code. The biggest hogs in php programming are: au contraire, my dear friend. I have often ripped out a bunch of OO crap and replaced it with functional programming and had SIGNIFICANT performance increases. All that class junk has to get loaded and parsed, and inexpereienced OO programmers invariably have three times as much code as they need, to no benefit. 1) unnecessary images and animated crap/unnecessary javascript 2) terrible database usage 3) too much complexity in the design It doesn't matter whether you are using OO or functions - if your application has too many lines of code per task, it won't be fast. As far as I'm concerned, classes almost always have too many lines of code per task. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] allow_url_fopen ini directive not enough
KJ wrote: So, not only do you have register_globals on which is a Bad Idea, you've got PHP files in your web tree that they can surf to, bypass your configuration setting of $base_url, and execute code that the Programmer never ever ever intended to be executed out of sequence (IE, without having the code in config.php executed) This is a MUCH BIGGER PROBLEM than remote include working or not. That's down to your opinion and experience. Most packaged applications have all the files accessible in the webdir. In most apps changing this would mean a lot of rewriting. No, it doesn't. You just move all those include files somewhere else, and change PHP's include_path setting. This is not rocket science. If you can't do that, for whatever reason, you may be able to stop those files from being executed outside the context in which they were intended: Convince Apache *not* to execute .inc files as PHP, for example. Of course, some well-intentioned, but badly-designed, packages use .inc.php to force the execution of include files as PHP. As we have seen here, you simply do not *want* that to happen. Executing snippets of code out of the context in which they were programmed is just plain foolhardy. I agree but your perfect world isn't the one I'm living in, if it were, we wouldn't have needed register_globals. I'm not suggesting a perfect world. I'm suggesting you move a bunch of files from A to B and change one (1) PHP setting, include_path. If that's too much effort, then you might as well just resolve yourself to re-installing from backups every few months because that *IS* what you will be doing. You've got huge chunks of code in those packages that the bad guys are executing all out of any sort of order that the Programmer ever even thought about them. So we agree that the programmer isn't always considering these things. Phew. Yes. Or, more likely, if you read the install documentation carefully, they will recommend that you do just what I described above. Of course, far too many users dump all the source in a directory, fire up their browser, configure the application, get it to work, and NEVER READ the install docs thoroughly. They get it to work, and let the sleeping dog lie. Alas, this is an except to that rule of letting the dog be. Don't do that. comprimise the site was to have a variable passed in the url to set the base url to a remote site, which in turn output php to execute, i.e.: http://example.com/config.php?base_url=http://myhacksite.example.com Now, you are correct that education on how to avoid this kind of issue is key, however that does not avoid the problem. Turning of register globals would prevent many of these attacks, however there are still many apps out there that require register globals to be on and there are other ways to use this exploit with them off. Please explain these other ways, or provide references. Sorry, same way. I have seen ann application that set the base url in $_REQUEST. Needless to say it was avoided like the plague. And to be honest, it was the only app I've seen that did this. That, for sure, was the right decision for such a badly-designed application. Also, if an application requires register_globals on at this point in time, it may be prudent to simply not support the installation of that package. That may seem harsh, even unreasonable, but at some point, it's time for the application developers, who have quite some time now, to make their software well-behaved with register_globals OFF. Yeah I agree... unfortunately there are hosting companies who insist on keeping them for BC. And I was a bit shocked when this first happened to me with a stable version of phpBB. It has since been fixed, but I wonder how many people were open to the attack. I wonder how manby people had not copied all of those include file out of the web dir? Many I imagine. Yup. And that's one reason why register_globals became such the Big Issue in the first place. If all programmers initialized all variables correctly, and all include files were outside the web tree where they belonged, register_globals OFF would not be necessary at all. I'm not naive enough to think that's going to happen, mind you, but, honestly, register_globals is not *ENOUGH*. You've got to move the include files anyway. And you may want to test with error_reporting set to E_ALL. I, personally, have my own standards for installing applications. If they can't run with register_globals OFF, they don't get installed. If they can't run with E_ALL, they don't get installed. And no cheating by resetting error_reporting inside the application either. Un-unh. It runs with true E_ALL, or it doesn't get installed. If I can't figure out how to get all those include files somewhere else, it doesn't get installed. I appreciate your problems -- I'm just trying to tell you that your solution is like swatting an elephant with a feather.
Re: [PHP] Close all open tags in HTML text
Matt Palermo wrote: I realize that I can use the strip_tags function to remove HTML. But I don't want to remove HTML tags. I just want to make sure all open HTML tags are closed. For example if they user submits HTML with a table tag and never closes it, then the rest of the page will look screwed up. I still want to allow them to use HTML, but I want to close tags that were left open by them. This way it allows them to use HTML and it won't screw up the rest of the page. Hopefully these are trusted users, authenticated to alter any and all content on the web-site. Otherwise, you might as well post your 'root' password on your home page... Perhaps I'm just telling you something you already know -- better that than you going forward with this and *not* realizing just how insecure it is. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] allow_url_fopen ini directive not enough
KJ wrote: OK, I don't think you've read my posts in much detail at all. I looks as though you have skimmed over them and got a pre-determined idea of my issue in your head. Not once have I mentioned anything about customers in my posts. I'm not a web host. I'm not talking about people who have access to my web server uploading malicious scripts; I know that if I give people that I don't trust access to my server then they could f**k things up... obviously. I'm not a script kiddie who wants to stop people using the mail() function or something like that, I'm talking about a real life vunerability. Let me try to paint another simple senario: 1. You have a shared hosting account with example.com hosted on it. 2. You want a guestbook setup on it, and you've found one that you like. 3. You install phpMyFantasticGuestbook onto your account. 4. It's a well used application and thus you don't go through the source to check for vunerabilities. 5. Joe Hacker has studied the script coz he's a tart that wants to piss people off and he has found a vunerability. 6. Joe Hacker uses the vunerability to change your account passwd. He then logs in as you and deletes all your files. He has access to your mysql password which was in the congif file of phpMyFantasticGuestbook and he deletes all your data, he then leaves a nice index.php in your account to say that he's been by. This is what I'm talking about, I hope this is clear. The vunerability I described in one of my previous posts. The worry that I'm expending comes from being hacked twice using this method, I think the amount of worry expended is in line with the amount of frustration that I have endured. Yes! I'm only telling you that you have incorrectly analyzed the source of your problem, not the scale and scope of the problem. This horse is probably dead, but: As long as your include files are in the web tree, your risk, regardless of remote include on/off, remains TOO HIGH. After the include files aren't in the web tree, the remote include is irrelevant in most cases of the well-used/well-tested applications. There are still other risks to them, however, but they are almost certainly smaller and less pervasive than this. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Byte Array
Try the unpack function, it should do quite nicely. Chris Ian Firla wrote: Hello All, I've hit a bit of a show stopper in a project I'm working on. I'm getting a 65 byte stream of data. 32 of those bytes are of the type Byte Array. Is there a way that I can covert that data into something useful? For the record, the data stream that I'm getting is in the format: |ascii|ascii|asciiX10|integerX4|byte arrayX32| The byte array looks like this: g..UA9x|%r9. Any ideas? Ian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] GD functions don't delete temporary files
[snip] But the problem is still there (CGI and CLI sapi tested). I used the -n option, so php.ini can't cause the problem, either. Has anyone else experienced that? [/snip] Yes. You will have to write your own clean-up code for things like this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Varible calling a define value
Currently i have a Defiune setup of: define(THS, This is a test); I also have a string value of $that='THS'; When I echo out $that it get THS. I want to echo out $that and get: This is a test. How can I do this? $that = THS You don't want the quotes. thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Varible calling a define value
[snip] Currently i have a Defiune setup of: define(THS, This is a test); I also have a string value of $that='THS'; When I echo out $that it get THS. I want to echo out $that and get: This is a test. How can I do this? [/snip] Remove the quotes around THS $that = THS; echo $that; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Varible calling a define value
I actually figure this out from the web site and had to use constant(); At 04:36 PM 12/13/2004, you wrote: Hello all, I am setting up a page that I would like to use DEFINE to retrieve more information about abriviations in a database. The database part all works just fine. Currently i have a Defiune setup of: define(THS, This is a test); I also have a string value of $that='THS'; When I echo out $that it get THS. I want to echo out $that and get: This is a test. How can I do this? -- UMPA Brian C. Doyle Director, Internet Services United Merchant Processing Association http://www.umpa-us.comhttp://www.umpa-us.com 1-800-555-9665 ext 212 -- UMPA Brian C. Doyle Director, Internet Services United Merchant Processing Association http://www.umpa-us.comhttp://www.umpa-us.com 1-800-555-9665 ext 212
Re: [PHP] Configuring PHP 5.0.2 on OpenBSD 3.6: png.h not found
Raymond C. Rodgers wrote: On Fri, 2004-12-10 at 13:23, Richard Lynch wrote: Where exactly is png.h in your directory system? If libpng is installed, it should be there. What are you using after the --with-png-dir= Whatever you are using, it must be a directory far enough *above* png.h to encompass not only '/include/*/png.h' but also '/lib/*/*png*.so/ Many beginners mistakenly pass in the directory that contains 'png.h' -- Alas, PHP *also* needs to find all the png library binary files (.so) in order to pull them in. So starting at png.h, work your way 'up' until you hit a directory that also has *png*.so down inside it somewhere (perhaps one or two levels deep) and pass *that* directory with --with-png-dir= The problem was solved by making symlinks from the actual location of the png headers (/usr/local/include/libpng) to a slightly higher location (/usr/local/include). Previously attempting to point --with-png-dir= to either /usr/local/ didn't work. I found the tip about making symlinks to correct this issue by sheer luck. You may want to report this as a bug... That is, unless you took some action when installing PNG that caused the files to be put under libpng instead of at the higher level. If you did that, it's on your shoulders to remember and make other applications aware of your customization. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sharing info between websites with XML?
p80 wrote: On Sunday 12 December 2004 05:15 pm, Jason Wong wrote: On Sunday 12 December 2004 22:33, p80 wrote: eg do you want to only make available specific pre-defined bits of data to client websites, yes this is how I'd like to proceed OK, if there are only a limited number of these pre-defined bits of data then the easiest way is probably just output it as plain text (you don't say what kind of data you're sharing) in an easy to parse format (CSV, XML, whatever you're comfortable with). and in case i need it what if it's not pre-defined bits of data, how shoud it be handle? That's an open-ended question. If you can limit yourself to specific data-types in MySQL, PHP, and in the recipient/sending web-sites, you can build a fairly simple system where your XML includes the data-type of the information being sent, and you can use type information available from MySQL and PHP to send what you want. But there are more and more complexities as you add more and more types of data: int float text are simple enough, but then you go with char() and varchar() and throw in BLOB and ... If you want to support *ALL* data types, you've got a major project on your hands, though, especially as you'll find that converting data into and out of XML will make some things a lot more complex than they seem at first glance. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sharing info between websites with XML?
p80 wrote: I have several website that use mysql as a database and I would like them to access each other DB. The problem is that I can't connect to each other mysql DB so I'm looking for a way to do so. Why aren't you able to connect to the other databases? cause hosters forbid it. Get somebody else to host your MySQL database that *does* allow remote connections, I guess... Or, if the amount of traffic is *REALLY* low, you could write PHP scripts on each host, that provide the data the other hosts need... Is that what prompted the XML question? Ah. Well, really, switching hosts is probably going to be the easiest solution -- Or convince your host to give you a custom database that is accessible to all your sites. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php self problem
hi i use framework in my scripts, and i have a problem with forms that calls the same page for example i have a form in that link http://localhost/play/index.php?fuseaction=SiteMain.showGamePageGame_ID=33 when i use $PHP_SELF it goes to http://localhost/play/index.php so how can i make the form go to the same page with the passed fuseaction and Game_ID variables can anyone help ? Ahmed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session newbyness...
Tony Di Croce wrote: I just started using PHP a week or so ago... And everything is coming along great... But I have some general question about sessions... Actually, about PHP's built in session support. Do I need to call session_start() in every script that needs access to $_SESSION[]? Would it cause any problems if I do? If not, am I supposed to just call it once on the login page for my website and then thats it? I think I would like to store a user id in my $_SESSION[] global. If this variable is set, I will consider this session logged in. Is their a secure way to do this? I would like to have at least an outline of how this works in my head, so tell me if I am wrong in any of this: When session_start() is called, this function sets a cookie in this browser with a unique value that is bound to a set of globals (IE, the contents of $_SESSION[]). When subsequent HTTP requests have this cookie attached, the correct set of $_SESSION[] variables is loaded... Everything right? On any _main_ page that you need to use the session, you need to call session_start() before doing anything with the session. You don't need to call it on pages that are included/required into the _main_ page. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php self problem
hi thanks, i used it but i have a new problem but i solved it so for people who will face the same problem u can do this $same_page = $PHP_SELF.?.$_SERVER['QUERY_STRING']; this will go to the same page with the variables passed too thanks for help Ahmed Abdelaliem On Mon, 13 Dec 2004 16:54:42 -0500, John Nichel [EMAIL PROTECTED] wrote: Ahmed Abdel-Aliem wrote: hi i use framework in my scripts, and i have a problem with forms that calls the same page for example i have a form in that link http://localhost/play/index.php?fuseaction=SiteMain.showGamePageGame_ID=33 when i use $PHP_SELF it goes to http://localhost/play/index.php so how can i make the form go to the same page with the passed fuseaction and Game_ID variables can anyone help ? Ahmed $_SERVER['QUERY_STRING'] -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [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] Re: getimagesize() for image resources
Greg Donald wrote: Does anyone know a way to get the size of an an image while it exists as an image resource? getimagesize() appears to work on image files, but not image resources. I need something that works on image resources like those created with the PHP imagecreatefrom* functions. I realize I can write the file to disk, then acquire the info.. that's the step I'm trying to avoid if possible. TIA.. imagesx() and imagesy() -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] STUMPED: path/style vars in Windows with IIS
Hi Richard. Thank you for the reply. I was dragged to IIS kicking and screaming! I have been doing php development for almost 6 years, and this will be my first production-level experience with php through IIS... Unfortunately it is a hosted environment and there is a legacy coldfusion application that needs to be maintained. We could not find a hosting company that offers php coldfusion via apache, as well as meeting some other email-related and SLA requirements. I changed my Link class to use the ?normal=style vars rather than /path/style, and thereby am circumventing the issue for the time-being. Thank you, Chris --- Richard Lynch [EMAIL PROTECTED] wrote: Ck wrote: Hello. I am trying to get path/style variables working in windows with IIS on a hosted environment. What I mean by path/style variables is the following: Say I have a script test.php that can be accessed via: http://mydomain/controller.php ...I want to pass variables to it like: http://mydomain/controller.php/article/10 ...With IIS, I get a 404 Object Not Found error when I append anything after controller.php. In the past with Apache this has always just simply worked, even as a cgi module. What do I do to get this working with IIS? Switch to Apache :-) http://apache.org Actually, semi-seriously -- If you *can* switch, you'll be able to install, configure, and fix this issue in Apache faster than you can figure out how to fix this one issue in IIS. Much less fix all the other issues you're going to run into in IIS. YMMV. -- Like Music? http://l-i-e.com/artists.htm -- 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] session newbyness...
I just started using PHP a week or so ago... And everything is coming along great... But I have some general question about sessions... Actually, about PHP's built in session support. Do I need to call session_start() in every script that needs access to $_SESSION[]? Would it cause any problems if I do? If not, am I supposed to just call it once on the login page for my website and then thats it? I think I would like to store a user id in my $_SESSION[] global. If this variable is set, I will consider this session logged in. Is their a secure way to do this? I would like to have at least an outline of how this works in my head, so tell me if I am wrong in any of this: When session_start() is called, this function sets a cookie in this browser with a unique value that is bound to a set of globals (IE, the contents of $_SESSION[]). When subsequent HTTP requests have this cookie attached, the correct set of $_SESSION[] variables is loaded... Everything right? -- td -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: getimagesize() for image resources
On Mon, 13 Dec 2004 23:17:22 +0100, M. Sokolewicz [EMAIL PROTECTED] wrote: imagesx() and imagesy() I knew there had to be a way. Thanks so much. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session newbyness...
Greg Donald wrote: On Mon, 13 Dec 2004 14:09:02 -0800, Tony Di Croce [EMAIL PROTECTED] wrote: I just started using PHP a week or so ago... And everything is coming along great... Awesome, welcome to the club. :) But I have some general question about sessions... Actually, about PHP's built in session support. Do I need to call session_start() in every script that needs access to $_SESSION[]? Yup. I place the call in my config.php file that I include in all my other PHP files. I think I would like to store a user id in my $_SESSION[] global. If this variable is set, I will consider this session logged in. Is their a secure way to do this? That's pretty much how I do it. User's who are not logged in have a $_SESSION['userid'] equal to zero. Logged-in users have their userid set as it exists in the table of users. it's a very common way of doing it :) (yes, I use it aswell) I would like to have at least an outline of how this works in my head, so tell me if I am wrong in any of this: When session_start() is called, this function sets a cookie in this browser with a unique value that is bound to a set of globals (IE, the contents of $_SESSION[]). When subsequent HTTP requests have this cookie attached, the correct set of $_SESSION[] variables is loaded... Everything right? Yup. There are ways to encrypt you PHP sessions if you need such functionality. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Delivering large files via PHP (300MB)
Hello Greg, Monday, December 13, 2004, 9:42:30 PM, you wrote: GD Use set_time_limit(0); to prevent the timeout. ignore_user_abort() is GD pretty handy too. Yeah, I have the time-out limit in there already (the client end will detect for a time-out from the server as well). GD If that doesn't work you might give them authenticated http access GD with temporary passwords. You can have the usernames and passwords GD in a db and pass the proper auth headers with PHP. I did think of this, and it gets around a few issues, but if they are not running any software to manage the download, and are not using a decent browser (ala FireFox) we still hit the same cannot resume problem should the download abort. I'm also aware that it's not such a hot idea to lock-up Apache for the time it takes to download the whole file, especially with a large number of users doing this. GD Apache 2 is pretty good with multiple threads from what I hear. I use GD it but not in a production environment. Most of our servers run 1.3 - which is perfectly good, no complaints there, it's just HTTP itself was never even really designed for extremely large file downloads, so I am wary of any single server+browser solution. Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services I am not young enough to know everything. - Oscar Wilde -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Delivering large files via PHP (300MB)
Hello Bruce, Monday, December 13, 2004, 9:22:52 PM, you wrote: BD you might also look into 'bit torrent'... Not really any use at all in this situation. Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services I am not young enough to know everything. - Oscar Wilde -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fsockopen https problem
Maycon de Oliveira wrote: Hi, i have problem in my script, this error is Permission Danied (13) ? $host = 193.132.139.36; $port = 443; $path = /gatekeeper/ink/quexry.asp; //or .dll, etc. for authnet, etc. $fp = fsockopen(https://.$host, $port, $errno, $errstr, $timeout = 10); You can't just open up a socket on port 443 to a secure server and start sending/getting data. The whole point of SSL is that you need to provide a half of an SSH key-pair, and get half of their key-pair, then you each generate a key-pair from your secret half key-pairs, and then you swap those so you each know the other has the secret half of the key-pair they gave you, then you can send a new unique key-pair to encrypt/decrypt the data, and then you can start sending the username/password back and forth safely to be logged in, and then you can kiss each other... You could, in theory, develop all of the code to implement this protocol for yourself and use fsockopen as you are. But it would be *WAY* mo' betta to just use this: http://php.net/curl Have fun. PS Keep all the urlencode stuff you have -- That's all good. Just the fsockopen bit needs to change. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Apache Upload file Permission denied
Hi all, the user is apache for PHP. the directory is owned by apache user. I am 100% certain for the directory name. yours, Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Delivering large files via PHP (300MB)
Richard Davey wrote: So I came up with an idea that I'd like your opinions on: I built a small but friendly Windows application (50KB in size) that will connect to the web server via HTTPS, check the download credentials and if all is ok, it then downloads the file via HTTP in 1MB chunks. The file is just a single EXE file sat outside of my web root, and the PHP script that serves the file uses fopen() to open the file, then fseeks to the required section of it, reads in 1MB worth of data, closes the file and then echos this out (after suitable headers of course, shown below) This sounds an awful lot like various web installers. It's likely that there are pre-existing applications out there to do the same thing as yours. They might even support interrupted downloads better, or have other features worth investigating. For sure, having them be somebody else's code to be maintained has its pros and cons. It would be worth your time, maybe, to investigate them. I'd suggest starting with the traditional installer software vendors whose name you always see when you install software. I'm aware my app is for Windows only (although I could easily port it to OS X), but the files they are downloading are PC games anyway, so it's no bad thing in this case. I have been known to download a Windows app on my non-Windows work computer, and then burn a CD to take it home. Especially if it's 300MB -- where the bandwidth of the download machine is more important to the user than the OS on it. Granted, that's going to be a very very very small minority of users, but it's something to consider -- Sooner or later, you are excluding some user somewhere by limitin the download application to Windows users. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unreliable mail delivery through PHP
Hello, I have a function that is called each time a new visitor creates an account on our site. The function is as follows: ?php function send_new_account_alert() { $to= ADMIN_EMAIL; $from = Accounts accounts@.SITE_DOMAIN.; $subject = New Account Created at .SITE_NAME; $tmp_ADMIN_URL = ADMIN_URL; $body = QQQ A new account has been created and needs approval. You can find a list of accounts that nead approval by logging in to the admin section found at: $tmp_ADMIN_URL Do not reply to this email as it is unattended. QQQ; send_email($to, $from, $subject, $body); } function send_email($to, $from, $subject, $body, $bcc = false) { $headers = From: $from\n .Reply-To: $from\n .X-Mailer: PHP/.phpversion(); if($bcc != false) { $headers .= \nBcc: $bcc; } mail($to, $subject, $body, $headers); } ? Assuming all the email addresses are correct, is there anything about the above two functions that is incorrect or might be causing the unreliable'ness'? Or maybe someone has some tips for debugging this kind of thing? Specifically, what's happening is that I don't get the same number of emails as I do new users. Let's say I get an email notifying me of a new account, when I get to the Admin section I'll see that there are maybe 2, 3, or 4 accounts waiting to be approved (administrator approval is required in most cases). But I didn't get that many emails, I just got the one. I haven't been able to figure out why yet. The server is not under any amount of load (almost no load in fact) that would cause something like this. Any ideas are welcome. Thanks, Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Apache Upload file Permission denied
And apache user can read/write /tmp? What files are in /tmp? su to apache and see if you can read the uploaded files, and mv them to the directory. Michael Leung wrote: Hi all, the user is apache for PHP. the directory is owned by apache user. I am 100% certain for the directory name. yours, Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] bargraph gd not working
Hi guys: I'm using php5 on winxp with IIS. I'm trying to run a simple bar graph demo found it on phpbuilder site. When I run it I get nothing but an x in the top left corner of my web page(no errors nothing). GD is uncommented in my php.ini, ext dir set and I have verified that GD is installed through php -m,phpinfo() , and gd_info(). Can anyone offer me some advice on how to troubleshoot this problem. I searched google, and did see other posts like mine but no solutions. Any thoughts or suggestions would be appreciated -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Close all open tags in HTML text
On 09-Dec-2004 Marek Kilimajer wrote: snipage not really, but it removes script and /script so javascript is not interpreted. $txt = preg_replace('|script[^]*?.*?/script|si', '', $txt); Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Apache Upload file Permission denied
Hi, Yes, apache can do read/write in /tmp. I can't su to apache. But I created another account in apache group(userid test1). I have such tests by using that account. I can do mv , cp , create new file. After those successful test, I have modified httpd.conf to make apache web server run as test1. But they are still working like the same error. yours, Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Delivering large files via PHP (300MB)
On Mon, 13 Dec 2004 13:22:52 -0800 (GMT-08:00), Bruce Douglas [EMAIL PROTECTED] wrote: you might also look into 'bit torrent'... You must have missed the part about 'cannot have this file in a public location'. Just thought I would pick the collective brain on this one. I have a requirement to deliver a large EXE file to customers after they order. The file is just under 400 MB in size and, because they have just purchased it, I obviously cannot have this file in a public location on the web server that someone could browse to. I can push the file out quite easily using a modified header and a simple script to check if they can download it or not, but with such a large file a significant number of web browsers fail to obtain the entire EXE before closing - or any other number of factors kick into play (their PC resets, ISP disconnects, Windows crashes, etc). Use set_time_limit(0); to prevent the timeout. ignore_user_abort() is pretty handy too. If that doesn't work you might give them authenticated http access with temporary passwords. You can have the usernames and passwords in a db and pass the proper auth headers with PHP. Some browsers support resuming download, but not when the file has been sent via the headers I use, also FTP is not an option as I cannot create and destroy FTP users on the server easily (or for that matter assume the customer knows how to perform FTP operations). I feel your pain. I'm also aware that it's not such a hot idea to lock-up Apache for the time it takes to download the whole file, especially with a large number of users doing this. Apache 2 is pretty good with multiple threads from what I hear. I use it but not in a production environment. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session newbyness...
On Mon, 13 Dec 2004 14:09:02 -0800, Tony Di Croce [EMAIL PROTECTED] wrote: I just started using PHP a week or so ago... And everything is coming along great... Awesome, welcome to the club. :) But I have some general question about sessions... Actually, about PHP's built in session support. Do I need to call session_start() in every script that needs access to $_SESSION[]? Yup. I place the call in my config.php file that I include in all my other PHP files. I think I would like to store a user id in my $_SESSION[] global. If this variable is set, I will consider this session logged in. Is their a secure way to do this? That's pretty much how I do it. User's who are not logged in have a $_SESSION['userid'] equal to zero. Logged-in users have their userid set as it exists in the table of users. I would like to have at least an outline of how this works in my head, so tell me if I am wrong in any of this: When session_start() is called, this function sets a cookie in this browser with a unique value that is bound to a set of globals (IE, the contents of $_SESSION[]). When subsequent HTTP requests have this cookie attached, the correct set of $_SESSION[] variables is loaded... Everything right? Yup. There are ways to encrypt you PHP sessions if you need such functionality. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] bargraph gd not working
- Original Message - From: jm [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 14, 2004 3:22 AM Subject: [PHP] bargraph gd not working Hi guys: I'm using php5 on winxp with IIS. I'm trying to run a simple bar graph demo found it on phpbuilder site. When I run it I get nothing but an x in the top left corner of my web page(no errors nothing). GD is uncommented in my php.ini, ext dir set and I have verified that GD is installed through php -m,phpinfo() , and gd_info(). Can anyone offer me some advice on how to troubleshoot this problem. I searched google, and did see other posts like mine but no solutions. Any thoughts or suggestions would be appreciated Do other php/gd scripts work as expected? (ie display images) Do you send the correct headers to browser? Please show us the code cuz without it it's not so easy to help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php HTH Stan F -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-XML-DEV] DomXPath and default XML namespaces
On 14.12.2004 6:45 Uhr, Dan Phiffer wrote: Adam Maccabee Trachtenberg wrote: This is an XPath FAQ. Without a ns prefix, XPath doesn't choose elements living in the default ns, but ones living in no namespace. Are there any good references you might point me to? I'm pretty new to this stuff and beyond my in a Nutshell book don't have many places to consult yet. what happens to: root foo qxx/ /foo foo xmlns=bar qxx/ /foo /root And /root/foo/qxx? Do you select qxx in the default ns? Or not? -adam That makes perfect sense. I'm realizing that XPaths are not as portable as I thought they were. At least not without some way of converting element prefixes easily... You just have to learn that prefixes are just aliases to the real namespaces, then you're fine. Don't count on prefixes, they itself are meaninngless. And always use registerNamespace() for all namespaces you need in the XPath query. Then XPath is very portable. chregu Thanks, -Dan -- christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 http://www.bitflux.ch | [EMAIL PROTECTED] | gnupg-keyid 0x5CE1DECB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] curl libraries on Debian Woody with apache 1.3.29.0.2-6 and php 4.3.4-4
Dear friends, we would like to use the curl libraries on a server, which is open on the internet. We would like to know about security issues with curl, before installing it. We are using Debian Woody (some few packages from Sarge), and apache 1.3.29.0.2-6 and php 4.3.4-4. Thanks in advance. -- symbulos partners -.- symbulos ethical services for your organisation http://www.symbulos.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Byte Array
You're right. I think it will. Thanks. I've got another issue now though which may indeed be a show-stopper. It seems that while socket_recvfrom is binary safe, there's no way to send data in any way other than a string... Is that right? Can I not send data of other types? Ian On Mon, 2004-12-13 at 07:57 -0800, Chris wrote: Try the unpack function, it should do quite nicely. Chris Ian Firla wrote: Hello All, I've hit a bit of a show stopper in a project I'm working on. I'm getting a 65 byte stream of data. 32 of those bytes are of the type Byte Array. Is there a way that I can covert that data into something useful? For the record, the data stream that I'm getting is in the format: |ascii|ascii|asciiX10|integerX4|byte arrayX32| The byte array looks like this: g..UA9x|%r9. Any ideas? Ian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php.ini
restart your webserver Travis Conway [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What is the default place for php.ini? I have a few copies when I do a `whereis php.ini`. I figure it is the /etc/php.ini. Anyone shed some light? Also, is there anything that must be done after I modify the php.ini? Trav -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] email processing
Hi Adwin, I don't know if this'll help you but the way I've done it on my site is to send out a confirmation email with a link the user needs to follow to confirm. The link ends with two GET variables, one being the username and one being a unique number created for their account at time of registration. Eg xxx.org/verify.php?username=monkeyid=1D21xepFkk465 When the link is followed, the php page 'verify.php' includes something a little like this //*** $query = SELECT * FROM members WHERE username='$_GET[username]' AND id='$_GET[id]'; $result = mysql_query($query) or die(); $num_results = mysql_num_rows($result); if ($num_results == 1) { // Set authorisation to yes // Send email / Display confirmation message } else { // Display failure message } ***// I'm sure there are better ways of doing it than this but I find this works effectively for what I need. Also, you can give the recipient an easy way to unregister if someone has added them to your databse against their wishes through either a switch function or a separate page eg: To confirm, click here: .org/verify.php?action=confirmuser=id= To remove yourself, click here: ...org/verify.php?Action=removeuser=id= --- switch ($action) { case remove : // MySQL remove case confirm : // MySQL confirm OR To confirm, org/confirm.php?username=id= To remove, org/remove.php?username=id= Hope this helps? adwin wijaya wrote: Hi all :) I want to create a system to process the email that coming. For example, I send a confirmation email to our client and they just simply reply the email that we send to them to verify. The problem I got, I dont know how to process the email that coming to our mailbox and process the message inside with PHP. can someone recommend me a PHP class that has been created for handling this task ? -- -- David Green Information Centre, Central Science Laboratory Sand Hutton, York, YO41 1LZ Phone: +44 (0)1904 462388 (GTN: 5129 2388) Fax:+44 (0)1904 462111 E-Mail: [EMAIL PROTECTED] -- CSL email disclaimer: http://www.csl.gov.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Delivering large files via PHP (300MB)
Hello Richard, Tuesday, December 14, 2004, 12:02:19 AM, you wrote: RL This sounds an awful lot like various web installers. Sure, there's nothing unique about the concept. The aim was to reduce to load on the web server and make things a little easier for the end user. You can code Install Shield to download from a site before installing (which a lot of programs do), but it doesn't solve the server side solution in this respect. RL It's likely that there are pre-existing applications out there to do the RL same thing as yours. Yes, but not branded to my needs and I dare say not as compact either. RL They might even support interrupted downloads better, or have other RL features worth investigating. The app I built supports interrupted downloads perfectly. RL It would be worth your time, maybe, to investigate them. I'd suggest RL starting with the traditional installer software vendors whose name you RL always see when you install software. That would lock us into a platform specific environment too :) You don't run an Install Shield web delivery system by executing the setup file on a Mac just because you're at work and can burn it to CD :) I was more interested in comments re: the PHP side of things anyway - is it better to be spitting out 1MB segments and then letting the process finish and Apache free-up that httpd session, or does it make no difference to PHP or memory load, etc and we can just blast out 300MB+ files regardless. Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services I am not young enough to know everything. - Oscar Wilde -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Delivering large files via PHP (300MB)
Hello rouvas, Tuesday, December 14, 2004, 1:33:07 PM, you wrote: r Why don't you take the PHP out of the loop entirely? r Make a dir into the Apache area with a custom .htaccess r (with usernames/passwords, etc) and put the required files there. Then the files have to be within the web root and it'll only take one person to share out the username/password. It needs controlling as to who can download and how many times. PHP has to be in the loop somewhere (although granted, not for the actual file delivery). r From the thread I understood that you don't split the file into smaller r chunks, but instead server chunks from the same big file. This is bad r practice, as I've found out from personal experience. It is better to serve r small files as they finish earlier and free the server processes. What's the difference between serving a small 1MB file, and reading in 1MB of data from a 300MB file, closing that read operation and then outputting the result? I cannot see how actually splitting the file into 1MB chunks on the server will make it finish earlier. 1MB of data is 1MB of data, regardless how PHP read it in. The only real advantage might be in disk seek times however, so PHP wouldn't have to seek into the middle of a large file for example. r Also, this would allow users that already have other download accelerators r installed to grab the files. Download accelerators need a direct link to the file itself. The moment we have that, we're back to square one again. If it was that simple then when you buy something like a Symantec product on-line they'd just give you a link to the file. But they don't, you have to download their package installer app first. Large game downloads work in a similar way (Direct2Disk, Gigex Download, etc). I do not believe this is an uncommon practise, I just want my server to not get hammered. Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services I am not young enough to know everything. - Oscar Wilde -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Delivering large files via PHP (300MB)
[...snip...] RL always see when you install software. That would lock us into a platform specific environment too :) You don't run an Install Shield web delivery system by executing the setup file on a Mac just because you're at work and can burn it to CD :) I was more interested in comments re: the PHP side of things anyway - is it better to be spitting out 1MB segments and then letting the process finish and Apache free-up that httpd session, or does it make no difference to PHP or memory load, etc and we can just blast out 300MB+ files regardless. Why don't you take the PHP out of the loop entirely? Make a dir into the Apache area with a custom .htaccess (with usernames/passwords, etc) and put the required files there. Your app can download from there. From the thread I understood that you don't split the file into smaller chunks, but instead server chunks from the same big file. This is bad practice, as I've found out from personal experience. It is better to serve small files as they finish earlier and free the server processes. Also, this would allow users that already have other download accelerators installed to grab the files. Just my 0.02 euros... -Stathis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] curl libraries on Debian Woody with apache 1.3.29.0.2-6 and php 4.3.4-4
symbulos partners wrote: We would like to know about security issues with curl, before installing it. hem, this is a PHP list. Perhaps you're talking about curl PHP extension? We are using Debian Woody (some few packages from Sarge), and apache 1.3.29.0.2-6 and php 4.3.4-4. For Debian security, check these Archives of mailing list debian-security-announce http://lists.debian.org/debian-security-announce/debian-security-announce-2004/threads.html http://www.debian.org/security/ http://www.debian.org/security/2004/ http://www.debian.org/security/2003/ etc Also non vuln packages on Woody (Debian 3.0) http://www.debian.org/security/nonvulns-woody Also non vuln packages on Sarge (Debian 3.1) http://www.debian.org/security/nonvulns-sarge If you're mixing Woody/stable with Sarge/testing or unstable, check this (also for security) http://backports.org/ Hope this helps, Christophe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Delivering large files via PHP (300MB)
On Tuesday 14 December 2004 15:53, Richard Davey wrote: Hello rouvas, Tuesday, December 14, 2004, 1:33:07 PM, you wrote: r Why don't you take the PHP out of the loop entirely? r Make a dir into the Apache area with a custom .htaccess r (with usernames/passwords, etc) and put the required files there. Then the files have to be within the web root and it'll only take one person to share out the username/password. Not to the web root, but to an arbitrary named on-the-fly created dir protected with a *custom* (and different for each dir) .htaccess file (and accompanying htpasswd entries). Then, there would be no single pass to share. You can even make it time-limited, so as to expire after a predefined period. And anyway, what's from stopping the user to share the file after it has been downloaded into theri machine? It needs controlling as to who can download and how many times. PHP has to be in the loop somewhere (although granted, not for the actual file delivery). Sure you need to control it. But you need to control when, how (and if) the file gets to the client, not what or from where it gets served. which in my mind calls for something on the client side along the lines of your prog. r From the thread I understood that you don't split the file into smaller r chunks, but instead server chunks from the same big file. This is bad r practice, as I've found out from personal experience. It is better to serve r small files as they finish earlier and free the server processes. What's the difference between serving a small 1MB file, and reading in 1MB of data from a 300MB file, closing that read operation and then outputting the result? I cannot see how actually splitting the file into 1MB chunks on the server will make it finish earlier. 1MB of data is 1MB of data, regardless how PHP read it in. The only real advantage might be in disk seek times however, so PHP wouldn't have to seek into the middle of a large file for example. Assuming, that (a) you are sharing the same big file and (b) the number of users downloading is significant, then : (a) PHP is slower than Apache (b) Apache can cache the 1MB files, at least some of them, and serve them to the next client r Also, this would allow users that already have other download accelerators r installed to grab the files. Download accelerators need a direct link to the file itself. The moment we have that, we're back to square one again. The url to the download accelerators could contain authentication info. If it was that simple then when you buy something like a Symantec [...snip...] I don't think it's complicated. BTW, I don't find your solution compilcated, on the contrary is quite straightforward. and to be honest I don't think there is any reason to change it. I'm only replying to offer an alternative... -Stathis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Delivering large files via PHP (300MB)
On Dec 14, 2004, at 8:53 AM, Richard Davey wrote: Tuesday, December 14, 2004, 1:33:07 PM, you wrote: r Why don't you take the PHP out of the loop entirely? r Make a dir into the Apache area with a custom .htaccess r (with usernames/passwords, etc) and put the required files there. Then the files have to be within the web root and it'll only take one person to share out the username/password. It needs controlling as to who can download and how many times. PHP has to be in the loop somewhere (although granted, not for the actual file delivery). How's about using PHP to update a database of username/password pairs and then using something like apache mod_auth_mysql to authenticate a user logging in against the database? You could then write a MySQL procedure to automatically update a field showing that that user has logged in X times and use cron to periodically remove users (or change their group etc) who have used up their logins, or parse the server logs periodically to extract the same information. James. -- James Stewart : Freelance Web Developer Work : http://jystewart.net Play : http://james.anthropiccollective.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Byte Array
Just a follow-up to myself... I decided to try packet sniffing to see what was going on and ettercap confirms that I'm sending out strings rather than data of the type stored in my array: 16:12:26 192.168.0.101:32779 -- 192.168.0.88:32896 | UDP | : 3331 31 That 31 should be an integer of only one byte, not two. The function that's doing the sending looks like this: function send_back($sock, $msg, $ip, $port) { $fp = fsockopen(udp://$ip, $port, $errno, $errstr); foreach ($msg as $msg_to_send) { fwrite($fp, $msg_to_send); echo date(H:i:s). SENT '$msg_to_send'\n; //seen server side } fclose($fp); } Can anyone see where I might be going wrong? Why am I not sending the integers as integers and the binary bits as binary bits? Ian On Tue, 2004-12-14 at 12:12 +0100, Ian Firla wrote: You're right. I think it will. Thanks. I've got another issue now though which may indeed be a show-stopper. It seems that while socket_recvfrom is binary safe, there's no way to send data in any way other than a string... Is that right? Can I not send data of other types? Ian On Mon, 2004-12-13 at 07:57 -0800, Chris wrote: Try the unpack function, it should do quite nicely. Chris Ian Firla wrote: Hello All, I've hit a bit of a show stopper in a project I'm working on. I'm getting a 65 byte stream of data. 32 of those bytes are of the type Byte Array. Is there a way that I can covert that data into something useful? For the record, the data stream that I'm getting is in the format: |ascii|ascii|asciiX10|integerX4|byte arrayX32| The byte array looks like this: g..UA9x|%r9. Any ideas? Ian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php