![]() |
contact form problem
hi i have the following process script in my websites root direct:
[php] <?php include("http://teishu.ndnhost.com/global.inc.php"); $errors=0; $error="The following errors occured while processing your form input.<ul>"; pt_register('POST','name'); pt_register('POST','email'); pt_register('POST','msg'); $msg=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $msg);pt_register('POST','ip'); pt_register('POST','os'); pt_register('POST','date'); pt_register('POST','webbrowser'); if($name=="" || $email=="" || $msg=="" ){ $errors=1; $error.="<li>You did not enter one or more of the required fields. Please go back and try again."; } if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email)){ $error.="<li>Invalid email address entered"; $errors=1; } $ip = $HTTP_SERVER_VARS["REMOTE_ADDR"]; $os = $HTTP_SERVER_VARS["HTTP_USER_AGENT"]; $date = date("l jS of F Y h:i:s A"); $webbrowser = $HTTP_SERVER_VARS["HTTP_USER_AGENT"]; if($errors==1) echo $error; else{ $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/")); $message="name: ".$name." email: ".$email." msg: ".$msg." ip: ".$ip." os: ".$os." date: ".$date." webbrowser: ".$webbrowser." "; $message = stripslashes($message); mail("jason@juphotography.co.uk","Contact message",$message,"From: phpFormGenerator"); header("Refresh: 0;url=http://www.juphotography.co.uk"); ?><?php } ?> [/php] im hosting another website for a freind in a dir in websites root directory, that also needs a contact form the same but it needs to send to a different email address so i copied the process.php file to the correct directory, it has the exact same contact.php file that sends the data to be processed. the one running in the root dir works, the one in the dir for my freind dosen't.. i get this error: :
Fatal error: Call to undefined function: pt_register() in /home/teishu/public_html/v8enhance/pages/process.php on line 5thanks |
It probably deals with your include statement. Try your include based on a relative path instead of a url.
|
well i dosen't come up with the error now.. thanks
|
Includes use the file system, not a url. You can use either a relative or a fixed path, but it needs to refer to the file system. There is probably a %root% (or %home% or similar) variable that represents your top directory.
|
PHP includes can handle url's as well as local paths, but only if the server configuration is set to allow it. On many hosts it is disabled. Also it will cost you unnecessary bandwidth if use remote locations where you could use local ones.
|
| All times are GMT -5. The time now is 2:44 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC