Re: [PHP] Why not user...?
Hi! Thnank you for your input, but I used AUTH_USER-server variable instead of PHP_AUTH_USER and that did the trick! :-) Best regards /Gustav W iberg - Original Message - From: "Richard Lynch" <[EMAIL PROTECTED]> To: "Stut" <[EMAIL PROTECTED]> Cc: "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General" Sent: Tuesday, August 28, 2007 3:20 AM Subject: Re: [PHP] Why not user...? On Mon, August 27, 2007 8:51 am, Stut wrote: Gustav Wiberg wrote: Why is it so that I get this error. I'm using Windows Integrated authorization-method for actual webb I'm testing on. Notice: Undefined index: PHP_AUTH_USER in C:\www\utveckling\username.php on line 2 For some reason it's not getting set. This could be because you've not configured IIS correctly, are you sure you've disabled anonymous authentication? If you're sure it's configured correctly try var_dump'ing $_SERVER - it's possible (though unlikely) the username is in another place. Going for the more obvious... Did you perhaps take code written with the default setting of E_ALL ~ E_NOTICE and are now running it with E_ALL, and this is the first page-view before you've even typed in your usernane/password? Cuz that for sure would do it. Change the code to be more like this: if (isset($_SERVER['PHP_AUTH_USER'])){ //try to login } You'll probably have a fair number of these E_NOTICE thingies to fix before you are through. They're all trivial to fix, and there's no real excuse to have code that has E_NOTICE messages firing off anyway. Under extreme pressure, you can switch to E_ALL ~ E_NOTICE for this app for now and put it on the ToDo list to fix it right someday... -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] why?
Hi! Yes, a single sign-on it is... It doesn't work together with Windows (and PHP) you mean? Best regards /Gustav Wiberg - Original Message - From: "Jay Blanchard" <[EMAIL PROTECTED]> To: "Jay Blanchard" <[EMAIL PROTECTED]>; "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General" Sent: Monday, August 27, 2007 9:26 PM Subject: RE: [PHP] why? [snip] ... be the same as using computer locally on the network, but I have to enter username and password. I'm sure I have checked the "Windows Integreated authenication" - checkbox for the website it's about. When I have entered username and password I can go on and do whatever I want on that site... I've tested with both IE6, and IE7. What could be the problem? http://us.php.net/features.http-auth [/snip] I hit send before I finished my thoughts Are you trying to do single sign-on? This would be one of the holy grails of the PHP on Linux, Windows clients operations. This is available with .Net and with legacy ASP/Jscript apps but not with PHPeven on windows -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] why?
Hi! Ok. Of course Why didn't I think of that? Thanx! :-) Best regards /Gustav Wiberg - Original Message - From: "Stut" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Cc: "PHP General" Sent: Monday, August 27, 2007 8:59 PM Subject: Re: [PHP] why? Gustav Wiberg wrote: No it doesn't seem to work locally either (I haven't tested myself, but a working-friend did) I suggest you find a Windows Server mailing list and ask there. This is almost certainly not an issue with PHP. You might also want to find/write an ASP script that will show the username of the logged in user so you can take PHP out of the equation. Once it's working with ASP it should work with PHP. -Stut - Original Message - From: "Stut" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Cc: "PHP General" Sent: Monday, August 27, 2007 8:51 PM Subject: Re: [PHP] why? Gustav Wiberg wrote: I can't figure the thing with Windows Integrated authentication... I have checked a website for doing this. I still have to enter username and password even if I'm on the local computer (through a VPN though) This would be the same as using computer locally on the network, but I have to enter username and password. I'm sure I have checked the "Windows Integreated authenication" - checkbox for the website it's about. When I have entered username and password I can go on and do whatever I want on that site... I've tested with both IE6, and IE7. What could be the problem? Transparent authentication between IE and IIS may not work over a VPN depending on a huge number of factors, but mainly how the VPN server has been configured. Does it work when on the same network as the web server and AD server? -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] why?
Hi! No it doesn't seem to work locally either (I haven't tested myself, but a working-friend did) Best regards /Gustav Wiberg - Original Message - From: "Stut" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Cc: "PHP General" Sent: Monday, August 27, 2007 8:51 PM Subject: Re: [PHP] why? Gustav Wiberg wrote: I can't figure the thing with Windows Integrated authentication... I have checked a website for doing this. I still have to enter username and password even if I'm on the local computer (through a VPN though) This would be the same as using computer locally on the network, but I have to enter username and password. I'm sure I have checked the "Windows Integreated authenication" - checkbox for the website it's about. When I have entered username and password I can go on and do whatever I want on that site... I've tested with both IE6, and IE7. What could be the problem? Transparent authentication between IE and IIS may not work over a VPN depending on a huge number of factors, but mainly how the VPN server has been configured. Does it work when on the same network as the web server and AD server? -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] windows auth with php
Hi again! I read "The HTTP Authentication hooks in PHP are only available when it is running as an Apache module and is hence not available in the CGI version. In an Apache module PHP script, it is possible to use the header() function to send an "Authentication Required" message to the client browser causing it to pop up a Username/Password input window. Once the user has filled in a username and a password, the URL containing the PHP script will be called again with the predefined variables PHP_AUTH_USER, PHP_AUTH_PW, and AUTH_TYPE set to the user name, password and authentication type respectively. These predefined variables are found in the $_SERVER and $HTTP_SERVER_VARS arrays. Both "Basic" and "Digest" (since PHP 5.1.0) authentication methods are supported. See the header() function for more information." I'm checking Windows Integrated Authentication in IIS 6.0 and I'm using PHP 5.0.1. PHP is working as an ISAPI-module. Is this the problem? Is that why the authentication is not working automatically? (without logging in with username and password at first) Or is the version of PHP the problem? Should it be larger than 5.1.0 ? Is that why the authentication is not working automatically? (without logging in with username and password at first) I'm trying with IE6 and IE7... Best regards /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] why?
Hi! I can't figure the thing with Windows Integrated authentication... I have checked a website for doing this. I still have to enter username and password even if I'm on the local computer (through a VPN though) This would be the same as using computer locally on the network, but I have to enter username and password. I'm sure I have checked the "Windows Integreated authenication" - checkbox for the website it's about. When I have entered username and password I can go on and do whatever I want on that site... I've tested with both IE6, and IE7. What could be the problem? Best regards /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why not user...?
Hi! Thanx! I figured it out. The username wasn't in server-variable PHP_AUTH_USER but in AUTH_USER Best regards /Gustav Wiberg - Original Message - From: "Stut" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Cc: "PHP General" Sent: Monday, August 27, 2007 3:51 PM Subject: Re: [PHP] Why not user...? Gustav Wiberg wrote: Why is it so that I get this error. I'm using Windows Integrated authorization-method for actual webb I'm testing on. Notice: Undefined index: PHP_AUTH_USER in C:\www\utveckling\username.php on line 2 For some reason it's not getting set. This could be because you've not configured IIS correctly, are you sure you've disabled anonymous authentication? If you're sure it's configured correctly try var_dump'ing $_SERVER - it's possible (though unlikely) the username is in another place. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Why not user...?
Hi! Why is it so that I get this error. I'm using Windows Integrated authorization-method for actual webb I'm testing on. Notice: Undefined index: PHP_AUTH_USER in C:\www\utveckling\username.php on line 2 ? Best regards /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-WIN] Confused
AHA.. Thanx :-) /Gustav - Original Message - From: "John Mertic" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Cc: "Aaron Kenney" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, August 24, 2007 9:47 PM Subject: Re: [PHP-WIN] Confused Just grab the windows installer and choose LDAP under the Extensions tree. John On 8/24/07, Gustav Wiberg <[EMAIL PROTECTED]> wrote: Hi again! Sorry I'm so dumb, but what exactly should I download? I've tried to download OpenLDAP (Is this wrong?) ftp://ftp.openldap.org/pub/OpenLDAP/openldap-stable/openldap-stable-20070110.tgz but I found no php_ldap.dll Best regards /Gustav Wiberg - Original Message - From: "Aaron Kenney" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, August 24, 2007 4:44 PM Subject: Re: [PHP-WIN] Confused > To get LDAP working in PHP for Windows, you first need to download the > ZIP package of PHP. Extract the ZIP package to some folder (do NOT > overwrite your PHP installation!). From the files you have extracted, > open the /ext folder and copy the php_ldap.dll file. Paste the file > into the /ext folder of your PHP installation. Make sure that the file > has appropriate security so that your web server can access it. > Then edit the php.ini file and remove the ; so that the line > > ;extension=php_ldap.dll > > reads > > extension=php_ldap.dll > > if you do not have the original line, simply add the new line before > the Module Settings section. Restart IIS or Apache (whichever one you > are using). > > Here is an example of connecting and binding: > > $ldaprdn = '[EMAIL PROTECTED]'; > $ldappass = 'PWD'; > $ds = 'servername.domainname.net'; > $dn = 'dc=domainname,dc=net'; > $ldapport = 389; > $ldapconn = ldap_connect($ds, $ldapport) > or die("Could not connect to LDAP server."); > > if ($ldapconn) > { > ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION,3); > ldap_set_option($ldapconn, LDAP_OPT_REFERRALS,0); > $ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass); > } > > I hope this helps. > -Aaron Kenney > > On 8/24/07, Gustav Wiberg <[EMAIL PROTECTED]> wrote: >> Hi there! >> >> Yes, thank you - please send me examples. LDAP seems to be a part of >> Active Directory. I guess in true Microsoft-spirit, it isn't possible >> to >> turn it on or off. >> >> It seems you have to compile LDAP together with PHP on Windows. How do >> I >> do that? I tried to follow the instructions on php.net but I got >> lost... >> >> Best regards >> /Gustav Wiberg >> >> >> >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >> Sent: Friday, August 24, 2007 4:04 PM >> To: Gustav Wiberg >> Subject: Re: [PHP-WIN] Confused >> >> I don't know exactly how to do it but LDAP connection is available as >> a >> setting on active directory. I'm not sure how one turns it on or off, >> but >> it is possible. It was discussed on this list some time ago. I can >> send >> you an example of the script I used to connect if needed. >> Sent via BlackBerry from T-Mobile >> >> -Original Message- >> From: Gustav Wiberg <[EMAIL PROTECTED]> >> >> Date: Fri, 24 Aug 2007 15:56:00 >> To:"'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> >> Subject: FW: [PHP-WIN] Confused >> >> Hello! >> >> IS Active Directory an LDAP server? (dumb question I know but I need >> to >> know :-)) >> >> Best regards >> /Gustav Wiberg >> >> >> -Original Message- >> From: Gustav Wiberg [mailto:[EMAIL PROTECTED] >> Sent: Friday, August 24, 2007 3:53 PM >> To: '[EMAIL PROTECTED]' >> Subject: [PHP-WIN] Confused >> >> Hi! >> >> LDAP Server, LDAP Client >> >> LDAP is a protocol >> >> >> LDAP Client is needed to be installed and compiled together with PHP >> so >> it would work. >> >> Do I Have to install an LDAP Server also? Where do I find that? *can't >> figure it out really* >> >> >> >> /Gustav >> >> >> No virus found in this outgoing message. >> Checked by AVG Free Edition. >> Version: 7.5.484 / Virus Database: 269.12.4/969 - Release Date: >> 2007-08-23 16:04 >> >> >> -- >> PHP Windows Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> >> No virus found in this outgoing message. >> Checked by AVG Free Edition. >> Version: 7.5.484 / Virus Database: 269.12.4/969 - Release Date: >> 2007-08-23 16:04 >> >> >> -- >> PHP Windows Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- -- John Mertic"Explaining a joke is like dissecting a frog: you [EMAIL PROTECTED] understand it better, but the frog dies in the process." -Mark Twain -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Random pictures - not twice
- Original Message - From: "tedd" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General" Sent: Monday, December 04, 2006 4:15 PM Subject: Re: [PHP] Random pictures - not twice At 11:20 PM +0100 12/3/06, Gustav Wiberg wrote: Hi there! I have created a script the generates random pictures... -snip- With this above script the same picture can be shown twice. Is there any smart way of avoiding this without having to rely on cookies/sessionids? Random does mean it can happen more than once. I think what you want is more along a shuffle. Look into the array function "shuffle". Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi there! Ok, thanx! I will check the function out :-) Best regards Gsutav Wiberg http://www.stammis.com/ - Stammis Internet - pedigrees on the net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Random pictures - not twice
- Original Message - From: <[EMAIL PROTECTED]> To: Cc: <[EMAIL PROTECTED]> Sent: Sunday, December 03, 2006 11:52 PM Subject: Re: [PHP] Random pictures - not twice Without using cookies or session information, you're going to go through your picture list faster depending on how many users are accessing the random pic page. If you don't make it user-specific, then it doesn't really matter if you go through the images sequentially.. it may appear random on the user end because other users are going to be grabbing sequential pics as well. If you want to stir the waters a bit, you could run them sequentially but randomize the sequence. This is what some music playlist programs do when you randomize a playlist. Instead of pulling a random song from the list and risking playing the same song back to back, it just shuffles the playlist and plays it sequentially. When you get to the end of your randomized list, you can re-shuffle it and start over. This gives some semblance of randomness. If you want to make sure each image gets its fair amount of time in the spotlight, you could keep track of how many times each image has been displayed. Having a database table with a list of all the image names and their 'served' count would let you weight your list a bit to give preference to the images that havn't been displayed that often. And if you want to give each user the total package, you can keep track of how many times each image was served to a specific user and weight your shuffling that way. I'm sure there are other ways, but there are just a few that may be viable for you, depending on the level of randomness per user you need. Let us know what solution you come up with. I'm sure others have had similar questions and just havn't asked. -TG = = = Original message = = = Hi there! I have created a script the generates random pictures... With this above script the same picture can be shown twice. Is there any smart way of avoiding this without having to rely on cookies/sessionids? Best regards /Gustav Wiberg Stammis Internet - http://www.stammis.com/ - pedigrees on the net ___ 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 Hi again! I've solved it with array_rand. It wasn't that hard at all, just had to know which function to use! :-) code: Best regards /Gustav Wiberg Stammis Internet - http://www.stammis.com/ - pedigrees on the net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Random pictures - not twice
Hi there! I have created a script the generates random pictures... With this above script the same picture can be shown twice. Is there any smart way of avoiding this without having to rely on cookies/sessionids? Best regards /Gustav Wiberg Stammis Internet - http://www.stammis.com/ - pedigrees on the net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Quotes?
I want to save this to a string... </pre><tt>var uri = '<a rel="nofollow" href="http://impse.tradedoubler.com/imp/img/16352388/1122503">http://impse.tradedoubler.com/imp/img/16352388/1122503</a>?' + new </tt><tt>String (Math.random()).substring (2, 11); </tt><tt>document.write('<a </tt><tt>href="<a rel="nofollow" href="http://clk.tradedoubler.com/click?p=48859&a=1122503&g=16352388"">http://clk.tradedoubler.com/click?p=48859&a=1122503&g=16352388"</a>; </tt><tt>target="_blank"><img src="'+uri+'" border=0></a>'); </tt><pre style="margin: 0em;"> How could i type? I've tried with ' and ".. but can't get it to work. tested diffrent types.. $str = ''; </pre><tt>$str = 'var uri = '<a rel="nofollow" href="http://impse.tradedoubler.com/imp/js/16350344/1122503">http://impse.tradedoubler.com/imp/js/16350344/1122503</a>?' + </tt><tt>new String (Math.random()).substring (2, 11);'; </tt><tt>$str = ""document.write('<sc'+'ript language="JavaScript" src="'+uri+'" </tt><tt>charset="ISO-8859-1"></sc'+'ript>');""; </tt><pre style="margin: 0em;"> $str = """"; Best regards /Gustav Wiberg Stammis Internet -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Open Source mailinglist?
[snip] I hope you don't kill me out there, but I'm totally out of luck here. I've been doing some research on Open Source questions because I want a product of mine to become better in any ways (yes, it's written in PHP and yes, it's Open Source). Because of not doing advertising here, I'll skip the name :-) I can't seem to find any place on the net where you can discuss Open Source-related questions in general??? [/snip] Don't Sourceforge and Freshmeat have lists? I've checked there, but I just find newsletters. At freshmeat I found some chat-function located at IRC, and I don't want to install IRC. , but no mailinglists... (or else I'm blind) Best regards /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Open Source mailinglist?
Hi there! I hope you don't kill me out there, but I'm totally out of luck here. I've been doing some research on Open Source questions because I want a product of mine to become better in any ways (yes, it's written in PHP and yes, it's Open Source). Because of not doing advertising here, I'll skip the name :-) I can't seem to find any place on the net where you can discuss Open Source-related questions in general??? Best regards /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Range mktime?
- Original Message - From: "Barry" <[EMAIL PROTECTED]> To: ; "Gustav Wiberg" <[EMAIL PROTECTED]> Cc: "PHP General" Sent: Thursday, May 18, 2006 1:45 PM Subject: [PHP] Re: Range mktime? Gustav Wiberg schrieb: Hi I wondew which range the mktime has? (in digits) In my case it always start with 1. something like 1147951344 Is this ALWAYS TRUE (that it would start with 1) Best regards /Gustav Wiberg mktime is giving you the time in seconds since 1st april 1970 So no. It's not true. -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Ok, thanx! Best regards /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Range mktime?
Hi I wondew which range the mktime has? (in digits) In my case it always start with 1. something like 1147951344 Is this ALWAYS TRUE (that it would start with 1) Best regards /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pictures and caches
Hi! The thing I want to do is to copy a picturefile to another picturefile. The thing is that I want to copy this file, show it , and then delete it (when it has been shown) .Is this possible? I want to do this, because of avoiding problems with cache when uploading file through an admin-online-system... (the customer uses IE) When I delete the file in code down below, the picture is not shown (I guess because the browser hasn't rendered out all info?) If you want more code, tell me :-) Best regards /Gustav Wiberg $fileName = "pictures/products/$dbIDProduct1" . "_small"; $ran = strval(mktime()); //Current time if (file_exists($fileName . ".gif")) { copy($fileName . ".gif", "pictures/products/1_$ran.gif"); showpicture("pictures/products/1_$ran.gif", $dbProductName1, 300, 150, "top"); //deletefile("pictures/products/1_$ran.gif"); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Check before uploading
- Original Message - From: "Stut" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Cc: "PHP General" Sent: Monday, May 15, 2006 10:32 PM Subject: Re: [PHP] Check before uploading Gustav Wiberg wrote: From: "Stut" <[EMAIL PROTECTED]> Gustav Wiberg wrote: Just a thought. Someone posted a question if you could check filesize before uploading some days ago. Maybe this is possible with Javascript? Javascript wouldn't be the best solution, cause of it's incompability between browsers, that users can inactivate it. But it's might be better than nothing.. The important thing is not to RELY on the Javascript-code. This was suggested at the time, but for what should be obvious reasons it's not possible due to security restrictions. Ok, do you have a solution the problem now? It wasn't my problem, and not I don't really have the solution. There really isn't a solution short of using a Java applet. PHP doesn't get a look in until the file has been uploaded, and Javascript doesn't have the security scruples. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Ok! Best regards /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Copy of image -> smaller
- Original Message - From: "Rabin Vincent" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Cc: "PHP General" Sent: Monday, May 15, 2006 1:35 PM Subject: Re: [PHP] Copy of image -> smaller On 5/15/06, Gustav Wiberg <[EMAIL PROTECTED]> wrote: [snip] //What should/could I do here? // //Set new width and height // $new_width = 100; $new_height = 200; $tmp_image=imagecreatefromjpeg($toPath . $mfileAdd); $width = imagesx($tmp_image); $height = imagesy($tmp_image); $new_image = imagecreatetruecolor($new_width,$new_height); ImageCopyResized($new_image, $tmp_image,0,0,0,0, $new_width, $new_height, $width, $height); I can't see anything wrong with this resizing. //Grab new image ob_start(); ImageJPEG($new_image); $image_buffer = ob_get_contents(); ob_end_clean(); ImageDestroy($new_image); //Create temporary file and write to it $fp = tmpfile(); fwrite($fp, $image_buffer); rewind($fp); Instead of doing this, you may want to use the filename argument of ImageJPEG to save the image directly to a file. //Upload new image $copyTo = 'http://www.ledins.se/test.jpg'; $conn_id = ftp_connect(''); ftp_login($conn_id,'',''); ftp_fput($conn_id, $copyTo, $fp, FTP_BINARY); Destination file ($copyTo) is supposed to be a path (eg. public_html/test.jpg) and not a URL. Ok! Thanx, that might be the problem! :-) Best regards /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Check before uploading
- Original Message - From: "Stut" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Cc: "PHP General" Sent: Monday, May 15, 2006 12:50 PM Subject: Re: [PHP] Check before uploading Gustav Wiberg wrote: Just a thought. Someone posted a question if you could check filesize before uploading some days ago. Maybe this is possible with Javascript? Javascript wouldn't be the best solution, cause of it's incompability between browsers, that users can inactivate it. But it's might be better than nothing.. The important thing is not to RELY on the Javascript-code. This was suggested at the time, but for what should be obvious reasons it's not possible due to security restrictions. -Stut Hi there! Ok, do you have a solution the problem now? Best regards /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Copy of image -> smaller
- Original Message - From: "Chris" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Cc: "PHP General" Sent: Monday, May 15, 2006 9:42 AM Subject: Re: [PHP] Copy of image -> smaller Gustav Wiberg wrote: Hi there! When I upload a picture from a form, then I want to create a copy with a smaller image. For example: I upload a picture with dimensions 200x150 name 4.jpg. I also want a copy of this image but with the dimensions 100x75 pixels. I've tried this below, but I'm missing something I think... :-) I'm using PHP 4.x (don't know exactly the vers.nr, but I can search for it if it is of importance) First of all *run* to this thread and add some security checks to your image uploading: http://marc.theaimsgroup.com/?l=php-general&m=114755779206436&w=2 Secondly, what does or doesn't happen with your code? It looks fine at first glance but do you get an error? What do you expect it to do and what does it actually do? -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi there! Thanx for tip about security! There is no errors displayed, but the file test.jpg isn't created. It isn't accessible when accessing http://www.ledins.se/test.jpg Best regards /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Check before uploading
Hi there! Just a thought. Someone posted a question if you could check filesize before uploading some days ago. Maybe this is possible with Javascript? Javascript wouldn't be the best solution, cause of it's incompability between browsers, that users can inactivate it. But it's might be better than nothing.. The important thing is not to RELY on the Javascript-code. Best regards /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Copy of image -> smaller
Hi there! If I understand this right, I must have adminstration rights for installing Magic Wand... The problem is that my host doesn't have any support for this application. (It's not MY server) Is there any workaround? Best regards /Gustav Wiberg - Original Message - From: "Sascha Braun" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Sent: Monday, May 15, 2006 9:18 AM Subject: Re: [PHP] Copy of image -> smaller I dont have the code you need handy at the moment, but please take a look at imagemagick.org and the convert -size 120x80 in.jpg -resize 120x80 out.jpg command. First you have to use gd getimagesize command to find out the width and height of the uploaded image, to find out if the image has a higher width or height value. The scale it down by the factor needed. 200 / 120 * factor i guess. Don't forget the path in the convert command otherwise you are going to delete the original image. Normaly i do a copy(/tmp/file, /to/destination/path); unlink(/tmp(file); convert original source path to thumbnail destination path and so forth. When you get handy with ffmpeg you can do the same stuff with movies. Lame helps you to do the same with audio files. Have fun! Sascha Braun ___ SMS schreiben mit WEB.DE FreeMail - einfach, schnell und kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Copy of image -> smaller
Hi there! When I upload a picture from a form, then I want to create a copy with a smaller image. For example: I upload a picture with dimensions 200x150 name 4.jpg. I also want a copy of this image but with the dimensions 100x75 pixels. I've tried this below, but I'm missing something I think... :-) I'm using PHP 4.x (don't know exactly the vers.nr, but I can search for it if it is of importance) The code down below is a function for uploading a picture. The part I want help with is after the comment: //What should/could I do here? Best regards Gustav Wiberg 0) { //ECHO "yes! ID=$idUpload PIC=$picUpload ADD=$addUpload"; $uploaddir = dirname($_FILES[$picUpload]['tmp_name']) . "/"; //Replace .jpeg to .jpg // $_FILES[$picUpload]['name'] = str_replace(".jpeg",".jpg",$_FILES[$picUpload]['name']); //Get first 4 last characters of uploaded filename // $ble = strtolower(substr($_FILES[$picUpload]['name'], -4, 4)); //Move to path $toPath (followed by what to add after file (that is sent to this function)) and ext.) // $mfileAdd = $idUpload . $addUpload . $ble; move_uploaded_file($_FILES[$picUpload]['tmp_name'], $toPath . $mfileAdd); //echo "mfileAdd=$mfileAdd"; //Set appropiate rights for file // //echo "FILE TO TEST=$mfileAdd"; chmod($toPath . $mfileAdd, intval('0755', 8)); //Copy this file to another file? // if (strlen($copyFile)>0) { $mfile = $idUpload . $copyFile . $ble; //echo "MFILE=$mfile"; copy($toPath . $mfileAdd, $toPath . $mfile); chmod($toPath . $mfile, intval('0755', 8)); } //What should/could I do here? // //Set new width and height // $new_width = 100; $new_height = 200; $tmp_image=imagecreatefromjpeg($toPath . $mfileAdd); $width = imagesx($tmp_image); $height = imagesy($tmp_image); $new_image = imagecreatetruecolor($new_width,$new_height); ImageCopyResized($new_image, $tmp_image,0,0,0,0, $new_width, $new_height, $width, $height); //Grab new image ob_start(); ImageJPEG($new_image); $image_buffer = ob_get_contents(); ob_end_clean(); ImageDestroy($new_image); //Create temporary file and write to it $fp = tmpfile(); fwrite($fp, $image_buffer); rewind($fp); //Upload new image $copyTo = 'http://www.ledins.se/test.jpg'; $conn_id = ftp_connect(''); ftp_login($conn_id,'',''); ftp_fput($conn_id, $copyTo, $fp, FTP_BINARY); fclose($fp); //Return the filename created based on productID // return $mfileAdd; } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Convert from jpg to gif ... change dpi...
Hi there! Is there any way of converting a jpg to gif and change dpi on the fly? Best regards Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ID-tags from picture?
- Original Message - From: "Chris" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Cc: "PHP General" Sent: Tuesday, April 04, 2006 4:14 AM Subject: Re: [PHP] ID-tags from picture? Gustav Wiberg wrote: Hi guys! If I've got this right, there will be some kind of tag that is saved in a picture (hidden). Is it possible to retrieve this information from PHP and what it is called? Any ideas / suggestions would be approciated! Depends on what information you are after. Some images may have exif info, but not all. http://www.php.net/exif Possibly IPTC information too (but only applies to jpegs apparently): http://www.php.net/iptcparse -- Postgresql & php tutorials http://www.designmagick.com/ Hi! And thanx a lot! Exactly what I was looking for! Best regards /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ID-tags from picture?
Hi guys! If I've got this right, there will be some kind of tag that is saved in a picture (hidden). Is it possible to retrieve this information from PHP and what it is called? Any ideas / suggestions would be approciated! /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Div-element at same vert. position?
- Original Message - From: "Jay Blanchard" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General" Sent: Tuesday, March 28, 2006 11:52 PM Subject: RE: [PHP] Div-element at same vert. position? [snip] A. The is a CSS question 2. You didn't provide a way to see it. III. Using absolute positioning is a bad thing and the left div should be floated to the left. Ok, I got your message you all! But I really wanted to do the postitioning in PHP with absolute positioning (just for the sakes cause ;-)) [/snip] While you may be using PHP to output attributes for CSS you are not doing positioning with CSS. And your point is? /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Div-element at same vert. position?
- Original Message - From: "Jay Blanchard" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General" Sent: Tuesday, March 28, 2006 10:00 PM Subject: RE: [PHP] Div-element at same vert. position? [snip] I have a code-snippet here: while ($dbArray = mysql_fetch_array($querys)) { $dbIDLevel1 = $dbArray["IDLevel1"]; $dbLevel1Name = $dbArray["level1Name"]; $dbFactsLevel1Name = $dbArray["factsLevel1Name"]; $dbFactsPictureLevel1Name = $dbArray["factsPictureLevel1Name"]; ?> " to be at the same vertical level as div-element: "factsmenu_" Any ideas? (I tried with $yMenu +=(8*intval($nrRows)) with the rule that any row is 8 pixels, but this doesn't seem to be true) [/snip] A. The is a CSS question 2. You didn't provide a way to see it. III. Using absolute positioning is a bad thing and the left div should be floated to the left. Ok, I got your message you all! But I really wanted to do the postitioning in PHP with absolute positioning (just for the sakes cause ;-)) /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Div-element at same vert. position?
Hi guys! I have a code-snippet here: while ($dbArray = mysql_fetch_array($querys)) { $dbIDLevel1 = $dbArray["IDLevel1"]; $dbLevel1Name = $dbArray["level1Name"]; $dbFactsLevel1Name = $dbArray["factsLevel1Name"]; $dbFactsPictureLevel1Name = $dbArray["factsPictureLevel1Name"]; ?> align="top" width="200" height="150"> $sql2 = "SELECT tblevel2catlevel1cat.ForIDLevel1Cat, tblevel2catlevel1cat.ForIDLevel2Cat, tblevel2cat.IDLevel2, tblevel2cat.level2Name FROM tblevel2catlevel1cat"; $sql2 .= " LEFT JOIN tblevel2cat ON (tblevel2cat.IDLevel2 = tblevel2catlevel1cat.ForIDLevel2Cat)"; $sql2 .= " WHERE tblevel2catlevel1cat.ForIDLevel1Cat = " . safeQuote($dbIDLevel1); $querys2 = mysql_query($sql2); $nrRows++; while ($dbArray2 = mysql_fetch_array($querys2)) { $dbIDLevel2 = $dbArray2["IDLevel2"]; $dbLevel2Name = $dbArray2["level2Name"]; ?> title="">$dbLevel2Name;?> You'll see that two div-elements are created. I want "rightmenu_$dbIDLevel1;?>" to be at the same vertical level as div-element: "factsmenu_" Any ideas? (I tried with $yMenu +=(8*intval($nrRows)) with the rule that any row is 8 pixels, but this doesn't seem to be true) /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] making a tutorial
- Original Message - From: "John Taylor-Johnston" <[EMAIL PROTECTED]> To: "PHP-General" Sent: Friday, March 17, 2006 7:51 AM Subject: [PHP] making a tutorial I'm making a tutorial and don't really understand how to do this myself :) Which of the following pets do have at home: dog cat snake snake none of these How do I parse favourite[]? I might have 2 or 5, so I need to parse ^0] - nMax. It is a checkbox. I might use favourite[] with mail() or store it in a mysql field. If mysql, would I store it in a varchar(20) or an enum() and how? John Hi there! Do you have to name it as favourite[]? Can't you name it as "just" favourite (without brackets) If you name it as just favourite, at least in Javascript you could loop through favourite as an array. I don't know if this works in PHP as well. Best regards /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What am I missing?
- Original Message - From: "Shaunak Kashyap" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General" Sent: Tuesday, March 07, 2006 8:05 PM Subject: RE: [PHP] What am I missing? It is more of an HTML/HTTP question than PHP but here's my shot at a possible explanation: The file containing the form code seems to live in the /mobilkamera/admin/ directory. Therefore action="admin/phpfunctions..." implies that the form is to be submitted to that path starting from the current directory (i.e. /mobilkamera/admin/), which resolves to /mobilkamera/admin/admin/phpfunctions... One solution would be remove the "admin/" from the action. Another (and probably better solution) would be to use absolute paths, as Joe Henry suggests. Shaunak Kashyap Senior Web Developer WPT Enterprises, Inc. 5700 Wilshire Blvd., Suite 350 Los Angeles, CA 90036 Direct: 323.330.9870 Main: 323.330.9900 www.worldpokertour.com Confidentiality Notice: This e-mail transmission (and/or the attachments accompanying) it may contain confidential information belonging to the sender which is protected. The information is intended only for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking of any action in reliance on the contents of this information is prohibited. If you have received this transmission in error, please notify the sender by reply e-mail and destroy all copies of this transmission. -Original Message- From: Gustav Wiberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 07, 2006 10:45 AM To: PHP General Subject: [PHP] What am I missing? Hi there! Why... I have this code: Add manufacturer: action="admin/phpfunctions/addnewmanufacturer.php?frmManufacturer= echo $frmIDManufacturer;?>&frmModel=" method="post"> When i press the submit - button, I get this error: Not Found The requested URL /mobilkamera/admin/admin/phpfunctions/addnewmanufacturer.php was not found on this server. Apache/2.0.53 (Win32) Server at 192.168.0.3 Port 80 Why is there TWO admins? Why isn't the path like this...? The requested URL /mobilkamera/admin/phpfunctions/addnewmanufacturer.php was not found on this server. ??? If this is not a question that suits the list, please guide me tips where to look... Best regards /Gustav Wiberg -- 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 Thanx!!! /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] What am I missing?
Hi there! Why... I have this code: Add manufacturer: action="admin/phpfunctions/addnewmanufacturer.php?frmManufacturer=$frmIDManufacturer;?>&frmModel=" method="post"> When i press the submit - button, I get this error: Not Found The requested URL /mobilkamera/admin/admin/phpfunctions/addnewmanufacturer.php was not found on this server. Apache/2.0.53 (Win32) Server at 192.168.0.3 Port 80 Why is there TWO admins? Why isn't the path like this...? The requested URL /mobilkamera/admin/phpfunctions/addnewmanufacturer.php was not found on this server. ??? If this is not a question that suits the list, please guide me tips where to look... Best regards /Gustav Wiberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mysql Rows
- Original Message - From: "tedd" <[EMAIL PROTECTED]> To: Cc: "Gustav Wiberg" <[EMAIL PROTECTED]>; "Robert Cummings" <[EMAIL PROTECTED]> Sent: Sunday, March 05, 2006 12:58 AM Subject: Re: [PHP] Mysql Rows Hi: Gustav said: No, maybe not when it's a small db, but when you try to delete 50.000 posts I have a strong feeling this would be very much slower then if you don't alter table after each deletion. First, I'm not deleting 50,000 records -- I dropping a table and renumbering it. In any event, I just tested your claim on my host and I was able to renumber 50,000 records in less than 1/2 second. Even though I tried it several times, the results were never above 0.47 seconds. If I was dealing with a database that was accessible to others, then I would either lock tables or use transaction and then renumber -- but in either case the difference in time is less than additional 1/10 of a second. Ok, it wasn't really a claim, it was more a "feeling", but I couldn't say it for sure, so I applogize for misleading you there! :-) Half a second or 0.47 seconds may not be a big issue, but as I see it this could be "unessescary time", if you could achieve the same functionality (without doing some alter-statements) faster and without have to lock the db. Have you tested without the alter-table statement? *just curious* Aha... I missed the part ... "I was dealing with a database that was accessible to others" Only YOU are using the db? Ok, then it would not be a problem. I don't know if 1/2 second is a big deal in your world, or not, but it seems a bit slow to me. I wrote splay binary tree search routine that would perform 100,000 searches in a two million record dB in less than one second on my Mac. And if you know what a splay algorithm is, then you also know that it not only preforms a search but then reorders the tree each time a search is successful and thus is very laborious. Yet the time it took to preform 100,000 searches and reorders was still less than one second. Perhaps my host is running something slower -- after all, I'm only paying $7.00 per year for the service. But with all things considered, a half second is not that significant with a small 50,000 record dB. That's probably less than the majority of web sites that use MySQL, don't you think? Ok, I got your point! :-) But there is another side to it , and that is scalability. Ok, you don't have so many posts in your database. Ok, it does take less then a second... What if you had do make the db visible to other users? Then this link that might intrest you: (it's about pitfalls with transactions as may see in the link) http://www.onlamp.com/pub/a/php/2003/12/18/transaction_pitfalls.htmlhttp://www.onlamp.com/pub/a/php/2003/12/18/transaction_pitfalls.html But what If you suddenly hade to change host for some reason... The new host server maybe wouldn't be as fast as yours is today. And as someone mentioned, what about if your db was growing to include a couple of million posts. Of course, if you don't think your db will grow so much, and it works fine, then of course you could contiuning doing the ALTER-statement thing, but there's always two sides of the story... ;-) "That's probably less than the majority of web sites that use MySQL, don't you think?" I really have no clue, I could only guess... :-) Rod said: *LOL* I knew those MySQL people shouldn't have made the ALTER TABLE syntax available to just anyone. Gun --> foot --> *BLAM*. I hope to God you never get your hands on a real database with millions of entries. I'm glad that you were amused. Considering that I was talking about a flat dB, then you have already shot yourself in the foot if your "real database" is in the millions of entries and is flat. I hope to God that normalization may be something you consider in your next database design. In any event, it's interesting that I posted a question here and I expected some ribbing, but I also expected something of value. If the ALTER TABLE statement is prone to error, then I would like to know that and why. However, I suspect that claim isn't true, it's just that it's misuse has generated an urban myth of "Don't do that! That's dangerous!" without any real substance other than for programer error. *LOL* I have to say, that I agree with you on this one. I've searched on issues/regarding ALTER TABLE, and could only find errors regarding this when Microsoft was involved ;-) Of course, I've run into windozes programmers who accept the occasional crash and burn as "it comes with the territory", but that's unfortunate to apply this "apprehension" to MySQL. :-) In my previous post I plea
Re: [PHP] Mysql Rows
- Original Message - From: "tedd" <[EMAIL PROTECTED]> To: Cc: "benifactor" <[EMAIL PROTECTED]>; "Murray @ PlanetThoughtful" <[EMAIL PROTECTED]>; "Anthony Ettinger" <[EMAIL PROTECTED]> Sent: Saturday, March 04, 2006 3:14 PM Subject: Re: [PHP] Mysql Rows planetthoughtful wrote: But, too often I've seen people new to database design not liking 'gaps' because 'user1' will have a unique id of '1', while 'user2' will have a unique id of '6' because the records associated with unique ids '2' through '5' were deleted during testing, and so on. So, they feel that 'user2' should have a unique id of '2', ignoring the fact that that's not a unique id at all, if you had id '2' associated with another record at some point. And, Anthony wrote: I remember the days where i'd clear a database after testing to keep the auto_increment inline, but eventually, you will get out of sync on that, so it's not a reliable way of keeping a numerical sequence. Well... I'm one of those people who don't like gaps. I understand that if the dB is relational, then you shouldn't be concerned about gaps. Gaps are only perceived from a perspective of an artificial ordering system -- who knows where the data actually is in memory or on disk. However, when I'm working with a flat dB and want to step through the records to do editing, I like the records to be in order based upon an "id" (i.e., Record 1, Record 2, Record 3, and so on). I use an auto_increment unique "id" for this. It's not a big problem for me to keep the records in order either. Whenever I delete a record, I simply follow with: $dbQuery = "ALTER TABLE $dbtable "; $dbQuery .= "DROP id, "; $dbQuery .= "ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT,"; $dbQuery .= "AUTO_INCREMENT = 1"; $result = mysql_query($dbQuery) or die("2. Could not renumber dB $dbQuery" . mysql_error()); and my dB is in order and all things are right with the world again. I'm simple-minded that way. Now, I'm not allowing more one than one person (namely me) the ability to delete and reorder things, so I don't think there are any problems. Of course I could lock down the tables, delete, and then do the reorder if the dB is online -- but I haven't encountered any problems thus far. I've read numerous dB books about why it isn't necessary to reorder and everyone deplores the action, which is only done by newbies. But I don't really understand, with a flat dB, as to why it's a bad idea to do this? Now, is there a problem with the way I'm doing this? If so, *please* enlighten me. Please tell me why this isn't a reliable way of keeping a numerical sequence AND what technique would be? Many thanks. tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi Tedd! Generally speaking about db's it's not a good pratice to do in that you describe, but as I understand you've already figured that out... But one thing not doing "your" way is lack of performance: I'll quote you: "not a big problem for me to keep the records in order either. Whenever I delete a record, I simply follow with: $dbQuery = "ALTER TABLE $dbtable "; $dbQuery .= "DROP id, "; $dbQuery .= "ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT,"; $dbQuery .= "AUTO_INCREMENT = 1"; $result = mysql_query($dbQuery) or die("2. Could not renumber dB $dbQuery" . mysql_error());" No, maybe not when it's a small db, but when you try to delete 50.000 posts I have a strong feeling this would be very much slower then if you don't alter table after each deletion. /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Swedish sourgeforge for php-prg
Hi there! I wonder as a swedish PHP-programmer if there are any sites like sourgeforge.net but in swedish? /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Coding Practice: Use global $var or pass in by refernce
- Original Message - From: "Andreas Korthaus" <[EMAIL PROTECTED]> To: ; "Gustav Wiberg" <[EMAIL PROTECTED]> Sent: Friday, March 03, 2006 8:53 PM Subject: Re: [PHP] Coding Practice: Use global $var or pass in by refernce Hi Gustav! Gustav Wiberg wrote: My oponion is that is insane to use global variables. The main drawback with global variables is that is very easy to mix up variables, and keep track of what variable belongs to what. So an advice: Don't use it! Ok, so what's your recommendation to solve the problem with using a DB class in many other objects/methodes? Think of a DB class: class DB {...} And a lot of classes which want to use the DB class: class Foo { function saveChangesInDb() {...} } class Bar { function saveChangesInDb() {...} } - You can use a global "$db = new DB..." and pass it to every class/methode, - you can make $db "global" in each methode, - you can create a new instance ("new DB") in every methode (but you usually only want a single DB-connection per script, and where do you pass config-data to access the DB?) or - use a factory/singleton, which is not so much better than a global variable (and again, what about config-data?). So what's the way you'd recommend and why? best regards Andreas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi Andreas! I don't have that much experience with classes, but wouldn't it work to: 1. make a connection to the db like $db = , and then pass around this variable? 2. Extend the DB - class, so the saveChangesInDb() - function in the Foo-class would be an extension from the DB-class ? (I think this works to extend a class in PHP right?) 3 . Use already existing classes for db...http://www.phpclasses.org/ PHP Scripts / Databases I hope this'll help! /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: DOMElement::setAttribute() manual example question
- Original Message - From: "Rob" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Cc: "Andreas Korthaus" <[EMAIL PROTECTED]>; Sent: Friday, March 03, 2006 8:04 PM Subject: Re: [PHP] Re: DOMElement::setAttribute() manual example question Gustav Wiberg wrote: Check out: http://de3.php.net/manual/en/function.dom-domdocument-createelement.php ( This function creates a new instance of class DOMElement. This node will not show up in the document unless it is inserted with e.g. DOMNode->appendChild().) I really don't understand WHY your next example is working... Every example so far has called appendChild(). The only difference has been when at which point it is called to append the element and how the element to append has been created. Rob Maybe it is so that the objects propertys is created in a certain order undependet of the script order? /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Coding Practice: Use global $var or pass in by refernce
- Original Message - From: "Mark Steudel" <[EMAIL PROTECTED]> To: Sent: Friday, March 03, 2006 7:46 PM Subject: [PHP] Coding Practice: Use global $var or pass in by refernce I was wondering what the general rule on using the global driective versus passing in a variable by reference, why you should or shouldn't, etc. e.g. function () { global $db; $res =& $db->query( "SQL"); } or function ( &$db ) { $res =& $db->query( "SQL"); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi! My oponion is that is insane to use global variables. The main drawback with global variables is that is very easy to mix up variables, and keep track of what variable belongs to what. So an advice: Don't use it! /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: DOMElement::setAttribute() manual example question
- Original Message - From: "Rob" <[EMAIL PROTECTED]> To: "Andreas Korthaus" <[EMAIL PROTECTED]> Cc: Sent: Friday, March 03, 2006 4:43 PM Subject: [PHP] Re: DOMElement::setAttribute() manual example question Andreas Korthaus wrote: Hi! I've a question regarding the example in DOMElement::setAttribute() chapter of the PHP manual: http://de3.php.net/dom-domelement-setattribute There, an attribute is added to an element this way: createElement("root"); $newnode = $doc->appendChild($node); $newnode->setAttribute("align", "left"); echo $doc->saveXML(); ?> $doc->createElement() returns the created DOMElement, $doc->appendChild() returns the appended DOMNode. Isn't this the same object? Is it a reference? Check out: http://de3.php.net/manual/en/function.dom-domdocument-createelement.php ( This function creates a new instance of class DOMElement. This node will not show up in the document unless it is inserted with e.g. DOMNode->appendChild().) I really don't understand WHY your next example is working... /G I'm asking, because the following works too: createElement("root"); $node->setAttribute("align", "left"); $doc->appendChild($node); echo $doc->saveXML(); ?> I like the 2nd example more, because first you create an object (DOMElement), add some attributes to the object and after that append it somewhere to the DOM tree. The 1st example creates a new DOMElement object, appends it to the DOM tree, and adds the attributes not to the created object, but to another object (the DOMNode appended to the tree), which seems to be a reference to the original object. Why does the manual prefer the (IMO less intuitive) 1st way? Is there a problem with the 2nd way? Both ways are perfectly valid. $node and $newnode refer to the same object. It was written the 1st way to demonstrate the return value of appendChild(), because in many cases people create the element differently. i.e. $newnode = $doc->appendChild($doc->createElement("root")); or $newnode = $doc->appendChild(new DOMElement("root")); Also, in the event $node is created using the new DOMElement syntax: $node = new DOMElement("root"); the node is read only and must be appended into the tree before it can be modified, so the example just tries to be neutral here regarding the syntax used. Rob -- 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] Only 4 of 5...
- Original Message - From: "John Nichel" <[EMAIL PROTECTED]> To: "PHP General" Sent: Friday, March 03, 2006 2:30 AM Subject: Re: [PHP] Only 4 of 5... Gustav Wiberg wrote: Hi there! What's wrong here?? You're pulling the first row here if (intval($frmIDModel)>0) { ?> Visa telefonbilder för : 0) { $dbNameManufacturer = $dbArray["nameManufacturer"]; ?> Visa telefonbilder för : Alla telefonbilder i arkivet: So now there are only 4 rows left when you loop thru them here. while ($dbArray = mysql_fetch_array($querys)) { $dbIDPic = $dbArray["IDPic"]; $dbPicNameSmall = $dbArray["picNameSmall"]; ?> height="130"> I have 5 posts in the table, but the images shown are only four! Why? /G -- By-Tor.com ...it's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Thanx, I got feedback on this one yesterday! :) Thanx anyway! /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Only 4 of 5...
- Original Message - From: "Thorsten Suckow-Homberg" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General" Sent: Thursday, March 02, 2006 11:13 PM Subject: Re: [PHP] Only 4 of 5... Because of this: $dbArray = mysql_fetch_array($querys); This will fill $dbArray with the first row fetched from the table. 4 are left which you are calling in your loop at the end of your code example. What's your reason anyway to call mysql_fetch_array() here? Delete this line and I'd bet you're getting your 5 results ;) HTH Thorsten Aha, this seems reasonable! Thanx, this solved it! /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Only 4 of 5...
- Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; Sent: Thursday, March 02, 2006 11:15 PM Subject: RE: [PHP] Only 4 of 5... [snip] while ($dbArray = mysql_fetch_array($querys)) { $dbIDPic = $dbArray["IDPic"]; $dbPicNameSmall = $dbArray["picNameSmall"]; ?> 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] Only 4 of 5...
- Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; Sent: Thursday, March 02, 2006 11:05 PM Subject: RE: [PHP] Only 4 of 5... [snip] I have 5 posts in the table, but the images shown are only four! Why? [/snip] Are you counting starting with 1 or 0? Don't understand your question... I have 5 posts in the table, but I'll only retrieve 4 posts when going through the array... like this... while ($dbArray = mysql_fetch_array($querys)) { $dbIDPic = $dbArray["IDPic"]; $dbPicNameSmall = $dbArray["picNameSmall"]; ?> . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Only 4 of 5...
Hi there! What's wrong here?? 0) { ?> Visa telefonbilder för : 0) { $dbNameManufacturer = $dbArray["nameManufacturer"]; ?> Visa telefonbilder för : Alla telefonbilder i arkivet: height="130"> I have 5 posts in the table, but the images shown are only four! Why? /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] internal error when mailing...
- Original Message - From: "John Nichel" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Sent: Wednesday, March 01, 2006 9:57 PM Subject: Re: [PHP] internal error when mailing... Gustav Wiberg wrote: Here's my code if (strtoupper(substr(PHP_OS,0,3)=='WIN')): $eol="\r\n"; elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')): $eol="\r"; else: $eol="\n"; endif; //Message Subject $emailsubject="Stammis Internet nyhetsbrev " . date("Y/m/d H:i:s"); //Message Body ob_start(); require("emailbody.php");// page for showing in the email (no html and body-tags here) $body=ob_get_contents(); ob_end_clean(); // Common Headers // $headers .= 'From: Stammis Internet <[EMAIL PROTECTED]>'.$eol; $headers .= 'Reply-To: Stammis Internet <[EMAIL PROTECTED]>'.$eol; $headers .= 'Return-Path: Stammis Internet <[EMAIL PROTECTED]>'.$eol; // these two to set reply address $headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol; $headers .= "X-Mailer: PHP v".phpversion().$eol; // These two to help avoid spam-filters $headers .= 'MIME-Version: 1.0'.$eol; $headers .= "Content-type: text/html; charset=iso-8859-1\n"; // HTML Version // $msg = $body.$eol.$eol; // SEND THE EMAIL(s) // FROM MYSQL-db // require("../phpfunctions/opendb.php"); $sql = "SELECT mail FROM tbusers ORDER BY mail"; $querys = mysql_query($sql); while ($dbArray = mysql_fetch_array($querys)) { $dbMail = $dbArray["mail"]; $emailaddress=$dbMail; ini_set(sendmail_from,'[EMAIL PROTECTED]'); // the INI lines are to force the From Address to be used ! mail($emailaddress, $emailsubject, $msg, $headers); ini_restore(sendmail_from); echo "SENT EMAIL TO $dbMail right now"; } mysql_close(); ?> When I tested this script all mails I think was sent, BUT this error showed when the loop hade gone through all posts... HTTP/1.1 200 OK Date: Wed, 01 Mar 2006 20:41:15 GMT Server: Apache X-Powered-By: PHP/4.4.1 Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 OK The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [EMAIL PROTECTED] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. What could have caused this? Gremlins? ;) Misconfigured mail server. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] Ok, but the code is okay right? /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mailto members..?
- Original Message - From: "Jim Moseby" <[EMAIL PROTECTED]> To: "'Gustav Wiberg'" <[EMAIL PROTECTED]>; "Jim Moseby" <[EMAIL PROTECTED]> Cc: "PHP General" Sent: Wednesday, March 01, 2006 9:17 PM Subject: RE: [PHP] Mailto members..? > This type of email may be more susceptible to being caught in spam traps. > Check with your webhost to learn of any limits to the number of recipients > per message, and number of messages per day/hour/etc. > > JM Aha.. that's a reason good enough for me for not using this method. It would still be to your advantage to check with your hosting about limits. I ran up against that on the last newsletter I coded where I could have only 25 recipients per message and 99 total messages per day. JM That's true! Thanx again! /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] internal error when mailing...
Here's my code if (strtoupper(substr(PHP_OS,0,3)=='WIN')): $eol="\r\n"; elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')): $eol="\r"; else: $eol="\n"; endif; //Message Subject $emailsubject="Stammis Internet nyhetsbrev " . date("Y/m/d H:i:s"); //Message Body ob_start(); require("emailbody.php");// page for showing in the email (no html and body-tags here) $body=ob_get_contents(); ob_end_clean(); // Common Headers // $headers .= 'From: Stammis Internet <[EMAIL PROTECTED]>'.$eol; $headers .= 'Reply-To: Stammis Internet <[EMAIL PROTECTED]>'.$eol; $headers .= 'Return-Path: Stammis Internet <[EMAIL PROTECTED]>'.$eol;// these two to set reply address $headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol; $headers .= "X-Mailer: PHP v".phpversion().$eol; // These two to help avoid spam-filters $headers .= 'MIME-Version: 1.0'.$eol; $headers .= "Content-type: text/html; charset=iso-8859-1\n"; // HTML Version // $msg = $body.$eol.$eol; // SEND THE EMAIL(s) // FROM MYSQL-db // require("../phpfunctions/opendb.php"); $sql = "SELECT mail FROM tbusers ORDER BY mail"; $querys = mysql_query($sql); while ($dbArray = mysql_fetch_array($querys)) { $dbMail = $dbArray["mail"]; $emailaddress=$dbMail; ini_set(sendmail_from,'[EMAIL PROTECTED]'); // the INI lines are to force the From Address to be used ! mail($emailaddress, $emailsubject, $msg, $headers); ini_restore(sendmail_from); echo "SENT EMAIL TO $dbMail right now"; } mysql_close(); ?> When I tested this script all mails I think was sent, BUT this error showed when the loop hade gone through all posts... HTTP/1.1 200 OK Date: Wed, 01 Mar 2006 20:41:15 GMT Server: Apache X-Powered-By: PHP/4.4.1 Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 OK The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [EMAIL PROTECTED] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. What could have caused this? /G ps. YES http://phpmailer.sourceforge.net/ seems very great, but this code above is mostly for testing and experimenting... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mailto members..?
- Original Message - From: "Jim Moseby" <[EMAIL PROTECTED]> To: "'Gustav Wiberg'" <[EMAIL PROTECTED]>; "Marcus Gnaß" <[EMAIL PROTECTED]> Cc: "PHP General" Sent: Wednesday, March 01, 2006 7:29 PM Subject: RE: [PHP] Mailto members..? > Gustav Wiberg schrieb: >> while ($dbArray = mysql_fetch_array($querys)) { >> ...sendmail (from, to, htmltext...)... >> } > Why let PHP do all the work? If the body is all the same for all > recipients you could send only one mail with all recipients in the > BCC-field and only one dummy-adress in the To-field. This would lead to a > very short execution-time. > > Marcus Yes, that's true! Is there any sideffects maybe...? This type of email may be more susceptible to being caught in spam traps. Check with your webhost to learn of any limits to the number of recipients per message, and number of messages per day/hour/etc. JM Aha.. that's a reason good enough for me for not using this method. Thanx. /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mailto members..?
- Original Message - From: "Marcus Gnaß" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Sent: Wednesday, March 01, 2006 5:29 PM Subject: Re: [PHP] Mailto members..? Gustav Wiberg schrieb: while ($dbArray = mysql_fetch_array($querys)) { ...sendmail (from, to, htmltext...)... } Why let PHP do all the work? If the body is all the same for all recipients you could send only one mail with all recipients in the BCC-field and only one dummy-adress in the To-field. This would lead to a very short execution-time. Marcus Yes, that's true! Is there any sideffects maybe...? /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] About date & time...
- Original Message - From: "Marcus Gnaß" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Sent: Wednesday, March 01, 2006 5:24 PM Subject: Re: [PHP] About date & time... Gustav Wiberg schrieb: function currenttime() { $t = date('h\:\ i\:\ s'); $returnTime = str_replace(" ", "", $t); return $returnTime; } function currentdate() { $d = date('Y\-\ m\-\ d'); $returnDate = str_replace(" ", "", $d); return $returnDate; } Although beeing a totally noob to PHP I suggest this instead: function currenttime() {return date('H\:i\:s');} function currentdate() {return date('Y\-m\-d');} Marcus Why? return date('H\:i\:s') doesn't work as expected... :-) /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mailto members..?
- Original Message - From: "Kevin Davies - Bonhurst Consulting" <[EMAIL PROTECTED]> To: "'Jim Moseby'" <[EMAIL PROTECTED]>; "'Gustav Wiberg'" <[EMAIL PROTECTED]>; "'PHP General'" Sent: Wednesday, March 01, 2006 4:32 PM Subject: RE: [PHP] Mailto members..? Others here have mentioned the use of a mailer class I can't remember the name of (phpmailer maybe?). PHPMailer is really good for sending HTML/Text/Both emails - I'm using it on a few different sites. Link: http://phpmailer.sourceforge.net/ Also, if you're going to use PHPMailer an excellent tutorial can be found here: http://www.phpfreaks.com/tutorials/130/0.php HTH Cheers, Kev -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi there! THANX! This was really what I was looking for! :-) /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mailto members..?
Hi guys! Anyone knows of something like this, but for free? http://www.webscriptsdirectory.com/PHP/E-Mail-Systems/Php-Newsletter-Script-L1237/ All I want to do is to send "a html mail" to all my members at http://www.stammis.com/ (swedish site for pedigrees). It would be a informative letter that tells them about latest news at Stammis Internet. I could something like this... while ($dbArray = mysql_fetch_array($querys)) { ...sendmail (from, to, htmltext...)... } but this will bring a timeout. Any suggestions? (I don't want to change the timeout - value, it doesn't seem correct) /G ps. OT: Planning of making this site Open Source, do you think it matters if the site is in swedish for the sake of Open Source? (the code is in english). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] About date & time...
- Original Message - From: "tedd" <[EMAIL PROTECTED]> To: ; "Gustav Wiberg" <[EMAIL PROTECTED]> Sent: Tuesday, February 28, 2006 11:34 PM Subject: Re: [PHP] About date & time... Gustav: I'm a swede, and I we use hours 0 - 24. Well... I don't know what I am, but non sum qualis eram. In any event, you want military time -- simple enough -- just change the h to H, like so: echo("Time: " . date('H\:\ i\:\ s') . "" ); You can find more code examples at: http://www.weberdev.com/AdvancedSearch.php?searchtype=title&search=date&Submit1.x=0&Submit1.y=0 Also, you need to review the php manual regarding date() -- it's a super function that has lot's of formatting symbols. tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Yes, thanx! I've totally missed the part about 12/24-h setting... :-) /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] About date & time...
- Original Message - From: "Grant Young" <[EMAIL PROTECTED]> To: Cc: <[EMAIL PROTECTED]> Sent: Tuesday, February 28, 2006 11:25 PM Subject: Re: [PHP] About date & time... Hi Gustav. I'm a swede, and I we use hours 0 - 24. 8 pm = 20 for us. 9 pm = 21 for us 10 pm = 22... and so on... But with date()-function there is 10 pm that shows (and I want 22 to show instead) I'm using PHP 4.0.3... Do I have to use getdate() then? (getdate()-function showed 22...) The docs for date() (http://www.php.net/date) show that there are a number of different options for the first parameter. If you check out the table on that page, you'll find: >> H | 24-hour format of an hour with leading zeros | 00 through 23 With this in mind, the following will work (if I understand your question correctly): $t = date('H\:\ i\:\ s'); HTH, Grant AHA!!! Sometimes I'm so stupid... hm... Thanx! :-) /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] About date & time...
- Original Message - From: "tedd" <[EMAIL PROTECTED]> To: ; "Gustav Wiberg" <[EMAIL PROTECTED]> Sent: Tuesday, February 28, 2006 4:17 PM Subject: Re: [PHP] About date & time... >Thanx for your input about date & time... Here's some functions that worked for me after some searching... function currenttime() { -snip- lot's of code. Hi Gustav: Not meaning to embarrass, but your code could be shortened considerably by using date(), like so: Your lengthy -- function currenttime() can be replaced simply with: echo("Date: " . date('Y\-\ m\-\ d') . "" ); and your -- function currentdate() can be replaced with: echo("Time: " . date('h\:\ i\:\ s') . "" ); If you don't like the spaces in the output, then strip them out, like so: $date = date('Y\-\ m\-\ d'); $date = str_replace(" ", "", $date); echo("Date: " . $date. "" ); and $date = date('h\:\ i\:\ s') ; $date = str_replace(" ", "", $date); echo("Time: " . $date. "" ); You can find more code examples at: http://www.weberdev.com/AdvancedSearch.php?searchtype=title&search=date&Submit1.x=0&Submit1.y=0 tedd -- http://sperling.com Hi there! I've now done coding like this... function currenttime() { $t = date('h\:\ i\:\ s'); $returnTime = str_replace(" ", "", $t); return $returnTime; } function currentdate() { $d = date('Y\-\ m\-\ d'); $returnDate = str_replace(" ", "", $d); return $returnDate; } $insertTime = currenttime(); $insertDate = currentdate(); I'm a swede, and I we use hours 0 - 24. 8 pm = 20 for us. 9 pm = 21 for us 10 pm = 22... and so on... But with date()-function there is 10 pm that shows (and I want 22 to show instead) I'm using PHP 4.0.3... Do I have to use getdate() then? (getdate()-function showed 22...) /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] About date & time...
- Original Message - From: "tedd" <[EMAIL PROTECTED]> To: ; "Gustav Wiberg" <[EMAIL PROTECTED]> Sent: Tuesday, February 28, 2006 4:17 PM Subject: Re: [PHP] About date & time... >Thanx for your input about date & time... Here's some functions that worked for me after some searching... function currenttime() { -snip- lot's of code. Hi Gustav: Not meaning to embarrass, but your code could be shortened considerably by using date(), like so: Your lengthy -- function currenttime() can be replaced simply with: echo("Date: " . date('Y\-\ m\-\ d') . "" ); and your -- function currentdate() can be replaced with: echo("Time: " . date('h\:\ i\:\ s') . "" ); If you don't like the spaces in the output, then strip them out, like so: $date = date('Y\-\ m\-\ d'); $date = str_replace(" ", "", $date); echo("Date: " . $date. "" ); and $date = date('h\:\ i\:\ s') ; $date = str_replace(" ", "", $date); echo("Time: " . $date. "" ); You can find more code examples at: http://www.weberdev.com/AdvancedSearch.php?searchtype=title&search=date&Submit1.x=0&Submit1.y=0 tedd -- http://sperling.com Hi there! Not meaning to embarrass, but your code could be shortened considerably by using date(), like so: *hehe* It's all okey, it was something like this you're typing that I was searching for, but couldn't find it exactly as I wanted. Thanx a lot!!! :-) I really appreciate it! /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] About date & time...
Hi Thanx for your input about date & time... Here's some functions that worked for me after some searching... function currenttime() { $today = getdate(); $ithours = $today["hours"]; if (intval($ithours)<10) { $ithours = "0" . $ithours; } $itminutes = $today["minutes"]; if (intval($ithours)<10) { $ithours = "0" . $ithours; } $itseconds = $today["seconds"]; if (intval($itseconds)<10) { $itseconds = "0" . $itseconds; } $it = $ithours . ":" . $itminutes . ":" . $itseconds; return $it; } function currentdate() { $today = getdate(); $idyear = $today["year"]; if (intval($idyear)<10) { $idyear = "0" . $idyear; } $idmonthnr = $today["mon"]; if (intval($idmonthnr )<10) { $idmonthnr = "0" . $idmonthnr ; } $idmonthday = $today["mday"]; if (intval($idmonthday)<10) { $idmonthday = "0" . $idmonthday; } $id = $idyear . "-" . $idmonthnr . "-" . $idmonthday; return $id; } $insertTime = currenttime(); $insertDate = currentdate(); /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HOW update time and date-fields to mysql....
Hi there guys! I have used a date-field and a time-field in a mysql-database. How should I update these fields through php? This is my code now (it works fine locally with data on a win-machine, but not on Linux at my webhotel - Time doesn't work at all) function safeQuote($value) { // Stripslashes if (get_magic_quotes_gpc()) { $value = stripslashes($value); } // Quote if not integer if (!is_numeric($value)) { $value = "'" . mysql_real_escape_string($value) . "'"; } return $value; } $sql = "UPDATE tbforum SET"; $sql .= " question=" . safeQuote($frmQuestion); $sql .= ", insertDate='" . $dat . "'"; $sql .= ", insertTime='" . time() . "'"; $sql .= " WHERE IDForum=" . safeQuote($idForum); $querys = mysql_query($sql); /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Expat + PHP Examples...
Hi there! I've found out that I can use expat XML, but I can't figure out HOW to use... it seems simple, but I tried and can't figure it out... I'd like to get retrieve info from http://www.frisim.com/frisim/servlet/rss?searchString=google and convert it to html... I've read a lot a of text for Expat, but found no really good example (I found one at phpbuilder.com but with links that went to xml-files that didn't exists ): Someone who have used expat.. ..and can give me a hint... /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RSS / XML
- Original Message - From: "Weber Sites LTD" <[EMAIL PROTECTED]> To: "'Gustav Wiberg'" <[EMAIL PROTECTED]>; "'PHP General'" Sent: Saturday, February 25, 2006 7:37 PM Subject: RE: [PHP] RSS / XML Here are a few (from easy to hard) Parsing XML With DOMXML And PHP http://www.weberdev.com/ViewArticle-158.html Converting XML Into a PHP Data Structure http://www.weberdev.com/ViewArticle-389.html Building XML Trees with PEAR's XML_Tree Class http://www.weberdev.com/ViewArticle-345.html Building XML Web Services with PHP NuSOAP http://www.weberdev.com/ViewArticle-336.html Serializing XML With PHP http://www.weberdev.com/ViewArticle/450 Injecting XML Content Into Page Templates With patXMLRenderer http://www.weberdev.com/ViewArticle/441 berber -Original Message- From: Gustav Wiberg [mailto:[EMAIL PROTECTED] Sent: Saturday, February 25, 2006 2:55 PM To: PHP General Subject: [PHP] RSS / XML Hi there guys! Where is a good startpoint for learning XML Reader on a very, very basic level? (I appreciate links) Is RSS a technique for retrieving XML? I can't clue the pieces together... /G -- 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 Thanx! /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RSS / XML
Hi there guys! Where is a good startpoint for learning XML Reader on a very, very basic level? (I appreciate links) Is RSS a technique for retrieving XML? I can't clue the pieces together... /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP on domain...
- Original Message - From: "Steve Edberg" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General" Sent: Sunday, January 29, 2006 10:51 PM Subject: Re: [PHP] PHP on domain... At 10:08 PM +0100 1/29/06, Gustav Wiberg wrote: Hi guys! How can you check if a domain (that you don't own), can run PHP-code? Is it possible? /G @varupiraten.se Answer 1: Call them, fax them, email them, IM them, or check their website. This is the only way to know for sure. Answer 2: Check http://netcraft.com/ I don't know all the tools they use to record server information, but I presume that it includes methods like Answer 3 below. Answer 3: If you want to do this via a program, the answer is - in general, no. However, many servers will return an HTTP header containing this info. Also, (at least on Apache) server signatures may be set to reveal this info on error displays. You could open a socket connection to port 80 of the desired domain, and issue a HEAD request. You'll have to parse the results for Server and/or X-Powered-By and possibly other headers. Here's some examples via telnet: telnet 80 Trying ... Connected to . Escape character is '^]'. HEAD / HTTP/1.0 HTTP/1.0 200 OK Date: Sun, 29 Jan 2006 21:23:03 GMT Server: Apache Content-Type: text/html Connection: close telnet 80 Trying ... Connected to . Escape character is '^]'. HEAD / HTTP/1.0 HTTP/1.1 403 Access Forbidden Server: Microsoft-IIS/5.0 Date: Sun, 29 Jan 2006 21:32:26 GMT Content-Length: 4126 Content-Type: text/html telnet 80 Trying ... Connected to . Escape character is '^]'. HEAD / HTTP/1.0 HTTP/1.0 302 Moved Temporarily Date: Sun, 29 Jan 2006 21:36:52 GMT Server: Apache/1.3.33 (Unix) PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e X-Powered-By: PHP/4.3.10 Location: index_html.html Content-Type: text/html Connection: close However, many servers are set to not reveal this info for security purposes; it could also be spoofed for the same reason. For example, the second site above (the IIS one) actually *does* support PHP according to their website. See http://www.php.net/manual/en/ref.sockets.php for info on opening & reading from sockets; there is an example on this page in the user comments about sending HTTP HEAD requests. steve -- +--- my people are the people of the dessert, ---+ | Steve Edberghttp://pgfsun.ucdavis.edu/ | | UC Davis Genome Center[EMAIL PROTECTED] | | Bioinformatics programming/database/sysadmin (530)754-9127 | + said t e lawrence, picking up his fork + -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi there! Thanx for info! /G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP on domain...
Hi guys! How can you check if a domain (that you don't own), can run PHP-code? Is it possible? /G @varupiraten.se -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pages Expiring
Hi there! Yes, actually there is a "dirty" solution to this. You can use javascript to skip certain pages in historylist. window.document.replace('page1.php'); window.document.location = 'page2.php'; window.document.location.replace('page3.php'); The only page that would exist in the history list is now page2.php (and this means if you hit the back button, the only page that will display in this case would be page2.php) In your case you could goto the page with form with a window.document.location.replace('formpage.php') - statement.. Hope this was helpful! :-) /G http://www.varupiraten.se/ - Original Message - From: "Ben Miller" <[EMAIL PROTECTED]> To: Sent: Friday, January 06, 2006 1:40 AM Subject: [PHP] Pages Expiring When using forms with PHP sessions, hitting the back button results in WARNING: Page has Expired I am wondering if there is a work around for this so that it (IE, in this case) resubmits the form information and displays the previous page. Any ideas? -- 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] Hi!
Hi there! View source-code of output. Maybe that could give you a clue! :-) /G http://www.varupiraten.se/ - Original Message - From: "Nanu Kalmanovitz" <[EMAIL PROTECTED]> To: Sent: Tuesday, December 20, 2005 8:10 PM Subject: [PHP] Hi! Hi! Using a Win 2000 WS (work station), I'm trying to write the first PHP page as shown at http://il2.php.net/manual/en/tutorial.firstpage.php. The server is a Netware (Novell) 6.5 running Apache, PHP & MySQL all 3 on same server but different volumes. I created the file named hello.php by copying and pasting the following text to notepad and put it in my web server root directory I:\HTDocs: Example 2-1. Our first PHP script: hello.php: PHP Test Hello World'; ?> When I am accessing the site with IE browser at the http://www.kalmanovitz.co.il/hello.php URL address I can see a blank page. The other pages are shown correctly. Any Idea how to fix it and continue with the tutorial? TIA Nanu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] Load from db into -list
- Original Message - From: "Gustav Wiberg" <[EMAIL PROTECTED]> To: "Curt Zirzow" <[EMAIL PROTECTED]> Sent: Sunday, December 18, 2005 8:46 PM Subject: Re: [PHP] Load from db into -list Ajax? What is that? /G - Original Message - From: "Curt Zirzow" <[EMAIL PROTECTED]> To: Sent: Sunday, December 18, 2005 8:53 PM Subject: Re: [PHP] Load from db into -list On Sun, Dec 18, 2005 at 08:28:22PM +0100, Gustav Wiberg wrote: Hi there! Is it possible to load a -list with databasinfo without reloading a page??? With AJAX, yeah. Curt. -- cat .signature: No such file or directory -- 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] Load from db into -list
Hi there! Is it possible to load a -list with databasinfo without reloading a page??? /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Weird html - No "real"
Ok, thanx!:-) /G - Original Message - From: "Brady Mitchell" <[EMAIL PROTECTED]> To: Sent: Saturday, December 17, 2005 12:35 AM Subject: RE: [PHP] Weird html - No "real" Hi Yes, but I assume that echo "Kontroll rad i textfil:$rowsInTextFile av $totalRowsInTextFile"; would render a ? /G Echo does not automatically add a newline, you would have to use \n to get newlines with the echo statement: echo "Kontroll rad i textfil:$rowsInTextFile av > $totalRowsInTextFile"; Will display the line break in the webpage as expected, but to get the source code displayed to have the line break you would need to use: echo "Kontroll rad i textfil:$rowsInTextFile av > $totalRowsInTextFile\n"; Brady -- 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] Weird html - No "real"
Hi Yes, but I assume that echo "Kontroll rad i textfil:$rowsInTextFile av $totalRowsInTextFile"; would render a ? /G - Original Message - From: <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Sent: Saturday, December 17, 2005 12:15 AM Subject: Re: [PHP] Weird html - No "real" [assuming i understand your question correctly] a or other type of (operating system) newline is not a rendered value in html. you need to use an html , or (or put the text within an html block) to get the rendered html to have new lines. Original Message Date: Saturday, December 17, 2005 12:03:02 AM +0100 From: Gustav Wiberg <[EMAIL PROTECTED]> To: PHP General Subject: [PHP] Weird html - No "real" Hi there! Why do I get this kind of ... why don't work? There is now as when you view source in an ordinary html-file... I hope you guys understand what I mean... DOWN BELOW IS THE PHP CODE! :-) main PCBAUTOMATISK INFOGNING AV PRODUKTER SOM INTE FINNS I VP's databas!Loggfil=logfiles/pcb_autoinsert.txtRader i databas=354Kontroll rad i textfil:1 av 1881Kontroll rad i textfil:2 av 1881.Kontroll rad i textfil:3 av 1881.Kontroll rad i textfil:4 av 1881.Kontroll rad i textfil:5 av 1881.Kontroll rad i textfil:6 av 1881.Kontroll rad i textfil:7 av 1881.Kontroll rad i textfil:8 av 1881.Kontroll rad i textfil:9 av 1881.Kontroll rad i textfil:10 av 1881.Kontroll rad i textfil:11 av 1881.Kontroll rad i textfil:12 av 1881.Kontroll rad i textfil:13 av 1881.Kontroll rad i textfil:14 av 1881.Kontroll rad i textfil:15 av 1881.Kontroll rad i textfil:16 av 1881.Kontroll rad i textfil:17 av 1881.Kontroll rad i textfil:18 av 1881.Kontroll rad i textfil:19 av 1881.Kontroll rad i textfil:20 av 1881.Kontroll rad i textfil:21 av 1881.Kontroll rad i textfil:22 av 1881.Kontroll rad i textfil:23 av 1881.Kontroll rad i textfil:24 av 1881.Kontroll rad i textfil:25 av 1881.Kontroll rad i textfil:26 av 1881.Kontroll rad i textfil:27 av 1881.Kontroll rad i textfil:28 av 1881.Kontroll rad i textfil:29 av 1881.Kontroll rad i textfil:30 av 1881.Kontroll rad i textfil:31 av 1881.Kontroll rad i textfil:32 av 1881.Kontroll rad i textfil:33 av 1881.Kontroll rad i textfil:34 av 1881.Kontroll rad i textfil:35 av 1881.Kontroll rad i textfil:36 av 1881.Kontroll rad i textfil:37 av 1881.Kontroll rad i textfil:38 av 1881.Kontroll rad i textfil:39 av 1881.Kontroll rad i textfil:40 av 1881.Kontroll rad i textfil:41 av 1881.Kontroll rad i textfil:42 av 1881.Kontroll rad i textfil:43 av 1881.Kontroll rad i textfil:44 av 1881.Kontroll rad i textfil:45 av 1881.Kontroll rad i textfil:46 av 1881.Kontroll rad i textfil:47 av 1881.Kontroll rad i textfil:48 av 1881.Kontroll rad i textfil:49 av 1881.Kontroll rad i textfil:50 av 1881.Kontroll rad i textfil:51 av 1881.Kontroll rad i textfil:52 av 1881.Kontroll rad i textfil:53 av 1881.Kontroll rad i textfil:54 av 1881.Kontroll rad i textfil:55 av 1881.Kontroll rad i textfil:56 av 1881.Kontroll rad i textfil:57 av 1881.Kontroll rad i textfil:58 av 1881.Kontroll rad i textfil:59 av 1881.Kontroll rad i textfil:60 av 1881.Kontroll rad i textfil:61 av 1881.Kontroll rad i textfil:62 av 1881.Kontroll rad i textfil:63 av 1881.Kontroll rad i textfil:64 av 1881.Kontroll rad i textfil:65 av 1881.Kontroll rad i textfil:66 av 1881.Kontroll rad i textfil:67 av 1881.Kontroll rad i textfil:68 av 1881.Kontroll rad i textfil:69 av 1881.Kontroll rad i textfil:70 av 1881.Kontroll rad i textfil:71 av 1881.Kontroll rad i textfil:72 av 1881.Kontroll rad i textfil:73 av 1881.Kontroll rad i textfil:74 av 1881.Kontroll rad i textfil:75 av 1881.Kontroll rad i textfil:76 av 1881.Kontroll rad i textfil:77 av 1881.Kontroll rad i textfil:78 av 1881.Kontroll rad i textfil:79 av 1881.Kontroll rad i textfil:80 av 1881.Kontroll rad i textfil:81 av 1881.Kontroll rad i textfil:82 av 1881.Kontroll rad i textfil:83 av 1881.Kontroll rad i textfil:84 av 1881.Kontroll rad i textfil:85 av 1881.Kontroll rad i textfil:86 av 1881.Kontroll rad i textfil:87 av 1881.Kontroll rad i textfil:88 av 1881.Kontroll rad i textfil:89 av 1881.Kontroll rad i textfil:90 av 1881.Kontroll rad i textfil:91 av 1881.Kontroll rad i textfil:92 av 1881.Kontroll rad i textfil:93 av 1881.Kontroll rad i textfil:94 av 1881.Kontroll rad i textfil:95 av 1881.Kontroll rad i textfil:96 av 1881.Kontroll rad i textfil:97 av 1881.Kontroll rad i textfil:98 av 1881.Kontroll rad i textfil:99 av 1881.Kontroll rad i textfil:100 av 1881.Kontroll rad i textfil:101 av 1881.Kontroll rad i textfil:102 av 1881.Kontroll rad i textfil:103 av 1881.Kontroll rad i textfil:104 av 1881.Kontroll rad i textfil:105 av 1881.Kontroll rad i textfil:106 av 1881.Kontroll rad i textfil:107 av 1881.Kontroll rad i textfil:108 av 1881.Kontroll rad i textfil:109 av 1881.Kontroll rad i textfil:110 av 1881.Kontroll rad i textfil:111 av 1881.Kontroll rad i textfil:112 av 1881.Kontroll rad i textfil:113 av 1
[PHP] Weird html - No "real"
Hi there! Why do I get this kind of ... why don't work? There is now as when you view source in an ordinary html-file... I hope you guys understand what I mean... DOWN BELOW IS THE PHP CODE! :-) main PCBAUTOMATISK INFOGNING AV PRODUKTER SOM INTE FINNS I VP's databas!Loggfil=logfiles/pcb_autoinsert.txtRader i databas=354Kontroll rad i textfil:1 av 1881Kontroll rad i textfil:2 av 1881.Kontroll rad i textfil:3 av 1881.Kontroll rad i textfil:4 av 1881.Kontroll rad i textfil:5 av 1881.Kontroll rad i textfil:6 av 1881.Kontroll rad i textfil:7 av 1881.Kontroll rad i textfil:8 av 1881.Kontroll rad i textfil:9 av 1881.Kontroll rad i textfil:10 av 1881.Kontroll rad i textfil:11 av 1881.Kontroll rad i textfil:12 av 1881.Kontroll rad i textfil:13 av 1881.Kontroll rad i textfil:14 av 1881.Kontroll rad i textfil:15 av 1881.Kontroll rad i textfil:16 av 1881.Kontroll rad i textfil:17 av 1881.Kontroll rad i textfil:18 av 1881.Kontroll rad i textfil:19 av 1881.Kontroll rad i textfil:20 av 1881.Kontroll rad i textfil:21 av 1881.Kontroll rad i textfil:22 av 1881.Kontroll rad i textfil:23 av 1881.Kontroll rad i textfil:24 av 1881.Kontroll rad i textfil:25 av 1881.Kontroll rad i textfil:26 av 1881.Kontroll rad i textfil:27 av 1881.Kontroll rad i textfil:28 av 1881.Kontroll rad i textfil:29 av 1881.Kontroll rad i textfil:30 av 1881.Kontroll rad i textfil:31 av 1881.Kontroll rad i textfil:32 av 1881.Kontroll rad i textfil:33 av 1881.Kontroll rad i textfil:34 av 1881.Kontroll rad i textfil:35 av 1881.Kontroll rad i textfil:36 av 1881.Kontroll rad i textfil:37 av 1881.Kontroll rad i textfil:38 av 1881.Kontroll rad i textfil:39 av 1881.Kontroll rad i textfil:40 av 1881.Kontroll rad i textfil:41 av 1881.Kontroll rad i textfil:42 av 1881.Kontroll rad i textfil:43 av 1881.Kontroll rad i textfil:44 av 1881.Kontroll rad i textfil:45 av 1881.Kontroll rad i textfil:46 av 1881.Kontroll rad i textfil:47 av 1881.Kontroll rad i textfil:48 av 1881.Kontroll rad i textfil:49 av 1881.Kontroll rad i textfil:50 av 1881.Kontroll rad i textfil:51 av 1881.Kontroll rad i textfil:52 av 1881.Kontroll rad i textfil:53 av 1881.Kontroll rad i textfil:54 av 1881.Kontroll rad i textfil:55 av 1881.Kontroll rad i textfil:56 av 1881.Kontroll rad i textfil:57 av 1881.Kontroll rad i textfil:58 av 1881.Kontroll rad i textfil:59 av 1881.Kontroll rad i textfil:60 av 1881.Kontroll rad i textfil:61 av 1881.Kontroll rad i textfil:62 av 1881.Kontroll rad i textfil:63 av 1881.Kontroll rad i textfil:64 av 1881.Kontroll rad i textfil:65 av 1881.Kontroll rad i textfil:66 av 1881.Kontroll rad i textfil:67 av 1881.Kontroll rad i textfil:68 av 1881.Kontroll rad i textfil:69 av 1881.Kontroll rad i textfil:70 av 1881.Kontroll rad i textfil:71 av 1881.Kontroll rad i textfil:72 av 1881.Kontroll rad i textfil:73 av 1881.Kontroll rad i textfil:74 av 1881.Kontroll rad i textfil:75 av 1881.Kontroll rad i textfil:76 av 1881.Kontroll rad i textfil:77 av 1881.Kontroll rad i textfil:78 av 1881.Kontroll rad i textfil:79 av 1881.Kontroll rad i textfil:80 av 1881.Kontroll rad i textfil:81 av 1881.Kontroll rad i textfil:82 av 1881.Kontroll rad i textfil:83 av 1881.Kontroll rad i textfil:84 av 1881.Kontroll rad i textfil:85 av 1881.Kontroll rad i textfil:86 av 1881.Kontroll rad i textfil:87 av 1881.Kontroll rad i textfil:88 av 1881.Kontroll rad i textfil:89 av 1881.Kontroll rad i textfil:90 av 1881.Kontroll rad i textfil:91 av 1881.Kontroll rad i textfil:92 av 1881.Kontroll rad i textfil:93 av 1881.Kontroll rad i textfil:94 av 1881.Kontroll rad i textfil:95 av 1881.Kontroll rad i textfil:96 av 1881.Kontroll rad i textfil:97 av 1881.Kontroll rad i textfil:98 av 1881.Kontroll rad i textfil:99 av 1881.Kontroll rad i textfil:100 av 1881.Kontroll rad i textfil:101 av 1881.Kontroll rad i textfil:102 av 1881.Kontroll rad i textfil:103 av 1881.Kontroll rad i textfil:104 av 1881.Kontroll rad i textfil:105 av 1881.Kontroll rad i textfil:106 av 1881.Kontroll rad i textfil:107 av 1881.Kontroll rad i textfil:108 av 1881.Kontroll rad i textfil:109 av 1881.Kontroll rad i textfil:110 av 1881.Kontroll rad i textfil:111 av 1881.Kontroll rad i textfil:112 av 1881.Kontroll rad i textfil:113 av 1881.Kontroll rad i textfil:114 av 1881.Kontroll rad i textfil:115 av 1881.Kontroll rad i textfil:116 av 1881.Kontroll rad i textfil:117 av 1881.Kontroll rad i textfil:118 av 1881.Kontroll rad i textfil:119 av 1881.Kontroll rad i textfil:120 av 1881.Kontroll rad i textfil:121 av 1881.Kontroll rad i textfil:122 av 1881.Kontroll rad i textfil:123 av 1881.Kontroll rad i textfil:124 av 1881.Kontroll rad i textfil:125 av 1881.Kontroll rad i textfil:126 av 1881.Kontroll rad i textfil:127 av 1881.Kontroll rad i textfil:128 av 1881.Kontroll rad i textfil:129 av 1881.Kontroll rad i textfil:130 av 1881.Kontroll rad i textfil:131 av 1881.Kontroll rad i textfil:132 av 1881.Kontroll rad i te
Re: [PHP] Howto search in SQL for a specific character?
Hi there! This didn't work. Ok, mysql 4.x don't have support for the command. Exuse my.. didn't realize that before... I have to do this another way around... :-) /G - Original Message - From: "Jay Blanchard" <[EMAIL PROTECTED]> To: "'Gustav Wiberg'" <[EMAIL PROTECTED]>; "PHP General" Sent: Tuesday, November 29, 2005 9:59 PM Subject: RE: [PHP] Howto search in SQL for a specific character? [snip] $v1 = chr(39); //39 is apostrofe $sql = "SELECT nameOfPedigree FROM tbpedigrees WHERE SUBSTR(nameOfPedigree,0,1) = $v1"; Why doesn't this work? [/snip] Probably because the character set is misinterpreted. What happens when you echo $v1? Try $sql = "SELECT nameOfPedigree FROM tbpedigrees WHERE SUBSTR(nameOfPedigree,0,1) = ''' "; -- 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] Howto search in SQL for a specific character?
Hi I'm sorry but this didn't work either? If I replaced the ' with for example an a it worked /G - Original Message - From: "Stephen Johnson" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General" Sent: Tuesday, November 29, 2005 10:00 PM Subject: Re: [PHP] Howto search in SQL for a specific character? Try this : $sql = "SELECT nameOfPedigree FROM tbpedigrees WHERE nameOfPedigree like "'%"; The % is a wildcard and will give you the results you want. http://www.ouradoptionblog.com Join our journey of adoption http://www.thelonecoder.com [EMAIL PROTECTED] continuing the struggle against bad code */ ?> From: Gustav Wiberg <[EMAIL PROTECTED]> Organization: Gustav Wiberg Reply-To: Gustav Wiberg <[EMAIL PROTECTED]> Date: Tue, 29 Nov 2005 21:55:27 +0100 To: PHP General Subject: [PHP] Howto search in SQL for a specific character? Hi there! in PHP i Write.. $v1 = chr(39); //39 is apostrofe $sql = "SELECT nameOfPedigree FROM tbpedigrees WHERE SUBSTR(nameOfPedigree,0,1) = $v1"; Why doesn't this work? I want the sql to select all nameOfPedigree - fields where the first character is apostrofe (') /G http://www.varupiraten.se/ -- 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] Howto search in SQL for a specific character?
Hi there! in PHP i Write.. $v1 = chr(39); //39 is apostrofe $sql = "SELECT nameOfPedigree FROM tbpedigrees WHERE SUBSTR(nameOfPedigree,0,1) = $v1"; Why doesn't this work? I want the sql to select all nameOfPedigree - fields where the first character is apostrofe (') /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fixing ID's in mySQL Table
- Original Message - From: "Larry E. Ullman" <[EMAIL PROTECTED]> To: "Rahul S.Johari" <[EMAIL PROTECTED]> Cc: "PHP" Sent: Tuesday, November 08, 2005 3:38 PM Subject: Re: [PHP] Fixing ID's in mySQL Table Is there a way to fix ID sequence in a MySQL table using PHP? Basically I have some tables with a lot of records, 1000 to 5000. ‘ID’ is the Primary Key column in these tables, and at the time the code was originally written, there weren’t much verification of data being input going on. Thus a lot of junk records were being let in, which had to be deleted at some point or another. Now the ID sequence is all screwed up. It’s not in sequence anymore. You may not like this answer but you shouldn't "fix" this. Primary keys, by definition, should never change. Their purpose is to uniquely refer to a record. If you change the primary key of a record, then you've undermined this purpose. If you have "holes" in your sequencing, this isn't a problem either, as how the records are stored in the database is completely meaningless. If you need the records to be listed in some sort of order, you should add another column or table that manages that. But leave the primary key alone. Hope that helps, Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi I totally agree with you Larry. Couldn't have said it better myself! :-) /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fixing ID's in mySQL Table
- Original Message - From: "Rahul S. Johari" <[EMAIL PROTECTED]> To: "PHP" Sent: Tuesday, November 08, 2005 2:37 PM Subject: [PHP] Fixing ID's in mySQL Table Ave, Is there a way to fix ID sequence in a MySQL table using PHP? Basically I have some tables with a lot of records, 1000 to 5000. OID¹ is the Primary Key column in these tables, and at the time the code was originally written, there weren¹t much verification of data being input going on. Thus a lot of junk records were being let in, which had to be deleted at some point or another. Now the ID sequence is all screwed up. It¹s not in sequence anymore. Is there a way to fix this? Thanks, Rahul S. Johari Coordinator, Internet & Administration Informed Marketing Services Inc. 251 River Street Troy, NY 12180 Tel: (518) 266-0909 x154 Fax: (518) 266-0909 Email: [EMAIL PROTECTED] http://www.informed-sources.com Hi there! Do you want an orderby-statement to be done on ID-field? Is that what you mean? I would go to phpmyadmin and fix that in the database-structure. (or some kind of database-utility) /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FileExists?
- Original Message - From: "Jay Blanchard" <[EMAIL PROTECTED]> To: "'Gustav Wiberg'" <[EMAIL PROTECTED]>; "PHP General" Sent: Monday, November 07, 2005 9:02 PM Subject: RE: [PHP] FileExists? [snip] File_exists doesn't seem to work with URLs that point to another domain. What to use? $x = fopen(http://www.stammis.com/getstart.php); if file_exists($x) [/snip] What version of PHP are you using. With anything less than PHP5 you cannot use file_exists on anything other than the file system PHP is local to. All versions of PHP. Explicitly using file:// since PHP 4.3.0 /path/to/file.ext relative/path/to/file.ext fileInCwd.ext C:/path/to/winfile.ext C:\path\to\winfile.ext \\smbserver\share\path\to\winfile.ext file:///path/to/file.ext file:// is the default wrapper used with PHP and represents the local filesystem. When a relative path is specified (a path which does not begin with /, \, \\, or a windows drive letter) the path provided will be applied against the current working directory. In many cases this is the directory in which the script resides unless it has been changed. Using the CLI sapi, this defaults to the directory from which the script was called. Hi I'm using PHP 4.3.0. Thanx! :-) /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FileExists?
Hi there! File_exists doesn't seem to work with URLs that point to another domain. What to use? $x = fopen(http://www.stammis.com/getstart.php); if file_exists($x) /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RegEx - Is this right?
Hi there! I want to get conents of a file and split into a array... $s = file_get_contents($fileName); $splitS = preg_split("/\n/",$s); Is this equal to using $splitS = file($fileName) ? /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any good free easy converting tool?
- Original Message - From: "Joe Harman" <[EMAIL PROTECTED]> To: Cc: "Gustav Wiberg" <[EMAIL PROTECTED]> Sent: Wednesday, October 12, 2005 9:00 PM Subject: Re: [PHP] Any good free easy converting tool? On 10/12/05, Gustav Wiberg <[EMAIL PROTECTED]> wrote: Hi there! Someone know of any good free tool for converting from Access to Mysql. I just need to import certain tables into an already existance database. /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hey Gustav!!! I use Navicat... i think they have a free trail package for their software... it's the best that I can find out there!! Good luck! Joe -- Joe Harman - Do not go where the path may lead, go instead where there is no path and leave a trail. - Ralph Waldo Emerson -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.14/129 - Release Date: 2005-10-11 Hi there! Thanx! /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any good free easy converting tool?
Hi there! I need to do a one time convert from an Access-databasetable to an MySQL-database-table. Is the MyODBC the only way? /G - Original Message - From: "Jay Blanchard" <[EMAIL PROTECTED]> To: "'Gustav Wiberg'" <[EMAIL PROTECTED]> Sent: Wednesday, October 12, 2005 8:56 PM Subject: RE: [PHP] Any good free easy converting tool? [snip] Someone know of any good free tool for converting from Access to Mysql. I just need to import certain tables into an already existance database. [/snip] Isn't the MyODBC thingie free? -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.14/129 - Release Date: 2005-10-11 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Any good free easy converting tool?
Hi there! Someone know of any good free tool for converting from Access to Mysql. I just need to import certain tables into an already existance database. /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GET variables and mySQL functions inside an Image header.
- Original Message - From: "Kristopher Kane" <[EMAIL PROTECTED]> To: Sent: Monday, October 10, 2005 8:33 AM Subject: [PHP] GET variables and mySQL functions inside an Image header. I am currently in Afghanistan and don't have much access to look these questions up. I consider them basic and regret having to post them here. When passing variables using GET as in: index.php?first=value?second=value My script is reading the first value, however through an included file and another function, it can't read the second. What scope do these variables have? Or what other reasons for not being able to read the variables might there be? Try index.php?first=value&second=value (Use & instead of questionmark after first variable) /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular expressions
- Original Message - From: "Jasper Bryant-Greene" <[EMAIL PROTECTED]> To: "PHP General" Sent: Sunday, October 09, 2005 8:06 PM Subject: Re: [PHP] Regular expressions Gustav Wiberg wrote: // Loop through our array, show HTML source as HTML source; and line numbers too. foreach ($lines as $line_num => $line) { echo "Line #{$line_num} : " . htmlspecialchars($line) . "/>\n"; if ($line_num > 0 ) { $getName = explode('<>', $line); $pattern = "/ID=([0-9]*)\ // instead of preg_split, use preg_match $idNumber = preg_match($pattern, $subject, $matches); // your ID number is now in $matches[1] echo "NAME = " . $getName[2] . " has ID number=$idNumber[0]"; } //require("phpfunctions/opendb.php"); //$sql = "UPDATE beskrivandeVarunamn=" . safeQuote($bNamn) . " WHERER" //mysql_close(); } ?> -- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.13/124 - Release Date: 2005-10-07 Hi there! Thanx, I'll try that! :-) /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regular expressions
Hi there! I'm no good at reg exp... Yes, I confess.. Here's my code // Loop through our array, show HTML source as HTML source; and line numbers too. foreach ($lines as $line_num => $line) { echo "Line #{$line_num} : " . htmlspecialchars($line) . "\n"; if ($line_num > 0 ) { $getName = explode('<>', $line); $pattern = "/ID=([0-9]*)\"; } //require("phpfunctions/opendb.php"); //$sql = "UPDATE beskrivandeVarunamn=" . safeQuote($bNamn) . " WHERER" //mysql_close(); } ?> Output of this code is something like this: Line #0 : Varupiraten<>http://www.varupiraten.se/ NH01<><>Liteon DVD±RW<>1225<>http://www.varupiraten.se/web/spec_product.php?ID=2252<>PC-CD-DVD-LDW-SOHW-852SX<>0<> Line #1 : NH01<><>LiteOn DVD±RW 16 x<>655<>http://www.varupiraten.se/web/spec_product.php?ID=2251<>PC-CD-DVD-LDW-1653S-01C<>1<> NAME = LiteOn DVD±RW 16 x has ID number=NH01<><>LiteOn DVD±RW 16 x<>655<>http://www.varupiraten.se/web/spec_product.php? Line #2 : NH01<><>LiteOn DVD±RW 8x<>599<>http://www.varupiraten.se/web/spec_product.php?ID=1708<>PC-CD-DVD-LDW-832S-11C<>1<> NAME = LiteOn DVD±RW 8x has ID number=NH01<><>LiteOn DVD±RW 8x<>599<>http://www.varupiraten.se/web/spec_product.php? Line #3 : NH01<><>LiteOn DVD±RW 16<>725<>http://www.varupiraten.se/web/spec_product.php?ID=1711<>PC-CD-DVD-LDW-1653S-09C<>1<> NAME = LiteOn DVD±RW 16 has ID number=NH01<><>LiteOn DVD±RW 16<>725<>http://www.varupiraten.se/web/spec_product.php? Line #4 : NH01<><>LITEON 8x<>725<>http://www.varupiraten.se/web/spec_product.php?ID=2250<>CD-DVD-LDW-811S<>1<> NAME = LITEON 8x has ID number=NH01<><>LITEON 8x<>725<>http://www.varupiraten.se/web/spec_product.php? Just focus on $idNumber[0] in the code above... In the last row I get an output of LITEON 8x<>725<>http://www.varupiraten.se/web/spec_product.php? I want to get an output of 2250. I do I achieve that? /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ID from lines?
Hi Yes, it would work in these cases... But if there would be two or three =, then you couldn't generalize it in that matter... /G @varupiraten.se - Original Message - From: "Kevin Waterson" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Sent: Sunday, October 09, 2005 4:37 PM Subject: Re: [PHP] ID from lines? This one time, at band camp, "Gustav Wiberg" <[EMAIL PROTECTED]> wrote: Line #3 : NH01<><>LiteOn DVD±RW 16<>725<>http://www.varupiraten.se/web/spec_product.php?ID=1711<>PC-CD-DVD-LDW-1653S-09C<>1<> Line #4 : NH01<><>LITEON 8x<>725<>http://www.varupiraten.se/web/spec_product.php?ID=2250<>CD-DVD-LDW-811S<>1<> explode on "=" Kevin -- "Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.13/124 - Release Date: 2005-10-07 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ID from lines?
- Original Message - From: "Al Hafoudh" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Sent: Sunday, October 09, 2005 4:38 PM Subject: Re: [PHP] ID from lines? /ID=([0-9]*)\ Thanx! /G @varupiraten.se Gustav Wiberg wrote: Hi there! How do I get ID number from these lines? Do I have to use regular expressions? Line #3 : NH01<><>LiteOn DVD±RW 16<>725<>http://www.varupiraten.se/web/spec_product.php?ID=1711<>PC-CD-DVD-LDW-1653S-09C<>1<> Line #4 : NH01<><>LITEON 8x<>725<>http://www.varupiraten.se/web/spec_product.php?ID=2250<>CD-DVD-LDW-811S<>1<> /G http://www.varupiraten.se/ -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.13/124 - Release Date: 2005-10-07 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ID from lines?
Hi there! How do I get ID number from these lines? Do I have to use regular expressions? Line #3 : NH01<><>LiteOn DVD±RW 16<>725<>http://www.varupiraten.se/web/spec_product.php?ID=1711<>PC-CD-DVD-LDW-1653S-09C<>1<> Line #4 : NH01<><>LITEON 8x<>725<>http://www.varupiraten.se/web/spec_product.php?ID=2250<>CD-DVD-LDW-811S<>1<> /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Two MySQL connections in one script not working as expected
- Original Message - From: "Charles Kline" <[EMAIL PROTECTED]> To: Sent: Tuesday, September 27, 2005 8:25 PM Subject: [PHP] Two MySQL connections in one script not working as expected Hi all, I have a script that needs to update data in two databases. My db connections are both in class files that I created to execute the various connections and queries. What is happening is that the second database connection does not seem to work. The error I get is that it seems the second query is being executed against the first database connection - does that make sense? So I get an error that the database_name.table_name does not exist, which is true, but the query is getting executed against the wrong database name. Any ideas? Thanks, Charles -- Hi there! Maybe you are using the same variables that may confuse things...? /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] passing a variable with php_self
- Original Message - From: "A.J. Brown" <[EMAIL PROTECTED]> To: Sent: Tuesday, September 27, 2005 3:26 PM Subject: Re: [PHP] passing a variable with php_self "> works well too -- Sincerely, A.J. Brown "Jim Moseby" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] -Original Message- From: Ross [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 27, 2005 8:58 AM To: php-general@lists.php.net Subject: [PHP] passing a variable with php_self can someone show me the right way to do the following... I want to pass a variable to a self submitting link. Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.7/112 - Release Date: 2005-09-26 Try to avoid the typing as: Use instead for compability reasons... /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] selfreferencing script with output
- Original Message - From: "Silvio Porcellana" <[EMAIL PROTECTED]> To: "PHP general" Sent: Sunday, September 25, 2005 12:13 AM Subject: Re: [PHP] selfreferencing script with output Sabine wrote: Thanks for your answer, Gustav, now I see I didn't explain good enough what my problem is. My problem is not how to construct a status bar, but not it is possible to provide any output before the headering (*Warning*: Cannot modify header information - headers already sent by). Neither after it. Best regards Sabine P.S.: I played around with PEARs HTML_Progress. It's really worth trying. The user doc on Laurent Lavilles page provides a lot of explanation and examples. (http://pear.laurent-laville.org/HTML_Progress/). Hi Sabine why don't you try an AJAX approach? (Kinda like GMail and stuff like that?) You can create a DIV in your page that contains the *output* (maybe an image with the width set to the percentage of mails sent): the content of this DIV is updated by another script (the one that sends the email) that gets called (via JavaScript) at specific intervals with a specific query (in your case, the messages to send). This way your main page never gets reloaded and you see a nice progress bar in your DIV. I know it sounds a bit difficult, but it's a cool "technology" and after the initial difficulties it can be really useful. As a start, have a read here: http://en.wikipedia.org/wiki/AJAX HTH, cheers! Silvio -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.6/111 - Release Date: 2005-09-23 Look at the functions ob_start() and ob_flush().. Something like: /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] serialize
- Original Message - From: "blackwater dev" <[EMAIL PROTECTED]> To: Sent: Sunday, September 25, 2005 4:17 AM Subject: [PHP] serialize I have an app that stores evaluation scores so I have 30+ values all within a certain range, currently in the db, each of these values has it's own column: Table test id user_id motivation caring personal_characteristics creativity, ...etc. If the client decides they want to trap more characteristics, it requires changes to the table structure and the table quickly gets large with 30+ columns. I was thinking of just compacting all of these down to one column and then using serialize/unserialize and storing an array of the test scoresis this the best way?? Thanks! Hi! It doesn't seem like "good" db-practise to set all the values in one field. You shouldn't be forced to change database-structure just because the user inputs more information. You may reconsider using several tables and do relations between the tables.. /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is PHP the language for me???
- Original Message - From: "Jasper Bryant-Greene" <[EMAIL PROTECTED]> To: Sent: Sunday, September 25, 2005 1:38 AM Subject: Re: [PHP] Is PHP the language for me??? Gustav Wiberg wrote: I have read some posts about this issue, but one point that is essential that I've not read about is the future! I mean, what are your plans in the future? Or what plans is it for the website. Just because it's only simple links now, it might be right to consider if for example object-oriented programming would be an issue in the future. PHP5 has that implementation, but not PHP4 so this might depend on the webserver/webhost... PHP4 has OO as well. It's just an inferior and slower implementation. OO does not suit every case and you need to decide whether the additional time and work spent writing the code in OO is going to pay off in the future. If it isn't likely to, then I would suggest procedural might be a better choice. Ok, I didn't know that PHP4 had OO-support and yes, I agree that it is 95% always better to use OO This was just a spontanious thought! And yes, I just love PHP if I compare with ASP which maybe is the most relevant!? comparision.. (The two largest languages for dynamic web out there? Don't know if maybe Perl is larger though). ASP isn't actually a language, it's just a framework for dynamic ("active") server pages, that provides a bunch of common objects and stuf. In classic ASP you can write VBScript or JScript, and in ASP.NET you can write VB.NET, JScript or C#. Both classic and .NET allow you to add additional languages of your choice with a bit of work. Of course! Wrong of me to say that ASP is a language... I meant VBScript... which I have been working with. I still prefer PHP though; just thought I'd point out the difference... Who doesnt? :-) /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT - database and indexes... but anyone please?
- Original Message - From: "Rory Browne" <[EMAIL PROTECTED]> To: "Gustav Wiberg" <[EMAIL PROTECTED]> Cc: "PHP General" Sent: Sunday, September 25, 2005 1:26 AM Subject: Re: [PHP] OT - database and indexes... but anyone please? I'm not an expert on databases, and I haven't a notion of mailing you off-list, with information that could potentially benifit others as well, but from my understanding, deleting an index(a good index that is) would slow the db down in certain cases. Deleting a "bad index" would speed certain operations up. On 9/24/05, Gustav Wiberg <[EMAIL PROTECTED]> wrote: Hi there! This is not strictly PHP... but if there's anyone out there with good knowledge of indexes, please mail me off-list. My question: If I delete an index, what is the WORST thing that can happen? /G http://www.varupiraten.se/ -- 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 -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.6/111 - Release Date: 2005-09-23 Thanx! /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OT - database and indexes... but anyone please?
Hi there! This is not strictly PHP... but if there's anyone out there with good knowledge of indexes, please mail me off-list. My question: If I delete an index, what is the WORST thing that can happen? /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is PHP the language for me???
- Original Message - From: "Emily McCall" <[EMAIL PROTECTED]> To: Sent: Friday, September 23, 2005 11:07 PM Subject: [PHP] Is PHP the language for me??? I am trying to figure out whether php will help me to set up a website which is essentially just links to donwloadable material. I have directories in place and am using flash to auto fill the directory names on to an index page, however i cant use this to access the files themselves. So I am after a language i can use to read all the file names in the directory and display them with a bit of 'niceness' onto a webpage so as they can be used as links to the files. Thanks No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.5/110 - Release Date: 2005-09-22 Hi there! I have read some posts about this issue, but one point that is essential that I've not read about is the future! I mean, what are your plans in the future? Or what plans is it for the website. Just because it's only simple links now, it might be right to consider if for example object-oriented programming would be an issue in the future. PHP5 has that implementation, but not PHP4 so this might depend on the webserver/webhost... This was just a spontanious thought! And yes, I just love PHP if I compare with ASP which maybe is the most relevant!? comparision.. (The two largest languages for dynamic web out there? Don't know if maybe Perl is larger though). /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] LINKS
- Original Message - From: "php @ net mines" <[EMAIL PROTECTED]> To: Sent: Saturday, September 24, 2005 4:34 PM Subject: [PHP] LINKS Hi all is there a way to have a program detecting when a link was clicked and automatically opening another window (that can "plugged-in" in any website - running php of course)? I know... I hate pop-ups too but a client asked for it... Thanks M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi! I don't if I really understand you're question, but as I see it is done on the clientside (webbrowser) Link is clicked the popup-function in Javascript opens url1 in one window and url2 opens up in a new window. So a tip is to consult a Javascript-mailinglist. /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP in a commandline shell?
- Original Message - From: "John Nichel" <[EMAIL PROTECTED]> To: "PHP General" Sent: Friday, September 23, 2005 8:35 PM Subject: Re: [PHP] PHP in a commandline shell? Gustav Wiberg wrote: With PHPinfo() I get this result on my local testserver which has Windows XP running Apache Can I then use Shell? What command do I use for waiting for user input? Totally novice in this area of PHP... PHP Version 4.3.10 System Windows NT BLACKSHADOW 5.1 build 2600 Build Date Dec 14 2004 17:46:48 Server API CGI/FastCGI Virtual Directory Support enabled Configuration File (php.ini) Path C:\WINDOWS\php.ini PHP API 20020918 PHP Extension 20020429 Zend Extension 20021010 Debug Build no Thread Safety enabled Registered PHP Streams php, http, ftp, compress.zlib http://us3.php.net/features.commandline -- 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 -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.5/110 - Release Date: 2005-09-22 Hi! Thanx for link. That was helpful! /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] selfreferencing script with output
- Original Message - From: "Sabine" <[EMAIL PROTECTED]> To: "PHP general" Sent: Friday, September 23, 2005 6:14 PM Subject: [PHP] selfreferencing script with output Hello to all, I have 2 scripts ( preparing about 1000 mails for pear's mail-queue and sending them) which shall be started by the user. There are - limitations of the provider for the duration of the scripts - no cronjobs So I had the idea to write a selfreferencing script like that: $begin= intval($_GET["begin"]); $allMails = 1000; //... prepare / send a portion of for example 50 mails if (($begin+ 50) < $allMails) { header("Location: script.php?begin=".($begin+ 50)); } else { echo "Done!"; } But I want to show the user some output like a statusbar (eventually with pear's Html_Progress) or something like that so he knows the script is still working. Has anybody of you an idea, a tip for me how to do it? I don't see how I can do it within the construct above. Is there an alternative to it? Thanks in advance for your answers Sabine Hi I don't know if this works, but I think it ought to work: Set a picture (a line) with width 1, next iteration set the line to width 2, next to width 3... OR set a picture with width % off Change picture with dhtml (or if you prefer Javascript and css ;-)) /G http://www.varupiraten.se/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.11.5/110 - Release Date: 2005-09-22 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php