/    Sign up×
Community /Pin to ProfileBookmark

hi lads, i’m trouble with an error message that i can’t resolve. The error is on line 91 of this code, it would seem to be a syntax error but i can’t see it. Any takers?

I highlighted the area in question with the tag (line 91 error) in the code, but i feel the error maybe just before that…i’m not sure thou, i have only been using php steadily for about a month now. The error i receive is

[QUOTE]

Warning: Failed opening ‘join_form2.html’ for inclusion (include_path=’.;C:IBserverphpincludes;C:IBserverphppear’) in c:ibserverwwwpsaccountregister1.php on line 91

[/QUOTE]

all the files are in the same directory.

[code=php]<?

include ‘db.php’;

// Define post fields into simple variables
$first_name = $_POST[‘first_name’];
$last_name = $_POST[‘last_name’];
$email_address = $_POST[’email_address’];
$phone =$_POST[‘phone’];
$username = $_POST[‘username’];
$ccname = $_POST[‘ccname’];
$cctype = $_POST[‘cctype’];
$ccnum = $_POST[‘ccnum’];
$ccsec = $_POST[‘ccsec’];
$street = $_POST[‘street’];
$street2 = $_POST[‘street2’];
$city = $_POST[‘city’];
$country = $_POST[‘country’];
$month = $_POST[‘month’];
$year = $_POST[‘year’];

/* Do some error checking on the form posted fields */

function check_first_name($first_name){
if(!preg_match(“/[^a-zA-Z.-ßäÄüÜöÖ ]+$/s”,$first_name)) return TRUE;
else return FALSE;
}
if(!check_first_name($first_name)){
echo “Your first name should not contain any characters other than A-Z or a-z”;
//$error++; // $error=$error+1;
include ‘join_form2.html’;
exit();
}

function check_last_name($last_name){
if(!preg_match(“/[^^a-zA-Z.-ßäÄüÜöÖ ]+$/”,$last_name)) return TRUE;
else return FALSE;
}
if(!check_last_name($lasnt_name)){
echo “Your last name should not contain any characters other than A-Z or a-z”;
//$error++; // $error=$error+1;
include ‘join_form2.html’;
exit();
}

if((!$first_name) || (!$last_name) || (!$email_address) || (!$username)){
//(!$ccname) || (!$cctype) || (!$ccnum) || //(!$ccsec) || (!$month) || (!$year) || (!$street) || (!$street2) || (!$city) || (!$country) || (!$username)){
echo ‘You did not submit the following required information! <br />’;
if(!$first_name){
echo “First Name is a required field. Please enter it below.<br />”;
}
if(!$last_name){
echo “Last Name is a required field. Please enter it below.<br />”;
}
if(!$email_address){
echo “Email Address is a required field. Please enter it below.<br />”;
}
if(!$username){
echo “Desired Username is a required field. Please enter it below.<br />”;
}

if(!preg_match(‘/^[a-z]{5,15}$/i’, $username)){
echo “your username contains invalid characters. <br />”;
}

include ‘join_form2.html’; (line 91 error)
exit();
}

//error checking………more code after that…..[/code]

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@NogDogFeb 27.2006 — Either (1) join_form2.html does not exist (check spelling, including capitalization), (2) join_form2.html does not have read permission for the user under which PHP scripts are run on your server, or (3) join_form2.html exists but is in another directory other than those in your include path.
Copy linkTweet thisAlerts:
@MegatronauthorFeb 27.2006 — this is what is causing me so much problems

the html file is in the same directory as the php file and i have called the file in 2 other places within the code but it is only the 3rd instance of it that causes the error. I'm testing this locally so it wouldn't be a permisson problem

(congrats on 5000 posts ? )
Copy linkTweet thisAlerts:
@NogDogFeb 27.2006 — Is the script which is calling the include file itself being included from another file? If so, try giving a full path to the file it's trying to include. (If [i]everything[/i] is in the same directory, then never mind - but if not, sometimes it gets confusing when dealing with includes as to which directory is considered the current working dir.)
Copy linkTweet thisAlerts:
@MegatronauthorFeb 27.2006 — ok, i'll test it live on a server and see if it resolves the issue, thanks NogDog
×

Success!

Help @Megatron spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...