RE: [PHP] Form help
You could have a check for the HTTP_REFERER variable, if it doesn't contain "application.php", chances are they didn't come from that page. it's not a good idea to rely on $HTTP_REFERER for anything, and especially for this. a referer is only reported when the user follows a hyperlink, so in the hypothetical case given there would be no referer. Isn't that the point? If there's no referer, they didn't come from the first page, so you send them back there. I could be completely wrong here - is HTTP_REFERER empty following a form submission, even if it's to a different page? what you need to do is combine your two scripts, which is really a neater way handling forms anyway. point your form action to the same page ($PHP_SELF works really well for this, since you can rename the file and it will still run properly), and then add the following code to the top of your application.php file if($GLOBALS["REQUEST_METHOD"] == "POST") { include("process_application.php"); exit; } This is how I would handle it personally, but then he'd mentioned having two pages, so.. Cheers Jon ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Response.Write [OK]
You could investigate www.php.net/echo, I think it's what you're after. Cheers Jon -Original Message- From: AJDIN BRANDIC [mailto:[EMAIL PROTECTED]] Sent: 21 March 2001 12:05 To: [EMAIL PROTECTED] Subject: [PHP] Response.Write [OK] Hi, I have built a shopping cart and have made connection to an Internet payment company. Now once transaction is processed they want from my confirmation page to receive an "[OK]". How can I do this with php3/4? Response.Write"[OK]" is what ASP uses, I think??? Thanks Ajdin ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] get filename?
$FileName = $PHP_SELF; HTH Jon -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 20 March 2001 13:20 To: [EMAIL PROTECTED] Subject: [PHP] get filename? Hi Whats the best method to get the filename of the file I am using. E.G if the file is called tom_woz_here.php and would I go about stickin that into $FileName= ??? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] install
It's truly amazing what you can find three clicks away from the main page of www.php.net. http://www.php.net/manual/en/installation.php HTH Jon -Original Message- From: hananet [mailto:[EMAIL PROTECTED]] Sent: 14 March 2001 12:53 To: [EMAIL PROTECTED] Subject: [PHP] install how to install php on windows 98 or iis 5.0 ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Print form variables in PHP
If the ACTION attribute of the form points to your PHP script, the variables should automagically appear, i.e. $result would be "1", $age would be "23", and $name would be "john". Failing that you could investigate the explode() function. However, if the form isn't controlled by you, how come is it sending results to your script? Like the e-mail BTW :-) Cheers Jon -Original Message- From: Dream [mailto:[EMAIL PROTECTED]] Sent: 12 March 2001 15:27 To: [EMAIL PROTECTED] Subject: [PHP] Print form variables in PHP Any idea of how to get information from a form (not a form controlled by me, through GET method, i.e. info coming with the URL, like this http://www.xxx.com/xxx.cgi?result=1age=23name=john) and print it through php v.3? I don't know how to get the info (coming from an outside form) and pass it throught the php3 variables.. Thanks, marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Dynamic Links..
As a quick caveat you need to be *very* careful you're not obfuscating the target site copyright infringement, anyone? -Original Message- From: Richard S. Crawford [mailto:[EMAIL PROTECTED]] Sent: 08 March 2001 00:02 To: Ashwin Kutty; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Dynamic Links.. At our company we solve this problem by including the second page in a frameset. That's what I would recommend for you. At 07:39 PM 3/7/01 -0400, Ashwin Kutty wrote: No, not the URL and therefore not HTTP_REFERER.. This is how it is.. My_Script.php redirects to Someone_Elses_Dynamically_Generated_Page.html Someone_Elses_Dynamically_Generated_Page.html has 'link' to another Page. I want My_Script.php to grab the a href="contents" of the 'link' and redirect to it, right after. The reason I want to do the above is, the first page dynamically creates a session id and attaches it to the 'link'.. I need that session id to continue on, and since this page is not on my server I cant control it.. Thanks.. ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] dates from db
If it's stored as a unix timestamp you can format it any way you like. [www.php.net/date] If it's stored as a string in the -MM-DD hh:mm:ss format, you can use substr(0,10) [www.php.net/substr] to get the first 10 characters and only display those. HTH Jon -Original Message- From: Matt Davis [mailto:[EMAIL PROTECTED]] Sent: 07 March 2001 13:35 To: Php Mailing List Subject: [PHP] dates from db I am calling on a number of fields from my db one of which is a date. When the date displays it is in the following format -MM-DD 00:00:00 I Want it to only display the date and not the time like this -MM-DD Is it possible to remove the time when calling on it from the db can anyone help? Thanks Matt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] no-resubmit on reload/refresh
Javascript? (I know it's generally horrible, but it's good for this sort of thing) Stick this in your head.../head: script language="JavaScript" type="text/javascript"!--Begin var submitcount=0; function jsCheck() { if (submitcount == 0) { submitcount++; return true; } else { alert("This request has already been submitted, please wait while it is processed."); return false; } } //End--/script And call it from your form like this: form name="myform" action="whatever" method="post" onSubmit="return jsCheck()" Voila. HTH Jon -Original Message- From: Bruin, Bolke de [mailto:[EMAIL PROTECTED]] Sent: 06 March 2001 12:53 To: [EMAIL PROTECTED] Subject: [PHP] no-resubmit on reload/refresh I have a form which is submitted by a POST action. After submitting, the same page (updated though) returns with the form. (It's a messageboard) Now when someone refreshes/reloads the page they get the question if they want to resubmit the form. I don't want that. You get double posts this way. I know it is possible to check the input for any duplicates, but for example this guestbook http://pub.alxnet.com/guestbook?id=120611 (hope the id works) does it differently and your browser does NOT if you wnat to resubmit, it just doesn't do it. Anyone knows how this works (HTTP header maybe?) cheerz Bolke ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Screen Size?
Just remember that not everyone surfs with their browser window maximised. IIRC there's a window.innerheight and .innerwidth in NN's model, but not in IE's sigh Cheers Jon -Original Message- From: Todd Kerpelman [mailto:[EMAIL PROTECTED]] Sent: 26 February 2001 19:03 To: PHP Subject: RE: [PHP] Screen Size? How do you determine a user's screen size (resolution)? Isn't there a variable/function for this? I doubt you could do this in PHP, since your browser doesn't normally include screen size information in the headers it sends across to web servers. However, JavaScript can do this -- there's a screen object, with properties called screen.width and screen.height that specify (surprisingly enough) the width and height of the user's screen. You could create a form with some hidden inputs, and have a JavaScript body onLoad() event that would set the values of these hidden inputs to your user's screen size. When PHP receives this form. it could process the information from there. Hope this helps... --Todd -Original Message- From: Jason Bryner :: Focus Design Group, Inc. [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 25, 2001 10:52 PM To: PHP Subject: [PHP] Screen Size? How do you determine a user's screen size (resolution)? Isn't there a variable/function for this? -- Focus Design Group, Inc. http://www.focusdesigngroup.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] newbie question
Get an SQL database engine and off you go. MySQL is a good place to start, and it comes in a Mac OS/X flavour that you can download at http://www.mysql.com/Downloads/MySQL-3.23/mysql-3.23.33-apple-rhapsody5.5-po werpc.tar.gz. Check out www.mysql.com for more info. HTH Jon -Original Message- From: knaSen [mailto:[EMAIL PROTECTED]] Sent: 23 February 2001 11:38 To: [EMAIL PROTECTED] Subject: [PHP] newbie question Hello I use macintosh and want to make an sql-database...How do I do? --* [knaSen] icq #23830427 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Making .phtml an extension
You would add "phtml" to the line in your server config file that determines which extensions are handled by PHP To give more info we'd really need details of which server software you're running, and whether it's hosted by an external company or if it's in your bedroom. Cheers Jon -Original Message- From: Brandon Orther [mailto:[EMAIL PROTECTED]] Sent: 21 February 2001 17:14 To: PHP User Group Subject: [PHP] Making .phtml an extension Hello, I am trying to get .phtml to work for php files. How would I do this? Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] MySQL COUNT Won't Work
Shouldn't that be $result = mysql_query($sql,$db) or die("Couldn't execute query."); So you're querying the database, and not the connection? HTH Jon -Original Message- From: Jeff Oien [mailto:[EMAIL PROTECTED]] Sent: 16 February 2001 17:27 To: PHP Subject: [PHP] MySQL COUNT Won't Work I'm totally stuck on this code. I get the error "Couldn't execute query." so I know where it's failing but can't figure out what's wrong. I have a database with 'title' as one of the fields. Based on code in PHP Fast and Easy. Jeff Oien ?php $db_name = "Music"; $table_name = "music"; $connection = mysql_connect("localhost", "", "") or die("Couldn't connect."); $db = mysql_select_db($db_name, $connection) or die("Couldn't select database."); $sql = "SELECT COUNT (title) FROM music"; $result = mysql_query($sql,$connection) or die("Couldn't execute query."); //error from here $count = mysql_result($result,0,"count(title)"); echo "$count"; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] stupid problem!
This is because your server is set up to parse .php files as php, and .html files as html. If you have access to your httpd.conf or whatever, you can set it to include .html files in the php parsing. If not, you'll have to stick with calling your php files .php. HTH Jon -Original Message- From: kaab kaoutar [mailto:[EMAIL PROTECTED]] Sent: 15 February 2001 11:12 To: [EMAIL PROTECTED] Subject: [PHP] stupid problem! when i try the phinfo test in a php file it works! however when i put it in an htm file it does not work : htmlheadtitlePHP Test/title/head body ?php phpinfo(); ? /body/html It gives me a blank page _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] parse error driving me nuts ...
Instead of if ((mysql_num_rows($result)) = 1) try if ((mysql_num_rows($result)) == 1) HTH Jon -Original Message- From: Andrew [mailto:[EMAIL PROTECTED]] Sent: 15 February 2001 15:34 To: [EMAIL PROTECTED] Subject: [PHP] parse error driving me nuts ... hi, can anyone help me spot the parse error? It's throwing up on the first "if" line, and for the life of me I cannot find it! :) tia, andrew ?php include("db_connect_params.inc"); $sql="select path from PHOTO where pid =1"; $link_id = mysql_connect($host, $usr, $pass); $result = mysql_db_query($database, $sql, $link_id) or die("no result"); if ((mysql_num_rows($result)) = 1) { $row=mysql_fetch_array($result); extract($row); echo "img src =\"$path\"/imgbr"; } else { if (!isset($ii)) $ii = 1; $i = 1; while($row=mysql_fetch_array($result)) { extract($row); $displayed[$i]=$path; echo "a href=\"$PHP_SELF?ii=$i\"$i/anbspnbsp"; $i++; } echo "img src =\"$displayed[$ii]\"/imgbr"; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Problems with date() - what have I missed?
Hi list. I have a strange problem with a PHP script (WinNT/Apache/PHP4/MySQL). The line of code $dayname = date("D", mktime(0,0,0,$cmonth,$eventdate,$cyear)); should, if I understand it correctly, fill the variable $dayname with the three-letter abbreviation of the day of the week for the date I supply. I have $cmonth=3, $eventdate=26, and $cyear=2001. I would expect this to put "Mon" in $dayname, given that March 26th 2001 is a Monday. However, my script displays "Tue" which is a bit peculiar. As if that weren't enough, it isn't consistent in getting the days wrong. For example: November 30th 2000 was a Thursday. It gets this right. December 14th 2000 was a Thursday. It says it was a Tuesday. January 11th 2001 was a Thursday. It says it was a Monday. February 11th 2001 was a Sunday. It says it was a Monday. March 26th 2001 is a Monday. It says it is a Tuesday. What am I doing wrong? Is it something to do with last year (officially it wasn't a leap year but as 2000 is divisible by 4, many people thought it should be)? I'm in GMT so unless it's a BST thing I'm not being affected by a local time zone. All help gratefully appreciated Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Problems with date() - what have I missed?
Don't worry. False alarm. My bad. (etc) Hint for people experiencing a problem like this in the future: when passing variables to mktime(), ensure $cmonth=3 and not $cmonth="March", I find it helps a *lot* :-) Moral to the story: when having difficulties, echo your variables to the screen Cheers Jon -Original Message----- From: Jon Haworth [mailto:[EMAIL PROTECTED]] Sent: 13 February 2001 14:38 To: '[EMAIL PROTECTED]' Subject: [PHP] Problems with date() - what have I missed? Hi list. I have a strange problem with a PHP script (WinNT/Apache/PHP4/MySQL). The line of code $dayname = date("D", mktime(0,0,0,$cmonth,$eventdate,$cyear)); should, if I understand it correctly, fill the variable $dayname with the three-letter abbreviation of the day of the week for the date I supply. I have $cmonth=3, $eventdate=26, and $cyear=2001. I would expect this to put "Mon" in $dayname, given that March 26th 2001 is a Monday. However, my script displays "Tue" which is a bit peculiar. As if that weren't enough, it isn't consistent in getting the days wrong. For example: November 30th 2000 was a Thursday. It gets this right. December 14th 2000 was a Thursday. It says it was a Tuesday. January 11th 2001 was a Thursday. It says it was a Monday. February 11th 2001 was a Sunday. It says it was a Monday. March 26th 2001 is a Monday. It says it is a Tuesday. What am I doing wrong? Is it something to do with last year (officially it wasn't a leap year but as 2000 is divisible by 4, many people thought it should be)? I'm in GMT so unless it's a BST thing I'm not being affected by a local time zone. All help gratefully appreciated Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Netscape not resolving $PHPSELF ??
Is the script in the root? I seem to remember reading about problems with this and Netscape (although that sounds so strange I'm doubting myself here :-) Try shoving it in a subdirectory and see what happens. It's got to be worth 30 seconds to find out - I'd do it right now only I don't have Netscape at work HTH Jon -Original Message- From: John Vanderbeck [mailto:[EMAIL PROTECTED]] Sent: 13 February 2001 17:42 To: [EMAIL PROTECTED] Subject: [PHP] Netscape not resolving $PHPSELF ?? I'm having a problemin Netscape, any of my echo statements that use $PHPSELF, netscape isn't resolving $PHPSELF, but properly resolving all the other vars. There are several different types of echo statements, but here is a sample: echo 'BRA HREF="', $PHPSELF, '?mode=sub_categorycategory=', $category, 'sub_category=', urlencode($subcategories[$index]), '"', $subcategories[$index], '/A'; and: echo "P CLASS=NormalA HREF=$PHPSELF?mode=indexcategory=rootMain/A - $category/P"; Any ideas? This works FINE in Internet Explorer. And all the other vars in those echo statements are properly resoved into value. - John Vanderbeck - Admin, GameDesign -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] good free/cheap IDE for PHP
I'm sticking my vote in for Edit Plus 2 (www.editplus.com), although there are approx. 1,000,000 editors that would be suitable for your needs. I suggest a visit to www.download.com and a search for "text editors". Cheers Jon -Original Message- From: Dennis von Ferenczy [mailto:[EMAIL PROTECTED]] Sent: 09 February 2001 13:08 To: Php-General Subject: [PHP] good free/cheap IDE for PHP can anybody please tell me which good IDEs are theee, that are optimized for PHP? It acztually doesn't need to do much more, than just code highlighting and line numbering for me purposes, althoug i would of course appreciate additionla features. thx in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] sending mail with PHP from web
Can we see some code? I run a very similar thing (sending mails to around 500 people whose details are stored in a MySQL database and accessed via PHP) - the only difference is my OS is NT4 not FreeBSD. -Original Message- From: Yamin Prabudy [mailto:[EMAIL PROTECTED]] Sent: 07 February 2001 02:58 To: PHP List Subject: [PHP] sending mail with PHP from web Hi there,... i had make a web interface to send announcement mail to my customers,..rite now i had about 500 once I send mail to my customers my server hang ( i guess to much open file)...i complie by kernel again to get a big descriptor, but still worried about the hang problemi put a delay in my program so it send a mail and delay in x time, but i get a web error and my mail stop sending in my customer number 300 sorry for the broken english can any one help me with this kind of problem... i get my customer from mysql table, using freebsd4.1 and php4 Yamin Prabudy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Questions about simple php problems
One exception, on the main page, I have "index.html" which is simply a copy of "Index.php" renamed. This is so that requests to www.server.org/ will come up correctly. Probably there's a place to fix that in apache, but I haven't gone after it yet. There is a way to fix this on Apache, and a very easy one at that. Go into your httpd.conf file and look for a set of lines that look something like: IfModule mod_dir.c DirectoryIndex index.php index.shtml /IfModule The DirectoryIndex directive lists, in order, which pages the server should look for when it receives a request ending in /. As you can see, my config looks for an index.php file, followed by an index.shtml file. If it fails for both of these, I *think* it will return an HTTP 404 error. HTH Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Dear Friends Future Millionaire:
If I'd sent $5 off for every spam I've received someone else would be a millionaire by now. -Original Message- From: Duncan Hill [mailto:[EMAIL PROTECTED]] Sent: 06 February 2001 21:00 To: [EMAIL PROTECTED] Subject: Re: [PHP] Dear Friends Future Millionaire: On 2001-02-06, Hi Tech Services did say, AS SEEN ON NATIONAL TV: snip PLACE YOUR ORDER FOR THESE REPORTS NOW : REPORT# 1: The Insider's Guide to Advertising for Free on the Net Can we _please_ get the full headers for this message? The list software seems to strip them right off. -- Sapere aude My mind not only wanders, it sometimes leaves completely. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] newbie mail() function
You're missing a semicolon on line 8. HTH Jon -Original Message- From: Angerer, Chad [mailto:[EMAIL PROTECTED]] Sent: 07 February 2001 16:37 To: [EMAIL PROTECTED] Subject: [PHP] newbie mail() function Hello! I am very new to php programming. I have been experimenting around with php's mail function and html forms. I have a generic HTML form with user_name, email_address, comments, and like_site as inputs on the HTML form. I have the following code in a seperate php file which the form calls: ?php $msg = "Sender's Full Name:\t$user_name\n"; $msg .= "Sender's Email Address:\t$email_address\n"; $msg .= "User Comments:\t$comments\n"; $msg .= "Did you like the site?\t$like_site\n\n"; $mailheaders = "From: My Web Site\n" 9$mailheaders .= "Reply-To: $email_address\n\n"; mail("[EMAIL PROTECTED]", "Feedback Form", $msg, $mailheaders); echo ("Thank you $user_name\nbr"); echo ("I appreciate your feedback\n\n"); ? for some reason I get a parse error on line 9. If I remove the mailheaders variables the PHP script works just fine and emails the form to the correct address. Any help on this would be appreciated. It is probably something qyite simple. I just don't see it though. Thanks. Chad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] For My Information
Over 60% of websites use Apache. Many people using MySQL and PHP also run Apache for the complete open source solution. This is cheap to set up, and easy to get support for (there's even a mailing list called AMP - Apache/MySQL/PHP). And, IIRC, those on NT 4.0 Workstation don't *have* IIS. It's easy to configure and maintain, is constantly being upgraded and bug-fixed, and has tons of support and reference online. Just my 0.02 euros, obviously. Cheers Jon -Original Message- From: Dan Malcolm [mailto:[EMAIL PROTECTED]] Sent: 02 February 2001 11:49 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] For My Information I see in the posts, that a lot of people are using Apache on NT instead of the built in IIS. Is there a reason? I have PHP up and running with dBase tables converted to MySQL and ODBC connected to Access 2000, on an NT 4 box with IIS 4 and it runs very well. Performance is great. My only problem is automating the conversion to update tables in MySQL. I would like like to convert the Access 2000 tables also but the converters either don't seem to work with Access 2k, or not much at all, or are not such that a timed batch file can be generated using them. I just looked at what I've written and it's a little jumbled. Mega-Sigh. Let me summarize. 1.. Why Apache on NT 4.0? 2.. Is there a good way to automatically convert Access 2000 to MySQL to keep MySQL data up to date? The data needs to be updated several times a week. No I can't just switch everything over and not have to convert again. 3.. A way to do #2 for dBase would be good too, but less critical because the data only gets updated every couple months. Thanks in advance. Dan Malcolm [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] upload_max_filesize
It's usually in your system root, but you could have put it somewhere else when you installed PHP. If you're on Windows it's liable to be in \windows\system, \windows\system32, \winnt\system, or \winnt\system32. Most OSes come with a Find Files command these days (just a thought). Once you have found it, open it in your favourite text editor. Search for "upload_max_filesize" and set it to whatever you like. Save it. Tell your boss you'll have to spend all afternoon fixing this bug, then spend the rest of the day reading Dilbert cartoons. HTH Jon -Original Message- From: David Smith [mailto:[EMAIL PROTECTED]] Sent: 01 February 2001 11:45 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] upload_max_filesize Sorry, that isn't very detailed but I appreciate your help. Where can I find php.ini? - Original Message - From: Jonatan Bagge [EMAIL PROTECTED] To: David Smith [EMAIL PROTECTED] Sent: Thursday, February 01, 2001 6:41 AM Subject: Re: [PHP] upload_max_filesize David Smith wrote: Can anyone explain in detail how I can increase the upload_max_filesize to 5 meg instead of the default 2 meg? Thanks, David php.ini -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Pricing for PHP programming???
Of course, this might also be something to do with the fact that if one place is charging 80p/litre and one is charging 90p/litre, where are you going to spend your cash, given there's no difference between the petrol? -Original Message- From: thor [mailto:[EMAIL PROTECTED]] Sent: 01 February 2001 17:30 To: [EMAIL PROTECTED] Subject: RE: [PHP] Pricing for PHP programming??? What you may be referring to is when competitors in a small market (or in a market with limited competition) compare their prices behind the scenes in order to keep the prices high. Which is what the oil companies are often accused of doing (ever wonder why gas prices are usually within a few cents or even identical between stations even though they're supposed competitors?). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RE: test
No, I didn't get it -Original Message- From: ybcat [mailto:[EMAIL PROTECTED]] Sent: 01 February 2001 15:47 To: [EMAIL PROTECTED] Subject: test OK? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] mail( ) question
If you've copied-and-pasted that script, you might want to correct this line: scrip language="JavaScrip" Both the words "script" and "Javascript" have a T on the end of them :-) On the other hand, why don't you just use PHP for the whole thing? Get the e-mail address from a form, make the action of this form $PHP_SELF, and have a condition along the lines of if ($submit) { ... send the mail } else { ... display the form } Then you don't have to switch to and from client- and server-side scripts, and you don't risk your system being fubar'd by people who browse with Javascript turned off. Just a thought. Cheers Jon -Original Message- From: Fang Li [mailto:[EMAIL PROTECTED]] Sent: 29 January 2001 17:30 To: [EMAIL PROTECTED] Subject: [PHP] mail( ) question Hi All: Would anyone tell me how to correct the code in mail( ) function? Thanks a lot. html head scrip language="JavaScrip" function askEmailAddress( ){ var inputedData = prompt("The email address you want send to:"," "); if(confirm("The email address you want send to is" + inputedData + "?")){ alert("OK, the article will send to " + inputedData + "!"); } } /script /head body ... ?php mail(? script language="JavaScript" document.write(inputed_data)/script ?php , "My Subject", "Line 1\nLine 2\nLine 3"); ? /body /html Fang Li -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Beginner in php!
Hi, welcome to the wonderful world of PHP... grin You can use any text editor you like to write your PHP, my personal favourite is EditPlus 2 (www.editplus.com), but this is holy war territory so try a few out and see which one you get on with best. There are loads of great tutorials all over the www, IMHO you could do a lot worse than starting off at Webmonkey (http://hotwired.lycos.com/webmonkey/programming/php/) where there are a shedload of articles to do with loads of different aspects of PHP. If you're using NT Workstation and you're currently stuck with PWS (a big pile of sh*te), you might want to have a look at Apache (www.apache.org) which is considerably better. For databases, I'd heartily recommend MySQL (www.mysql.com). This combination - Apache/PHP/MySQL - is used by a huge number of websites and the support is superb from the open source community. The best thing about the whole lot is it's easy to persuade management to go for projects where the overall price tag is 0.00! HTH Jon -Original Message- From: kaab kaoutar [mailto:[EMAIL PROTECTED]] Sent: 24 January 2001 10:29 To: [EMAIL PROTECTED] Subject: [PHP] Beginner in php! Hi guys! I'm working on an NT workstation, i used to work with asp, but i heard a lot about php! that i decided to start working with it ! so i'm using PWS4 and i'm wondering which free php editor is more suitible for me ? and also what links to get free more tutorials, i got one of phpnet but still Regards _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Checking if files are there?
Yep. $file = @fopen (. The @ sign suppresses the warning messages. Should work fine after this. HTH Jon -Original Message- From: Sam [mailto:[EMAIL PROTECTED]] Sent: 24 January 2001 12:19 To: 'php' Subject: [PHP] Checking if files are there? Hi all, I was wondering if you could use PHP to test if a picture is there? I.E. checking if you could open the picture or not, and displaying a message either way. I have tried $file = fopen ("../images/maps/$filename.jpg", "r"); if (!$file) { print "This is no map for this trip."; exit; } else { print "img src=/images/maps/$filename.jpg"; } This works but also brings up a warning message as well, which is not wanted. Is there a way to get rid of the warning message? Thanks in advance Sam Rose -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Integration of PHP with MS Outlook?
Hi list, Is it possible to get PHP to create entities in Outlook, specifically tasks and calendar entries? TIA Jon Please visit us on the Internet: http://www.witanjardine.co.uk 'The information included in this e-mail is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege of confidentiality' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] multple select forms... going to hit my head against a wall ..
Sorry, my bad. I should have spotted the cunning way he used the word "array", really :-) Eyes closing. More coffee. glug aahaahhhrrrghhh Cheers Jon -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 23 January 2001 12:45 To: Jon Haworth Cc: '[EMAIL PROTECTED]' Subject: Re: [PHP] multple select forms... going to hit my head against a wall .. u ... $select is an array .. so echo $select will just produce "array" .. On Tue, Jan 23, 2001 at 12:44:20PM -, Jon Haworth wrote: Try either: ? input type="hidden" name="select" value="?php echo $select; ?" ?php OR printf ("input type=\"hidden\" name=\"select\" value=\"%s\"", $select); HTH Jon -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 23 January 2001 12:27 To: Adrian Murphy Cc: PHP list Subject: Re: [PHP] multple select forms... going to hit my head against a wall .. Having soved this .. thanks .. now for the next question .. *grin* I have the $select ... but I only use it on the next page .. heheh so I'm trying the following .. input type=\"hidden\" name=\"select\" value=\"$select\" which of course doens't work .. nor does input type=\"hidden\" name=\"select[]" value=\"$select\" any idea on how to pass an array on in an input field in a form ? Henti On Tue, Jan 23, 2001 at 12:01:40PM -, Adrian Murphy wrote: hey, since u are slecting multiple options you'll have to use an array here's how.i u need explanation,feel free to mail me: ? if ($select==""){ print" form method=\"post\" name=\"select\" action=\"test.php3\" SELECT MULTIPLE NAME=\"select[]\" Option VALUE=\"Chocolate\"Chocolate/Chocolate Chip Option VALUE=\"Peanut\"Peanut Brittle/Vanilla Option Selected VALUE=\"Cookie\"Cookie Batter Option VALUE=\"Blueberry\"Vanilla/Blueberry Option VALUE=\"Caramel\"Caramel Swirl Option VALUE=\"Other\"Other... /selectbr input type=\"submit\" name=\"send\" value=\"test\" /form "; }else{ ///count array $num = count($select); file://loop through array for($i = 0;$i $num;$i++){ print $select[$i] . "br"; } } ? - Original Message - From: [EMAIL PROTECTED] To: PHP list [EMAIL PROTECTED] Sent: Tuesday, January 23, 2001 11:42 AM Subject: [PHP] multple select forms... going to hit my head against a wall .. Hi all I'm having a slight little problem .. I can't seem to solve.. I have a multiple select form .. that i select mutiple options from and then it creates a variable called $select now if I display $select .. I only get the last selected value .. here foloows test code.. ? if ($select==""){ print" form method=\"post\" name=\"select\" action=\"test.php3\" SELECT MULTIPLE NAME=\"select\" Option VALUE=\"Chocolate\"Chocolate/Chocolate Chip Option VALUE=\"Peanut\"Peanut Brittle/Vanilla Option Selected VALUE=\"Cookie\"Cookie Batter Option VALUE=\"Blueberry\"Vanilla/Blueberry Option VALUE=\"Caramel\"Caramel Swirl Option VALUE=\"Other\"Other... /selectbr input type=\"submit\" name=\"send\" value=\"test\" /form "; }else{ print $select; } ? I'm de missing something ... can sombody please lend a hand .. thanks Henti Smith -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Calendar program
This should achieve a similar effect as that URI: ?php echo "404 Document Not Found"; ? ;-) Cheers Jon -Original Message- From: Todd Cary [mailto:[EMAIL PROTECTED]] Sent: 18 January 2001 13:56 To: [EMAIL PROTECTED] Subject: [PHP] Calendar program Does a calendar program exist in PHP similar to Yahoo's program? (http://www.yahoo.com/calendar) Todd -- Todd Cary Ariste Software [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] I love/hate FrontPage - need another HTML editor.
But, you know, the look and feel of a site is pretty important and an HTML editor goes a long way toward managing that part. If you can find an editor that helps you set up some style sheets that carry across all your pages without you having to type in all the code for every page, you're golden. If you can get some reports that check to be sure that you don't have any dead-ends, man, you're saving you and your users from some serious frustration. And, better yet, if you can see a bird's-eye view of your site with some easy-to-check tree charts, you can check on the logical layout of the site. Eek. You shouldn't have to "type in all the code" for each page for your styles anyway. The line link href="css/styles.css" rel="stylesheet" type="text/css" in your head../head will bring the same style rules into every document and give you the advantage of smaller pages. You can get link checkers such as Xenu which work superbly, even building you an HTML site map you can cut 'n' paste into your own site. I can't see the advantages of using an editor over hand code so far. See, all our fancy-schmancy work with databases and power-code is for naught if it's not easily accessible to the visitor and I think we all overlook that to our peril. What was that British fashion site that recently folded because they delayed launching because they wanted to "get it just right?" Then, their site was so bloated and took so long to load that people just surfed away... I think that a good HTML editor will display how long a page will load using various modem speeds and allow me to choose whether I want to spring that kind of burden on my visitors. Well, yes, in the same way Photoshop displays how long an image is supposed to take to load. But, in my experience, most HTML editors write code that is considerably more long-winded than a well-coded page should be - so the only benefit you get is an accurate picture of how much your editor has messed up your code. If you design your pages well and code them properly, you can avoid many of the long download times associated with most websites today. If you run an image-intensive site, optimising your pictures is as (more?) important than having tight code - and an HTML editor doesn't help with this. It was boo.com that went under, incidentally. So, you've used both products and you know what I mean when I say that I can apply a "theme" with FrontPage. Can you do likewise with Dreamweaver? If you set up a site that specializes in fireworks, for instance, will a button that you design once with a pretty exploding shell carry across all your pages without having to insert or "include" it on all your pages? With FrontPage, you just set up one "theme" and all the elements carry across without having to manually include them. That's the kind of drudgery I'd like to get away from so that all I have to do is open up the editor and stick some PHP in there that interacts with MySQL. Without having to insert or include it? You have two options, if you want the same stuff on several pages. 1. Have the code on each page. (ugh - if you want to change it you have to change all of them, and each page is bigger). 2. Have an include file of some sort (.css, .inc, .whatever) and link to it. I don't see (2) as being more drudgery than (1), quite the reverse in fact. Do you think I'm living in La-La Land? Not really - there's a time and a place for editors (marketing people who want to "just design a quick page for the Intranet"), but for anything serious, I'd like to quote your first sentence again. There's no question that hand-coding is the way to go. I'm with you 110% on that score! Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Working out the name of the day given a date
Hello list, Just a quickie. Does anyone have a code snippet for calculating the day of the week given a date? I was hoping I could feed a string like "20010116" to a function and have it return "Tuesday" - it doesn't have to be exactly this date format that is used for the input, but I do need the name of the day on the output! I'm hunting around at the moment but I haven't had any joy so far, I thought I'd see if anyone's already invented this wheel... Cheers Jon Please visit us on the Internet: http://www.witanjardine.co.uk 'The information included in this e-mail is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege of confidentiality' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] WML/WAP and PHP
I seem to remember reading something very recently, possibly on this list, about WML. IIRC, if you drop out of PHP at any point the rest of the document gets treated as text/html. Try something like ?php header("Content-type: text/vnd.wap.wml"); echo("wmlcardpHello world!/p/card/wml"); ? and see if it works. Sorry to be vague, but I didn't pay *that* much attention to it at the time! HTH Jon -Original Message- From: Rick Hodger [mailto:[EMAIL PROTECTED]] Sent: 16 January 2001 16:02 To: [EMAIL PROTECTED] Subject: Re: [PHP] WML/WAP and PHP "Pavel Kalian" [EMAIL PROTECTED] wrote in message 028e01c07fc1$dffdecf0$8361d4c2@pavelk">news:028e01c07fc1$dffdecf0$8361d4c2@pavelk... Hi Rick, you are not doing anything wrong. You just have to send the proper content-type depending on what you're outputing. For example if you want to produce a gif image you have to use header("Content-type: image/gif"); There's nothing wrong with it as PHP can't predict what you want to do. text/html is set as default simply because it's the type most users in most cases need. Yes, I know that. But what I'm saying is that eg. ?php header("Content-type: text/vnd.wap.wml"); ? wml card pHello world!/p /card /wml ...gets put out with a text/html content type as opposed to the specified text/vnd.wap.wml. Having said that, I just tried it on the linux machine and it worked fine. A Windows thing? -- Rick Hodger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Working out the name of the day given a date
Cheers Andy, between my last post and this one I came up with a rather long-winded way of doing it... $dayarray = getdate(mktime(0,0,0,$month,$date,$year)); switch ($dayarray["wday"]) { case 0: $day = "Sunday"; break; case 1: $day = "Monday"; break; case 2: $day = "Tuesday"; break; case 3: $day = "Wednesday"; break; case 4: $day = "Thursday"; break; case 5: $day = "Friday"; break; case 6: $day = "Saturday"; break; } Ugh. I'll try your method. Cheers Jon -Original Message----- From: Andrew Rush [mailto:[EMAIL PROTECTED]] Sent: 16 January 2001 16:03 To: Jon Haworth Subject: Re: [PHP] Working out the name of the day given a date On Tuesday, January 16, 2001, at 10:56 AM, Jon Haworth wrote: Just a quickie. Does anyone have a code snippet for calculating the day of the week given a date? I was hoping I could feed a string like "20010116" to a function and have it return "Tuesday" - it doesn't have to be exactly this date format that is used for the input, but I do need the name of the day on the output! covert your date string to a unix timestamp and then use date("l", $myString) have a great day, andy :: Andrew Rush :: Lead Systems Developer :: MaineToday.com :: ** "Crippled but free, blind all the time, i was learning to see" - J. Garcia / R. Hunter ** The views expressed herein are not necessarily those of my employer, but they let me have them anyway. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Working out the name of the day given a date
Hmmm. I did: $timestamp = mktime(0,0,0,$month,$date,$year); $day = date("1", $timestamp); and it returns 1, no matter what the contents of $month, $date and $year are. Did I miss something? -Original Message- From: Andrew Rush [mailto:[EMAIL PROTECTED]] Sent: 16 January 2001 16:03 To: Jon Haworth Subject: Re: [PHP] Working out the name of the day given a date On Tuesday, January 16, 2001, at 10:56 AM, Jon Haworth wrote: Just a quickie. Does anyone have a code snippet for calculating the day of the week given a date? I was hoping I could feed a string like "20010116" to a function and have it return "Tuesday" - it doesn't have to be exactly this date format that is used for the input, but I do need the name of the day on the output! covert your date string to a unix timestamp and then use date("l", $myString) have a great day, andy :: Andrew Rush :: Lead Systems Developer :: MaineToday.com :: ** "Crippled but free, blind all the time, i was learning to see" - J. Garcia / R. Hunter ** The views expressed herein are not necessarily those of my employer, but they let me have them anyway. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Working out the name of the day given a date
Gah. I read that lower case l as a number 1. Time to get new glasses/switch to 640x480 mode. Thanks to everyone for your help. Cheers Jon -Original Message- From: Andrew Rush [mailto:[EMAIL PROTECTED]] Sent: 16 January 2001 16:03 To: Jon Haworth Subject: Re: [PHP] Working out the name of the day given a date On Tuesday, January 16, 2001, at 10:56 AM, Jon Haworth wrote: Just a quickie. Does anyone have a code snippet for calculating the day of the week given a date? I was hoping I could feed a string like "20010116" to a function and have it return "Tuesday" - it doesn't have to be exactly this date format that is used for the input, but I do need the name of the day on the output! covert your date string to a unix timestamp and then use date("l", $myString) have a great day, andy :: Andrew Rush :: Lead Systems Developer :: MaineToday.com :: ** "Crippled but free, blind all the time, i was learning to see" - J. Garcia / R. Hunter ** The views expressed herein are not necessarily those of my employer, but they let me have them anyway. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Problem with Exec()
| | It should also be noted that the system interaction functions (namely, | passthru(), exec(), system() and popen()) are | broken/incorrectly implemented, | actually, its windows that's incorrectly implemented, but be | that as it may, the | functions do not work with windows). Well, I guess that clears that up... cheers Mr. Gates | | To the original poster: | Hello | Use PHP's built-in mail() function instead, don't fork | out to sendmail, | actually, better yet, use linux :-). I spotted the mail() function about ten minutes after I posted... (and I would be on a linux box if I could persuade my boss) Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Problem with Exec()
Hello list, I'm having a problem with Exec and Sendmail, on PHP-4 running under Apache 1.3.14 on Windows NT. When I go to a DOS prompt and enter d:\sendmail\sendmail -t -messagefile=d:\sendmail\msg.txt it works fine. When I have any of the lines exec ("d:\sendmail\sendmail.exe -t -messagefile=d:\sendmail\msg.txt"); exec ("d:\\sendmail\\sendmail.exe -t -messagefile=d:\\sendmail\\msg.txt"); $foo = exec ("d:\sendmail\sendmail.exe -t -messagefile=d:\sendmail\msg.txt"); $foo = exec ("d:\\sendmail\\sendmail.exe -t -messagefile=d:\\sendmail\\msg.txt"); all that happens is my PHP script times out. If I remove this line, everything works fine. I'm sure I'm missing something simple but I'm *very* tired. Any ideas? Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] to be persistent connected or not to be persistent connected
In your Apache httpd.conf, do you have the line KeepAlive On - this is the Apache directive to turn on persistent connections. You will also want to play with the MaxKeepAliveRequests directive, if you set it to 0 then it will allow an unlimited number of connections. There may be more to it than this, but it's worth checking. HTH Jon -Original Message- From: Kayra Otaner [mailto:[EMAIL PROTECTED]] Sent: 10 January 2001 15:32 To: [EMAIL PROTECTED] Subject: [PHP] to be persistent connected or not to be persistent connected Hi, I am searching for detailed information about persistent connection. I've looked at all the web sites just for "persistent" word but always I found the same information. All the time people are saying "persistent connection is good if you are dealing with lots of small queries". Here is my case: This week I've upgraded necessary server software to the latest versions of Php and Apache (Php 4.04 and Apache 1.3.14) As I did before upgrade I've compiled Php as an Apache Static Module ( mod_so is not necessary ) And check MySQL for persistent connection. My site is focused on free web services like graphic counter, polls, url redirection, webring and news syndication to personal web sites. (www.kelalaka.net, it is Turkish only). Only for graphic counter services, it counts 180.000+ hits per day. It means 350.000+ queries per day. Day average is 250 query , 60 connection per minute, but in popular hours it is very high and MySQL server gives "Too many connections" errors. MySQL server is default and set to 100 connection at most. Yesterday I ordered more ram in order to increase connection number of MySQL from 100 to 200+ connection. But today I realized that my server wasn't work with persistent connection. All the Php code contains mysql_pconnect for MySQL connections. Apache and Php works in module type not in cgi mode. I've looked at phpinfo() in order to see anything that can indicate status of persistent connection. It says "mysql.allow_persistent is On". But again in phpinfo it says "Active Persistent Links 1" . It is sometime changes to "0". In MySQL I am looking for active processess by using "mysql" and "show processlist" commands it shows me 100 active links but most of them are in sleep state. In php.ini there is a line in order to set maximum number of persistent connection and I set it to just 25. If somebody uses mysql_pconnect's instead of mysql_connect in Php cgi mode, he doesn't see any error messages. All mysql_pconnects work like mysql_connect. My questions : 1 - How can users exactly determine whether they are using Php as a module or cgi mode? (from phpinfo or ..?) 2 - Is it sufficient Php and Apache compiled in static or dynamic module version in order to use mysql_pconnects in Php code? Anything to do with MySQL? 3 - In a Apache + Php module compiled system is it normal to reach more than predefined connection number in php.ini? (100 active connection but 25 defined in php.ini. In phpinfo shows same settings in the php.ini file (it shows 25 max persistent connection)) 4 - Is there any web page containing a real how-to and tutorial about persistent connection? (If not I will certainly prepare one in a few weeks :-)) Any kind of help will be appreciated... Kayra Otaner www.kelalaka.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]