help...php in html
Home
Welcome, Guest. Please login or register.
Did you miss your activation email?

 



donations help testmy.net pay for the very high cost to run the site. Any amount is greatly appreciated.
Click to read why...

  spcr
    
News : smitten remember, testmy.net loves you!  Show your love back and tell your friends about our great community!  We rely 100% on word of mouth advertising, so if you find that the site is useful, tell a friend!  ~ Thanks!  cheesy November 20, 2009, 11:38:37 PM
testmy.net Broadband  |  Main Forum  |  General Discussion  |  Topic: help...php in html Advanced search

Recommended Tests

Click here to run a free Performance Scan   TIP: Test how fast your system is really running
   Free Performance Scan
Click here to run a Free PC Error Scan    TIP: Test how many system errors your PC has
   Free PC Error Scan


Note: The links above are sponsored links
  0 Members and 1 Guest are viewing this topic. « previous next »
Pages 1 2  All Go Down
Author
Topic: help...php in html  (Read 3339 times)
disturbed
News Anchor
TMN Veteran
*
Offline Offline

Posts: 2099


I am and always will be disturbed.


View Profile
« on: April 04, 2008, 04:30:32 PM »

I'm just now learning some php.

I'm getting some basic ideas of how it works and its going well...but I just cannot figure out why echo-ing php in html doesn't work....

If I have a php file with this contents:
echo "test echo";
$blah="display blah";
echo $blah;

and I run the file, it works great.

However, if I put in the same code inline with html code by:

<?php
echo "test echo";
$blah="display blah";
echo $blah;
?>

....nothing.  Empty.  Nothing gets displayed.


Why is this?  Also, because of this I cannot figure out how to use variables from php in html...same issue I believe.
Logged

Are you down with the sickness !?

