Re: [PHP] exist?

2001-03-14 Thread Simon Garner
From: "Kenneth R Zink II" [EMAIL PROTECTED] How would I go about checking to see if a file exist from php? I didn't find anything on php.net when I did a search for exist. if (file_exists("/full/path/to/file.txt")) http://php.net/manual/en/function.file-exists.php -- PHP General

Re: [PHP] Good Free PHP Editor?

2001-03-12 Thread Simon Garner
indows yes - supports syntax highlighting for lots of languages including HTML, PHP, Perl, SQL, ASP (VB/JS). - can edit multiple files yes - shows line numbers in gutter on left hand side - supports regular-expression based search replace across multiple files/directories - nice interface. Che

Re: [PHP] ASP vs PHP

2001-03-12 Thread Simon Garner
From: "Chris Anderson" [EMAIL PROTECTED] This is going to sound like heresy, but is there any way to use ASP and PHP in the same fle/page? Seperated of course. What if you put: !--#include virtual="path/to/file.php"-- in your ASP page? -- PHP General Mailing List

Re: [PHP] Good Free PHP Editor?

2001-03-12 Thread Simon Garner
have HomeSite 4.5.1 open for weeks, working on 10+ files, without any problems whatsoever. However, I used to run it under Win98 and it would crash 1-2 times per day... Regards Simon Garner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

Re: [PHP] validating fields

2001-03-08 Thread Simon Garner
eregi("^[a-z0-9]+$", $FirstName) eregi("^[a-z0-9]+$", $LastName) ) Cheers Simon Garner -- 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] anchor # not working?

2001-03-04 Thread Simon Garner
nd looking at the source of the news.php page shows: a href="#1"/a about half-way down.. but the page doesn't align with the anchor tag. Change this to: a name="1"/a Cheers Simon Garner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECT

Re: [PHP] date

2001-03-04 Thread Simon Garner
th 2001 12:30 PM": SELECT col1, col2, DATE_FORMAT(mydate, '%W %M %D %Y %r') AS mydate, col4 FROM mytable http://www.mysql.com/doc/D/a/Date_and_time_functions.html Cheers Simon Garner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: [PHP] Re: IE 5.5,authentication,PHP sessions: IE never stops

2001-03-04 Thread Simon Garner
of HTTP authentication. Then you can log users out just by unsetting the cookie(s). Cheers Simon Garner -- 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: IE 5.5,authentication,PHP sessions: IE never stops

2001-03-04 Thread Simon Garner
From: "Ken" [EMAIL PROTECTED] Nope - with IE5.5, even with that box NOT checked, the user remains logged in until either a) the computer is restarted, or b) a new user-authentication header is sent, AND the user clears out the password field and hits OK. Otherwise the user stays logged in, in

[PHP] Re: IE 5.5,authentication,PHP sessions: IE never stops

2001-03-04 Thread Simon Garner
From: "Ken" [EMAIL PROTECTED] What Windows version is this under? Windows 98 and Mac OS 8 or 9. - Ken Is IE set to "Launch browser windows in a separate process" (if that option still exists in 5.5)? Have a look in Tools Options Advanced. Perhaps if that is not checked, closing the

Re: [PHP] stumped on mailing a complete page

2001-03-03 Thread Simon Garner
. "MIME-Version: 1.0\n" . "Content-Type: multipart/alternative;\n" . " boundary=\"=_NextPart_\""; mail($mailto, $mailsubject, $mailbody, $mailheaders); ... ? Have a flick through: http://www.php.net/manual/en/ref.outcontrol.php h

Re: [PHP] quote problem

2001-03-02 Thread Simon Garner
; echo $title; ? The syntax in your original e-mail was not quite right - heredocs should work fine with quotes. http://www.php.net/manual/language.types.string.php Cheers Simon Garner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona

Re: [PHP] Munging hidden/form variables

2001-03-01 Thread Simon Garner
ge. Bogus form data is a problem for everyone working with html forms. You're trying to find an esoteric solution to the problem, while overlooking the obvious: just check if the data is valid. Regards Simon Garner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL

Re: [PHP] Munging hidden/form variables

2001-03-01 Thread Simon Garner
thing like that has happened. That's where my description of what I was thinking of doing came from. Chris Does the user have a password? You need to check if the password matches as well. Cheers Simon Garner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-ma

