![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: May 2006
Posts: 49
Rep Power: 0
![]() |
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 5 thanks
__________________
Intel Pentium M 1.73Ghz -- Sony Vaio -- 1024MB Ram -- Ubuntu 8.04 AMD Athlon X2 4200+ -- Asus V3-M2V890 -- 2GB Kingston -- Vista Ultimate 32bit Intel C2D E4400 -- 2048MB GeIL - Windows XP SP2 ASCII stupid question, get a stupid ANSI ! |
|
|
|
|
|
#2 |
|
Programmer
Join Date: Mar 2007
Posts: 39
Rep Power: 0
![]() |
It probably deals with your include statement. Try your include based on a relative path instead of a url.
|
|
|
|
|
|
#3 |
|
Programmer
Join Date: May 2006
Posts: 49
Rep Power: 0
![]() |
well i dosen't come up with the error now.. thanks
__________________
Intel Pentium M 1.73Ghz -- Sony Vaio -- 1024MB Ram -- Ubuntu 8.04 AMD Athlon X2 4200+ -- Asus V3-M2V890 -- 2GB Kingston -- Vista Ultimate 32bit Intel C2D E4400 -- 2048MB GeIL - Windows XP SP2 ASCII stupid question, get a stupid ANSI ! |
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
|
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.
__________________
#programmingforums relay - http://thegupstudio.com/cgi-bin/pforelay.cgi freelance scripts - http://ryanguthrie.com/index.html |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Contact form | ITcon | HTML / XHTML / CSS | 4 | Aug 21st, 2007 12:21 AM |
| FFT DWTIB -> Optimization -> Choosing An Appropriate Run Time | Sane | Software Design and Algorithms | 7 | Dec 1st, 2006 10:40 AM |
| Problem adding/removing rows to a form. | blasterstudios | JavaScript and Client-Side Browser Scripting | 11 | May 5th, 2006 3:44 PM |
| PHP E-mail form problem | MrMan9879 | PHP | 20 | Feb 6th, 2006 8:32 AM |
| Form Code problem | bulio | PHP | 6 | Jul 12th, 2005 1:05 PM |