[ http://hackaday.com ]
mudmanc4
Ɠξξ₭ òƒ Ɠξξ₭z
Global Moderator
TMN Seasoned Veteran
*
Online Online

Gender: Male
Posts: 6524



View Profile WWW
« Reply #1 on: April 04, 2008, 04:46:01 PM »

You need to enable error reporting and/or display errors in php.ini.
Logged



Don't do what others say - listen to them, but do what you feel good doing. ~ Warren Buffet
disturbed
News Anchor
TMN Veteran
*
Offline Offline

Posts: 2099


I am and always will be disturbed.


View Profile
« Reply #2 on: April 04, 2008, 04:56:05 PM »

tried that....made a php.ini and put it in the same folder as my script....still the same outcome
Logged

Are you down with the sickness !?

[ http://hackaday.com ]
mudmanc4
Ɠξξ₭ òƒ Ɠξξ₭z
Global Moderator
TMN Seasoned Veteran
*
Online Online

Gender: Male
Posts: 6524



View Profile WWW
« Reply #3 on: April 04, 2008, 04:58:12 PM »

tried that....made a php.ini and put it in the same folder as my script....still the same outcome
Create a php.ini in your cgi-bin directory right?
Logged



Don't do what others say - listen to them, but do what you feel good doing. ~ Warren Buffet
disturbed
News Anchor
TMN Veteran
*
Offline Offline

Posts: 2099


I am and always will be disturbed.


View Profile
« Reply #4 on: April 04, 2008, 05:04:33 PM »

I tried both the location where my .html file is that I am trying to run and now the cgi-bin as well.  Nothing.
Logged

Are you down with the sickness !?

[ http://hackaday.com ]
mudmanc4
Ɠξξ₭ òƒ Ɠξξ₭z
Global Moderator
TMN Seasoned Veteran
*
Online Online

Gender: Male
Posts: 6524



View Profile WWW
« Reply #5 on: April 04, 2008, 05:08:08 PM »

Do you have " display_errors " turned on?

 Since it is a syntax error , nothing will execute there fore no errors, did you check the logfile?
Logged



Don't do what others say - listen to them, but do what you feel good doing. ~ Warren Buffet
disturbed
News Anchor
TMN Veteran
*
Offline Offline

Posts: 2099


I am and always will be disturbed.


View Profile
« Reply #6 on: April 04, 2008, 05:12:10 PM »

Yes, I did both:
error_reporting(E_ALL);
ini_set('display_errors', '1');

No errors within the erorr log.  It's empty.
Logged

Are you down with the sickness !?

[ http://hackaday.com ]
mudmanc4
Ɠξξ₭ òƒ Ɠξξ₭z
Global Moderator
TMN Seasoned Veteran
*
Online Online

Gender: Male
Posts: 6524



View Profile WWW
« Reply #7 on: April 04, 2008, 05:20:21 PM »

Yes, I did both:
error_reporting(E_ALL);
ini_set('display_errors', '1');

No errors within the erorr log.  It's empty.
Shouldn't the ini_set('display_errors', '1'); look like   ini_set('display_errors', 'on' " , or does "1" represent on ?
Logged



Don't do what others say - listen to them, but do what you feel good doing. ~ Warren Buffet
disturbed
News Anchor
TMN Veteran
*
Offline Offline

Posts: 2099


I am and always will be disturbed.


View Profile
« Reply #8 on: April 04, 2008, 05:23:18 PM »

yes, 1 is on....

Wierd thing is...within html when I use the <?php ....

not even the print "something"; works

.......argh....
Logged

Are you down with the sickness !?

[ http://hackaday.com ]
mudmanc4
Ɠξξ₭ òƒ Ɠξξ₭z
Global Moderator
TMN Seasoned Veteran
*
Online Online

Gender: Male
Posts: 6524



View Profile WWW
« Reply #9 on: April 04, 2008, 05:31:33 PM »

yes, 1 is on....

Wierd thing is...within html when I use the <?php ....

not even the print "something"; works

.......argh....
Is apache running? hahahaa
Logged



Don't do what others say - listen to them, but do what you feel good doing. ~ Warren Buffet
disturbed
News Anchor
TMN Veteran
*
Offline Offline

Posts: 2099


I am and always will be disturbed.


View Profile
« Reply #10 on: April 04, 2008, 05:39:23 PM »

lol...everything is up and running
Logged

Are you down with the sickness !?

[ http://hackaday.com ]
disturbed
News Anchor
TMN Veteran
*
Offline Offline

Posts: 2099


I am and always will be disturbed.


View Profile
« Reply #11 on: April 04, 2008, 05:39:47 PM »

.....i can echo and print all I want from within php scripts....just not html....
Logged

Are you down with the sickness !?

[ http://hackaday.com ]
nanobot
News Anchor
TMN Friend
*
Online Online

Gender: Male
Posts: 329



View Profile WWW
« Reply #12 on: April 04, 2008, 05:44:12 PM »

See if this helps:

http://www.desilva.biz/php/phpinhtml.html
Logged



92% of the teenage population has switched to rap. If you are in the 8% who ROCKS, copy & paste this in your signature
disturbed
News Anchor
TMN Veteran
*
Offline Offline

Posts: 2099


I am and always will be disturbed.


View Profile
« Reply #13 on: April 04, 2008, 05:59:35 PM »

Well, when I do that I get:

Premature end of script headers ERROR in the log.
Logged

Are you down with the sickness !?

[ http://hackaday.com ]
nanobot
News Anchor
TMN Friend
*
Online Online

Gender: Male
Posts: 329



View Profile WWW
« Reply #14 on: April 04, 2008, 06:02:24 PM »

Try:

<?php echo "test echo"; ?>

With all the edits the page said to do.
Logged



92% of the teenage population has switched to rap. If you are in the 8% who ROCKS, copy & paste this in your signature
Print  Pages 1 2  All Go Up
testmy.net Broadband  |  Main Forum  |  General Discussion  |  Topic: help...php in html « previous next »
Jump to:  

    
testmy.net's forum is proudly Powered by SMF | SMF © 2006-2007, Simple Machines LLC
Bookmark: Del.icio.us    StumbleUpon
 
 

 

© 1999-2009 testmy.net - Contact - Legal - Facts & FAQs
Page Loading Stats: This forum Page created in 0.113 seconds with 52 queries.