Page 1 of 1

Embedding PHP Code in HTML

Posted: Thu Oct 06, 2005 1:34 pm
by Barry16801
I'm new to PHP scripting and MySql. I'm working on a database now. I
purchased the "Build your own database driven website using Php &
MySql" book and it's great. But I'm trying to do something that isn't
working and I'm not sure why. I created an HTML file that is really
just a "wrapper" for my php script. In the BODY of the html file, I
just included my php scripting with the appropriate tags <?php and ?>

But it doesn't work. If I put the EXACT Same code in a separate file
and then put a button on my page that has an onsubmit of the php file,
it works. I don't want to user to have to do this. The PHP script is
running a query on the MYSQL database and creating a table dynamically
of the information in the table. I want this to happen when the page
loads.. not have the user hit a button to continue loading the page. I
can provide examples if need be.. but I'm thinking it's just something
stupid I'm doing or not doing.

Any help would be GREATLY appreciated.

Thanks

Posted: Thu Oct 06, 2005 2:03 pm
by infolock
if when you did this it outputed the actual php tags on the browser screen, you don't have php installed/configured correctly.

if you do have it, and it reported an error, try posting the error.

in either case, post the code and we can go from there....