Re: [PHP] Munging hidden/form variables

2001-03-01 Thread Simon Garner
the logged in user is allowed to act on behalf of the other ID? You just have to keep reverifying that the client is allowed to do what they're doing. It's a chore I know - security usually is :( Cheers Simon Garner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL

Re: [PHP] validating fields

2001-03-01 Thread Simon Garner
From: "W.D." [EMAIL PROTECTED] I dont know how to do this, but Ive tried several things with no success. I need to validate several form fields and here is the script I'm working with... ?php if($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST") {

Re: [PHP] Loss of connection handle object

2001-03-01 Thread Simon Garner
wwroot/php/PostgreSQLDataSource.php on line 67 - What happens if you do: ?php $db = new PostgreSQLDataSource("host", "port", "user", "pass", "db"); $db-open(); echo $db-connection; ?

Re: [PHP] Declaring SERVER-WIDE Variables

2001-03-01 Thread Simon Garner
you would need to serialize() it first. Cheers Simon Garner From: "Michael David" [EMAIL PROTECTED] Greetings, fellow PHP hackers! The current project I'm working on is porting software written in Tango to PHP4. Because these programs heavily rely on information held in

Re: [PHP] Dumb newbie graphics question

2001-03-01 Thread Simon Garner
ute newbie questions like these? Create a new file called test.php and in it put: ?php phpinfo(); ? FTP it to your web server and then look at it in your browser. It should tell you a whole lot of stuff about how PHP has been configured on your server. Regards Simon Garner -- PHP General Ma

Re: [PHP] what is wrong with this sniplet?

2001-02-28 Thread Simon Garner
: mailto:[EMAIL PROTECTED]\n"; $mailHeaders .= "Content-Type: text/html\n"; mail($mailTo, $mailSubject, $mailBody, $mailHeaders); ? Cheers Simon Garner -- 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] Getting form name

2001-02-28 Thread Simon Garner
you should be able to achieve the desired effect with a hidden INPUT element: form name="someform" method="POST" input type="hidden" name="formname" value="someform" /form Cheers Simon Garner -- PHP General Mailing List (http://www.php.net/) To un

Re: [PHP] multiple databases

2001-02-28 Thread Simon Garner
ut you get a memory overhead instead - if you have 40 connections open, there's got to be 40 mysqld processes (threads?) running too. Cheers Simon Garner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: [PHP] multiple databases

2001-02-28 Thread Simon Garner
name.col_name." http://www.mysql.com/doc/S/E/SELECT.html Cheers Simon Garner -- 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] optimal way of counting votes in online poll

2001-02-28 Thread Simon Garner
in PHP, let MySQL do the work: UPDATE polls SET votecount=votecount+1 WHERE pollid=$poll There are all sorts of manipulations you can do to the data during queries, and they're all usually much better than trying to do the same thing in your application. http://www.mysql.com/doc/F/u/Functions.

Re: [PHP] regex frustration

2001-02-28 Thread Simon Garner
tr); ? Or alternatively: ?php $str = "Nelson Bob and Mary, 123 Street st., Ashton, 555-1212"; $str_bits = explode(" ", $str); $str_bits[0] .= ","; $str = implode(" ", $str_bits); ? Cheers Simon Garner -- PHP General Mailing List (http://ww

Re: [PHP] parse error on line after last one???

2001-02-27 Thread Simon Garner
..! does this actually mean anything, or is it just poor error reporting?? I think this usually means you have opened a block (e.g. an if statement), and forgotten to close it. Cheers Simon Garner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL

[PHP] Full mailbox

2001-02-27 Thread Simon Garner
PROTECTED] Received: (qmail 8648 invoked from network); 27 Feb 2001 23:25:20 - Message-ID: 004901c0a114$f09af980$[EMAIL PROTECTED] From: "Simon Garner" [EMAIL PROTECTED] To: "Jaxon" [EMAIL PROTECTED], [EMAIL PROTECTED] References: [EMAIL PROTECTED] Date: Wed, 28 Feb 2001 12:27:08 +13

Re: [PHP] very off the topic questions here but hope someone can help out

2001-02-27 Thread Simon Garner
From: "Jacky@lilst" [EMAIL PROTECTED] This is very off the topic question, people. But I just wanna see if anyone has this experience and can tell me the procedure. I need to change the registrant company of several domains we own to the new company name. I only know that I need to do that

Re: [PHP] How to PHP process a .phtml file, or capture the output from within PHP?

2001-02-27 Thread Simon Garner
$fp = fopen("/usr/local/apache/htdocs/file.html", "w") or die("eek"); fwrite($fp, ob_get_contents()); fclose($fp); // and output the buffer to the browser ob_end_flush(); ? And have a flick through: http://www.php.net/manual/en/ref.outcontr

Re: [PHP] Converting code to a function

2001-02-27 Thread Simon Garner
uot;, "jksajfeioe"); function viewdoc ($docid) { ... $dbh = mysql_connect(HOSTNAME, DB_USER, DB_PASS); ... } ? Hope this helps. Cheers Simon Garner - Original Message - From: "Clayton Dukes" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sen

