FRIHOST • FORUMS • SEARCH • FAQ • TOS • BLOGS • COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PHP Question





idolztheunknown
Can an entire site be typed with pure PHP Question
quick_basic
You cant code the layout with php I think. But I might be wrong and do you mean EVERYTHING in php with no html/css ect.
Rhysige
though it is possible it woud be beyond extremely dodgy, PHP is not designed for full site coding it is designed as the programming and data support for HTML pages which in addition can use css.
webbone
you need other web language,like css to design web style and html to make basic web frame and javascript to make good effect for client!
photon
i dont think a stand alone php site will be functional. html is absolutely needed for basic page design
mathiaus
php is a programming language. It creates a program to do tasks. It doesnt format text or anything so not really.
On the other hand though without using html/css you can display just text but without these two you cannot have anything else such as tables, colours, links etc.

Wink
dandelion
idolztheunknown wrote:
Can an entire site be typed with pure PHP Question

Well, you can generate all HTML/CSS/Javascript output with PHP. In some cases it may be quite reasonable. Wink

There is a bunkle of PEAR::HTML packages producing various HTML content such as tables, forms, and even whole pages.
threezeroone
is it possible to insert a PHP tag inside a javascript and combine them like combining HTML and PHP?
sonam
Last month I have one question because I want run PHP script with users local time. Because, PHP haven’t possibility to get users local time I am using few lines of JavaScript. In that time I find out that is possible to pass values from PHP to JavaScript, but not from JavaScript to PHP.

Passing values from PHP to JavaScript:

Quote:
<?php $a = 2; ?>
<script type="text/javascript">
<!—
var a = <?php echo $a;?>;
//-->
</script>


or

Quote:
<?php $a = 2;
echo "<script type=\"text/javascript\">
<!—var
a = $a;
//-->
</script>";



But this is not solved my problem. After little experiment (because my JavaScript knowledge are very poor), I solved problem with small peace of PHP and JavaScript on the top of my page. If is claimed information's empty JavaScript redirect users to the same page with information's in address bar. Wink


Quote:
$time = $_GET['time'];
$h = $_GET['h'];

if(empty($h)){
echo '<SCRIPT LANGUAGE="JavaScript">
<!--
var now = new Date();
var y = now.toTimeString();
window.location="?time="+y+"&&h=yes";
//-->
</script>';
exit;
} else {
…



Sonam
mattd8752
You "COULD" do pure php websites, but they are quite small. You can't put in much format. You wouldn't be able to have any links. You could do a single page with php, but it would be all images and unformated text.
thnn
It isnt actually a good idea to use PHP for your whole site, as it puts a lot of strain on servers and your loding time would be really slow because PHP has to read all your code and then output it as HTML.
JustaMin
You can absolutely write a whole site in PHP with the exact same content and functionality as HTML by echoing out markup, but th question is why would you. It only takes 2 characters to switch in and out of PHP, it would be madness to echo all your markup and run it through the php parser.
mathiaus
JustaMin wrote:
You can absolutely write a whole site in PHP with the exact same content and functionality as HTML by echoing out markup, but th question is why would you. It only takes 2 characters to switch in and out of PHP, it would be madness to echo all your markup and run it through the php parser.

by echoing markup your still using something other than just PHP aren't you.

Anyway to finalise this topic as its now starting to get spammy.
Yes you can but all you will get is plain text with no formatting so it would be stupid. Use HTML and/or css.

-close-
Related topics
php question
JSP and PHP Question
PHP Question
a grouping question?
PHP question
PHP question, $_SESSION[] gets changes to by $_POST var
PHP Question - Solved
PHP Question: '.../something.php/something_else.png'
Need help with a HTML / PHP question.
A quick PHP Question! You know the answer! Answer ASAP .
Simple PHP question...
O'calhoun's reusable stupid php question thread [NEW]
MySQL and PHP Question
PHP question about passing variables (noob)
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.