khaibar
Jun 19 2007, 05:53 PM
| | Hey ,
In the note pad, I put the proper code for php
<?php
?>
and save the file as name.php
But i can't put that file in html. This is a big problem since Iam trying to make an online text based game. Whats the code to put a
script inside a web page. And do i need any special software for it?
If so where can i download it?
Thanks for reading . |
Reply
TavoxPeru
Jun 19 2007, 10:11 PM
QUOTE(khaibar @ Jun 19 2007, 12:53 PM)  Hey  , In the note pad, I put the proper code for php <?php ?> and save the file as name.php But i can't put that file in html. This is a big problem since Iam trying to make an online text based game. Whats the code to put a script inside a web page. And do i need any special software for it? If so where can i download it? Thanks for reading  . You can't do this, instead what you do is to put the html code inside the php file, then in your browser when you run the php file you vie the output generated by. For example: CODE <?php // simple example ?> <html> <head> <?php echo "<title>Simple Example</title>\n"; ?> </head> <?php echo "<body style=\"margin:0 auto;color:#900;\">\n" . "<p>Simple Example<br />Other texts....</p>\n"; ?> </body> </html> Best regards,
Reply
FirefoxRocks
Jun 20 2007, 04:23 AM
Yes, PHP is designed to be integrated within HTML documents, with the file having a .php extension. So therefore, your code could look like this: CODE <?php // Some scripts can even come before the HTML part of the document, like session scripts. ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>My page with PHP scripts</title> </head> <body> <?php //Some scripts. ?> <p>A paragraph in HTML</p> <?php //Some more scripts. ?> <p>Well, you get the idea.</p> </body> </html> So you don't make separate files for the PHP code, you just add them in the page.
Reply
Habble
Jun 20 2007, 06:06 AM
Also, on most servers, you cannot put php scripts in .htm/.html files, although that can be changed. If you wish, you can make one .php file, and include other .php files in it, if you have a lot. E.g. CODE <html> <head> <title>Test Page</title> </head> <body> <p>There's some included scripts below this!</p> <?php include("[b]script.php[/b]"); ?> </body> </html> Replacing script.php with the filename of your .php file.
Reply
khaibar
Jun 20 2007, 12:14 PM
Thanks a lot guys  <quote> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"> </quote> Is that necessary O_o?
Reply
MediYama
Jun 20 2007, 06:14 PM
I would like to learn PHP to use it for my website, make it look fancy. But it seems to be really hard for me. Maybe I need to learn HTML a bit better... Would make a difference heh.
Reply
lonelym
Jun 21 2007, 10:53 AM
Maybe your server/host doesn't allow the <?php ?> ending. I'm not sure, but I remember being taught that it is in one of the .INI files of PHP.
Reply
FirefoxRocks
Jun 21 2007, 12:55 PM
QUOTE(khaibar @ Jun 20 2007, 07:14 AM)  Thanks a lot guys  <quote> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"> </quote> Is that necessary O_o? That is necessary for every HTML document that you have. the xml:lang and lang things in the <html> element just declares the document to be English, so those are optional. However, the simplest format are either: CODE <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> or stricter.... CODE <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> It is part of the HTML/XHTML standards and absolutely cannot be ignored, PHP or not. QUOTE(MediYama @ Jun 20 2007, 01:14 PM)  I would like to learn PHP to use it for my website, make it look fancy. But it seems to be really hard for me. Maybe I need to learn HTML a bit better... Would make a difference heh. Yes, I recommend having an average knowledge of XHTML before integrating PHP. Seems a lot easier  QUOTE(lonelym @ Jun 21 2007, 05:53 AM)  Maybe your server/host doesn't allow the <?php ?> ending. I'm not sure, but I remember being taught that it is in one of the .INI files of PHP. Astahost's servers are PHP and MySQL compatible. Unless you are on a non-PHP host, you should be able to execute PHP commands successfully.
Reply
TavoxPeru
Jun 22 2007, 04:08 AM
QUOTE(lonelym @ Jun 21 2007, 05:53 AM)  Maybe your server/host doesn't allow the <?php ?> ending. I'm not sure, but I remember being taught that it is in one of the .INI files of PHP. No, it is not a configuration variable of the php.ini file, the configuration variable that you can set is short_open_tag and the suggested setting of this variable is to always set this to Off and in your php files always use <?php. if you turn off this variable you cant be able to use the short tag <? and if your turn On you can be able to use both, <? and <?php. Best regards,
Reply
SilverFox
Jun 22 2007, 04:49 AM
I own an online text based game. Good luck, I hope it works. Download WAMP5 (google it to find it) and dev it locally I recommend for one. Using this you can build your project on your local PC, which is faster and more secure. It comes with SQL, Apache, PHP5 and PHPmyadmin and runs from your taskbar. You do not need a doc type. Simply echo PHHP. <?php echo "<html><head>..etc"; ?>
Reply
Latest Entries
TavoxPeru
Jun 27 2007, 05:12 AM
Searching for other stuff here at the PHP forum i found this topic that i think will help you: Introduction to PHPBest regards,
Reply
jlhaslip
Jun 25 2007, 12:28 AM
And a correct Doctype forces a Browser out of Quirks mode into a Standard Compliant mode, so use that Doctype is recommended for that reason. Otherwise, the Browser will 'guess' at the rendering of the page.
Reply
TavoxPeru
Jun 25 2007, 12:17 AM
QUOTE(FirefoxRocks @ Jun 23 2007, 01:53 PM)  Without a doctype, it will work. But do you seriously want pages to be invalid? No, of course not! We use a doctype to follow the HTML/XHTML standards (rules).  That's absolutely correct.
Reply
Recent Queries:--
post scripts for html - 147.14 hr back. (1)
Similar Topics
Keywords : scripts, html
- Indentation In Html
(4)
Style P And H? Html Tags
(2) Well, I have found that css was very hard to predict and precise control their apperance. When mix
and use the p and h? tags. Their apperaence were not identity. Place the h? tags within the p tag
causes style error on both firefox and IE. So, anyone should do it reserved, instead, place the p
tag with any h? tags will do the jobs on both browsers. Still learning it coz it much varies when
doing styles. Tested it on XHTML 1.0 Strict....
Yaml - (x)html/css Framework
(2) The YAML (Yet Another Multicolumn Layout) Framework is an excellent open source project that helps
you to create two or three columns (X)HTML/CSS floated layouts. This framework is very easy to use
and allows you to modifiy it to your own needs, this framework offers some tools for rapid
development of modern and accessible CSS layouts. QUOTE Yet Another Multicolumn Layout (YAML)
is an (X)HTML/CSS framework for creating modern and flexible floated layouts. The structure is
extremely versatile in its programming and absolutely accessible for end users. Based on w....
Sitepoint's Css And Html Reference Sites
(2) Recently the folks at SitePoint.com launched two excelent online reference sites for web designers
and developers, the first one is the SitePoint CSS Reference and the second one is the SitePoint
HTML Reference (Beta) . Both of them are free and available to anyone and everyone who needs to
lookup any information related to CSS and HTML in an easy and fast way. The SitePoint HTML
Reference (Beta) is still in progress. Also, both of them are very detailed and up-to-date on each
subject and are focused not only to beginners because they covers from general to advance....
Are There Imageless, Xml Compatable Css Corners Scripts?
(3) I am looking for a CSS Rounded Corners script that works with application/xml+html (I believe this
means not document.write), no images, javascript script that works in the main three or so browsers.
I've tried a lot, things like Curvey corners jump around a bit and need extra settings in the
head. I havn't seen many using bullet points, none through js.....
Html Emails How?
(12) How on earth do you create HTML emails? I have been searching Google for some time now and can find
ABSOLUTELY no information what so ever on how to ACTUALLY create HTML content emails. It just a
bunch of programs and Microsoft applications, or testing facilities, I don't need any of this,
there must be some coding system to it? I tried emailing using basic direct HTML tags (like ), but
it fails (it just shows ), so how can I do this? I am not looking for anything really fancy, I
just want to use some basic bolding and font changes and things to make it look a ....
Html Table Issue.
(18) Does anyone know how I might create a HTML table but using pure CSS (div's and what not). I
really have no idea why, but for some odd reason my layout goes nuts if I try to use the table tags,
even used properly with no errors the whole thing just brakes down (I don't use tables
anywhere). So I figured my only option is to attempt to do it CSS way if possible?....
About Html
(15) How long did it take you to learn Html?? It took me about 2months to learn the basics lmao. I need
a tuturial that has it all or a website.i would like it if someone did it. Thats why i get my
friends to help me /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0"
alt="biggrin.gif" /> But they are nice friends thats why. Like 2 people have helped me Sten and
Habble Sten Owns www.habbofront.com which uses Asta as its host and www.habble-aus.com which uses
Asta as its host. so this must be a good host because 2 good sites that have expert Htmlers so need
he....
Html Stats
(3) Do you know how to get website stats in a html code?? Like The amount of people viewing the site at
the moment and stuff like that?? because i need to know. Thanks if you reply to this i am in need
for it. /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" />....
Stretching My Site Vertically
Using CSS or HTML (6) I know it's possible, I've seen it one time. But I forgot. Many websites, if they hold more
content than there is room for in the minimum height, the site stretches vertically. How can I do
this? I only know that I need a background image of 1px height. Thanks in advance MediYama....
Firefox Inventing Its Own Html?
(9) I am building a website for a client. I finally have the animations and the site content the way i
want it. I updated the site via FTP, and IE displays it perfectly. Firefox however displays my "work
in progress" animations still, even though the index file references the new animation. I have
cleared cache, and even looked up the site on different computers, and on every one, FF displays
those darn rough draft animations while IE works perfectly. Any idea as to what is going on here?....
Quick Tips On Html And Css
(11) Here are just some general tips, helpers and time-savers for HTML and CSS. HTML Ideally, you should
be working under the XHTML 1.1 doctype specification. Some reasons: Improved semanticism - make use
of the elements available appropriately to convey the information as it was intended. Improved
understanding - because of an increase in semanticism, it's easier for your audience to
understand what your trying to convey. Cleaner code - due to the deprecation of some elements and
the strict requirements of nesting, closing and structure, your code becomes much cleane....
Bulletproof HTML: 37 Steps To Perfect Markup
Excellent article that highlights and answers most FAQ about HTML (4) Hi, i want to share with everybody this excellent article at sitepoint.com that i just read, it
highlights and answers most FAQ about HTML, it's very consice and simply and for me it is a must
to read. You can read it at Bulletproof HTML: 37 Steps to Perfect Markup . Best regards,....
Home Videos
html code for home video (4) I was wondering if anyone knows how to turn a home video that is saved on your computer to that of a
html code so I can put it onto my myspace page... Please if anyone at all knows how to do this
please please help me!!!!....
A First Peep Into Html
(5) Dear friends HTML is the building block of any web page. Without it no pages can be written though
there are some exceptions. Even you got to have some knowledge of HTML to write dynamic web
applications. An HTML file is a text file containing small markup tags The markup tags tell the Web
browser how to display the page An HTML file must have an htm or html file extension An HTML file
can be created using a simple text editor HTML is acronym of Hyper Text Markup Language. This time
I will discuss about HTML tags. Dear friends HTML is the building block of any web pa....
Where To Find A WML To HTML Converter ?
(2) hello people, i need to convert few wml codings to html.. I have found plenty of converter that
convert html to wap. But none of my use.. Please guide me.. Thanks in advance....
HTML: Seems Like A Simple Problem, But I'm Baffled!
(4) i got this one question...I have this page http://ebiztip.com/thankyou.html with an image of the
book not coming out.....the image is named chapterm-big.jpg...but the image just want to hide....i
swear there's nothing wrong with the html....or am I wrong???....
Two Cool Web-Design Scripts
(1) hi all, While wandering in internet for getting an idea about the design of my website. I came
across a very nice script for website title. Here i am sharing it with you guys: QUOTE
<script LANGUAGE="JavaScript"> var message = new Array(); message = ":: Sandeep Bhandari ::"
var reps = 5; var speed = 100; var p = message.length; var T = ""; var C = 0; var mC = 0; var s =
0; var sT = null; if (reps function doTheThing() { T = message ; A(); } function A() { s++; if (s >
8) { s = 1;} if (s == 1) { document.title = '.¸.·´¯`·.¸.·´¯`· '+T+' ¸.·´¯....
Need Help With The HTML HR Tag
(5) Hi, does anybody knows which is the equivalent tag in CSS of the HTML HR tag or how do i replace
this. I need this because the HR tag is deprecated and i wanna validate a website. The code that i
need to replace is this: QUOTE best regards,....
HTML Editor
(23) I am sick of using notepad to create my HTML pages and I want somthing better. Are there any
programs available that are easier to use than notepad for html editing. If so i wolud like to know
about them. Thanx....
How Can You Spice Up Your Basic HTML Site ? Beginner Needs Help
(9) Well im new to this,and i know a person who knows how to do HTML,I of course dont lol,but I was
wondering with html can you change the way the sites you make on here look and ect..(put flash in
and w/e..)....
Get Input From Html/txt File?
with just html/css and maybe javascript? (2) I was just wondering if it's possible to retrieve text (and maybe images) from a .html or .txt
file. So for example you get the header and footer from an external file. Is it possible with just
html/css and maybe a little javascript or does it require server side scripting like php???
-=jeroen=-....
Here Are Some Html Tutorial Sites
(1) I think here is a very good HTML Tutorial : Rolling Eyes
http://www.allfreetutorials.com/htmltutorials.htm Also very competent : Rolling Eyes
http://www.yourhtmlsource.com/ Adequate one : Rolling Eyes http://htmldog.com/ Take a look and
you'll get all answers about HTML, CSS and Java-scripting. Laughing....
Where Can I Learn Html Codes ?
html codes (8) does anyone know a good website with html codes?....
Html Background Tutorial
(2) Back grounds are very essential in html and if you dont know how you can make a background on your
website then there is no use of creating one . First well start with the basics . Color Background
: If you want to change your backgrounds color you put this code in the body of the page : CODE
<BODY BGCOLOR="######"> Where the ###### are you have to put a color code .
Just put that in and save your page and thats done . Image Backgrounds : The code below takes an
image and puts it on the background on the page : CODE <BODY BGCOLOR....
Where Can I Learn Advanced Html ?
(11) Well over a few years ive been picking up little bits of html and have slowly learnt quite a bit (to
my own surprise) But im still quite new and havnt found any sites that help much with advanced
html! /sad.gif' border='0' style='vertical-align:middle' alt='sad.gif' /> If anyone knows
of sites that show mainly advanced html and maybe even a bit of java could they plaese post it im
desperate CHEERS!! /biggrin.gif' border='0' style='vertical-align:middle'
alt='biggrin.gif' /> ....
Free Shoutbox? HTML, Flash or PHP Code
(24) does anyone know where i can find a free shoubox thats customisable? it can be in html, php or flash
format. thanks in advance paul....
Force Object To Load Last
html question (2) Alright html wizards...i've got a question ^_^ I assume that, like other programming codes, html
and php compilers read a code from top to bottom. Say I have a object though...and I want it to load
last...how do I do that? Let's just pretend I have an image that I do not want to load until
everything else on the webpage is loaded...how can I set that up? Is there perhaps a javascript code
for it...or maybe a CSS style I could add onto the object? Or better yet, is it possible to make
everything within a div/span/table tag load last? Another thing...if I leave an....
Embedding XML into HTML
(2) Hi, I am looking for a way to embed external rss/xml files into my html page, how/is this possible?....
Basic Tips and Tricks in HTML
(15) Here is some quick links for basic html coding... A quick and easy way to create your first web
page! -> The easiest HTML guide for beginners You'll learn how to create tables from real
examples. -> How to create TABLE? You will learn how to create frames from a real example.
You'll see how to create a borderless frame, how to specify the target frame, etc. -> How to
build FRAMES? Follow a few easy steps to add sound to your web pages. -> How to add sound to a
web page? This page tells you how to automatically load a visitor to another web p....
Looking for scripts, html
|
|
Searching Video's for scripts, html
|
advertisement
|
|