Re: [PHP] Simple String Replace Question

2001-02-25 Thread Simon Garner
cing any \n with a space, as long as that \n is not next to another \n. Cheers Simon Garner -- 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] Removing HTML codes using regexp

2001-02-25 Thread Simon Garner
://php.net/striptags Cheers Simon Garner -- 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] Simple String Replace Question

2001-02-25 Thread Simon Garner
lmno"; $str = ereg_replace("\r", "", $str); $str = ereg_replace("([^\n])\n([^\n])", "\\1 \\2", $str); echo $str; ? A CR is a carriage return, a LF is a line feed or newline. \r = CR, \n = LF. Unix files use only LF (\n) for new lines,

Re: [PHP] Script not updating

2001-02-25 Thread Simon Garner
one,faxareacode,fax,email ,secret) VALUES ('$name','$company','$address','$suburb','$state','$post','$areacode','$phon e','$faxareacode','$fax','$email','$secret')"); ^^ Here's your culprit. Check your logic. Whenever they push submit it INSERTs a new record (I think...). Regards Si

Re: [PHP] Regular expression problems

2001-02-25 Thread Simon Garner
like: "[^[:alphanum:]]". However you are probably better off using an explicit set of characters as I have shown, so that it is obvious what is and is not allowed. Cheers Simon Garner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] F

Re: [PHP] Regular expression problems

2001-02-25 Thread Simon Garner
Compatible Regular Expressions) Cheers Simon Garner -- 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] Simple String Replace Question

2001-02-25 Thread Simon Garner
me troubleshooting ideas: ?php $str = ereg_replace("\r", "CR", $str); // replace CRs with "CR" $str = ereg_replace("\n", "LF", $str); // replace LFs with "LF" ? ?php echo urlencode($str); // may help to highlight any spe

Re: [PHP] JavaScript

2001-02-25 Thread Simon Garner
// can't go back... try JS instead $url = "javascript:history.back()"; } echo "a href=\"$url\"Back Button/a"; ? Cheers Simon Garner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

Re: [PHP] $result = $$function

2001-02-24 Thread Simon Garner
From: "Peter Van Dijck" [EMAIL PROTECTED] Hi, I'd like to do: $function = "build_result()"; $result = $$function; but it doesn't seem to work. Try: ?php $function = "build_result"; $result = $function(); ? Cheers Simon Garner -- PHP General Ma

Re: [PHP] checking $more still does not work !

2001-02-24 Thread Simon Garner
e" value="Click for more" Cheers Simon Garner -- 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] Parsing a string

2001-02-23 Thread Simon Garner
as explode() accepts just a normal string. The difference is, split() is slower. Cheers Simon Garner -- 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] getting what's between td/td

2001-02-22 Thread Simon Garner
eregi("trtd([^]+)/trtd([^]+)/td/tr", $data, $regs); From: "Simon Garner" [EMAIL PROTECTED] From: "Tyler Longren" [EMAIL PROTECTED] Hello, I've been reading a LOT on how to solve my problem today, but haven't been able to come up with anything yet.

Re: [PHP] Generating percentages of numbers

2001-02-22 Thread Simon Garner
$result = mysql_query("SELECT (hitcount / $totalhits) * 100 AS percentage FROM pages"); ? I think... From: "Christian Reiniger" [EMAIL PROTECTED] On Thursday 22 February 2001 00:04, Simon Garner wrote: I have a database of numbers: TOTAL HITS: 1000 PAGE 1: 500 PAG

Re: [PHP] String manipulation with ereg_replace

