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
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
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
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
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]
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
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]
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]
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
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
. "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
;
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
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
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
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
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")
{
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;
?
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
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
: 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]
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
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]
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]
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.
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
..!
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
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
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
$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
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
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]
://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]
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,
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
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
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]
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
// 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
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
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]
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]
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.
$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
(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
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]
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
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
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]
$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
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
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,
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]
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
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
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
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]
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
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
58 matches
Mail list logo