//-------------------------------
// index CustomIncludes begin
include_once ("./common.php");
include ("./header_all.php");
include ("./footer.php");
// index CustomIncludes end
//-------------------------------
//session_start();
//===============================
// Save Page and File Name available into variables
//-------------------------------
$filename = "index.php";
$template_filename = "1index.html";
$header_filename="header_all.html";
$footer_filename="footer.html";
//===============================
//===============================
// index PageSecurity begin
// index PageSecurity end
//===============================
//===============================
// index Open Event begin
// index Open Event end
//===============================
//===============================
// index OpenAnyPage Event start
// index OpenAnyPage Event end
//===============================
//===============================
//Save the name of the form and type of action into the variables
//-------------------------------
$sAction = get_param("FormAction");
$sForm = get_param("FormName");
//===============================
// index Show begin
//===============================
// Display page
//-------------------------------
// Load HTML template for this page
//-------------------------------
$tpl = new Template($app_path);
$tpl->load_file($template_filename, "main");
//-------------------------------
// Load HTML template of Header and Footer
//-------------------------------
$tpl->load_file($header_filename, "Header");
$tpl->load_file($footer_filename, "Footer");
//-------------------------------
$tpl->set_var("FileName", $filename);
//-------------------------------
// Set variables with search parameters
//-------------------------------
$send = strip(get_param("send"));
$sender_email = strip(get_param("sender_email"));
//-------------------------------
// Search Show begin
//-------------------------------
$error="";
if ($send=='ok')
{
if ($sender_email == '' || !ereg('^([a-z0-9_]|\\-|\\.)+'.'@'.'(([a-z0-9]|\\-)+\\.)+'.'[a-z]{2,4}$',$sender_email))
$error .= "Your E-Mail is incorrect.<br>";
if ($error=='')
{
$db->query("select count(*) as col from subscription where email='".trim($sender_email)."'");
$db->next_record();
if ($db->f("col")==0)
{
$db->query("insert into subscription (email,date_s,gender) values ('".trim($sender_email)."',now(),'$gender')");
$mail_subject = $site_name." dispatch";
$iam=($gender=='w')?'woman':'man';
$sql = "select u.id, u.login, u.descr_short, (year(now())-year(u.birthday)) as age, u.ideal_short, ".
"c.name as country, l.name as lang, ".
"if(p.id>0,1,0) as pic, ".
"p.picture ".
"from users u, countries c left join langs l on (u.n_lang=l.id) ".
"left join pictures p on (u.id=p.user_id and p.show_p=1) ".
"where u.country = c.code and u.security<>0 and u.iam='$iam'".
" group by u.id order by u.dates desc limit 5";
$db->query($sql);
$tpl1 = new Template(".");
$tpl1->load_file("mail/subscription.html", "mail");
$tpl1->load_file("images/site.css", "Style");
if ($message<>'')
@mail(trim($sender_email),$mail_subject,$message,"From: $dontreply \nContent-Type: text/html; X-Mailer Version 6.9");
}
?>
<SCRIPT language="javascript">
alert("Thanks for subscribing");
</SCRIPT>
<?
}
}
//-------------------------------
// Step through each form
//-------------------------------
header_form_show();footer_form_show();Search_show();form_show();
//-------------------------------
// Process page templates
//-------------------------------
$tpl->parse("Header", false);
$tpl->parse("Footer", false);
//-------------------------------
// Output the page to the browser
//-------------------------------
$tpl->pparse("main", false);
// index Show end
//===============================
// index Close Event begin
// index Close Event end
//===============================
//********************************************************************************
//===============================
// Display Menu Form
//-------------------------------
function form_show()
{
global $tpl;
global $db;
global $error;
global $message, $sender, $sender_email, $friend_name, $friend_email;
$sFormTitle = "form";
//-------------------------------
// form Open Event begin
// form Open Event end
//-------------------------------
//-------------------------------
// Set URLs
//-------------------------------
//-------------------------------
// form Show begin
//-------------------------------
$tpl->set_var("FormTitle", $sFormTitle);
$tpl->set_var("error", $error);
if ($error=='')
{
$message="I have found this site. Look at it.";
$tpl->set_var("message", $message);
}
else
{
$tpl->set_var("message", $message);
$tpl->set_var("sender", $sender);
$tpl->set_var("sender_email", $sender_email);
$tpl->set_var("friend_name", $friend_name);
$tpl->set_var("friend_email", $friend_email);
}
//-------------------------------
// form BeforeShow Event begin
// form BeforeShow Event end
//-------------------------------
//-------------------------------
// Show fields
//-------------------------------
$tpl->parse("Formform", false);
//-------------------------------
// form Show end
//-------------------------------
}
//===============================
//===============================
// Display Search Form
//-------------------------------
function Search_show()
{
global $db;
global $tpl;
global $sForm;
$sFormTitle = "Search:";
$sActionFileName = "search.php";
//-------------------------------
// Search Open Event begin
// Search Open Event end
//-------------------------------
$tpl->set_var("FormTitle", $sFormTitle);
$tpl->set_var("ActionPage", $sActionFileName);
//-------------------------------
// Set variables with search parameters
//-------------------------------
$flds_seek = strip(get_param("seek"));
$flds_country = strip(get_param("country"));
$flds_age_from = strip(get_param("age_from"));
$flds_age_to = strip(get_param("age_to"));
$flds_gallery = get_param("gallery");
//-------------------------------
// Search Show begin
//-------------------------------
//-------------------------------
// Search Show Event begin
// Search Show Event end
//-------------------------------
if ($flds_gallery=='on')
$tpl->set_var("g_checked", "CHECKED" );
else
$tpl->set_var("g_checked", "" );
$tpl->set_var("SearchLBseek", "");
$db->query("select * from searches");
while ($db->next_record())
{
$lookup_seek[$db->f("var")] = $db->f("value");
}
if(is_array($lookup_seek))
{
reset($lookup_seek);
while(list($key, $value) = each($lookup_seek))
//-------------------------------
// Search Show end
//-------------------------------
//-------------------------------
// Search Close Event begin
// Search Close Event end
//-------------------------------
$tpl->parse("FormSearch", false);
//===============================
}
?>
Atropa
Messages postés1940Date d'inscriptionmercredi 25 juin 2008StatutMembreDernière intervention11 mai 2014274 30 nov. 2009 à 08:06
bonjour,
au moment de réouvrir la balise php après ton insertion de <script></script> tu as mis <? au lieu de <?php
quand tu as ce genre d'erreur le plus simple et de supprimer des morceau en en partant de la fin pour localiser l'erreur. si l'erreur existe toujours tu remet ce que tu as supprimé et tu supprimes au dessus etc...
quand l'erreur n'existe plus c'est qu'elle est dans ce que tu viens de supprimer donc tu affines progressivement
sinon <SCRIPT language="javascript"> c'est pas terrible , déjà les balises en majuscule et en plus language qui n'est pas compatible w3c préfère <script type="text/javascript"> et ajoute <!-- juste après et ferme le script avec //-->
comme ça :
<script type="text/javascript">
<!--
alert("Thanks for subscribing");
//-->
</script>
sinon j'ai vu aussi
if($message<>'')
ça veut dire quoi ?
sinon quand tu poste un code comme ça met le entre deux balise < code ></ code > (sans les espaces)
c'est beaucoup plus facile pour ce qui voudront t'aider
Trouvez des réponses à vos questions sur les langages, les frameworks et les astuces de codage. Échangez avec d'autres développeurs passionnés pour améliorer vos compétences en programmation et rester au fait des dernières tendances du secteur.