i dont get an error with it at all..it works fine, but i want to change it. At the moment how it is written, this would be the output.
1stly
define the template with this in the top of the php script which isnt posted in the above coding
$template = "template.html"
and in
global $template,$template2,$registerlink,$domain,$ext;
and then u have
//Function to print the results into your template
function print_results($layout)
{
global $template,$registerlink,$domain,$ext;
if(!is_file($template)){
print"The template file into which to print the results either does not exist or is
not writeable<br>
please correct this if you are the webmaster of this site<br>
The script can not continue exiting......";
exit;
}
$template = file ($template);
$numtlines = count ($template); //Number of lines in the template
$line = 0;
while (! stristr ($template[$line], "<!--DOMAIN RESULTS-->") && $line < $numtlines) {
echo $template[$line];
$line++;
}
if($layout==0){
$line++;
print "<table width=\"100%\" border=\"0\" cellPadding=2 class=font1l>";
print "<tr><td><b>Domain query Results for \"$domain.$ext\"</b></td></tr>";
print "<tr><td><hr></td></tr>";
print "<tr><td>The domain is available <a href=\"$registerlink?domain=$domain.$ext\">register</a> it now</td></tr>";
print "</table>";
}
if($layout==1){
$line++;
print "<table width=\"100%\" border=\"0\" cellPadding=2 class=font1l>";
print "<tr><td><b>Domain query Results for \"$domain.$ext\"</b><br></td></tr>";
print "<tr><td><hr></td></tr>";
print "<tr><td><b>The domain is already taken <a href=\"$PHP_SELF?domain=$domain&ext=$ext&option=whois\">Check</a> the whois information<br></td></tr>";
print "<tr><td>Check another domain name <a href=\"javascript:history.back()\">here</a></td></tr>";
print "</table>";
}
while ($line < $numtlines) {
echo $template[$line];
$line++;
}
}
now when you enter the form data and it passes through the script, this would output the end result being either
($layout==0) or
($layout==1)
to $template and show the result
what i want it to do is like this
define the templates
$template = "template.html"
$template2 = "template2.html
so when u pass the form data through it you would get
($layout==0) to print the results to $template
and
($layout==1)prints to $template2
im just not sure on how 2 make it print out to different templates for each outcome of the script
that may give you a better idea of what im trying to achieve