Computer Forums PHP & HTML

 06-05-2006, 10:58 PM #1 In Runtime   Join Date: May 2006 Posts: 148 Php & Html Can I insert this html code in a php file that says this? Thanks! __________________ __________________
 06-06-2006, 04:58 AM #2 Site Team     Join Date: Mar 2004 Posts: 8,098 Re: PHP & HTML Yes... Code:  "; redirect($settings['opening_page']); ?> But I'm not really sure I get why you would do this since as soon as the page is loaded it redirects to another page. Code: redirect($settings['opening_page']); __________________ __________________ I didn’t fight my way to the top of the food chain to be a vegetarian… Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns. "The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
 06-06-2006, 10:22 AM #3 In Runtime   Join Date: May 2006 Posts: 148 Re: PHP & HTML Thanks! So if I ever have to do it again, I would type in Code: print "code" right? __________________
 06-06-2006, 10:31 AM #4 Site Team     Join Date: Mar 2004 Posts: 8,098 Re: PHP & HTML yes.. you use either print "code"; or echo 'code'; but bear in mind that whenever you open a statement with print " <-quote, it ends with another quote so it you have quote marks in the code they have to be escaped with the escape char \ so this won't work print ""; but this will print ""; __________________ I didn’t fight my way to the top of the food chain to be a vegetarian… Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns. "The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
06-06-2006, 10:43 AM   #5
In Runtime

Join Date: May 2006
Posts: 148
Re: PHP & HTML

I followed your instructions and put this:
Code:
print "<!-- Start of StatCounter Code -->
<script type=\text/javascript\ language=\javascript\>
var sc_project=1621564;
var sc_invisible=1;
var sc_partition=15;
var sc_security="578f130d\;
</script>

<script type=\text/javascript\ language=\javascript\ src=\http://www.statcounter.com/counter/counter.js\></script><noscript><img  src=\http://c16.statcounter.com/counter.php?sc_project=1621564&java=0&security=578f130d&invisible=0\ alt=\simple hit counter\ border=\0\> </noscript>
<!-- End of StatCounter Code -->"
in a php file. Now I get an error that says "
Parse error: parse error, unexpected T_LNUMBER in /home/www/runekillerz.awardspace.com/phpBB2/index.php on line 475". When I take out the code, it works just fine but when I put it back in it does not. What did I do wrong? What you gave me in the first reply works fine.

I tried the wrong way of what you wrote here
Quote:
 so this won't work print ""; but this will print "";
The php file works just fine when I use this method
Code:
print "<img src="example.jpg">";
and not this method
Code:
print "<img src=\"example.jpg\">";
__________________

06-06-2006, 03:37 PM   #6
Site Team

Join Date: Mar 2004
Posts: 8,098
Re: PHP & HTML

The error refers to the fact that the script has found something that it didn't expect, for example if you miss a semi colon from the end of a statement you'll get an error like that, since the script interperetor expects a semi colon, or a boolean opperator to tie some functions together.
alternativly the error could be caused by missing a escape charector before a quote mark, since the script interperator assumes thats the end of the statement, and again expects a semi colon.

Quote:
 print " "
I can tell you that if that's the code, then it's most likely that you've missed the semi colon from the end.

however, I don't quite understand why you've removed all the quote marks, (and left in the escape chars).
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."

 06-06-2006, 10:29 PM #7 In Runtime   Join Date: May 2006 Posts: 148 Re: PHP & HTML So this would be right? Code: print " "; __________________
 06-07-2006, 04:37 AM #8 Site Team     Join Date: Mar 2004 Posts: 8,098 Re: PHP & HTML yes. __________________ I didn’t fight my way to the top of the food chain to be a vegetarian… Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns. "The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
 06-07-2006, 10:37 PM #9 In Runtime   Join Date: May 2006 Posts: 148 Re: PHP & HTML Thanks! __________________ __________________