Page 1 of 1

Trouble in include

Posted: Tue Jul 16, 2002 12:12 am
by kaily
here is code:

Code: Select all

if ($addemail!=$email) $check=check_email($addemail,$username); 
if (empty($check)){ 
include("datafile/useremail.txt"); //----here 
$o=count($userid);$i=0; 
while ($i < $o)&#123; 
if($wandererboardid==$userid&#1111;$i]) $newdata&#1111;]="\$email&#1111;]='$addemail';\$userid&#1111;]='$userid&#1111;$i]';"."\n"; 
else $newdata&#1111;]="\$email&#1111;]='$email&#1111;$i]';\$userid&#1111;]='$userid&#1111;$i]';"."\n"; 
$i++; 
&#125; 
$newdata=implode("",$newdata); 
writetofile('datafile/useremail.txt',"<?php\n".$newdata,"w"); 
&#125; 

function check_email($addemail,$username)&#123; 
include("datafile/useremail.txt"); //--- here 
$check_email = array_keys($email,$addemail); 
if ($check_email)&#123;$id=$check_email&#1111;0]; 
$err_msg="Your E_mail address&#65306;$addemail has been<a href=wdbprofile.php?job=show&target=$userid&#1111;$id]>$userid&#1111;$id]</a> used&#65281;Please go back and rewrite another one&#12290;<br>"; 
&#125; 
return $err_msg; 
&#125;
It doesn't work!
How I can do?Plz help me!

Posted: Tue Jul 16, 2002 1:11 am
by hob_goblin
try changing include to include_once

Posted: Tue Jul 16, 2002 2:26 am
by twigletmac
It would really help if you said what was wrong, ie. what didn't happen that should have (or vice versa), what error messages did you get.

Mac

Posted: Tue Jul 16, 2002 2:46 am
by hob_goblin
oh, now that i read it.. it sticks out so blandly..

Code: Select all

function check_email($addemail,$username)&#123; 
include_once("datafile/useremail.txt");
$check_email = array_keys($email,$addemail); 
if ($check_email)&#123;$id=$check_email&#1111;0]; 
$err_msg="Your E_mail address&#65306;$addemail has been<a href=wdbprofile.php?job=show&target=$userid&#1111;$id]>$userid&#1111;$id]</a> used&#65281;Please go back and rewrite another one&#12290;<br>"; 
&#125; 
return $err_msg; 
&#125; 

if ($addemail!=$email) $check=check_email($addemail,$username); 
if (empty($check))&#123; 
include_once("datafile/useremail.txt");
$o=count($userid);$i=0; 
while ($i < $o)&#123; 
if($wandererboardid==$userid&#1111;$i]) $newdata&#1111;]="\$email&#1111;]='$addemail';\$userid&#1111;]='$userid&#1111;$i]';"."\n"; 
else $newdata&#1111;]="\$email&#1111;]='$email&#1111;$i]';\$userid&#1111;]='$userid&#1111;$i]';"."\n"; 
$i++; 
&#125; 
$newdata=implode("",$newdata); 
writetofile('datafile/useremail.txt',"<?php\n".$newdata,"w"); 
&#125;

Posted: Tue Jul 16, 2002 3:29 am
by twigletmac
Sorry I was just having a moan at the vague statement of the problem - there's lots of things that can go wrong with an include statement...

Mac