473,386 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

#including

How do I include a php file with arguments in a shtml file? It just gives me
an error. Can this be done?
Jul 17 '05 #1
7 2010
In article <2y*****************@news.indigo.ie>, no@no.ie says...
How do I include a php file with arguments in a shtml file? It just gives me
an error. Can this be done?


yes if you set the shtml file to parse as a php file.

--
**************************************
The Eldritch Dark:
Dedicated to Clark Ashton Smith
http://www.eldritchdark.com/
Jul 17 '05 #2

"Boyd" <bo**@dont.spam.me> wrote in message
news:MP************************@news.slingshot.co. nz...
In article <2y*****************@news.indigo.ie>, no@no.ie says...
How do I include a php file with arguments in a shtml file? It just gives me an error. Can this be done?


yes if you set the shtml file to parse as a php file.

--
**************************************
The Eldritch Dark:
Dedicated to Clark Ashton Smith
http://www.eldritchdark.com/


can you please explain how to do this?
Jul 17 '05 #3
It might be easier to rename the file to .php and use the equivalent parts
in php rather than .shtml
--
Mike Bradley
http://www.gzentools.com -- free online php tools
"Joe Cybernet" <no@no.ie> wrote in message
news:2y*****************@news.indigo.ie...
How do I include a php file with arguments in a shtml file? It just gives me an error. Can this be done?

Jul 17 '05 #4
Yeah I dont mind doing that, but if I use the include() function, it gives
me an error msg if I include any arguments. For example if I have a file
called ad.php and i include the line

<?include("ad.php")?>

It works fine. But if I chang it to

<?include("ad.php?id=2")?>

I get an errormessage.
"CountScubula" <me@scantek.hotmail.com> wrote in message
news:P8****************@newssvr29.news.prodigy.com ...
It might be easier to rename the file to .php and use the equivalent parts
in php rather than .shtml
--
Mike Bradley
http://www.gzentools.com -- free online php tools
"Joe Cybernet" <no@no.ie> wrote in message
news:2y*****************@news.indigo.ie...
How do I include a php file with arguments in a shtml file? It just
gives me
an error. Can this be done?


Jul 17 '05 #5
if you want to do something like
<?php
include("ad.php?id=2");
?>

rewrite it like this
<?php
$id = 2;
include("ad.php");
?>

the variable $id will automaticaly be available to your included ad.php
script, it is included as if it were part of the original source

--
Mike Bradley
http://www.gzentools.com -- free online php tools
"Joe Cybernet" <no****@eircom.net> wrote in message
news:w8*****************@news.indigo.ie...
Yeah I dont mind doing that, but if I use the include() function, it gives
me an error msg if I include any arguments. For example if I have a file
called ad.php and i include the line

<?include("ad.php")?>

It works fine. But if I chang it to
I get an errormessage.
"CountScubula" <me@scantek.hotmail.com> wrote in message
news:P8****************@newssvr29.news.prodigy.com ...
It might be easier to rename the file to .php and use the equivalent parts in php rather than .shtml
--
Mike Bradley
http://www.gzentools.com -- free online php tools
"Joe Cybernet" <no@no.ie> wrote in message
news:2y*****************@news.indigo.ie...
How do I include a php file with arguments in a shtml file? It just

gives
me
an error. Can this be done?



Jul 17 '05 #6
The syntax is <!--#include virtual="/something/counter.php?cow=500" -->.

Uzytkownik "Joe Cybernet" <no@no.ie> napisal w wiadomosci
news:2y*****************@news.indigo.ie...
How do I include a php file with arguments in a shtml file? It just gives me an error. Can this be done?

Jul 17 '05 #7
In article <Ue*****************@news.indigo.ie>, no@no.ie says...

"Boyd" <bo**@dont.spam.me> wrote in message
news:MP************************@news.slingshot.co. nz...
In article <2y*****************@news.indigo.ie>, no@no.ie says...
How do I include a php file with arguments in a shtml file? It just gives me an error. Can this be done?


yes if you set the shtml file to parse as a php file.


can you please explain how to do this?

Add:
AddType application/x-httpd-php .shtml
in your .htaccess file

--
**************************************
The Eldritch Dark:
Dedicated to Clark Ashton Smith
http://www.eldritchdark.com/
Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Theo | last post by:
Just a quick question... When including a page inside another (include('page.php')), is it bad for the second document to also have <head> and <body> tags etc? Im using iframes currently, and it...
4
by: WindAndWaves | last post by:
Hi Gurus I hope I am going to make sense with this question: I have an html page that I have turned into a php page with a bit of php code above the html (connect to database, massage data a...
2
by: Stanimir Stamenkov | last post by:
I'm trying to find out if it is permissible to include a schema document with absent target namespace to a schema with specified target namespace, and if it is, what are the rules to resolve the...
5
by: hntgzr | last post by:
I am trying to include a function in a .php file on a different server from the main .php files. I am using: include_path=http://www.anotherserver.com/foldername;...
3
by: Daniel Xiao | last post by:
I intend to establish a setup project including one or multiple windows service project(s). The outcome package should be SELF-INSTALLABLE on a separate Windows 2003 PC. How to do? *** Sent...
5
by: Bijoy Naick | last post by:
I'm using the MailMessage and SmtpMail classes to send HTML emails from my website. Just wondering if there is a way to include graphics with the email, which I can reference in the HTML.
2
by: Craig | last post by:
Is there a way to conditionally include a file in the HTML? <TD> if x= 1 then <!--#INCLUDE FILE="../File1"--> else <!--#INCLUDE FILE="../File2"--> end if
4
by: Husam | last post by:
Hi Every Body: How can I add the .Net Framework to my setup project? any help will be appreciated. Regard's Husam
8
by: John Salerno | last post by:
I was just thinking, since Python 3.0 is supposed to clean up a lot of the unnecessary or redundant features of Python and make other things more streamlined, does it seem to anyone that including...
5
by: =?Utf-8?B?SmltbWVy?= | last post by:
Hello, I've been trying to create a WCF SOAP Router Service that can forward not just the message body but also any security headers set by the originator of the message. The destination service...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.