[PHP] mysql and php questions
Hello all: I had a few questions. First, I'm using php-fastcgi with nginx for my primary web server. I was wondering what sorts of optimizations exist to make this process a lot faster. Second, I'm setting up a custom application, and it contains an authentication module for login/registration. In doing this, I discovered PDO (I used to just use the mysql_* functions). According to google, it's easier to prevent mysql injection attacks with PDO, so I dove in. Before, I was using $pdo-exec(...);, but I read that I need to call quote on the variables I'm passing in. It looks like that all quote does is just add '...' on the variables, but I could be wrong. So, here's my questions: First, I know that prepared statements are immune to mysql injection attacks, if I just use the variables with placeholders in the statements. I know that caching these means that the optimization does not have to be done every time, but is this the most efficient method for adding a single user for registration? Or would a basic query be better. Also, I had the idea of building up common queries and cacheing them, but this isn't really possible since each php script (as far as I'm aware) gets it's own process or environment. If I can build the prepared statements and cache them, it seems like things would be a lot quicker. Is this something commonly done? -- Take care, Ty http://tds-solutions.net The aspen project: a barebones light-weight mud engine: http://code.google.com/p/aspenmud He that will not reason is a bigot; he that cannot reason is a fool; he that dares not reason is a slave. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Echo in __GET()
Is the a way to have an array, or use __get() to provide different data if you are echoing a variable, rather than if you are using it in a 'if' statement? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DB access and sessions
Since you can't be sure to be notified when a user stops editing a page, whatever solution you choose will probably involve some sort of timeout-based system. (e.g. when someone starts editing a page, set a last_opened time field on the resources, and when someone else tries to edit the same page, check to see if last opened is in the last 30 mins). If you combine this with an ajax/iframe reload, you can be much more precise (e.g. while someone is editing a document, have their browser hit a designated url every 60 seconds; when the repeated hits stop, you know they're done) Since no such system is absolutely positively foolproof, you'll probably want to look into optimistic locking if you want to guarantee that no one's changes are accidentally overwritten. Tyler On 8/17/05, Bret Walker [EMAIL PROTECTED] wrote: Hello- I'm developing a web-based system whereby users can edit documents and then e-mail the documents to selected recipients. The documents are comprised of the data from several MySQL fields. I want to make sure that two people don't edit a document at the same time. My users log in via a script that starts a session. My initial idea was to have a field to denote file access (1 for in use 0 for available). The problem with this would be if a user navigates to a different page or closes the browser window without clicking a save or close button (which would execute a query to set the in_use field to 0). I'm sure others have dealt with the issue of exclusive access to a MySQL resource. I've looked into InnoDB transactional support, but that doesn't seem to be what I need, since I'm not overly concerned about simultaneously access, just simultaneous editing. How can I ensure the document isn't accessed by two people at the same time? Thanks, Bret -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Restarting windows from php
I never used this kind of functions before. What's wrong? In IIS for Execute Permissions I have Scripts and Executables. What permissions should I set for the Internet Guest Account? Or something else caused the problem, not the permissions? Please help me.:) On windows, php uses cmd.exe to do exec() stuff. IIRC if your web server/php script is running as an underprivileged user (which it should be), it probably don't have read/exec access to cmd.exe. This is one possible cause of the fork error you mentioned. You can solve this by giving your php script access to cmd.exe, or copying cmd.exe into the directory that contains your php dll or exe. (you may have already done this, or this may be different in newer versions of windows -- I haven't had this issue in a while) Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Missing or wrong reply-to headers in this mailing list
On 7/12/05, Rasmus Lerdorf [EMAIL PROTECTED] wrote: Probably just means the lists aren't very technical. That comment amused me greatly, because the only other mailinglist I'm on is the Ruby on Rails list, and that one does reply-to munging. What that says about the respective userbases of PHP and RoR, I'm not sure... :p -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: jpgs into database
I've always liked storing all data in the DB to keep things simple, so I stored images in the DB and then cache them on the filesystem when they're first requested. Granted, it's pretty inefficient with disk space, but if you have a good ORM db lib and caching lib, it's extremely convenient. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is there a way to get a variable name as a string?
function named_print($var_name) { return echo 'the variable named $var_name is set to ' . \$var_name; } eval(named_print($foo)); ;-) Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Converting to a string
you could just use the time() or numbers of the date function From: PartyPosters [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] Converting to a string Date: Wed, 23 Mar 2005 20:43:30 - MIME-Version: 1.0 Received: from lists.php.net ([216.92.131.4]) by mc10-f11.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 23 Mar 2005 12:46:08 -0800 Received: from ([216.92.131.4:3752] helo=lists.php.net)by pb1.pair.com (ecelerity HEAD r(5268)) with SMTPid 6E/E2-06694-265D1424 for [EMAIL PROTECTED]; Wed, 23 Mar 2005 15:45:22 -0500 Received: (qmail 40045 invoked by uid 1010); 23 Mar 2005 20:43:52 - Received: (qmail 39914 invoked by uid 1010); 23 Mar 2005 20:43:41 - X-Message-Info: JGTYoYF78jGnXCyUPttfpp6UKiZEgipk++L9rr4c6Ms= Return-Path: [EMAIL PROTECTED] X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:php-general@lists.php.net Delivered-To: mailing list php-general@lists.php.net Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] X-Host-Fingerprint: 62.241.163.7 blaster.systems.pipex.net Linux 2.4/2.6 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600. X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600. X-OriginalArrivalTime: 23 Mar 2005 20:46:08.0620 (UTC) FILETIME=[572A42C0:01C52FE9] Hello guys, i am using date(l dS of F Y h:i:s A) and want to put the value in a database as a string, How do I converting it to a string, this is what I have got so far:- $v_ship_date = date(l dS of F Y h:i:s A); Lots of thanks. - Original Message - From: PartyPosters To: php-general@lists.php.net Sent: Tuesday, March 22, 2005 10:01 PM Subject: Passing Arrays between pages Hello, Please can someone tell me how you pass arrays between PHP pages. I have tried something like this and have tried many variations of this but nothing working yet ; Page 1 $testArray[0] =Apple; $testArray[1] =Banana; $testArray[2] =Peach; echo INPUT NAME = \kcompany[]\ TYPE = \hidden\ VALUE=\$testArray\; Page2 echo $testArray[1]; On different variations of this I keep on getting 'Array' when I to return the variable on the second page Many Thanks. Kaan. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql query update two table in one?
Can you update two tables in one mysql query i've got these two queries $db-query(update `dbn_members_counters` set views =(views +1) where id = '$this-id' ); $db-query(update `dbn_members` set lastaction = $conf-site_time, page = '$this-page' where id = '$this-id' ); and i was wonder if i could get them into one because there are right next two each other and i'm trying to lower my query count. From: K Karthik [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] php-help Date: Thu, 10 Mar 2005 12:31:35 +0530 MIME-Version: 1.0 Received: from mc7-f40.hotmail.com ([65.54.253.47]) by IMC3-S26.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Mar 2005 22:59:41 -0800 Received: from lists.php.net ([216.92.131.4]) by mc7-f40.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Mar 2005 22:59:41 -0800 Received: from ([216.92.131.4:25901] helo=lists.php.net)by pb1.pair.com (ecelerity HEAD r(5124)) with SMTPid E8/F4-53294-F40FF224 for [EMAIL PROTECTED]; Thu, 10 Mar 2005 01:59:30 -0500 Received: (qmail 17042 invoked by uid 1010); 10 Mar 2005 06:58:09 - Received: (qmail 17024 invoked by uid 1010); 10 Mar 2005 06:58:09 - X-Message-Info: JGTYoYF78jFevGptXBXjGwKBSvHljkD+bF1qvT/FEkQ= Return-Path: [EMAIL PROTECTED] X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:php-general@lists.php.net Delivered-To: mailing list php-general@lists.php.net Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] X-Host-Fingerprint: 203.193.155.110 alps.manageengine.org Linux 2.4/2.6 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913 X-Accept-Language: en-us, en X-OriginalArrivalTime: 10 Mar 2005 06:59:41.0597 (UTC) FILETIME=[BBA044D0:01C5253E] sir, i'll explain my problem.and if anyone could help me i'll be thankful. i am displaying a content read from a file into a text area of a form. when i make changes andretrieve back in the text area, i encounter a problem.. i.e., when i enter text=please enter i have an outputas text= / please enter/ thanks, kkarthik -- 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] getting mac id
lol, its been hard not to, its happened a few times but now that hotmail is 250 mb i'm fine. From: anirudh dutt [EMAIL PROTECTED] Reply-To: anirudh dutt [EMAIL PROTECTED] To: Tyler Replogle [EMAIL PROTECTED] CC: php-general@lists.php.net Subject: Re: [PHP] getting mac id Date: Mon, 28 Feb 2005 07:27:22 +0530 MIME-Version: 1.0 Received: from wproxy.gmail.com ([64.233.184.196]) by mc11-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sun, 27 Feb 2005 17:57:23 -0800 Received: by wproxy.gmail.com with SMTP id 67so1905911wrifor [EMAIL PROTECTED]; Sun, 27 Feb 2005 17:57:22 -0800 (PST) Received: by 10.54.46.8 with SMTP id t8mr90237wrt;Sun, 27 Feb 2005 17:57:22 -0800 (PST) Received: by 10.54.39.25 with HTTP; Sun, 27 Feb 2005 17:57:22 -0800 (PST) X-Message-Info: JGTYoYF78jEHjJx36Oi8+Z3TmmkSEdPtfpLB7P/ybN8= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=FLz2QcENnR004ksGTQ5TYqJitN2OHEqT3Pld2OQVPZAS1n9xXTbLNgifiu04IN55tl0Riehw8fmLj1LRAmKondLO/kzJJGw96vlb7Amb8x1ApUmE4zCVh/UZwwLVVv2hk6ciBp9LFFRkEI3llXd8CNDwxMZuYTBlHyEsrlK9OoQ= References: [EMAIL PROTECTED] [EMAIL PROTECTED] Return-Path: [EMAIL PROTECTED] X-OriginalArrivalTime: 28 Feb 2005 01:57:23.0399 (UTC) FILETIME=[D8496570:01C51D38] On Fri, 25 Feb 2005 15:52:02 -0800, Tyler Replogle [EMAIL PROTECTED] wrote: Hey, I've been on this mailing list for quite a while, but i think this is my first question. I'm not sure though. congrats on managing not to exceed ur account limit ;-) especially since u've been on this mailing list for quite a while -- ]# Anirudh Dutt ...pilot of the storm who leaves no trace like thoughts inside a dream -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getting mac id
Yeah i wasn't think. I've already ruled that out i guess i'll have to use java. From: M. Sokolewicz [EMAIL PROTECTED] To: php-general@lists.php.net Subject: Re: [PHP] getting mac id Date: Sun, 27 Feb 2005 09:29:41 +0100 MIME-Version: 1.0 Received: from lists.php.net ([216.92.131.4]) by mc4-f19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sun, 27 Feb 2005 00:31:17 -0800 Received: from ([216.92.131.4:7256] helo=lists.php.net)by pb1.pair.com (ecelerity HEAD r(5124)) with SMTPid A6/B7-43672-82581224 for [EMAIL PROTECTED]; Sun, 27 Feb 2005 03:30:38 -0500 Received: (qmail 24721 invoked by uid 1010); 27 Feb 2005 08:29:32 - Received: (qmail 24706 invoked by uid 1010); 27 Feb 2005 08:29:32 - X-Message-Info: JGTYoYF78jEHjJx36Oi8+Z3TmmkSEdPtfpLB7P/ybN8= Return-Path: [EMAIL PROTECTED] X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:php-general@lists.php.net Delivered-To: mailing list php-general@lists.php.net Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050106 X-Accept-Language: en-us, en References: [EMAIL PROTECTED] [EMAIL PROTECTED] X-Posted-By: 62.131.2.67 X-OriginalArrivalTime: 27 Feb 2005 08:31:18.0398 (UTC) FILETIME=[B56E49E0:01C51CA6] javascript has pretty strict permissions when run via the browser itself, so I would say no. Unless you instruct your user to run the Javascript via the system itself... but you can't expect that from a simple user. Besides that, a user can choose to turn off JavaScript, or even make it run some new JavaScript code specific to that site, with a click of a button in most modern browsers, and giving the user the ability to completely spoof a part of your control system is never a good idea ;) - tul Tyler Replogle wrote: do you think i could get it with javascript? From: M. Sokolewicz [EMAIL PROTECTED] To: php-general@lists.php.net Subject: Re: [PHP] getting mac id Date: Sat, 26 Feb 2005 21:15:47 +0100 MIME-Version: 1.0 Received: from lists.php.net ([216.92.131.4]) by MC6-F37.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 26 Feb 2005 12:16:54 -0800 Received: from ([216.92.131.4:25405] helo=lists.php.net)by pb1.pair.com (ecelerity HEAD r(5124)) with SMTPid 58/43-51537-B19D0224 for [EMAIL PROTECTED]; Sat, 26 Feb 2005 15:16:27 -0500 Received: (qmail 13001 invoked by uid 1010); 26 Feb 2005 20:15:39 - Received: (qmail 12988 invoked by uid 1010); 26 Feb 2005 20:15:39 - X-Message-Info: JGTYoYF78jH290JDSHtK0Hwmz4NODmcj7i2AMiICo2M= Return-Path: [EMAIL PROTECTED] X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:php-general@lists.php.net Delivered-To: mailing list php-general@lists.php.net Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050106 X-Accept-Language: en-us, en References: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] X-Posted-By: 62.131.2.67 X-OriginalArrivalTime: 26 Feb 2005 20:16:54.0784 (UTC) FILETIME=[1D786000:01C51C40] you can't get the mac-address from a remote (client) computer via PHP because PHP is server-sided (server). The mac-address isn't part of any sort of standard header the browser sends, thus the server will never see it. And if the server can't see it, then PHP can't see it either. The only way to get it would be to run a local script which would pick it up, and send it over. This however would require something like a JAVA applet / application. The mac address is usually hidden away quite well so people can't get it and start pretending to be someone else. Although the idea is good, it most likely will not be possible (relativly easily) - tul Lancer Emotion 16 wrote: But think that not everbody has a computer in his house,especially in 3rd world countries. Here in Peru and in another countries from Sudamerica,lot of people play this mmorpgs,like Knigths Online,WoW or Mu,in lan houses. If you ban the pc, none of the users who will play at this computer will be able to do it. On Fri, 25 Feb 2005 15:52:02 -0800, Tyler Replogle [EMAIL PROTECTED] wrote: Hey, I've been on this mailing list for quite a while, but i think this is my first question. I'm not sure though. Well here goes. I'm working at this site that has an MMORPG, a big online game, and we have this ban script. it bans the ip for the user and the user acount for an amount of time. This doesn't seem to be doing its job because people just change there ip and make a new user. I know there isn't any full way to ban some one from a site, but i've been think and getting the mac id of a computer would work
Re: [PHP] getting mac id
Yeah i thought of that but banning the ip iwon't do any better. From: Lancer Emotion 16 [EMAIL PROTECTED] Reply-To: Lancer Emotion 16 [EMAIL PROTECTED] To: php-general@lists.php.net Subject: Re: [PHP] getting mac id Date: Sat, 26 Feb 2005 12:59:15 -0500 MIME-Version: 1.0 Received: from lists.php.net ([216.92.131.4]) by mc9-f30.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 26 Feb 2005 09:59:51 -0800 Received: from ([216.92.131.4:29512] helo=lists.php.net)by pb1.pair.com (ecelerity HEAD r(5124)) with SMTPid 0D/DF-51537-519B0224 for [EMAIL PROTECTED]; Sat, 26 Feb 2005 12:59:49 -0500 Received: (qmail 90336 invoked by uid 1010); 26 Feb 2005 17:59:18 - Received: (qmail 90322 invoked by uid 1010); 26 Feb 2005 17:59:18 - X-Message-Info: JGTYoYF78jEHjJx36Oi8+Z3TmmkSEdPtfpLB7P/ybN8= Return-Path: [EMAIL PROTECTED] X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:php-general@lists.php.net Delivered-To: mailing list php-general@lists.php.net Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] X-Host-Fingerprint: 64.233.170.204 rproxy.gmail.com Linux 2.4/2.6 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;s=beta; d=gmail.com;h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references;b=AUwTxkptdTLMJHMTyly+ctuG3HxXmWK2T+FcbF8tKR+YarWJMth7kEmgiVMwtGIdPGcCMU/Yc7kNGX4rtRjd0PO7dHMYmUmb8lpeshQ9+eI+ACF77+Uw4Ju+m44hEkRvkpP5tQAod4I48Jk5Heq50U10n4Wz4XDd500vwCasYtk= References: [EMAIL PROTECTED][EMAIL PROTECTED] X-OriginalArrivalTime: 26 Feb 2005 18:00:04.0786 (UTC) FILETIME=[FFEE1920:01C51C2C] But think that not everbody has a computer in his house,especially in 3rd world countries. Here in Peru and in another countries from Sudamerica,lot of people play this mmorpgs,like Knigths Online,WoW or Mu,in lan houses. If you ban the pc, none of the users who will play at this computer will be able to do it. On Fri, 25 Feb 2005 15:52:02 -0800, Tyler Replogle [EMAIL PROTECTED] wrote: Hey, I've been on this mailing list for quite a while, but i think this is my first question. I'm not sure though. Well here goes. I'm working at this site that has an MMORPG, a big online game, and we have this ban script. it bans the ip for the user and the user acount for an amount of time. This doesn't seem to be doing its job because people just change there ip and make a new user. I know there isn't any full way to ban some one from a site, but i've been think and getting the mac id of a computer would work a lot better then ip. I'm not sure how to get teh mac id of a computer though. If any of you know how to can you please tell me. It doesn't just have to be with use php we own the server can we can installl other apps, but many others are on the server anyways. So how do i get the mac id of a user that is going on to my server? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- lancer emotion 16 -- 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] getting mac id
do you think i could get it with javascript? From: M. Sokolewicz [EMAIL PROTECTED] To: php-general@lists.php.net Subject: Re: [PHP] getting mac id Date: Sat, 26 Feb 2005 21:15:47 +0100 MIME-Version: 1.0 Received: from lists.php.net ([216.92.131.4]) by MC6-F37.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 26 Feb 2005 12:16:54 -0800 Received: from ([216.92.131.4:25405] helo=lists.php.net)by pb1.pair.com (ecelerity HEAD r(5124)) with SMTPid 58/43-51537-B19D0224 for [EMAIL PROTECTED]; Sat, 26 Feb 2005 15:16:27 -0500 Received: (qmail 13001 invoked by uid 1010); 26 Feb 2005 20:15:39 - Received: (qmail 12988 invoked by uid 1010); 26 Feb 2005 20:15:39 - X-Message-Info: JGTYoYF78jH290JDSHtK0Hwmz4NODmcj7i2AMiICo2M= Return-Path: [EMAIL PROTECTED] X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:php-general@lists.php.net Delivered-To: mailing list php-general@lists.php.net Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050106 X-Accept-Language: en-us, en References: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] X-Posted-By: 62.131.2.67 X-OriginalArrivalTime: 26 Feb 2005 20:16:54.0784 (UTC) FILETIME=[1D786000:01C51C40] you can't get the mac-address from a remote (client) computer via PHP because PHP is server-sided (server). The mac-address isn't part of any sort of standard header the browser sends, thus the server will never see it. And if the server can't see it, then PHP can't see it either. The only way to get it would be to run a local script which would pick it up, and send it over. This however would require something like a JAVA applet / application. The mac address is usually hidden away quite well so people can't get it and start pretending to be someone else. Although the idea is good, it most likely will not be possible (relativly easily) - tul Lancer Emotion 16 wrote: But think that not everbody has a computer in his house,especially in 3rd world countries. Here in Peru and in another countries from Sudamerica,lot of people play this mmorpgs,like Knigths Online,WoW or Mu,in lan houses. If you ban the pc, none of the users who will play at this computer will be able to do it. On Fri, 25 Feb 2005 15:52:02 -0800, Tyler Replogle [EMAIL PROTECTED] wrote: Hey, I've been on this mailing list for quite a while, but i think this is my first question. I'm not sure though. Well here goes. I'm working at this site that has an MMORPG, a big online game, and we have this ban script. it bans the ip for the user and the user acount for an amount of time. This doesn't seem to be doing its job because people just change there ip and make a new user. I know there isn't any full way to ban some one from a site, but i've been think and getting the mac id of a computer would work a lot better then ip. I'm not sure how to get teh mac id of a computer though. If any of you know how to can you please tell me. It doesn't just have to be with use php we own the server can we can installl other apps, but many others are on the server anyways. So how do i get the mac id of a user that is going on to my server? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FTP info in a variable
Yes i think you can but i really won't do that. It does depend on the server and php verison that is installed on the server. From: Steve Buehler [EMAIL PROTECTED] To: PHP php-general@lists.php.net Subject: [PHP] FTP info in a variable Date: Thu, 24 Feb 2005 11:19:25 -0600 MIME-Version: 1.0 Received: from lists.php.net ([216.92.131.4]) by MC8-F29.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Fri, 25 Feb 2005 08:56:50 -0800 Received: from ([216.92.131.4:22676] helo=lists.php.net)by pb1.pair.com (ecelerity HEAD r(5124)) with SMTPid 39/05-51537-DC85F124 for [EMAIL PROTECTED]; Fri, 25 Feb 2005 11:56:46 -0500 Received: (qmail 50993 invoked by uid 1010); 25 Feb 2005 16:21:52 - Received: (qmail 20808 invoked by uid 1010); 25 Feb 2005 15:49:59 - X-Message-Info: 6sSXyD95QpUypKMHi+vQyQhgpFDWBX43dtyZ3S9x9rA= Return-Path: [EMAIL PROTECTED] X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:php-general@lists.php.net Delivered-To: mailing list php-general@lists.php.net Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] X-Host-Fingerprint: 66.163.170.83 smtp813.mail.sc5.yahoo.com X-Mailer: QUALCOMM Windows Eudora Version 6.2.1.2 X-OriginalArrivalTime: 25 Feb 2005 16:56:50.0514 (UTC) FILETIME=[FFF46320:01C51B5A] I have to write a little program that pulls information from a database, formats it into csv format for importing into excel and ftps it to another server. I have everything worked out except for the ftping. I have read through http://us4.php.net/manual/en/ref.ftp.php and I know I can get the data from the database, save it to a file and ftp it. Does anybody know if I can skip the step of saving it to a file and ftp/stream it directly to a filename on another server? Thanks Steve -- 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 read PHP source code into a textarea
Try php.net for flat file date basing. It should tell you how to read a line and write to a new line. From: Tim Burgan [EMAIL PROTECTED] To: [php] PHP General List php-general@lists.php.net Subject: [PHP] HOWTO read PHP source code into a textarea Date: Fri, 25 Feb 2005 10:26:36 +1030 MIME-Version: 1.0 Received: from lists.php.net ([216.92.131.4]) by mc10-f12.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Fri, 25 Feb 2005 09:20:40 -0800 Received: from ([216.92.131.4:17572] helo=lists.php.net)by pb1.pair.com (ecelerity HEAD r(5124)) with SMTPid D9/58-51537-46E5F124 for [EMAIL PROTECTED]; Fri, 25 Feb 2005 12:20:37 -0500 Received: (qmail 56201 invoked by uid 1010); 25 Feb 2005 16:23:57 - Received: (qmail 29434 invoked by uid 1010); 25 Feb 2005 15:51:19 - X-Message-Info: 6sSXyD95QpV9yk8eof5sDoBjj7rfuQB3oBBEJSBDxio= Return-Path: [EMAIL PROTECTED] X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:php-general@lists.php.net Delivered-To: mailing list php-general@lists.php.net Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] X-Host-Fingerprint: 66.102.135.69 mx69a.mysite4now.com Windows 2000 SP4, XP SP1 X-SmartMax-AuthUser: [EMAIL PROTECTED] User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en X-OriginalArrivalTime: 25 Feb 2005 17:20:40.0742 (UTC) FILETIME=[546FDC60:01C51B5E] Hello, I have a file 'nav.php', whose source code I want to load into the textarea on page 'aaa.php', so the source can be edited and changed. Is there a resource that I can read to help me do this? Thanks Tim -- 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] Hash Issues
Try doing the hash code after the password is posted From: Erbacher Karl [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] Hash Issues Date: Thu, 24 Feb 2005 08:26:35 -0800 Received: from lists.php.net ([216.92.131.4]) by mc5-f20.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Fri, 25 Feb 2005 09:30:44 -0800 Received: from ([216.92.131.4:11652] helo=lists.php.net)by pb1.pair.com (ecelerity HEAD r(5124)) with SMTPid 8D/AB-51537-5C06F124 for [EMAIL PROTECTED]; Fri, 25 Feb 2005 12:30:45 -0500 Received: (qmail 66774 invoked by uid 1010); 25 Feb 2005 16:28:10 - Received: (qmail 48782 invoked by uid 1010); 25 Feb 2005 15:54:21 - X-Message-Info: 6sSXyD95QpWP6+shjfuSKTd7f5bTEYxLS2AOsK0Gtko= Return-Path: [EMAIL PROTECTED] X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:php-general@lists.php.net Delivered-To: mailing list php-general@lists.php.net Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] Lines: 22 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-Posted-By: 68.234.190.142 X-OriginalArrivalTime: 25 Feb 2005 17:30:45.0014 (UTC) FILETIME=[BC9C7360:01C51B5F] Hello, I'm trying to hash passwords before saving them to a mySQL database but I am having a problem. I created three seperate sample users with three different passwords (password1, password2, password3). When I go back to look at the table info in the database, it has saved the exact same hash value for all three users. Any ideas why this might be happening? The script is very straight forward. The form that collects the data: input type='password' name='password' $pass=bin2hex(mhash(MHASH_SHA1, $password)); input type='hidden' name='pass' value='$pass' The file that verifies the data and stores it to the database: $pass=$_POST['pass']; INSERT INTO table (username, password) VALUES ('$logname', '$pass'); Thanks, Cat -- 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] list down
I think it didn't because i wasn't getting an emails for a while last night. I wanted one too becuase i didn't have the email to start a new message. From: Kris [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] list down Date: Thu, 24 Feb 2005 15:04:31 -0600 MIME-Version: 1.0 Received: from lists.php.net ([216.92.131.4]) by mc10-f14.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Fri, 25 Feb 2005 09:04:52 -0800 Received: from ([216.92.131.4:18799] helo=lists.php.net)by pb1.pair.com (ecelerity HEAD r(5124)) with SMTPid 13/69-51537-6096F124 for [EMAIL PROTECTED]; Fri, 25 Feb 2005 13:05:58 -0500 Received: (qmail 92239 invoked by uid 1010); 25 Feb 2005 16:38:08 - Received: (qmail 94944 invoked by uid 1010); 25 Feb 2005 15:59:00 - X-Message-Info: JGTYoYF78jH/nHL12+6B+afltd+ugzie6PM4BHsyhVg= Return-Path: [EMAIL PROTECTED] X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:php-general@lists.php.net Delivered-To: mailing list php-general@lists.php.net Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] X-Host-Fingerprint: 65.24.5.135 ms-smtp-01-smtplb.ohiordc.rr.com NetCache Data OnTap 5.x User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en X-Virus-Scanned: Symantec AntiVirus Scan Engine X-OriginalArrivalTime: 25 Feb 2005 17:04:52.0078 (UTC) FILETIME=[1EFD38E0:01C51B5C] sent an email to the list earlier.. never received a copy.. its like the list went down around 8AM CST? -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 2/22/05 -- 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] List gone quiet?
Yeah same here. I think it went down. From: Lester Caine [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] List gone quiet? Date: Fri, 25 Feb 2005 11:13:50 + MIME-Version: 1.0 Received: from lists.php.net ([216.92.131.4]) by mc9-f30.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Fri, 25 Feb 2005 11:05:44 -0800 Received: from ([216.92.131.4:4641] helo=lists.php.net)by pb1.pair.com (ecelerity HEAD r(5124)) with SMTPid 08/9C-51537-6077F124 for [EMAIL PROTECTED]; Fri, 25 Feb 2005 14:05:42 -0500 Received: (qmail 60156 invoked by uid 1010); 25 Feb 2005 17:04:47 - Received: (qmail 10446 invoked by uid 1010); 25 Feb 2005 16:13:18 - X-Message-Info: 6sSXyD95QpXynrcVtRJuLWY8uUBJBJyjnCsL5m3ygVM= Return-Path: [EMAIL PROTECTED] X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:php-general@lists.php.net Delivered-To: mailing list php-general@lists.php.net Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en, en-us X-Posted-By: 81.138.11.136 X-OriginalArrivalTime: 25 Feb 2005 19:05:44.0362 (UTC) FILETIME=[01AFF0A0:01C51B6D] Nothing on list over night? -- Lester Caine - L.S.Caine Electronic Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [NEWBIE] How to allow for a href tags but no others?
Hey Most of your question can be asnwer by this one i hope. I don't know how to make it so a would only work, but i know how to make it i could work. You could change the , in only a tags to [ ] before you take the html tags out then after you could change the [,] to , in only [a] tags or you could just use so forum code here is some that i have made. forum code/// function replace_output($str){ $search = array([b], [/b], [i], [/i], [u], [/u], [br], [li], [/li], [q],[/q],[center],[/center]); $replace = array(b, /b, i, /i, u, /u, br, li, [/li],$q1,$q2,center,/center); $str = str_replace($search, $replace, $str); $str = eregi_replace(\\[img\\]([^\\[]*)\\[/img\\],img src=\\\1\,checkImgURL($str)); $str = eregi_replace(\\[aim\\]([^\\[]*)\\[/aim\\],a href=\aim:goim?screenname=\\1\\\1/a,$str); $str = eregi_replace(\\[email\\]([^\\[]*)\\[/email\\],a href=\mailto:\\1\;\\1/a,$str); $str = eregi_replace(\\[url\\]([^\\[]*)\\[/url\\],a href=\\\1\ target=_blank\\1/a,checkURL($str)); $str = eregi_replace(\\[url=([^\\[]*)\\]([^\\[]*)\\[/url\\],a href=\\\1\ target=_blank\\2/a,checkURL($str)); $str = eregi_replace(\\[color=([^\\[]*)\\]([^\\[]*)\\[/color\\],font color=\\\1\\\2/font,$str); $str = eregi_replace(\\[size=([^\\[]*)\\]([^\\[]*)\\[/size\\],font size=\\\1\\\2/font,$str); $str = $str./b/a/i/u; return $str; } //checkImgURL function checkImgURL($url){ if(strstr($url, www) !strstr($url, http://;)){ $url = str_replace(www.,http://www.,$url); } elseif((!strstr($url, www) !strstr($url, http://;)) || strstr($url, [img)){ $url_array = explode( , $url); $ii = count($url_array); for($i = 0; $i $ii; $i++){ if(strstr($url_array[$i], [img]) !strstr($url_array[$i], [img]http)){ $url_array[$i] = str_replace([img],[img]http://,$url_array[$i]); } } $url = implode( , $url_array); } return $url; } /checkURL/ function checkURL($url){ if(strstr($url, www) !strstr($url, http://;)){ $url = str_replace(www.,http://www.,$url); } elseif((!strstr($url, www) !strstr($url, http://;)) || strstr($url, [url)){ $url_array = explode( , $url); $ii = count($url_array); for($i = 0; $i $ii; $i++){ if(strstr($url_array[$i], [url]) !strstr($url_array[$i], [url]http)){ $url_array[$i] = str_replace([url],[url]http://,$url_array[$i]); } elseif(strstr($url_array[$i], [url=) !strstr($url_array[$i], [url=http)){ $url_array[$i] = str_replace([url=,[url=http://,$url_array[$i]); } } $url = implode( , $url_array); } return $url; } ///done/ I hope that helps you From: Dave [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] [NEWBIE] How to allow for a href tags but no others? Date: Fri, 25 Feb 2005 17:36:31 +0900 MIME-Version: 1.0 Received: from lists.php.net ([216.92.131.4]) by mc2-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Fri, 25 Feb 2005 10:52:06 -0800 Received: from ([216.92.131.4:28767] helo=lists.php.net)by pb1.pair.com (ecelerity HEAD r(5124)) with SMTPid 35/B7-51537-4D37F124 for [EMAIL PROTECTED]; Fri, 25 Feb 2005 13:52:05 -0500 Received: (qmail 45356 invoked by uid 1010); 25 Feb 2005 16:58:14 - Received: (qmail 86348 invoked by uid 1010); 25 Feb 2005 16:10:18 - X-Message-Info: JGTYoYF78jH7VGsHZ31QAA+JEDZdsFRzO2tR5TxXPwo= Return-Path: [EMAIL PROTECTED] X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:php-general@lists.php.net Delivered-To: mailing list php-general@lists.php.net Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] X-Host-Fingerprint: 210.188.175.72 mta3p.point.ne.jp Solaris 2.5-7 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en X-OriginalArrivalTime: 25 Feb 2005 18:52:06.0653 (UTC) FILETIME=[1A4B72D0:01C51B6B] PHP General, 1. The Situation: I have a forum in which users can enter text which is then displayed on my web site. I want to be able to allow them to insert their own a href tags to provide links. The text is stored in a MySQL database. 2. The Problem: My understanding is that if the input of HTML tags or other coding elements is left unrestricted, then the potential is there for users to cause damage either maliciously or by accident by inserting scripts or MySQL commands. Although the users who have access to the text input forms have to pass a username and password check first, I would still rather be safe than sorry. Mostly I am concerned about people unfamiliar with HTML inserting incorrect code which may break the page design. 3. The Question: Can I set up a PHP script which will strictly only allow instances of a href=??? and /a and absolutely nothing else? I would like the default behavior to be that if any other tag element, or use of or be simply deleted from the text before
RE: [PHP] What's up with the list?
So many people have said this, but i think its fix. From: John Nichel [EMAIL PROTECTED] To: PHP Mailing Lists php-general@lists.php.net Subject: [PHP] What's up with the list? Date: Fri, 25 Feb 2005 09:11:34 -0500 MIME-Version: 1.0 Received: from lists.php.net ([216.92.131.4]) by mc4-f38.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Fri, 25 Feb 2005 11:19:03 -0800 Received: from ([216.92.131.4:3626] helo=lists.php.net)by pb1.pair.com (ecelerity HEAD r(5124)) with SMTPid C8/A0-51537-42A7F124 for [EMAIL PROTECTED]; Fri, 25 Feb 2005 14:19:00 -0500 Received: (qmail 71754 invoked by uid 1010); 25 Feb 2005 17:09:56 - Received: (qmail 28961 invoked by uid 1010); 25 Feb 2005 16:15:56 - X-Message-Info: 6sSXyD95QpWkzSNc9/Tf5uB29F4Z8qKHffTnWnJjgh4= Return-Path: [EMAIL PROTECTED] X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:php-general@lists.php.net Delivered-To: mailing list php-general@lists.php.net Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] X-Host-Fingerprint: 69.20.124.142 unknown Linux 2.4/2.6 User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en X-OriginalArrivalTime: 25 Feb 2005 19:19:03.0314 (UTC) FILETIME=[DDE65720:01C51B6E] Haven't gotten anything from the list since yesterday...is it me, or is it the list. Fix it Jay!!! ;) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getting mac id
Hey, I've been on this mailing list for quite a while, but i think this is my first question. I'm not sure though. Well here goes. I'm working at this site that has an MMORPG, a big online game, and we have this ban script. it bans the ip for the user and the user acount for an amount of time. This doesn't seem to be doing its job because people just change there ip and make a new user. I know there isn't any full way to ban some one from a site, but i've been think and getting the mac id of a computer would work a lot better then ip. I'm not sure how to get teh mac id of a computer though. If any of you know how to can you please tell me. It doesn't just have to be with use php we own the server can we can installl other apps, but many others are on the server anyways. So how do i get the mac id of a user that is going on to my server? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [php] -help me
$str_array = explode(/, /home/karthik/welcome.php/view.php); // $str_array[4] shoud be view.php From: K Karthik [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] [php] -help me Date: Fri, 18 Feb 2005 11:20:29 +0530 MIME-Version: 1.0 Received: from lists.php.net ([216.92.131.4]) by MC8-F21.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 17 Feb 2005 21:49:59 -0800 Received: from ([216.92.131.4:8115] helo=lists.php.net)by pb1.pair.com (ecelerity 1.2 (r4437)) with SMTPid CA/4E-28819-70285124 for [EMAIL PROTECTED]; Fri, 18 Feb 2005 00:49:59 -0500 Received: (qmail 87241 invoked by uid 1010); 18 Feb 2005 05:49:25 - Received: (qmail 87119 invoked by uid 1010); 18 Feb 2005 05:49:22 - X-Message-Info: JGTYoYF78jHVyuGSbP1BO8du3qnIwzSNq7BOh4Qcf90= Return-Path: [EMAIL PROTECTED] X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:php-general@lists.php.net Delivered-To: mailing list php-general@lists.php.net Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] X-Host-Fingerprint: 203.193.155.110 alps.manageengine.org Linux 2.4/2.6 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913 X-Accept-Language: en-us, en X-OriginalArrivalTime: 18 Feb 2005 05:50:00.0026 (UTC) FILETIME=[AEF42BA0:01C5157D] i have got string as /home/karthik/welcome.php/view.php i just need view.php how shall i remove rest of the string. please do help me.i am new to php. -thanks, karthik -- 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] Compiling PHP Source guides
Greg Donald wrote: On Wed, 22 Dec 2004 13:56:39 -0800, Donald Tyler [EMAIL PROTECTED] wrote: I do have a rudimentary knowledge of *nix stuff I don't mean to offend, but it doesn't really seem so. Basic *nix skills usually include knowing how to configure, compile, and install software from source. The PHP docs explain in very explicit detail how to do it, and I have to say you won't find any more hand holding than you get with PHP documentation. The 'F' in RTFM really means 'Fine' when used in a PHP context. and am very computer literate, but most of the programming I have done is with scripting languages such as Actionscript, Javascript, PHP etc. I realy have no idea about compiling source code. If your download is still compressed you need to uncompress it. Depending on the download's file extension you will need to use one of these commands: tar zxvf php-4.3.10.tar.gz tar jxvf php-4.3.10.tar.bz2 Then you change to the source directory: cd php-4.3.10/ Then you configure the source: ./configure You will need to add your desired compile options in the ./configure command. I have no idea what support you want to build into your PHP. If you don't either you might look at: ./configure --help Then after you're done with the configure, you compile the software: make Then you probably want to install the software permanently to a system-wide location (or you might not, I don't know). On *nix the usual install locations are somewhere like /usr or /usr/local, which can be defined in the configure with --prefix if you don't want the default location. So then to do the actual install you would do: make install Then your php binary will be /usr/bin/php or /usr/local/bin/php. There's also the configure option to build your PHP as a module for use with a web server such as Apache. For that you might use a configure command something like: ./configure --enable-module=so --with-apxs=/usr/sbin/apxs I was just hoping for something in laymans terms I guess... I would guess it's hard to talk about heart surgery without talking about heart surgery. Same goes for compiling software. The commands are pretty explicit and you have to know what your doing to get the desired results. It's no disgrace to not know, once upon a time I didn't know.. but I read lots of docs, and I asked many questions and I learned. I got a few flames along the way but that's part of knowing *nix I guess. :) Several companies I've worked for in the past have brought in outside consultants when something would come up that we didn't have skills for in-house. On that note, you might consider talking with a consultant or even getting them to do your PHP install for you if in the end you give up and cannot figure it out. Make them document the process as part of the deal. Thanks for your responses. Wish me luck. Good luck. Thanks for the info. I do understand that *nix usage generaly relies on a lot of compiling software, but I have been relying on pre-compiled RPMs so far. I am by no means an expert, or even intermediate *nix user, which is why I used the term rudimentary. I have been running 6 Linux servers for a small company for about a year now learning as I go. I knew nothing about *nix when I started and considering most of my other responsibilities leave very little time to learn and experiment on the Linux systems I dont think I've done too badly. P.S. You didnt offend me, I just wanted to explain my situation. Thanks again for the help. Donald Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Compiling PHP Source guides
I did RTFM. The exact page you linked to in fact: QUOTE: Requirements In order to have these functions available, you must compile PHP with support for the mysqli extension. END QUOTE That is the whole point of my request. I need a guide explaining *how* to compile the PHP Source. John Nichel wrote: Donald Tyler wrote: Hi, I am looking for a guide on compiling PHP 4. I am a complete newbie to compiling and have no idea where to start, so any links to guides and/or other useful info would be much appreciated. My reason is that I need MySQL 4 support, but I would like to get a general overview of compiling a program source in general. Thanks in advance. Donald Tyler I'd say RTFM, but I don't want to offend anyone's sensibilities, so... http://us4.php.net/manual/en/install.unix.php MySQL up too 4.0... http://us4.php.net/manual/en/ref.mysql.php MySQL = 4.1 http://us4.php.net/manual/en/ref.mysqli.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Compiling PHP Source guides
[EMAIL PROTECTED] wrote: Quoting Donald Tyler [EMAIL PROTECTED]: I did RTFM. The exact page you linked to in fact: QUOTE: Requirements In order to have these functions available, you must compile PHP with support for the mysqli extension. END QUOTE That is the whole point of my request. I need a guide explaining *how* to compile the PHP Source. The directions to compile the PHP source *are* on the page at http://us4.php.net/manual/en/install.unix.php -- you compile it using the make steps in the directions there. (But it seems the problem is that you don't recognize those as compilation instructions, which is understandable if you're a newbie. The page also says that Basic Unix skills (being able to operate make and a C compiler) are a prerequisite, so you probably should find a person you can rely on to deliver those skills repeatably or teach them to you, which is not something you really get from a mailing list. Get a good intor Unix book. After all, you wouldn't expect that if you subscribed to a heart surgery mailing list and said I'm a complete newbie -- can you tell me how to do a quadruple bypass? someone would step you through it? Yes, there are differences in degree, but...! :) OK, I guess I'll try to read the instructions again. I *have* tried reading them on multiple occasions but its just greek to me. I do have a rudimentary knowledge of *nix stuff and am very computer literate, but most of the programming I have done is with scripting languages such as Actionscript, Javascript, PHP etc. I realy have no idea about compiling source code. I was just hoping for something in laymans terms I guess... Thanks for your responses. Wish me luck. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Compiling PHP Source guides
Hi, I am looking for a guide on compiling PHP 4. I am a complete newbie to compiling and have no idea where to start, so any links to guides and/or other useful info would be much appreciated. My reason is that I need MySQL 4 support, but I would like to get a general overview of compiling a program source in general. Thanks in advance. Donald Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] help me split chars w/o spaces by 2... like: 2004
have you tride using chop() ? # begin code $year_split = date(Y); $chars = chop($year_split); $chars[0] // = 2 $chars[1] // = 0 $chars[2] // = 0 $chars[3] //= 4 # end code I hope that will help From: Louie Miranda [EMAIL PROTECTED] Reply-To: Louie Miranda [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] help me split chars w/o spaces by 2... like: 2004 Date: Thu, 9 Dec 2004 09:55:57 +0800 MIME-Version: 1.0 Received: from pb1.pair.com ([216.92.131.4]) by mc6-f24.hotmail.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 8 Dec 2004 17:56:52 -0800 Received: (qmail 21242 invoked by uid 1010); 9 Dec 2004 01:56:02 - Received: (qmail 21150 invoked by uid 1010); 9 Dec 2004 01:56:01 - X-Message-Info: 6sSXyD95QpUKIecQn+Z/xIP21pcg8LTu Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:[EMAIL PROTECTED] Delivered-To: mailing list [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=gp2OcpYqK7wZkSMBhO5OvxdTzhTOQdM1+n9ZtLJ4lmsKWFpVRb9Y2kyjNIrRIX/rvXeFfwCVGh7LT6kub0DMmCGdeRiLKeCjJkxK4fWxSrP2D+FexciD2lT8ASKD7TNYC3YGIZLZbk5UEJIq9Yx2TkbIdgNd/Op3+iEviy1scI4= Return-Path: [EMAIL PROTECTED] X-OriginalArrivalTime: 09 Dec 2004 01:56:53.0406 (UTC) FILETIME=[5AF313E0:01C4DD92] Help me split chars w/o spaces by 2... like: 2004 How can i make it? first: 20 second: 04 Im working on this.. # begin code $year_split = date(Y); $chars = preg_split('//', $year_split, -1, PREG_SPLIT_NO_EMPTY); # end code But it splits the whole 2004 string.. Array ( [0] = 2 [1] = 0 [2] = 0 [3] = 4 ) -- Louie Miranda http://www.axishift.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to count objects instances
Thanks, But im using php 4.3. Quoting Curt Zirzow [EMAIL PROTECTED]: * Thus wrote Robert Cummings: On Mon, 2004-08-23 at 20:54, John Holmes wrote: [EMAIL PROTECTED] wrote: You could write a wrapper class for Test that kept count of the instances and returned a new object upon request... In PHP5: ?php class Foo { static $instances = 0; function __construct() { Foo::$instances++; } function __destruct() { Foo::$instances--; } And: function __clone() { Foo::$instances++; } Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- This mail sent through Horde-Toaster (http://qmailtoaster.clikka.com/) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to count objects instances
hi, What is best method(if it's possible) to count how many times an object is instanced in one time script call? I means that if i have a class named Test, i what to know how many times she's called, how many copies exists etc. The idea is for monitoring in the way to optimizing the code. The method get_declared_classes() only shows only the classes included/required. Tanks -- This mail sent through Horde-Toaster (http://qmailtoaster.clikka.com/) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Coding productivity benchmarks?
hey, I just did all of that and it took me 1 hour and 35 mins, but I edited the code that i had already made from site before. It didn't take my anywhere near 4 hours, but there is no way i could do it in 40 mins. From: Derrick fogle [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] Subject: [PHP] Coding productivity benchmarks? Date: Mon, 7 Jun 2004 09:51:20 -0500 I've been searching around for productivity benchmarks for PHP programming. The only references I can find for it are in for-pay publications. I've ended up becoming a PHP developer more out of happenstance than anything. I've been doing it for a couple of years now, but... I don't really know how 'good' I am at it. The place I work has always had extremely unreasonable expectations for worker productivity, and I'm trying to fight that. I've recently been called into another job interview, and part of the interview is a coding assignment. Some of the documentation suggests that this assignment should take about 40 minutes. A rough overview of the 'assignment' - a simple Document Management System - is: * new user registration and existing user login * admin-level user management * document upload and download * review and suggestion * a conditional matrix of 5 document conditions vs 3 user levels * 6 input forms * 2 listing layouts with fix sorting * conditional access to changing document conditions based on user levels It took me about 4 hours to completely satisfy and debug the assignment specs with an OK interface. This was with plenty of code copy/modification from other web apps I've done before, or other online resources. I ended up spending nearly 4 more hours futzing around with the interface to get something really nice. So, am I just a pretender? Are there people out there that can really bust out a basic DMS in 40 minutes? If anyone does have some basic PHP programmer productivity benchmarks, or knows where I can get ahold of them, I'd sure appreciate it. This issue of productivity expectations has really gotten under my skin, and I need to know whether or not I should be doing this for a living. Thanks, -Derrick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN Toolbar provides one-click access to Hotmail from any Web page FREE download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem with PHP + WML + Post method
hey, don't you need a page thats after that and will check the info, if you have it will help use see what your problem with the $_POST[] is. From: Shelby [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] Problem with PHP + WML + Post method Date: Fri, 4 Jun 2004 11:46:10 +0800 Hi, I'm having problem with the Post method in my PHP + WML file. Note that I have No problem with the Get method. When I click Login, The Error: Malformed server response I'm using Win2k + PHP436 for testing. And I have set the MIME type in the IIS: .wml application/x-httpd-php = index.php = ? header(Content-type: text/vnd.wap.wml); echo ?xml version=\1.0\?; echo !DOCTYPE wml PUBLIC \-//WAPFORUM//DTD WML 1.1//EN\ . \http://www.wapforum.org/DTD/wml_1.1.xml\;; ? wml card id=card1 title=Home p User ID: input name=myuserid size=15 value=/br/ Password: input type=password name=mypwd size=15 value=/br/ do type=accept name=next label=Login go href=index.php method=post postfield name=myuserid2 value=$myuserid/ /go /do /p /card /wml Is there anything I miss out? By the way, when I test with Win2003 server + PHP436, there is no problem. Does the problem lie with the Win2k server? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Stop worrying about overloading your inbox - get MSN Hotmail Extra Storage! http://join.msn.click-url.com/go/onm00200362ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Spammers
yeah same thing for me, but i don't really care, its no reason to start hacker the server. From: Steve Douville [EMAIL PROTECTED] Reply-To: Steve Douville [EMAIL PROTECTED] To: Php-General-Help [EMAIL PROTECTED] Subject: Re: [PHP] Spammers Date: Tue, 1 Jun 2004 11:57:33 -0400 Those messages are only broadcast if you happen to send a message to the board cause people have autoresponders set. Given that there are only two and now one bad address returning a message, I find it fairly easy to just hit the delete button three times. I don't think this qualifies as spam. So, as I hit the send button, I know I'll have 3 messages to delete in a few seconds. No big deal... - Original Message - From: The Digital E [EMAIL PROTECTED] To: Php-General-Help [EMAIL PROTECTED] Sent: Tuesday, June 01, 2004 11:50 AM Subject: [PHP] Spammers Hey everyone, don't know about you, but I'm sick of spam and so I've reported the spammers to their ISP ipowerweb.com I've sent them the headers and traceroute results and their abuse team is investigating, it would be more powerful if a bunch of people complained about it, so if you have a minute and are sick of the garbage from suisse bank and information desk, send a quick email to the ISP. They should be shut down. Last resort If this doesn't work, I have a few buddies that would love to try out their DOS attack skills, but I'd rather deal with it legally. -- 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 _ Watch LIVE baseball games on your computer with MLB.TV, included with MSN Premium! http://join.msn.click-url.com/go/onm00200439ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to check for a $_GET without throwing a Notice?
aslo you could change it to something else like this $_GET['id'] = $id; if (!$id) { // whatever you want to happen put here } From: Daniel Clark [EMAIL PROTECTED] Reply-To: Daniel Clark [EMAIL PROTECTED] To: Brian Dunning [EMAIL PROTECTED],[EMAIL PROTECTED] [EMAIL PROTECTED] Subject: Re: [PHP] How to check for a $_GET without throwing a Notice? Date: Wed, 26 May 2004 10:59:20 -0700 if (isset( $_GET['id'])) How do I check for the presence of an optional $_GET param without throwing a Notice: Undefined index when the param is not present? Tried all three of these, they all produce the Notice when the param is not passed: if ($_GET['id']) if ($_GET['id'] != ) if (isset $_GET['id']) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN Toolbar provides one-click access to Hotmail from any Web page FREE download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Possible Work in the Los Angeles Area...
hey, I'm not going to call you, but we can talk over the net with email. I also have msn ([EMAIL PROTECTED]) and aim (catim2005). That goes for anyone that want to talk. O and if see my buddy icon on aim don't be scared. From: Domains4Days [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] Possible Work in the Los Angeles Area... Date: Wed, 26 May 2004 12:14:32 -0700 Hello, I hope it's OK that I put this email on this list I have some possible Web design work in the Los Angeles Area... regarding PHPMySQL. If anyone wants to: Can you call me ASAP to discuss the particulars? Thanks, Dave B. Ph. 818 763-9988 - Cel: 818 314-8900 -- Thanks - RevDave [EMAIL PROTECTED] [db-lists] Check out some great Domain Names at: http://www.domains4days.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Watch LIVE baseball games on your computer with MLB.TV, included with MSN Premium! http://join.msn.click-url.com/go/onm00200439ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: clearing new pages
hey, you could use some jave script there a.php: echo 'hello'; echoscript language=\Javascript\ window.location = 'http://www.yourwebsite.com/b.php'; From: Rick Fletcher [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: [PHP] Re: clearing new pages Date: Wed, 26 May 2004 12:52:55 -0700 Hi, a file called a.php prints hello to the browser then calls b.php which prints goodbye to the browser. the output looks like this: hello goodbye how do I clear the screen so the end results looks like this: a.php: echo 'hello'; header('location: b.php'); exit; That actually wouldn't work, because once there's output (echo) you can't send a header. --Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Learn to simplify your finances and your life in Streamline Your Life from MSN Money. http://special.msn.com/money/0405streamline.armx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] require_once('') relative path problem
hey, i didn't quite get when you ment by that but have you tried using $DOCUMENT_ROOT before your path, that might help it will be something like this require_once('$DOCUMENT_ROOT/test/db.php'); $DOCUMENT_ROOT goes to your first folder that shows up online (where your index page is) From: Sheeraz fazal [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] require_once('') relative path problem Date: Thu, 22 Apr 2004 14:34:23 -0600 Hi, I have problem in undertanding the require_once/require/include/include_once functionality. Php files in my project are located in different folders. Some folders have common files for other files. And file layout is like this /* File: a.php */ require_once('../test/db.php'); ... /* File: db.php */ require_once('../globals/global.php'); ... when i include a.php in another file i get error for global.php file that path could not be found. And if i correct the path in db.php then someother file which is using db.php will get error. So, can someone elaborate that how relative path works in require_once. what is the starting directory for require_once function which is using relative path. Or Is there any way that i can included some constant which include the absolute path from which all relative paths can be determined? Comments welcome. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Lose those love handles! MSN Fitness shows you two moves to slim your waist. http://fitness.msn.com/articles/feeds/article.aspx?dept=exercisearticle=et_pv_030104_lovehandles -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] very large and long if statement
yeah well they are really close but i add a ) on line 3 From: Andy B [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [PHP] very large and long if statement Date: Thu, 8 Apr 2004 02:03:38 -0400 i dont see any difference in the one you wrote and the one i wrote...they seem to be exactly the same?? - Original Message - From: Tyler Replogle [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, April 07, 2004 9:43 PM Subject: RE: [PHP] very large and long if statement hey, i don't know how to make it smaller but should it be if (!empty($_SESSION['add']['type']) !empty($_SESSION['add']['start_date']) !empty($_SESSION['add']['end_date']) !empty($_SESSION['add']['name']) !empty($_SESSION['add']['county']) !empty($_SESSION['add']['discription']) !empty($_SESSION['add']['StartingDay']) !empty($_SESSION['add']['StartingMonth']) !empty($_SESSION['add']['StartingYear']) !empty($_SESSION['add']['EndingDay']}) !empty($_SESSION['add']['EndingMonth']) !empty($_SESSION['add']['EndingYear'])) {//run the insert query} else {//show error since one or more fields above are blank} ? From: Andy B [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] very large and long if statement Date: Wed, 7 Apr 2004 18:47:02 -0400 I have this very large and long if statement: if (!empty($_SESSION['add']['type']) !empty($_SESSION['add']['start_date'] !empty($_SESSION['add']['end_date']) !empty($_SESSION['add']['name']) !empty($_SESSION['add']['county']) !empty($_SESSION['add']['discription']) !empty($_SESSION['add']['StartingDay']) !empty($_SESSION['add']['StartingMonth']) !empty($_SESSION['add']['StartingYear']) !empty($_SESSION['add']['EndingDay']}) !empty($_SESSION['add']['EndingMonth']) !empty($_SESSION['add']['EndingYear'])) {//run the insert query} else {//show error since one or more fields above are blank} was wondering if there was really any way to condense that down to something any better? all fields in the form that those came from are required... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Watch LIVE baseball games on your computer with MLB.TV, included with MSN Premium! http://join.msn.com/?page=features/mlbpgmarket=en-us/go/onm00200439ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Check out MSN PC Safety Security to help ensure your PC is protected and safe. http://specials.msn.com/msn/security.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] very large and long if statement
hey, i don't know how to make it smaller but should it be if (!empty($_SESSION['add']['type']) !empty($_SESSION['add']['start_date']) !empty($_SESSION['add']['end_date']) !empty($_SESSION['add']['name']) !empty($_SESSION['add']['county']) !empty($_SESSION['add']['discription']) !empty($_SESSION['add']['StartingDay']) !empty($_SESSION['add']['StartingMonth']) !empty($_SESSION['add']['StartingYear']) !empty($_SESSION['add']['EndingDay']}) !empty($_SESSION['add']['EndingMonth']) !empty($_SESSION['add']['EndingYear'])) {//run the insert query} else {//show error since one or more fields above are blank} ? From: Andy B [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] very large and long if statement Date: Wed, 7 Apr 2004 18:47:02 -0400 I have this very large and long if statement: if (!empty($_SESSION['add']['type']) !empty($_SESSION['add']['start_date'] !empty($_SESSION['add']['end_date']) !empty($_SESSION['add']['name']) !empty($_SESSION['add']['county']) !empty($_SESSION['add']['discription']) !empty($_SESSION['add']['StartingDay']) !empty($_SESSION['add']['StartingMonth']) !empty($_SESSION['add']['StartingYear']) !empty($_SESSION['add']['EndingDay']}) !empty($_SESSION['add']['EndingMonth']) !empty($_SESSION['add']['EndingYear'])) {//run the insert query} else {//show error since one or more fields above are blank} was wondering if there was really any way to condense that down to something any better? all fields in the form that those came from are required... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Watch LIVE baseball games on your computer with MLB.TV, included with MSN Premium! http://join.msn.com/?page=features/mlbpgmarket=en-us/go/onm00200439ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cookies
yes i do but here is a really good tutorial on it http://www.phpfreaks.com/tutorials/120/0.php From: Wykis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] Cookies Date: Fri, 2 Apr 2004 16:52:23 +0100 Does Any One Knows How To Set And Get Cookies? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Persistent heartburn? Check out Digestive Health Wellness for information and advice. http://gerd.msn.com/default.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] can I get at screen size ?
hey, yes it would take 2 steps i made a script like this before so i know, i stpent much time looking for it, but php doesn't get info like that because it is running on the server and not the computer or viewer's computer From: E.H.Terwiel [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] can I get at screen size ? Date: Mon, 05 Apr 2004 16:20:03 +0200 I want to write a Server Side PHP program that generates a HTML page client side. How would I get at the clients' screen size, before serving the generated page ? Would it be a two-step process: first let the client execute a piece of JavaScript to generate Height and Width, and then send those values to the PHP server (FORM, PUT) ? Or can it be done in only one PHP program ? frgr Erik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Limited-time offer: Fast, reliable MSN 9 Dial-up Internet access FREE for 2 months! http://join.msn.com/?page=dept/dialuppgmarket=en-usST=1/go/onm00200361ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP Access Violation using PEAR::Mail_smtp
hey, i think the reason you get no reply is becauase no one knows why it happens From: Ben Ramsey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] Re: PHP Access Violation using PEAR::Mail_smtp Date: Tue, 06 Apr 2004 14:27:08 -0400 I've asked about PHP Access Violation errors before (this very same error, as a matter of fact), and every time I ask, I get no response. It's been 24 hours, and no one on php-general, pear-general, or #php and #pear in Freenode IRC has responded to this particular post. Do I smell bad? Please forgive me for refreshing my own post to the list, but this is an important question, and it is time-sensitive. Any help or pointers would be greatly appreciated, as I cannot get around this issue at all. Thanks, Ben Ben Ramsey wrote: I'm getting the following error when using the Mail_smtp package from PEAR: PHP has encountered an Access Violation at 0177A8B4 It does not occur everytime I use it, but even when send() returns true, e-mail messages are not being sent. However, it all worked fine a week ago when I was testing it, and I don't think anything has changed to my installation of PHP. I'm using PHP 5RC1 on a Windows Server 2003. The localhost has no built-in mail functionality, so I cannot use mail(). I must use Mail_smtp to log in to the mail server. I also have Net_SMTP and Net_Socket installed, and, like I said, when I first dropped in my code, all was working fine. My code is, as follows: code require_once 'Mail/smtp.php'; $smtp_settings = array( 'host' = 'localhost', 'port' = '25', 'auth' = 'LOGIN', 'username' = 'username', 'password' = 'password' ); $to = [EMAIL PROTECTED]; $msg = Line 1\nLine 2\nLine 3; $headers = array( 'Subject' = My Subject, 'From' = [EMAIL PROTECTED], 'Date' = date('r'), 'Content-Type' = 'text/plain', 'X-Mailer' = PHP/ . phpversion() ); $mail = new Mail_smtp($smtp_settings); if ($mail-send($to, $headers, $msg)) { echo h2Sent successfully/h2; } else { echo h2Not sent/h2; } /code If I don't get the access violation error, I get the message Sent successfully. Yet, I don't receive any messages. In the code for Mail_smtp (in Mail/smtp.php), I have added the following line just under the function declaration line for the send() method: echo test; When the access violation occurs, I get this line: PHP has encountered an Access Violation at 0177A8B4test From this, it appears to me that the access violation is not occurring when the class tries to send mail, but sometime earlier than that. However, I do not know much more about these Access Violoations, other than PHP is trying to access memory that it doesn't have permission to access. I couldn't find anything at bugs.php.net or through Google that helped much with this problem. Any help would be greatly appreciated. I am on a tight deadline, so any help ASAP would be even more greatly appreciated. ;-) -- Regards, Ben Ramsey http://benramsey.com http://www.phpcommunity.org/wiki/People/BenRamsey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Tax headache? MSN Money provides relief with tax tips, tools, IRS forms and more! http://moneycentral.msn.com/tax/workshop/welcome.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Not exactly PHP....
hey, what kind of news group are you talking about. Like a news script where people can post news? and would you like it in mysql or text files? From: Shimi [EMAIL PROTECTED] Reply-To: Shimi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] Not exactly PHP Date: Tue, 6 Apr 2004 21:29:49 +0200 can anyone email me explaining me how to crate my own news group? for free... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Persistent heartburn? Check out Digestive Health Wellness for information and advice. http://gerd.msn.com/default.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Pulling Certain Data
hey, trying putting at where in your SELECT * FROM $main_tbl so it looks like this SELECT * FROM $main_tbl where whatever = somthing you can also make a limit in SELECT * FROM $main_tbl just like this SELECT * FROM $main_tbl LIMIT 4 From: Jason T. Davidson [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] Pulling Certain Data Date: Tue, 6 Apr 2004 14:40:38 -0500 Community- I am a first time databaser and am having trouble pulling information from a database to display on a site. Not every entry is supposed to show up on the web page, but does so. I have tried IF statements without any help. Here is what I have so far: ? $r1=SELECT * FROM $main_tbl; $rsql=mysql_query($r1,$db); ? body text=#66 link=#66 vlink=#66 alink=#66 table width=600 tr td font size=5ZMP Rosters/fontfont size=5 - font size=2a href=http://www.vatusa.org/html/modules.php?op=modloadname=PN_Contentfile =indexreq=visitartid=26VATUSA listing/a/font/font/td /tr /table br/br table width=600 tr td font size=5Active Controllers/font/td /tr /table table width=600 tr bgcolor=#99 td width=180div align=centerfont size=3strongCONTROLLER/strong/font/div/td td width=60div align=centerfont size=3strongCID/strong/font/div/td td width=100div align=centerfont size=3strongRATING/strong/font/div/td td width=130div align=centerfont size=3strongPOSITION/strong/font/div/td td width=130div align=centerfont size=3strongDATE JOINED/strong/font/div/td /tr ? while ($a_row=mysql_fetch_array($rsql)) { ? tr bgcolor=#CC td width=180 align=leftfont size=2? echo $a_row[LNAME], $a_row[FNAME];?/font/td td width=60 align=centerfont size=2? echo $a_row[CID];?/font/td td width=100 align=centerfont size=2? echo $a_row[RATING];?/font/td td width=130 align=centerfont size=2? echo $a_row[POSITION];?/font/td td width=130 align=centerfont size=2? echo $a_row[JDATE];?/font/td /tr ?} ? /table /body I would like to only show people who are active within our roster and within the database I have identified those people by putting a A, I or L depending on their status with our organization. I guess I am looking for a way for the code to see how that person is labeled and then put them in the proper roster. www.zmpartcc.com/roster/roster.php -- Jason T. Davidson _ Check out MSN PC Safety Security to help ensure your PC is protected and safe. http://specials.msn.com/msn/security.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 2 x DB connections at once
Yes thanks, that will do it. I wasn't aware you had to pass an extra param to get it to create a new connection. Both the connections were in separate objects and they were being specified every time I did a query or select db, but since I didn't add that extra param you mentioned I guess they were really the same connection even though they were two separate private variables in different objects. Thanks for your help -Original Message- From: Luke [mailto:[EMAIL PROTECTED] Sent: Thursday, January 22, 2004 4:22 PM To: Donald Tyler Subject: Re: [PHP] 2 x DB connections at once It depends, how are you creating the connections, and where are you keeping the connection ID and when you query, or select database, or anything to do with the databases, do you make sure you specify that connection id? //Notice the TRUE, that creates a new conenction, and doesnt use the existing connection (hence returning a different id) $sqlconnection1 = mysql_connect('test.com', 'username', 'password'); $sqlconnection2 = mysql_connect('test.com', 'username', 'password', TRUE); then when you select databases and query youll have to specify that connection! //choose DB 1 on connection 1 mysql_select_db('mydata1', $sqlconnection1); //choose db2 on connetion 2 mysql_select_db('mydata1', $sqlconnection2); //and querying //this will select the table named table from the mydata1 database mysql_query(SELECT * FROM table WHERE name='me', $sqlconnection1); //this will select the table named table from the mydata2 database mysql_query(SELECT * FROM table WHERE name='me', $sqlconnection2); hope thats what you were after -- Luke _ Donald Tyler [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] OK, now I have done some work and it gets even stranger. Two Objects Validator Importer Both objects have private variables called $this-Connection However, when I change the DB for one objects connection pointer, the other objects connection pointer ALSO changes DB. Is it not possible to have two completely separate DB connections active at the same time? -Original Message- From: Donald Tyler [mailto:[EMAIL PROTECTED] Sent: Thursday, January 22, 2004 3:08 PM To: [EMAIL PROTECTED] Subject: [PHP] 2 x DB connections at once I thought this was possible, but it doesn't seem to be working: I have a class, that has a private variable called $this-Connection, which is a Database Connection pointer to a MySQL database. During the lifetime of the Class, it uses the connection multiple times without a problem. The class also uses a function from an include file that has its OWN Database Connection pointer. And it seems that for some reason, as soon as that external function is called, the Private Database Pointer within my Class suddenly points to the Database name that the external functions Database Pointer was using. I ALWAYS specify which connection pointer I want to use when selecting the DB and doing a mysql_query, so I have no earthly idea how the external Connection pointer is affecting my Private Connection Pointer. I hope I explained that well enough; it's real difficult to put into words. Does anyone have any idea what might be happening? -- 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] 2 x DB connections at once
I thought this was possible, but it doesn't seem to be working: I have a class, that has a private variable called $this-Connection, which is a Database Connection pointer to a MySQL database. During the lifetime of the Class, it uses the connection multiple times without a problem. The class also uses a function from an include file that has its OWN Database Connection pointer. And it seems that for some reason, as soon as that external function is called, the Private Database Pointer within my Class suddenly points to the Database name that the external functions Database Pointer was using. I ALWAYS specify which connection pointer I want to use when selecting the DB and doing a mysql_query, so I have no earthly idea how the external Connection pointer is affecting my Private Connection Pointer. I hope I explained that well enough; it's real difficult to put into words. Does anyone have any idea what might be happening? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 2 x DB connections at once
OK, now I have done some work and it gets even stranger. Two Objects Validator Importer Both objects have private variables called $this-Connection However, when I change the DB for one objects connection pointer, the other objects connection pointer ALSO changes DB. Is it not possible to have two completely separate DB connections active at the same time? -Original Message- From: Donald Tyler [mailto:[EMAIL PROTECTED] Sent: Thursday, January 22, 2004 3:08 PM To: [EMAIL PROTECTED] Subject: [PHP] 2 x DB connections at once I thought this was possible, but it doesn't seem to be working: I have a class, that has a private variable called $this-Connection, which is a Database Connection pointer to a MySQL database. During the lifetime of the Class, it uses the connection multiple times without a problem. The class also uses a function from an include file that has its OWN Database Connection pointer. And it seems that for some reason, as soon as that external function is called, the Private Database Pointer within my Class suddenly points to the Database name that the external functions Database Pointer was using. I ALWAYS specify which connection pointer I want to use when selecting the DB and doing a mysql_query, so I have no earthly idea how the external Connection pointer is affecting my Private Connection Pointer. I hope I explained that well enough; it's real difficult to put into words. Does anyone have any idea what might be happening? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Flash-PHP Socket Connection
We are just about to try and get this working with sockets ourselves. Our intranet currently does exactly what you are trying to do, but without using sockets. In reply to your question, there is no one site for XMLRPC really. I suggest you read up on the following subjects: XMLRPC document specification: http://www.xmlrpc.com/spec Flash XML object: http://www.macromedia.com/devnet/mx/flash/articles/tools_xmlobject.html PHP XMLRPC implementation: http://us3.php.net/manual/en/ref.xmlrpc.php Using XMLRPC instead of the previously mentioned methods of loading the PHP output as a text file has the following benefits: 1. Complete freedom to communicate a complex data structure, including multidimensional arrays. This is difficult if not impossible to do with simple PHP text output. 2. Data types are kept intact when being transferred. E.g. there is no confusion as to whether: 1 = integer: 1 1 = string: 1 1 = Boolean: true 3. XMLRPC is an industry standard. Using it will allow other developers to easily build clients for your server side script should you wish. 4. PHP has full XMLRPC functionality built in; Flash has XML functionality built in. There is a little extra work involved in extending the Flash XML object to an XMLRPC parser (or you could try one of the OpenSource alternatives), but I recommend building one yourself if you have the time, it really helps you understand XML. -Original Message- From: Eric Bolikowski [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 4:03 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: Flash-PHP Socket Connection Hey Ben I know it may sound nuts, but I really want to make a socket connection between a Flash and a PHP file. Normally I would simply read in a text file/read XML/send data with GET or POST, but I'm looking for a socket connections of following reasons: 1) I want a fast connection 2) I'm looking at this as a challenge, because it doesn't seem like anyone else has done this before Eric Ben Ramsey [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What I mean is: you shouldn't need to use sockets to read in a file from Flash unless you're trying to do something more complicated, but from the way it sounds, you just want to pull data from MySQL with a PHP script and output it to Flash. The PHP script could just echo plain text and Flash can read that in just fine without needing to connect via a socket. -Ben Ben Ramsey wrote: Flash has the ability to read in text files, so you could use PHP to output data in the correct format and use Flash to read the PHP script like it reads a text file. We did this in ASP once upon a time. Here's a tutorial about reading text files into Flash: http://www.virtual-fx.net/tutorials/html/loadtextfile.htm Also, from what I understand, Flash now has a great XML parser, so you could use PHP to generate XML and Flash could read in the XML as variables. You might want to look into that, but I think it's only available in the newest version. -Ben Eric Bolikowski wrote: Hi everybody I'm working on a site that will be based on Flash, PHP and MySQL. PHP will work as a middleware for Flash and MySQL. My problem is communication between Flash and PHP. I'm really out looking for using the socket functions in PHP and Flash to make fast connection. I have googled for almost an hour now, and I can't seem to find any interesting. The only info I find, is about sending data between Flash and PHP with HTTP GET or HTTP POST. So if anybody has some general information on this or a link to a tutorial on the subject, I would like to get those resources. Thanks a lot Eric -- 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] thumbnail???
Try this: function Resize_Image($FilePath, $new_w){ $File = fopen($FilePath, r); $FileContents = fread($File, filesize($FilePath)); $src= imagecreatefromstring($FileContents); $width = imagesx($src); // Shrink the image to the maximum width // Maintaining aspect ratio if($width $new_w){ $height = imagesy($src); $aspect_ratio = $height/$width; $new_h = abs($new_w * $aspect_ratio); $img = imagecreatetruecolor($new_w,$new_h); imagecopyresized($img,$src,0,0,0,0,$new_w,$new_h,$width,$height); ob_start(); imagejpeg($img); $FileContents = ob_get_contents(); ob_end_clean(); imagedestroy($img); } return $FileContents; } you can then either save the filecontents as an image, or place it in a database. -Original Message- From: Rafael Alex Cremer [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 5:29 PM To: [EMAIL PROTECTED] Subject: [PHP] thumbnail??? OK, but how? I already use GD, I need to now how to create a thumbnail, somebody now how to use the GD functions to create a thumbnail??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Flash-PHP Socket Connection
You would use sockets if you were developing a client/server application that was making a LOT of requests very quickly. Opening and closing connections using normal HTTP methods gets slow when carrying out such intense data communication. A good example would be an online game where you need to constantly know the location of all players all the time. -Original Message- From: Miles Thompson [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 7:55 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Flash-PHP Socket Connection Use xmlReceiver to trigger the back end PHP script. Have that script generate XML which you parse in Flash. Plain text will work, but a single quotation mark in the text sends you off to never never land. Here's an example: xmlReceiver.load( http://; + host + feed_xml_article.php); I know it's not a socket, but it's plenty fast. Regards - Miles Thompson PS What good would a socket to PHP do, anyway? (I probably just revealed my ignorance!) /mt At 11:03 PM 1/20/2004 +0100, Eric Bolikowski wrote: Hey Ben I know it may sound nuts, but I really want to make a socket connection between a Flash and a PHP file. Normally I would simply read in a text file/read XML/send data with GET or POST, but I'm looking for a socket connections of following reasons: 1) I want a fast connection 2) I'm looking at this as a challenge, because it doesn't seem like anyone else has done this before Eric Ben Ramsey [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What I mean is: you shouldn't need to use sockets to read in a file from Flash unless you're trying to do something more complicated, but from the way it sounds, you just want to pull data from MySQL with a PHP script and output it to Flash. The PHP script could just echo plain text and Flash can read that in just fine without needing to connect via a socket. -Ben Ben Ramsey wrote: Flash has the ability to read in text files, so you could use PHP to output data in the correct format and use Flash to read the PHP script like it reads a text file. We did this in ASP once upon a time. Here's a tutorial about reading text files into Flash: http://www.virtual-fx.net/tutorials/html/loadtextfile.htm Also, from what I understand, Flash now has a great XML parser, so you could use PHP to generate XML and Flash could read in the XML as variables. You might want to look into that, but I think it's only available in the newest version. -Ben Eric Bolikowski wrote: Hi everybody I'm working on a site that will be based on Flash, PHP and MySQL. PHP will work as a middleware for Flash and MySQL. My problem is communication between Flash and PHP. I'm really out looking for using the socket functions in PHP and Flash to make fast connection. I have googled for almost an hour now, and I can't seem to find any interesting. The only info I find, is about sending data between Flash and PHP with HTTP GET or HTTP POST. So if anybody has some general information on this or a link to a tutorial on the subject, I would like to get those resources. Thanks a lot Eric -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problems with $_POST
This is the method I recommend also. The token method works fine, but is slightly harder to implement. Basically you would keep the function that creates the record separate from the page that shows confirmation of the record being created. e.g. 1. User visits: www.mysite.com/accounts/pages/NewInvoice.php 2. User fills out form and clicks submit, forms Action is: www.mysite.com/accounts/Functions/CreateInvoice.php 3. After CreateInvoice.php has successfully made the invoice, WITHOUT printing any other output, you use the header() command to send them to: www.mysite.com/accounts/pages/InvoiceSuccess.php -Original Message- From: Aidan Lister [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 21, 2004 4:01 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Problems with $_POST Or, After you've dumped the data into the DB, issue a header('location: /path/to/script'); This will also solve the problem of IE saying are you sure you want to resend the form data. Toby Irmer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] You can use a token to check if a form has been sent before... ? class formReload { var $tokenarray = '__token'; var $tokenname = '__token'; function createToken() { $tok = md5(uniqid(mytoken)); return sprintf(input type='hidden' name='%s' value='%s',$this-tokenname,htmlspecialchars($tok)); } function easyCheck() { $tok = $_REQUEST[$this-tokenname]; if (isset($_SESSION[$this-tokenarray][$tok])) { return false; } else { $_SESSION[$this-tokenarray][$tok] = true; return true; } } } ? hth toby - Original Message - From: Binay [EMAIL PROTECTED] To: [EMAIL PROTECTED]; Reidar Solberg [EMAIL PROTECTED] Sent: Wednesday, January 21, 2004 9:23 AM Subject: Re: [PHP] Problems with $_POST Hi What is the primary key in your tble? Using tht primary key check for duplicate entry... Theres no way u can change the posted data ... so even if u reset $_POST['submit'] after the insert operation is done, next time u refresh it will be set and hence will duplicate...so check for duplicate entries urself only based on primary key or unique values in ur table. Hope this helps Cheers Binay U wrote.. I have a FORM for entering data into a DB. I use: ... ... if ($_POST['submit'] == 'Register') { ... code for INSERT into DB. This works OK, but if I REFRESH the page, it duplicates the dataset in the table. How can I reset $_POST['submit'] so it don't make this happen? Rgds Reidar Solberg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] textfields showing php tags code
Is it just showing that one or in all three text fields? -Original Message- From: craig [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 21, 2004 11:24 AM To: Php Subject: [PHP] textfields showing php tags code Hi All, This one has me stumped, it worked yesterday, but not today, and I didn't change anything (as far as I know). This is some of the code from a function which is now showing the ?php echo $quantity; ? code inside the textareas, rather than the passed value from the function call. any ideas are greatly appreciated. Craig function showForm($quantity='', $fname='', $lname='') { ? form action='orderX.php' method='post' name='orderForm' table border='0' tr td align='right'Quantity:/td tdinput name='quantity' type='text' size='3' value='?php echo $quantity; ?'*/td /tr tr td align='right'First Name:/td tdinput name='fname'type='text' size='25' value='?php echo $fname; ?'*/td /tr tr td align='right'Last Name:/td tdinput name='lname'type='text' size='25' value='?php echo $lname; ?'*/td /tr /table /form ?php } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 5 Book
Hi Anyone know if Rasmus (or anyone for that matter) is writing a book on PHP 5? And when it might be available? Thanks Donald Tyler
RE: [PHP] textfields showing php tags code
There is nothing wrong with your code, I just tried it on my site and it works fine. Try and run the function you posted on its own, without adding back anything that you removed, just to make sure you didn't inadvertently remove the problem. If it works, then you know where to look, if it doesn't work, I would check your webserver and see if anyone has messed around with the PHP configuration. Someone must have changed something if it was working before.h -Original Message- From: craig [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 21, 2004 12:21 PM To: Donald Tyler Subject: RE: [PHP] textfields showing php tags code all of them, there are actually 11 fields, but I shorted the code up. Craig -Original Message- From: Donald Tyler [mailto:[EMAIL PROTECTED] Sent: January 21, 2004 11:12 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] textfields showing php tags code Is it just showing that one or in all three text fields? -Original Message- From: craig [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 21, 2004 11:24 AM To: Php Subject: [PHP] textfields showing php tags code Hi All, This one has me stumped, it worked yesterday, but not today, and I didn't change anything (as far as I know). This is some of the code from a function which is now showing the ?php echo $quantity; ? code inside the textareas, rather than the passed value from the function call. any ideas are greatly appreciated. Craig function showForm($quantity='', $fname='', $lname='') { ? form action='orderX.php' method='post' name='orderForm' table border='0' tr td align='right'Quantity:/td tdinput name='quantity' type='text' size='3' value='?php echo $quantity; ?'*/td /tr tr td align='right'First Name:/td tdinput name='fname'type='text' size='25' value='?php echo $fname; ?'*/td /tr tr td align='right'Last Name:/td tdinput name='lname'type='text' size='25' value='?php echo $lname; ?'*/td /tr /table /form ?php } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FW: [PHP] Flash-PHP Socket Connection
We use XMLRPC to communicate between flash PHP. I presume it can be coupled with sockets if you should need a permanent connection as well. It has worked perfectly for pretty much anything we throw at it (It allows you to send any PHP or Action script native data type, e.g. arrays, Booleans, integers etc. back and forth across the web) Obvious security implications about, so be very very careful with what you do with the data received. Trust no one! Not even your own Flash Client. -Original Message- From: Eric Bolikowski [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 3:26 PM To: [EMAIL PROTECTED] Subject: [PHP] Flash-PHP Socket Connection Hi everybody I'm working on a site that will be based on Flash, PHP and MySQL. PHP will work as a middleware for Flash and MySQL. My problem is communication between Flash and PHP. I'm really out looking for using the socket functions in PHP and Flash to make fast connection. I have googled for almost an hour now, and I can't seem to find any interesting. The only info I find, is about sending data between Flash and PHP with HTTP GET or HTTP POST. So if anybody has some general information on this or a link to a tutorial on the subject, I would like to get those resources. Thanks a lot Eric -- 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] Syntax Error - This is WEIRD!
There could be something you're not seeing and assuming it's correct. But typing your code into the email we aren't getting the full story. Can you actually attach your scripts to an email and send that? Copying and pasting then into the email won't necessarily provide all the info needed to solve your problem. For example: I once uploaded a PHP script to the server and for some reason on the way up extra character were placed in the document that did not show up in most text editors. I had to use a very basic terminal text editor to see the added characters. -Original Message- From: Nick Wilson [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 8:17 AM To: php-general Subject: [PHP] Syntax Error - This is WEIRD! if a script calls antohter like 'include('http://site.com/index.php'); Why would I get a syntax error on line 1 of index.php when it looks like this: ?php // line one above this one What's the deal there? Many thanks for any insight ;-) -- Nick W -- 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] Syntax Error - This is WEIRD!
Yes your right, thats exactly the problem. I didnt even realize he was doing that. By including the PHP file via HTTP, you are including the OUTPUT of the PHP file, not the actual PHP file itself. e.g. by including a file with the following code: ?PHP print 'Hello'; ? you would be including the word Hello as PHP code, which is obviously going to cause a syntax error. -Original Message- From: Dagfinn Reiersøl [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 10:18 AM To: PHP General Subject: Re: [PHP] Syntax Error - This is WEIRD! Nick Wilson wrote: if a script calls antohter like 'include('http://site.com/index.php'); Why would I get a syntax error on line 1 of index.php when it looks like this: ?php // line one above this one What's the deal there? Many thanks for any insight ;-) I've never tried to do an include via HTTP, so maybe I'm clueless, but it occurs to me that it might be a good idea to try doing a plain old file include, using exactly the same file. I have the feeling it would be interesting to know whether that would work or not. -- 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] Syntax Error - This is WEIRD!
Yes that is true. But I would strongly recommend against doing that. You should never include anything over HTTP. Its extremely messy, 100% insecure and just a very very bad idea. You should have all the files you need to include located on your web server. -Original Message- From: Dagfinn Reiersøl [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 11:50 AM To: PHP General Subject: Re: [PHP] Syntax Error - This is WEIRD! Donald Tyler wrote: Yes your right, thats exactly the problem. I didnt even realize he was doing that. By including the PHP file via HTTP, you are including the OUTPUT of the PHP file, not the actual PHP file itself. e.g. by including a file with the following code: ?PHP print 'Hello'; ? you would be including the word Hello as PHP code, which is obviously going to cause a syntax error. Yes. I read the manual which provides no clear explanation (I suspect that whoever wrote it didn't actually know how it works). So I decided to test it. It does exactly what you say it does. I made an include file like this: ?php echo '?php echo Hello World!; ?'; ? If you inlude that using HTTP, it outputs Hello world! Seems like a strange thing to do, outputting PHP code on a Web page, but it's not without conceivable usefulness. -Original Message- From: Dagfinn Reiersøl [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 10:18 AM To: PHP General Subject: Re: [PHP] Syntax Error - This is WEIRD! Nick Wilson wrote: if a script calls antohter like 'include('http://site.com/index.php'); Why would I get a syntax error on line 1 of index.php when it looks like this: ?php // line one above this one What's the deal there? Many thanks for any insight ;-) I've never tried to do an include via HTTP, so maybe I'm clueless, but it occurs to me that it might be a good idea to try doing a plain old file include, using exactly the same file. I have the feeling it would be interesting to know whether that would work or not. -- 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] Intermitent problems retreiving PDF's from a MySQL database.
Hi, I have a website where the admin can create entries in a news list and upload an associated PDF document. I am storing the document in a MySQL database on another machine on the same network. For some reason, occasionaly when loading a PDF document, internet explorer will lock up, the Windows flag will continue to wave as if it is loading the document, but it will never load. Once this happens, all of the other PDF documents wont load until you restart internet explorer. Then it all works fine until you click that one PDF again. I thought that maybe the PDF had been corrupted somehow, but the problem miraculously fixed itself so I didnt have a change to check that out. Now I got a call from one of my users complaining of the exact same problem, which once again miraculously fixed itself after reloading internet explorer. There are no error messages in the apache log or the mysql log. Does anyone have any idea what is going on?!? Thanks Donald Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fw: Intermitent problems retreiving PDF's from a MySQL database.
Hi, I have a website where the admin can create entries in a news list and upload an associated PDF document. I am storing the document in a MySQL database on another machine on the same network. For some reason, occasionaly when loading a PDF document, internet explorer will lock up, the Windows flag will continue to wave as if it is loading the document, but it will never load. Once this happens, all of the other PDF documents wont load until you restart internet explorer. Then it all works fine until you click that one PDF again. I thought that maybe the PDF had been corrupted somehow, but the problem miraculously fixed itself so I didnt have a change to check that out. Now I got a call from one of my users complaining of the exact same problem, which once again miraculously fixed itself after reloading internet explorer. There are no error messages in the apache log or the mysql log. Does anyone have any idea what is going on?!? Thanks Donald Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_affected_rows() function
Hi, I don't think mysql_affected_rows() is working like it should for me. In the manual for mysql_affected_rows() it has this (Example 1): /* this should return the correct numbers of deleted records */ mysql_query(DELETE FROM mytable WHERE id 10); printf(Records deleted: %d\n, mysql_affected_rows()); However, when I do this: $delete_assignment = mysql_query(DELETE FROM consultingprojectassign WHERE workerid='$assigned[$i]'); printf(Records deleted: %d\n, mysql_affected_rows()); It always says Records deleted: 0. Even though the record was, indeed, deleted. I have an if statement also that says if mysql_affected_rows() 1, then print an error message. Well, since it always returns 0, no matter what, the error is always shown, even when the record is deleted. As I understand it, if no WHERE clause is in the query, then it will automatically return a 0. As you can see, my query above does have a WHERE clause. Can anyone help me out? Thanks!!! Best Regards, -- Tyler Longren J.D. Web Services, L.C. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] counting charactors
Hi Philip, strlen() will work. http://www.php.net/manual/en/function.strlen.php Best Regards, -- Tyler Longren J.D. Web Services, L.C. On Wed, 2004-01-07 at 01:25, Philip J. Newman wrote: can someone point me to the right place for a thing that would count charactors in a string? --- Philip J. Newman Master Developer PhilipNZ.com [NZ] Ltd. [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_affected_rows() function
Hi Cpt, That's not the exact code. The exact code is below. Multiple workers are being selected from a MULTIPLE select form field. I just use a while loop do go through the selected ones to delete them individually. PHP Version: 4.3.4 MySQL Version: 4.0.17 $i=0; while ($i = $selected) { $delete_assignment = mysql_query(DELETE FROM webprojectassign WHERE workerid='$assigned[$i]'); $i++; } if (mysql_affected_rows($delete_assignment) 1) { $tpl-newBlock('message'); $tpl-assign(message,bERROR:/b There was an error deleting those workers from the project.); } else { $tpl-newBlock('message'); $tpl-assign(message,The workers have been deleted from the project.); } If you (or anyone else) know of another way I should be doing this, please let me know. I'm open to any suggestions. Best Regards, -- Tyler Longren J.D. Web Services, L.C. On Tue, 2004-01-06 at 15:14, CPT John W. Holmes wrote: From: Tyler Longren [EMAIL PROTECTED] I don't think mysql_affected_rows() is working like it should for me. In the manual for mysql_affected_rows() it has this (Example 1): /* this should return the correct numbers of deleted records */ mysql_query(DELETE FROM mytable WHERE id 10); printf(Records deleted: %d\n, mysql_affected_rows()); However, when I do this: $delete_assignment = mysql_query(DELETE FROM consultingprojectassign WHERE workerid='$assigned[$i]'); printf(Records deleted: %d\n, mysql_affected_rows()); It always says Records deleted: 0. Even though the record was, indeed, deleted. I have an if statement also that says if mysql_affected_rows() 1, then print an error message. Well, since it always returns 0, no matter what, the error is always shown, even when the record is deleted. I can't see a reason why that wouldn't work. Is that your exact code, i.e. you're not doing anything else between the mysql_query() call and the mysql_affected_rows() call? What versions of PHP/MySQL are you using? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting results from Select Multiple HTML tag
Hi, http://www.php.net/manual/en/faq.html.php#faq.html.select-multiple I read that. Doesn't work in php since the whole register_globals thing. Now, when I get the results from a form, they're all in a $_POST[] array. Example. When I have a select name=test MULTIPLE I would have to access the values of the test field like this: count($_POST['test']); But since I have to have the [] in the name=select name=test[] MULTIPLE ()part, I get parse errors when trying to read it: ex: count($_POST['test[]']); That doesn't even look right. Anyone understand what I'm tryin to get at? Any help would be great. Best Regards, -- Tyler Longren J.D. Web Services, L.C. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting results from Select Multiple HTML tag
Oh yea, I also searched the archives at http://marc.theaimsgroup.com/?l=php-general There were quite a few releated postings, but no answers! Mostly it was dick heads telling people that need help to RTFM. So, if you don't have any real help for me, then disregard my question. Telling me to RTFM won't help cuz I've red that section. Don't tell me to STFA (search the fuckin archives???), cuz I've done that also. Thanks for your understanding! tyler On Mon, 2004-01-05 at 22:05, Tyler Longren wrote: Hi, http://www.php.net/manual/en/faq.html.php#faq.html.select-multiple I read that. Doesn't work in php since the whole register_globals thing. Now, when I get the results from a form, they're all in a $_POST[] array. Example. When I have a select name=test MULTIPLE I would have to access the values of the test field like this: count($_POST['test']); But since I have to have the [] in the name=select name=test[] MULTIPLE ()part, I get parse errors when trying to read it: ex: count($_POST['test[]']); That doesn't even look right. Anyone understand what I'm tryin to get at? Any help would be great. Best Regards, -- Tyler Longren J.D. Web Services, L.C. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting results from Select Multiple HTML tag
Hi Tom, $_POST['test'][] doesn't work. I thought I had tried $test = $_POST['test'] before and it didn't work. I just tried it though and it seemed to work. Thanks Tom! Tyler On Mon, 2004-01-05 at 22:20, Tom Rogers wrote: Hi, Tuesday, January 6, 2004, 2:05:47 PM, you wrote: TL Hi, TL http://www.php.net/manual/en/faq.html.php#faq.html.select-multiple TL I read that. Doesn't work in php since the whole register_globals TL thing. Now, when I get the results from a form, they're all in a TL $_POST[] array. Example. TL When I have a select name=test MULTIPLE TL I would have to access the values of the test field like this: TL count($_POST['test']); TL But since I have to have the [] in the name=select name=test[] MULTIPLE ()part, I get parse errors when trying to read it: TL ex: count($_POST['test[]']); TL That doesn't even look right. Anyone understand what I'm tryin to get TL at? Any help would be great. TL Best Regards, TL -- TL Tyler Longren TL J.D. Web Services, L.C. try $_POST['test'][] or copy it to another array $test = $_POST['test']; print_r($test); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parse error in mysql_query()
Error: Parse error: parse error, expecting `']'' in /usr/local/apache/htdocs/UP/index.php on line 871 Line 871: mysql_query(INSERT INTO domainregistrations (domain,type,years,price) VALUES ('$_POST[domainregister_domain$i]','$_POST[domainregister_type$i]','$_POST[domainregister_years$i]','$_POST[domainregister_price$i]')); Anyone know why that parse error is happening? I can't find a missing ] anywhere. Any help would be greatly appreciated. Thanks, Tyler Longren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse error in mysql_query()
Sorry, should have mentioned that I tried quoting them already. That gives a T_VARIABLES parse error. Thanks for the reply, Tyler On Mon, 2003-12-22 at 12:30, Sam Masiello wrote: Perhaps it doesn't like the fact that you don't have quotes around your array keys? --Sam Tyler Longren wrote: Error: Parse error: parse error, expecting `']'' in /usr/local/apache/htdocs/UP/index.php on line 871 Line 871: mysql_query(INSERT INTO domainregistrations (domain,type,years,price) VALUES ('$_POST[domainregister_domain$i]','$_POST[domainregister_type$i]','$_PO ST[domainregister_years$i]','$_POST[domainregister_price$i]')); Anyone know why that parse error is happening? I can't find a missing ] anywhere. Any help would be greatly appreciated. Thanks, Tyler Longren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse error in mysql_query()
Hi Matt, I put this right above like 871: print brbr$_POST[domainregister_domain$i]brbr; So now that print line is 871. It produces the exact same error as the mysql_query() line. The reason I'm doin it like this is cuz I'm dynamically generating forms, and lots of the fields are the same, just with different numbers at the end: ex: domainregister_domain1 domainregister_domain2 Those field names are generated by PHP for the form, and now I'm doing the page to process that form. Would doing $_POST['domainregister_domain'][$i] get the correct value from my domainregister_domain1 field if $i=1? Thanks, Tyler Thanks, Tyler On Mon, 2003-12-22 at 12:47, Matt Matijevich wrote: [snip] Sorry, should have mentioned that I tried quoting them already. That gives a T_VARIABLES parse error. Thanks for the reply, Tyler [/snip] What happens if you comment out the mysql statement and just echo the variables? echo $_POST[domainregister_domain$i] $_POST[domainregister_type$i]; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse error in mysql_query()
Doing this fixed it: mysql_query(INSERT INTO domainregistrations (domain,type,years,price) VALUES ('$_POST[domainregister_domain]$i','$_POST[domainregister_type]$i','$_POST[domainregister_years]$i','$_POST[domainregister_price]$i')); I just moved the $i to the outside of the [] and it works now. Thanks for everyone's input..helped me open my eyes a bit. Tyler On Mon, 2003-12-22 at 12:51, John W. Holmes wrote: Tyler Longren wrote: Error: Parse error: parse error, expecting `']'' in /usr/local/apache/htdocs/UP/index.php on line 871 ('$_POST[domainregister_domain$i]', If you're going to be creating array keys like that, break out of the string to do it. (' . $_POST['domainregister_domain' . $i] . ', ... Having a key like that kind of begs the question of why you're not just using $_POST['domainregister_domain'][$i], though... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] display settings
Not via PHP. You will need javascript to accomplish this. On Tue, 2003-12-09 at 10:57, Hartley, Matt wrote: I am sort of new at this, I am wondering if it is possible to find the display settings of the user I know that ?php echo $_SERVER[HTTP_USER_AGENT]; ? will give you Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) is there one that will recover the display settings of the user? Matt -- Tyler Lane [EMAIL PROTECTED] Lyrical Communications -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions within new windows
Windows update doesn't fix the problem. I keep my system updated 100% of the time. I no one has mentioned getting it to work on Windows XP. That is what I am using, Windows XP Professional. Maybe the problem is confined to XP. Here is the EXACT IE version that I am using: 6.0.2800.1106.xpsp2.030422-1633 I have a few other machine in the building that have other Versions of M$ Windows on them, I will give those a try and let you know how it goes. -Original Message- From: olinux [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 12:48 AM To: Pablo Gosse; [EMAIL PROTECTED] Subject: RE: [PHP] Sessions within new windows If, as Chris wrote, this is indeed a feature/bug of IE, then it must be configurable somewhere, though I'm lost as to where that might be. Does anyone have any ideas how this could be controlled via IE's settings? I've experienced a similar problem on a php based system I use. I don't know what their code looks like. I think its an IE issue though - windows update always fixes the problem for me. http://windowsupdate.microsoft.com olinux __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions within new windows
I am downloading ethereal and I will post my findings. -Original Message- From: Chris Shiflett [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 2:31 PM To: Pablo Gosse; Donald Tyler; [EMAIL PROTECTED] Subject: RE: [PHP] Sessions within new windows --- Pablo Gosse [EMAIL PROTECTED] wrote: Hi Donald. I just tried this in XP Professional on IE 6.0 and it worked fine, both via a javascript function and a standard link with the target set to _blank. Anyone else have any idea why this would be happening? No, but it would really be nice if anyone that experiences this could capture the HTTP transaction(s) that illustrate the behavior more definitively. Ethereal (http://www.ethereal.com/) can help with this. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions within new windows
Well that's bizarre. I change it back to opening the new windows so that I can go test it on some other machines, and now it works on this machine!? Makes no sense... -Original Message- From: Chris Shiflett [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 2:31 PM To: Pablo Gosse; Donald Tyler; [EMAIL PROTECTED] Subject: RE: [PHP] Sessions within new windows --- Pablo Gosse [EMAIL PROTECTED] wrote: Hi Donald. I just tried this in XP Professional on IE 6.0 and it worked fine, both via a javascript function and a standard link with the target set to _blank. Anyone else have any idea why this would be happening? No, but it would really be nice if anyone that experiences this could capture the HTTP transaction(s) that illustrate the behavior more definitively. Ethereal (http://www.ethereal.com/) can help with this. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions within new windows
Hi, Not sure if this is a PHP or Browser issue but here is my problem: I have a site that has a members section. In the news area, when a user clicks the link for an article, it pops open a new window a requests the article via a PHP script. What's happening is that when the new window pops up, the script isn't getting the session info properly. I changed it so that the page opens up in the main window instead of a new one and it works fine. I presume this is because the browser is not sending the session ID to the script when opening the new window. Does anyone know of a way for me to fix this without embedding the session ID in the URL? I thought the only criteria that the browser used when deciding if to send a Session ID or not was if the page is located at the same domain name. P.S. Its Internet Explorer 6 I am using. Thanks.
RE: [PHP] Sessions within new windows
Just a quick update: It seems to only be a problem with Internet Explorer on the PC. Both IE Safari on MacOSX work as expected. -Original Message- From: Donald Tyler [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 8:17 AM To: [EMAIL PROTECTED] Subject: [PHP] Sessions within new windows Hi, Not sure if this is a PHP or Browser issue but here is my problem: I have a site that has a members section. In the news area, when a user clicks the link for an article, it pops open a new window a requests the article via a PHP script. What's happening is that when the new window pops up, the script isn't getting the session info properly. I changed it so that the page opens up in the main window instead of a new one and it works fine. I presume this is because the browser is not sending the session ID to the script when opening the new window. Does anyone know of a way for me to fix this without embedding the session ID in the URL? I thought the only criteria that the browser used when deciding if to send a Session ID or not was if the page is located at the same domain name. P.S. Its Internet Explorer 6 I am using. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions within new windows
Yeah I was. I did try that though and it made no difference =0( -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 8:40 AM To: Donald Tyler Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Sessions within new windows Are you using _blank as target. Then try a named window. But this is just a wild guess. Donald Tyler wrote: Just a quick update: It seems to only be a problem with Internet Explorer on the PC. Both IE Safari on MacOSX work as expected. -Original Message- From: Donald Tyler [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 8:17 AM To: [EMAIL PROTECTED] Subject: [PHP] Sessions within new windows Hi, Not sure if this is a PHP or Browser issue but here is my problem: I have a site that has a members section. In the news area, when a user clicks the link for an article, it pops open a new window a requests the article via a PHP script. What's happening is that when the new window pops up, the script isn't getting the session info properly. I changed it so that the page opens up in the main window instead of a new one and it works fine. I presume this is because the browser is not sending the session ID to the script when opening the new window. Does anyone know of a way for me to fix this without embedding the session ID in the URL? I thought the only criteria that the browser used when deciding if to send a Session ID or not was if the page is located at the same domain name. P.S. Its Internet Explorer 6 I am using. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions within new windows
I am using a normal link. Here is the exact html code: a href=View_Article.php?ID={ID} target=_blankimg src=../Images/view.gif width=22 height=22 border=0/a -Original Message- From: Pablo Gosse [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 11:17 AM To: [EMAIL PROTECTED]; Donald Tyler; [EMAIL PROTECTED] Subject: RE: [PHP] Sessions within new windows That's strange, as I've been writing a CMS over the past year which requires the user to have IE 5.5 or newer, and I have no problems with pop-ups accessing session values under IE 6.0. Perhaps it's an issue of how you're invoking the new windows? Are you using a normal link with target=_blank or are you using Javascript to launch the new window? Cheers, Pablo -Original Message- From: Chris Shiflett [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 8:42 AM To: Donald Tyler; [EMAIL PROTECTED] Subject: Re: [PHP] Sessions within new windows --- Donald Tyler [EMAIL PROTECTED] wrote: I have a site that has a members section. In the news area, when a user clicks the link for an article, it pops open a new window a requests the article via a PHP script. What's happening is that when the new window pops up, the script isn't getting the session info properly. [snip] P.S. Its Internet Explorer 6 I am using. This is a feature/bug of IE 6. It might be something you can configure somewhere, but I avoid IE like the plague, so I'm not sure about that. Every other browser, to my knowledge, will work properly. Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- 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
FW: [PHP] Sessions within new windows
-Original Message- From: Pablo Gosse [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 2:11 PM To: Donald Tyler Subject: RE: [PHP] Sessions within new windows Hmm, that's strange. I use Javascript functions to control the few pop-up windows in the CMS, but I just went in and changed some to standard href tags with the _blank for the target attribute, as you have, and it still works with no problem. If, as Chris wrote, this is indeed a feature/bug of IE, then it must be configurable somewhere, though I'm lost as to where that might be. I just tested it out on a number of systems around here, both on a Windoze 2000 box and on a RedHat box using a Terminal Services connection, and it worked fine for me. Does anyone have any ideas how this could be controlled via IE's settings? Cheers, Pablo -Original Message- From: Donald Tyler [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 11:48 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Sessions within new windows I am using a normal link. Here is the exact html code: a href=View_Article.php?ID={ID} target=_blankimg src=../Images/view.gif width=22 height=22 border=0/a -Original Message- From: Pablo Gosse [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 11:17 AM To: [EMAIL PROTECTED]; Donald Tyler; [EMAIL PROTECTED] Subject: RE: [PHP] Sessions within new windows That's strange, as I've been writing a CMS over the past year which requires the user to have IE 5.5 or newer, and I have no problems with pop-ups accessing session values under IE 6.0. Perhaps it's an issue of how you're invoking the new windows? Are you using a normal link with target=_blank or are you using Javascript to launch the new window? Cheers, Pablo -Original Message- From: Chris Shiflett [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 8:42 AM To: Donald Tyler; [EMAIL PROTECTED] Subject: Re: [PHP] Sessions within new windows --- Donald Tyler [EMAIL PROTECTED] wrote: I have a site that has a members section. In the news area, when a user clicks the link for an article, it pops open a new window a requests the article via a PHP script. What's happening is that when the new window pops up, the script isn't getting the session info properly. [snip] P.S. Its Internet Explorer 6 I am using. This is a feature/bug of IE 6. It might be something you can configure somewhere, but I avoid IE like the plague, so I'm not sure about that. Every other browser, to my knowledge, will work properly. Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem connecting to remote MySQL Server
Hi, I am publishing a site I have developed and I am having problems with the scripts being able to access the remote MySQL server. When I try to connect using the PHP scripts I just get an error saying that access is denied. I can access it fine from my machine using PHPMyAdmin so I know that remote access is being allowed. I have also connected to the web hosting server via SSH and have connected successfully to the MySQL server via the MySQL client at the terminal from that machine. So I know the server that the scripts are running on also has access to the MySQL server. Here is my script. Please let me know if you have any ideas why this would be happening: - ?PHP /*** ** * Connects to a MySQL database using the Belvedere account * */ function DBMS_CONNECT() { global $Site_Settings; // Connect To DBMS $Connection = mysql_connect($Site_Settings['DB_Host'], $Site_Settings['DB_UserName'], $Site_Settings['DB_Password']) or SQL_KillScript(Connecting to DBMS,$Connection); // Select DB if (!mysql_select_db($Site_Settings['DB_Name'],$Connection)) SQL_KillScript(Selecting Database,$Connection); // Return the connection variable return $Connection; } ? --- Here is the error message: MySQL Error 1044 : Access denied for user: '[EMAIL PROTECTED]' to database 'Belvedere' --- My DB_Host is specified as a domain name. e.g. db1.myhost.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Find the last friday of each month.
OrangeHairedBoy wrote: Hi all, I'm trying to write a script to get the next last friday of the month and I am failing miserably. It keeps giving me October 10th. So, I scrapped it. Basically, I just want to show what the last friday of the month is, and if that date has already passed, show the last friday of the next month. How can I do that? You can get the number of days in a month from date() Now you know that the last Friday of the month will be at most 7 days from the end of the month, loop through the last 7 days of the month and determine what date it is using the date() function. Compare the date to determine if it is Friday or not. And then add in the check for if the date has passed or not. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Restarting Apache without screwing up running scripts?
Hi, We are building an Intranet for our company and I was wondering how people deal with having to restart the server when its running an intranet. Obviously if there is a complex process running and the server restarts in the middle of it then its going to screw a lot of stuff up. The only thing I could think of was to script the Intranet in such a way as I could go into the admin section and simply disable it, then all the currently running processes would finish, but the system would refuse to start any new ones until I re-enabled it again. Just want some advice, thanks. Donald
Re: [PHP] Read a PDF File using php
Are you sending a Content-Type header to the browser to let it know what type of file you are sending it? On Wed, 2003-10-01 at 12:27, Pushpinder Singh Garcha wrote: Hello All I need to allow a user to access a PDF file, only if he/she is logged in as a registered user. So here is the code that I am trying to use. I have been able to make this work in the past, when I had to read .html file, now since the file in question is a .pdf file, I am having trouble. The browser shows a long list of weird characters instead of the pdf file if(session_is_registered(user_valid)){ $filepath =docs/any_file.pdf; -- Tyler Lane [EMAIL PROTECTED] Lyrical Communications -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Resource Limits
Just incase you weren't aware. You can change the Max execution time during the script with: set_time_limit(Milliseconds); -Original Message- From: Decapode Azur [mailto:[EMAIL PROTECTED] Sent: Saturday, September 27, 2003 5:51 AM To: [EMAIL PROTECTED] Subject: [PHP] Resource Limits hi the list, How can I get the values of 'max_execution_time', 'max_input_time' and 'memory_limit' from my php script ? thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to smart refresh php section using iframe?
This is not possible with PHP alone. You need to use some client side code such as JavaScript or Flash. I would recommend JavaScript. It would be pretty easy to accomplish what you are talking about with that. Grab yourself a copy of JavaScript the Definitive Guide by Orielly. It's pretty comprehensive. -Original Message- From: ascll [mailto:[EMAIL PROTECTED] Sent: Saturday, September 27, 2003 1:44 AM To: [EMAIL PROTECTED] Subject: [PHP] How to smart refresh php section using iframe? Greetings, I'm newbie in php and I would like to develop a .php page that constantly retrieves data from MySQL database, but I having difficulties to doing so. Please show me the complete code, if possible. Thanks in advance. = index.php = html body table !-- // SECTION A // = // Load one only, no need to refresh -- tr tdColumn1/td tdColumn2/td tdColumn3/td tdColumn4/td tdColumn5/td /tr !-- // SECTION B // = // Using .php to retrieve data from MySQL database (no problem) // together with iframe (I don't know how to configure iframe) // and also use javascript to auto refresh this section every 1-second (SECTION B ONLY) // since the data show on section B would keep on changing (I don't know the codes) -- tr td . $Column1 . /td td . $Column2 . /td td . $Column3 . /td td . $Column4 . /td td . $Column5 . /td /tr !-- // SECTION C // = // Auto refresh this section every 30-second (SECTION C ONLY and I don't know the codes) -- tr td . $Column1 . /td td . $Column2 . /td td . $Column3 . /td td . $Column4 . /td td . $Column5 . /td /tr !-- // SECTION D // = // Load one only, no need to refresh -- tr tdEnd of Record/td /tr /table /body /html = index.php = -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: $_SESSION stuffs that come with php.ini
Session auto start is not enabled as default because it is a performance drain. It is much more efficient to use session_start() only when you need it. The easiest way to do things is usual the worst. (Most inefficient) -Original Message- From: Scott Fletcher [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 2:47 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: $_SESSION stuffs that come with php.ini Alright that work now Don't know why does the php.ini default is not what it should be... I found a few that aren't on the list in php.ini, but hte most important thing right now is that it is fixed... Scott Fletcher [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is this the one??? http://us3.php.net/session Thanks... Scott Fletcher [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have been building the website for 6 months with everything and I didn't have hte php.ini on it. Just didn't realize it, so I create the php.ini that come from php.ini_dist that came with php source code. Now the $_SESSION doesn't work. I'm not able to make the php.ini to be like the one that php work without it. So, anyone know what is the default session configuration? Thanks... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql.lock file location
Hi, Does anyone know how to tell PHP to look in a different location for the mysql.lock file? It's currently looking in /tmp/ and that's wrong. Thanks Donald
FW: [PHP] mysql.sock file location
I meant mysql.sock, sorry. -Original Message- From: Donald Tyler [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 8:18 AM To: [EMAIL PROTECTED] Subject: [PHP] mysql.lock file location Hi, Does anyone know how to tell PHP to look in a different location for the mysql.lock file? It's currently looking in /tmp/ and that's wrong. Thanks Donald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.lock file location
The MySQL functions only allow me to change the location per function call. I want to change the default mysql.sock file location for PHP, it would seem silly to change every script to do that, especially since this is only a test server and the main server will most likely have the mysql.sock file in another location. -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 8:26 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] mysql.lock file location On Thursday 25 September 2003 21:17, Donald Tyler wrote: Does anyone know how to tell PHP to look in a different location for the mysql.lock file? It's currently looking in /tmp/ and that's wrong. manual MySQL Functions -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Oh, give me a home, Where the buffalo roam, And I'll show you a house with a really messy kitchen. */ -- 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] mysql.sock file location
Thanks for the reply. I forgot about the php.ini file. That seemed to point me in the right direction. However, although PHP is now looking at the correct file. I still get the error message: Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /usr/local/apache2/htdocs/dbtest.php on line 3 Do you have any idea why it would not connect even though its looking at the correct file? Here is the line from the PHP.ini file after I edited it (incase I did something retarded) mysql.default.socket = /var/lib/mysql/mysql.sock -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 9:06 AM To: Donald Tyler; [EMAIL PROTECTED] Subject: RE: [PHP] mysql.sock file location [snip] I meant mysql.sock, sorry. Does anyone know how to tell PHP to look in a different location for the mysql.lock file? It's currently looking in /tmp/ and that's wrong. [/snip] But MySQL is running? PHP AFAIK doesn't care where mysql.sock is, unless it is not the default. locate mysql.sock look in my.conf to see if the paths match if not, change the path in my.conf and restart mysql There is a PHP directive in the php.ini ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. mysql.default_socket = where you can specify the location of the sock if need be. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.sock file location
Yeah I thought so to. But I did a chmod 755 on the sock file and it didn't help. Here's the test script I am using: (Presume that's what you meant by connection string? ?PHP if($Connection = mysql_connect('localhost', '**', '**')) print 'Success!'; else print 'Failure'; ? -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 9:44 AM To: Donald Tyler; [EMAIL PROTECTED] Subject: RE: [PHP] mysql.sock file location [snip] Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /usr/local/apache2/htdocs/dbtest.php on line 3 [/snip] Can we see your connection string? My bet would be permissions... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.sock file location
Yes, I ping it and it says its alive. -Original Message- From: Brad Pauly [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 10:07 AM To: Donald Tyler Cc: [EMAIL PROTECTED] Subject: Re: [PHP] mysql.sock file location Donald Tyler wrote: Yeah I thought so to. But I did a chmod 755 on the sock file and it didn't help. Here's the test script I am using: (Presume that's what you meant by connection string? ?PHP if($Connection = mysql_connect('localhost', '**', '**')) print 'Success!'; else print 'Failure'; ? Are you sure the MySQL server is running? Can you connect from the command line using the same credentials as above? - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.sock file location
I wasn't worried about short code =0P I would have done this if I was: $Connection = mysql_connect('localhost','**','**') or die(mysql_error()); =0P -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 10:13 AM To: Brad Pauly; Donald Tyler Cc: [EMAIL PROTECTED] Subject: RE: [PHP] mysql.sock file location [snip] Here's the test script I am using: (Presume that's what you meant by connection string? ?PHP if($Connection = mysql_connect('localhost', '**', '**')) print 'Success!'; else print 'Failure'; ? [/snip] Let's get a hair more info, try if(!($Connection = mysql_connect('localhost', '**', '**'))){ print(mysql_error() . \n); exit(); } It also has the added benefit of shortening the code -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.lock file location
Yeah I do that too. But I was reluctant to do that with something that just seemed like a fix for a problem that shouldnt even exist. If the server with my scripts is configured correctly, then I should never have to specify a .sock file. I hope... -Original Message- From: Jackson Miller [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 10:15 AM To: Donald Tyler Subject: Re: [PHP] mysql.lock file location On Thursday 25 September 2003 8:55, you wrote: Is there no way for me to change the default location for PHP? I have quite a few scripts that I really dont want to have to do that to. I would rather reconfigure PHP. You can set default mysql settings in php.ini which allows you to set a socket file. Then you leave the default settings out of mysql_connect all together. I _think_ that you can then connect with mysql_connect(localhost,username,password) and it will use the socket file set in php.ini. If that doesn't work you can try editing the client section of /etc/my.cnf Also, I always set up my apps in a way that the db connection is only in one place and just called from all the scripts that need it. You can do this with an include or using object oriented coding. This way if you ever have to make a system wide change you don't have to go to all the scripts and change it. Hope that helps. -Jackson -Original Message- From: Jackson Miller [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 8:24 AM To: Donald Tyler Subject: Re: [PHP] mysql.lock file location On Thursday 25 September 2003 8:17, Donald Tyler wrote: Hi, Does anyone know how to tell PHP to look in a different location for the mysql.lock file? It's currently looking in /tmp/ and that's wrong. mysql_connect(:/path/to/mysql.lock,username,password); -Jackson Thanks Donald -- jackson miller cold feet creative 615.321.3300 / 800.595.4401 [EMAIL PROTECTED] cold feet presents Emma the world's easiest email marketing Learn more @ http://www.myemma.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.sock file location
Argh! Wonderful. Now I have broken something else. I just restarted the machine and now MySQL won't start. I keep getting the error: 030925 10:30:10 mysqld started 030925 10:30:10 InnoDB: Operating system error number 13 in a file operation. InnoDB: See http://www.innodb.com/ibman.html for installation help. InnoDB: The error means mysqld does not have access right to InnoDB: the directory. InnoDB: File name ./ibdata1 InnoDB: Fire operation call: 'open'. InnoDB: Cannot continue operation 030925 10:30:10 mysqld ended I went and checked the entire /var/lib/mysql directory structure and everything (including ibdata1) is set to root:mysql 755 I am going to headbut the screen in a minute! -Original Message- From: Donald Tyler [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 10:32 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] mysql.sock file location Yes, I ping it and it says its alive. -Original Message- From: Brad Pauly [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 10:07 AM To: Donald Tyler Cc: [EMAIL PROTECTED] Subject: Re: [PHP] mysql.sock file location Donald Tyler wrote: Yeah I thought so to. But I did a chmod 755 on the sock file and it didn't help. Here's the test script I am using: (Presume that's what you meant by connection string? ?PHP if($Connection = mysql_connect('localhost', '**', '**')) print 'Success!'; else print 'Failure'; ? Are you sure the MySQL server is running? Can you connect from the command line using the same credentials as above? - Brad -- 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] mysql.sock file location
No not a network IP ping. A mysqladmin ping: Mysqladmin --user=root ping -Original Message- From: Brad Pauly [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 10:53 AM To: Donald Tyler Cc: [EMAIL PROTECTED] Subject: Re: [PHP] mysql.sock file location Donald Tyler wrote: Yes, I ping it and it says its alive. I don't understand. What did you ping? How does that mean it is running? Getting a response from a ping does not mean MySQL is running. Did you try connecting with a MySQL client from the command line? Have you looked at the running processes to see if it exists there? - Brad -- 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] mysql.sock file location
Don't know yet, I've managed to stop mysql from loading now! (See my previous mail) -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 10:40 AM To: Donald Tyler; [EMAIL PROTECTED] Subject: RE: [PHP] mysql.sock file location [snip] I wasn't worried about short code =0P I would have done this if I was: $Connection = mysql_connect('localhost','**','**') or die(mysql_error()); =0P [/snip] Cool, but do you get errors? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What to use?
round() and number_format() are what i would suggest using. On Thu, 2003-09-25 at 13:01, Ryan A wrote: Hi, I am running a query on the database to get the avg of a few fields, I am getting a result something like this: 5. 4. 5. I dont want to use such big averages and want to cut the last to digits off so it will be something like: 5.00 4.00 44.23 etc I visited the manual and had a look at a few functions like trim, rtrim,ltrim,chop,explode etcwhich one is right for me? most of them are dealing with whitespace so it does not make much sense right now with my current output Please help. Thanks, -Ryan We will slaughter you all! - The Iraqi (Dis)information ministers site http://MrSahaf.com -- Tyler Lane [EMAIL PROTECTED] Lyrical Communications -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql.sock file location
Well after getting MySQL back up and running (After restarting the machine) the script worked fine. So it looks like editing the PHP.ini file worked. Thanks to everyone who helped. Don't know where I would be without you guys ( gals?). Donald. -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 10:40 AM To: Donald Tyler; [EMAIL PROTECTED] Subject: RE: [PHP] mysql.sock file location [snip] I wasn't worried about short code =0P I would have done this if I was: $Connection = mysql_connect('localhost','**','**') or die(mysql_error()); =0P [/snip] Cool, but do you get errors? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP vs CGI ???
PHP can be installed as either a CGI or an Apache module. There is documentation on this in the PHP readme files. Pretty much everything I read said that its always better to use the Apache Module version. (apparently its much more stable and secure) -Original Message- From: Scott Fletcher [mailto:[EMAIL PROTECTED] Sent: Friday, September 19, 2003 8:38 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP vs CGI ??? Hi! I have a question. Someone said that PHP is CGI, that kind of turned my head because PHP is not like that. But I can see one thing, PHP can be compiled as either a 'Shell-Scripting-Language', 'Webserver Component' or 'Both'... PHP would be a form of CGI if it is used as Shell Scripting Language but if I compile Apache and have it create a PHP module then it is not a form of CGI. Can anyone point this out or clarify this? It would be very much be appreciated. Thanks, Scott F. -- 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] Resizing a jpeg stored in a database
Hi, I have a question that I hope you can answer. So far I have accomplished the following: Storing a jpeg in a MySQL database Retrieving the jpeg from the database Sending the jpeg to a browser and displaying it correctly Creating dynamic PNG images in PHP Resizing the dynamic PNG image in PHP Now I need to combine the two processes. I am storing jpegs in a database, and I want to write a script that can serve the image as either a thumbnail view or a full view. How exactly would I go about this? I was hoping I could just load the image from the database and then insert it into an object I created with imagecreate(). However I don't seem to be able to find any functions that will allow me to do that. I noticed there were functions to import images from files or URL's. Does this mean that I will first have to save the image as a file on the hard drive and THEN import it into the image object? Thanks in advance for your help. Donald Tyler