Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 23rd, 2007, 7:43 AM   #1
teishu
Programmer
 
Join Date: May 2006
Posts: 49
Rep Power: 0 teishu is on a distinguished road
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)/","&nbsp;<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
why is the function not recognised ? any help would be appreciated.

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 !
teishu is offline   Reply With Quote
Old Jun 23rd, 2007, 9:03 AM   #2
Styx
Programmer
 
Join Date: Mar 2007
Posts: 39
Rep Power: 0 Styx is on a distinguished road
It probably deals with your include statement. Try your include based on a relative path instead of a url.
Styx is offline   Reply With Quote
Old Jun 23rd, 2007, 10:36 AM   #3
teishu
Programmer
 
Join Date: May 2006
Posts: 49
Rep Power: 0 teishu is on a distinguished road
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 !
teishu is offline   Reply With Quote
Old Jun 23rd, 2007, 10:36 AM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Jun 24th, 2007, 12:10 PM   #5
Mocker
Hobbyist Programmer
 
Mocker's Avatar
 
Join Date: Oct 2005
Location: Indiana
Posts: 202
Rep Power: 0 Mocker is an unknown quantity at this point
Send a message via AIM to Mocker
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
Mocker is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:17 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC