View Single Post
Old 05-04-2005, 08:27 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,470
sde is on a distinguished road
1. why do you need the about us button to link to an include file?

the function include() will make it as if the page that you are including is in the same script that you are calling the function. it would be like copying the contents of about.inc.php and pasting it in the href tag where you did.

it seems like you just need an aboutus.php page and just link to it normally like you would any other html file.

<a href=aboutus.php><img src=aboutus.gif></a>

#2 sorta goes along with the same logic. reasons for using includes are usually so you don't have to maintain the same code in various parts of the site. for example, i might make a database connection include file. i use a database connection on every page, but i make it an include so if i ever need to change my connection information, it updates on every page that it was included in.

for question2, you could go about it a couple different ways. the easiest is probably to do the processing on the same page and submit the form to itself. see the example below:
PHP Code:
<?
if($_POST){
  
// do the processing code here
}
?>
<form method=post action=<?=$_SERVER['PHP_SELF']?>>
<input type=text name=somefield> <input type=button name=submit value=submit>
</form>
in the processing area of that code, you could do whatever you want .. and you could even do an if/else to determine if you want to show that form or not.

alternatively, you could make the action of the form submit to a seperate page. in that case, your processing logic would be in that target page.
__________________
Mike
sde is offline   Reply With Quote