Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 08-22-2007, 10:41 AM xhtml strict & PHP
Korzonek's Avatar
Skilled Talker

Posts: 60
Name: Michael
Location: Warsaw
Trades: 0
Dose any one know how to mix them together??I've tried every combination I could think of, and I could find,but still I cant get it working.

(I want to fit a news script(phpnews) on to my page)

Or maybe somebody knows a php news script working in xhtml strict??
Korzonek is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-22-2007, 12:02 PM Re: xhtml strict & PHP
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
Erm... Ok sorry but im going to be a bit blunt, if you dont know you shouldnt be learning PHP...

XHTML is just the language which marks up PHP output.

to send soemthing to the browser u use echo or print

so

PHP Code:
<?php
 
echo 'This is plain text';
 
echo 
'<span style="color: #000; font-weight: bold;">this text is styled with xhtml/css</span>';
 
?>
so thats how to send text/xhtml to browser.

but if u used it "combined" with php it would be the same so like

PHP Code:
<?php
 
if($lang == 'english')
{
echo 
'welcome';
}
elseif(
$lang == 'french')
{
echo 
'bonjour';
}
else 
{
echo 
'Please select language or somin.';
}
?>
if u explain further and give a example i might be able to help you more.
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 08-22-2007, 12:37 PM Re: xhtml strict & PHP
Korzonek's Avatar
Skilled Talker

Posts: 60
Name: Michael
Location: Warsaw
Trades: 0
I want to have this in my page:
<?php
include("news/news.php");
?>

but It's not working...I should see some news, but on the page I've got a blank spot....

The page is vaild xhtml strict.

This is my source if it helps.:

<?xml version="1.0" encoding="iso-8859-2"?>
<!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" xml:lang="pl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />

<title>Socjologia.net.pl</title>

<meta name="Title" content="Socjologia.net.pl"/>

<meta name="Author" content="Schizofrenia.net.pl"/>

<meta name="Subject" content="Socjologia"/>

<meta name="Description" content=""/>

<meta name="robots" content="index,follow"/>

<meta name="Keywords" content=""/>

<link rel="stylesheet" href="/css/index.css" type="text/css"/>

</head>

<body>

<div class="container">
<div class="baner">
<img src="/Images/baner4.png" alt="Baner" />
</div>
<div class="main">


<div class="left">

aaaaaaaa<br/>
aaaaaaaa<br/>
aaaaaaaa<br/>
aaaaaaaa<br/>
aaaaaaaa<br/>
aaaaaaaa<br/>
aaaaaaaa<br/>
aaaaaaaa<br/>
aaaaaaaa<br/>

</div>

<div class="center">
aaaaaa<br/>

And I want to place the news here

</div>
<div class="right">
aaaa
</div>
<div class="right2">
aaaa
</div>
</div>


<!--Stopka-->

</div>
</body>

</html>

Last edited by Korzonek; 08-22-2007 at 12:41 PM..
Korzonek is offline
Reply With Quote
View Public Profile
 
Old 08-22-2007, 04:08 PM Re: xhtml strict & PHP
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
send a link to this

and try with single quotes

include('news/news.php');

could be the xml thing at the top. remove it and retry
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 08-23-2007, 09:41 AM Re: xhtml strict & PHP
Korzonek's Avatar
Skilled Talker

Posts: 60
Name: Michael
Location: Warsaw
Trades: 0
single quotes or removing the "xml version" isn't working...
link to the page:www.socjologia.net.pl

Maybe its "Doctype" fault or something.....?? In HTML 4 it worked really fine...or maybe I should change the script or so...I even looked through the web looking for usage of <?php include(.Webmaster-Talk.com - Reply to Topic..)> but it seems that they do it differently...
Even if you look up the php news project page :http://newsphp.sourceforge.net/

and view the source the only script they use on it is java script...or maybe I'm blind.

I've spend last two day looking for some info how to mix xhtml strict and php cause the "normal way" isn't working and its pretty depressing....
Korzonek is offline
Reply With Quote
View Public Profile
 
Old 08-23-2007, 10:52 AM Re: xhtml strict & PHP
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Your file is not being parsed by the php engine.
Did you changed the file extension to html, or htm ?

The PHP engine base itself on the file extension to choose which files he will parse and which he won't.
Simply rename the file to index.php, and the script will run again.

Note that the extension have nothing to do upon the mode the browser renders the page. It's altered by the headers sent by the server upon a request from the browser and the content of the page.
__________________
Only a biker knows why a dog sticks his head out the window.

Last edited by tripy; 08-23-2007 at 10:54 AM..
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 08-23-2007, 11:55 AM Re: xhtml strict & PHP
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
I was just about so say that i look at his code and it has this:
Code:
<?php
include(" news/news.php");
?>
and i was like (slaps hand on head)

Lol...

ok you can just rename the file to .php or if you so wish you can set it up to also parse .html files.
or in fact if u wanted you could tell it to parse file.someweirdreallylongextwhichiwantphptoparse ... but i would advise against it

Dan
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 09-01-2007, 05:23 AM Re: xhtml strict & PHP
Korzonek's Avatar
Skilled Talker

Posts: 60
Name: Michael
Location: Warsaw
Trades: 0
Dam it...I've just got back from a short vacation read your reply and realized that I'm realy dumb.... everything works, thx for help...
Korzonek is offline
Reply With Quote
View Public Profile
 
Old 09-01-2007, 10:27 AM Re: xhtml strict & PHP
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
hehe... its always the simple things like it actually being parsed that trip you up

Talkupation Apprrieciated

Dam
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Reply     « Reply to xhtml strict & PHP
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45316 seconds with 12 queries