2001-02-22 Thread Simon Garner
(untested!): ? $contents = "img src=ThisOneReallyNeedsToBeAllLowercase.gif alt=ThisOneReallyNeedsToBeAllLowercase.gif"; $contents = preg_replace("/([-_a-zA-Z0-9]+)\.gif/e", "strtolower('\\1') . '.gif'", $contents); ? Cheers Simon Garner -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] passing variables in javascript

2001-02-22 Thread Simon Garner
tp://www.domain.com/biz/pubs.html#antitrust"); ?', 'email','width=410,height=435')"Emailthis/a Cheers Simon Garner -- 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] Counter Help

2001-02-22 Thread Simon Garner
rint nothing (or an error), because there is no index matching "donkey" (the value of the constant "foo"). But for some reason PHP looks for an array index matching the string "foo" as well, encouraging this kind of sloppy programming. Regards Simon Garner -- PHP General

Re: [PHP] select name=....

2001-02-22 Thread Simon Garner
ona", ... etc "WY" = "Wyoming" ); drawListBox("state", $states, $state); ? When it comes to programming, in many ways "laziness is a virtue". Instead of writing the same code 10 times over in subtly different ways, write it on

Re: [PHP] mail prob

2001-02-22 Thread Simon Garner
body, "From: $from"); ? http://www.php.net/manual/en/function.mail.php Regards Simon Garner -- 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 prob

2001-02-22 Thread Simon Garner
$subject = $Email; $message = "Question from $FirstName $LastName:\n\n$Info"; mail("[EMAIL PROTECTED]", $subject, $message, "From: $from\nCc: [EMAIL PROTECTED]"); ? I'm assuming you wanted to send a copy to [EMAIL PROTECTED] Please read the docs

Re: Re: [PHP] passing variables in javascript

2001-02-22 Thread Simon Garner
From: "Nicholas W. Miller" [EMAIL PROTECTED] H ... is there anyway to do this without requiring the page with the link to use PHP? Well if the string you're going to urlencode() is always going to be the same, then just run it through once, grab the encoded version and hard-code it

Re: [PHP] How to pass variables on php command line ?

2001-02-22 Thread Simon Garner
esn't work. Is there any means of doing this ? Leonard Schneider Easiest way is using environment variables. ?php system("SOME_VAR=blah; php -q script.php file.html"); ? Then in script.php you can do: ?php $some_var = getenv("SOME_VAR"); ? Hope this helps,

Re: [PHP] htaccess problems disabling phplib

2001-02-21 Thread Simon Garner
e directly in there. :) Cheers Simon Garner -- 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 passwordcheck-program problem

2001-02-20 Thread Simon Garner
s, classes and objects work in PHP. Have a closer read through the manual. Moreover, if you're just starting out with PHP then steer clear of objects entirely - you don't need them! ? /body /html If you can and like to help me I will be very pleased. Thanks in advance !!! Ronald Hope

Re: [PHP] Re: sending variables

2001-02-20 Thread Simon Garner
From: "Ifrim Sorin" [EMAIL PROTECTED] In test1.php you shoul have ? $qry=getenv("QUERY_STRING"); $rosen=substr($qry,6); print("$rosen"); ? Sorin Ifrim wtf? Most certainly do NOT do it like that. That's a ridiculous kludge. Rosen, when you say "it doesn't work" what do

Re: [PHP] How do I ....

2001-02-20 Thread Simon Garner
the things ? phpinfo() ? is giving me like: session.use_cookie and/or session.save_path or anything else they list there. My question.. how do you do it? Thanks Mike I think you'll find those settings in your php.ini file. Cheers Simon Garner -- PHP General Mailing List (http://w

Re: [PHP] PHP SSI

2001-02-20 Thread Simon Garner
file("http://your-adserver.dom/banner.php?id=1234"); ? Cheers Simon Garner -- 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] php and javascript

2001-02-20 Thread Simon Garner
From: "Carl Natale" [EMAIL PROTECTED] I need some help passing a variable to a popup window. The following form collects input from the user and stores it in the variable $summary. ? print "FORM action=\"hint.php\" METHOD=\"post\""; $summary = "Hellow universe"; print "INPUT

Re: [PHP] % Help

2001-02-20 Thread Simon Garner
en/ref.math.php, but it is far from clear (to me at least). Well, this is a mathematical concept rather than PHP language-specific. :) Cheers Simon Garner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL