بسم الله الرحمن الرحيم
لنبدأ على بركة الله كل منا عنه مايفيد في البرمجة
فالرجاء من من عنده ماهو مفيد وضعه هنا
في الردود
بسم الله الرحمن الرحيم
لنبدأ على بركة الله كل منا عنه مايفيد في البرمجة
فالرجاء من من عنده ماهو مفيد وضعه هنا
في الردود
__________________
PHP5
لرفع
__________________
PHP5
ياهوووووووووو ما أحد بفيد و لابيستفيد
__________________
PHP5
السلام عليكم
انا طرحت سؤال في منتدى phpnuke عن كيفية ادارج صفحة html ضمن اطار المجلة فدلوني على الكود التالي .. وما فهمت بصراحة كيف استخدمه...ممكن تدلوني لو سمحتوا
I tested this in nuke 4.4 & in nuke 5.0.1 and it works ok.
You can easily add more fields to the form and get them displayed on the results page very easily.
The best way it create your own form, run your wysiwyg editor and use the built in validation, but you cannot use
FrontPage for it, as it uses web bots and FrontPage extensions to generate the functions, use something like Dream Weaver.
Once you have made your form remove <html><head></head><title></title><body></body></html> so it is just the rest of the html
language left and give it a name like myform.html.
Quick Example done in Dreamweaver:-
*****************************************************
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') {
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
<form name="myform" method="post" action="myresults.php">
<input type="text" name="emailaddress" size="20" onBlur="MM_validateForm('emailaddress','','RisEmail');return document.MM_returnValue">
<input type="submit" name="Submit" value="Submit">
</form>
*****************************************************
Then run notepad and add the following code to the phpnuke standard:-
<?PHP
if (!IsSet($mainfile)) { include ('mainfile.php'); }
include("header.php");
directly under the last line "include("header.php");" add you include file which would be:-
include("myform.html");
After this line just and the last include line from phpnuke:-
include("footer.php");
?>
Save this text file as myform.php
What ever the form names are known as in myform.html I.E name="emailaddress" will be $emailaddress in your results page.
You give the name of your results .php file anything you like E.G myresults.php, so you form action would be for example:-
<form action="myresults.php" method="POST">
to get the info from the form printed on the myresults.php page will be like this:-
*********** phpnuke code 1st ***************
<?php
if (!IsSet($mainfile)) { include ('mainfile.php'); }
include('header.php');
*********** directly after the code above *******
PRINT " <p>This is your Email Address $emailaddress</p>";
*********** then you would want to email them with their form submission, so after the last line of code add ********
*********** this part you need to have that emailaddress form filled out to be able to email ********
mail("$emailaddress", "The is the subject line of the email", "Hello you went to my site and filled out my feedback form and said your
email address is $emailaddress\n
Thank you from the Webmaster");
**************Then you want the form to email you **********
mail("you@youremail.com", "Subject line you want to have", "$emailaddress just used your feedback form, you can email them
back at $emailaddress\n
The Information they gave is\n
$emailaddress");
*********** then close the page off with the phpnuke footer lines **********
include('footer.php');
?>
And that is it..........
I don't know if any of you phpnukers would aggree to this but it seem to work well.
P.S you don't even need the external html file to add your form into you could do it like the example below, buy cut and paste from a wysiwyg editor.
*****************************************************
<?php
if (!IsSet($mainfile)) { include ('mainfile.php'); }
include('header.php');
?>
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') {
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
<form name="myform" method="post" action="myresults.php">
<input type="text" name="emailaddress" size="20" onBlur="MM_validateForm('emailaddress','','RisEmail');return document.MM_returnValue">
<input type="submit" name="Submit" value="Submit">
</form>
<?php
include('footer.php');
?>
*****************************************************
Hope you find this useful.
Regards
Ian
Email : ian@navernet.com Website: http://www.navernet.com/gateway
__________________
الحمدلله