php inside html

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
To call a php script from inside an HTML page I use the href tag with a
link like .  This works but is it the
best way / only way?

Re: php inside html

Skijor wrote:
Quoted text here. Click to load it

You're problem is PHP is server-side.  To access a PHP script, you must  
submit a page to the server.  This script can then output information,  
redirect the user back to the original page or onto a completely new  
page.  See the header() function.

An alternative is AJAX, which uses Javascript to help you call scripts  
on the server.

But basically your webserver environment requires a different way of  
thinking - each page is separate from others.  Any requests to the  
server will load a new page (or frame), erasing what was previously  
there.  So if you want to show the data again, you need to display the  
page again.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline