,
Justin.
P.S. WOW, this is a late response...sorry.
-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Saturday, April 17, 2004 12:20 PM
To: Pooya Eslami
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] why doesn't this work ?
Pooya Eslami wrote:
I took out the scrip tags
Yes, the server supports php, and I don't want to make it into a php file
because its a big html file and I just need this little script on it. Why
cannot I embed php in html files?
Andy Ladouceur [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
It's already been mentioned, but you do
On Sun, 2004-04-18 at 10:27, Pooya Eslami wrote:
Yes, the server supports php, and I don't want to make it into a php file
because its a big html file and I just need this little script on it. Why
cannot I embed php in html files?
You CAN embed PHP in .html files PROVIDED THAT YOUR WEBSERVER
Pooya Eslami wrote:
Yes, the server supports php, and I don't want to make it into a php file
because its a big html file and I just need this little script on it. Why
cannot I embed php in html files?
The server does not parse html files for php so that it does not waste
CPU on parsing files
You have this as a xxx.php file right?
It has to have a .php extension for it to work.
I put this in the body of an html file:
?php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ($file != . $file != .. eregi('\.html$', $file)) {
echo lia
The web server is set up to see the .php file extension and pass the entire page to
the PHP engine for processing. Then the web server passes the
results back to the client's browser ( HTML, text, and images).
Yes, the server supports php, and I don't want to make it into a php file
because
Why cannot I embed php in html files?
I'm relatively new to PHP, but I am fairly sure that it is
possible to have PHP embedded in .html files, as my web hosting service
accomplishes exactly that. I believe it's just some kind of setting in
Apache or somewhere else that you or your web
Okay, what you can do is try use an .htaccess file (providing your host
allows them) to make the PHP engine parse .html files.
Create a file titled .htaccess with the following contents:
AddType application/x-httpd-php .php .php3 .html .htm
Upload it to the same folder that the .html file is in,
If I put the following script in a .php file it would work but if I put it
in an .html file doesn't work, why? script tag is only used in .html file.
script language = php
echo ul;
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ($file != . $file != ..
Pooya Eslami wrote:
If I put the following script in a .php file it would work but if I put it
in an .html file doesn't work, why? script tag is only used in .html file.
You web server determines whether or not to look for PHP in a file based
upon its extension. You must set up your web server to
How do I do that? I don't have a webserver, it is hosted by a hosting
company.
John W. Holmes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Pooya Eslami wrote:
If I put the following script in a .php file it would work but if I put
it
in an .html file doesn't work, why? script
The browser doesn't know what to do with PHP code.
If I put the following script in a .php file it would work but if I put it
in an .html file doesn't work, why? script tag is only used in .html file.
script language = php
echo ul;
if ($handle = opendir('.')) {
while (false !== ($file =
I should have also said:
Because it's missing the ?php and ? tags, the web server isn't going to run the
code, but pass it back to the client browser.
If I put the following script in a .php file it would work but if I put it
in an .html file doesn't work, why? script tag is only used in .html
I took out the scrip tags and put in ?php in the beginning and ? at the
end, but it returns this:
$file
; } } closedir($handle); } echo
; ?
Any ideas how to fix this?
Daniel Clark [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I should have also said:
Because it's missing the
Daniel Clark wrote:
I should have also said:
Because it's missing the ?php and ? tags, the
web server isn't going to run the code, but pass
it back to the client browser.
You are right, but not for the reason you think. script language=php
is a valid way of starting PHP mode.
I took out the scrip tags and put in ?php in the beginning and ? at the
end, but it returns this:
$file
; } } closedir($handle); } echo
; ?
Any ideas how to fix this?
John W. Holmes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Daniel Clark wrote:
I should have also said:
Pooya Eslami wrote:
I took out the scrip tags and put in ?php in the beginning and ? at the
end, but it returns this:
$file
; } } closedir($handle); } echo
; ?
Any ideas how to fix this?
Use a .php extension on your file. Or you can ask your hosting company
to have .html files processed as
Can you post the code and error.
I took out the scrip tags and put in ?php in the beginning and ? at the
end, but it returns this:
$file
; } } closedir($handle); } echo
; ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I put this in the body of an html file:
?php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ($file != . $file != .. eregi('\.html$', $file)) {
echo lia href=\$file\font color=\#CC\$file/
font/a/libr;
}
}
closedir($handle);
It's already been mentioned, but you do need to ensure you are using a
.php extension on the file. Also, forgive me if this has already been
covered, but are you sure the server even supports PHP?
Try creating a new file with:
?php
phpinfo();
?
And save it as something.php, check and see if it
This is interesting. I did my testing in Opera 5.05 and it fails to display
the page correctly. I then opened Netscape 6.2 and it works fine. Must be a
problem with Opera. I also set Opera to identify itself as Netscape and it
still failed to load the page.
Thanks for the assistance.
Chip
On
$sql = INSERT INTO table_name(ip,browser,received)
VALUES('.mysql_escape_string($ip).','.mysql_escape_string($browser).',now()) ;
- Original Message -
From: chip [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, November 27, 2001 4:39 PM
Subject: Re: [PHP] Why
I have this small test page, below, which returns an error -
Parse error: parse error in /usr/local/apache/htdocs/test.php on line 4
on the $browser line, if I comment it out, it returns an error on the $ip
line, etc. I can leave all the php lines out, add an echo statement
? echo
snip
What have I done wrong in such a simple bit of code?
-
htmlheadtitle/title/head
body
?
$browser = $HTTP_USER_AGENT;
$ip = $REMOTE_ADDR ;
$db = mysql_connect ( localhost , username , password );
mysql_select_db ( database , $db );
$sql = INSERT INTO
On Tue, 27 Nov 2001 17:43, Craig Vincent wrote:
snip
What have I done wrong in such a simple bit of code?
-
htmlheadtitle/title/head
body
?
$browser = $HTTP_USER_AGENT;
$ip = $REMOTE_ADDR ;
$db = mysql_connect ( localhost , username , password );
mysql_select_db
print split(=,$testString)[0];
First, using split() on such a simple delimiter is a waste. Use
explode(). And yes, PHP does not support automatic dereferencing of
returned arrays like that.
-Rasmus
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
I've come across this problem enough that I want to find out if there's a
way to make it work, or if this is just a limitation of PHP. Here's what
I'm trying to do:
print split(=,$testString)[0];
This gives me a syntax error. I've also tried:
print (split(=,$testString))[0];
Along with
...
jack
-Original Message-
From: Ray Van Dolson [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 14, 2001 10:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Why doesn't this work?
I've come across this problem enough that I want to find out if there's a
way to make it work, or if this is just
Hi,
Maybe someone can take a look at the script below and tell how to make the
bottom part work
the same way the top part works. The top part (select box) works where the one
item chosen is
written to a hidden file and passed on to the next page, then on and on through
several more
pages and
s
[EMAIL PROTECTED]
Simrad, Inc
Lynnwood, WA
425-712-1138
"There is no reason anyone would want a computer in their home."
--Ken Olson, president, chairman and founder of Digital Equipment
Corp., 1977
(-- Then why do I have nine? Somebody help me!)
Please respond to [EMAIL PR
30 matches
Mail list logo