| |
|
|
| |
|
|
| |
|
Scriptingage
03.11.02, 02:17:50
|
|
|
|
Post #1 (permalink) |
|
|
| |
|
|
Alrighty, anyone know how to do scripts? I want to make a help page on my website, have it send the results to me, and transfer the browser to a comfirmation page. Now, when it comes to scripting, I know nothing, so its gonna have to be an idiots guide. Can anyone help me there?
Thanks,
Eraph |
|
|
|
|
|
|
| your sig makes scotland look gay u fag. |
|
|
|
|
|
|
I'm not sure what you wanted but I think it was some sort of from that people could use to send you a email, and when they submited it then they would get a confirmation page.
Here's something I used on a site (you'll have to edit the colors and some stuff at the top of the code, when you are done save it with a .php extension)
PHP Code:
<?
// Enter your email address here
$adminaddress = "yourname@domain.com";
// Enter the address of your website here MUST include [url]http://www.[/url]
$siteaddress ="http://www.domain.com";
// Enter your company name or site name here
$sitename = "Site Name";
// Enter your page title here
$ptitle = "Page Title";
// Colour/Style Values for your page - hexy!
//Background Colour
$bgcolor = "#324659";
//Table Border
$bocolor = "";
// Font Colour
$fcolor = "#FFFFFF";
// Link Colour
$lcolor = "#BDBD8C";
// Font Style
$font = "verdana";
// Font Size
$fontsize = "1";
// Unless you know better I advise that you don't touch anything below here!
// Don't touch this it grabs the date and time from your server
$date = date("m/d/Y H:i:s");
$traceroute = "<a href=\"http://www.above.net/cgi-bin/trace?$REMOTE_ADDR\">";
if ($REMOTE_ADDR == "") $ip = "<i> no ip </i>";
else $ip = getHostByAddr($REMOTE_ADDR);
IF ($action==""):
?>
<html>
<head><title><? echo "$ptitle"; ?></title>
<body bgcolor="<? echo "$bgcolor"; ?>" Link="<? echo "$lcolor"; ?>" vLink="<? echo "$lcolor"; ?>">
<center>
<FORM name=validation METHOD=POST ACTION="<? echo "$PHP_SELF"; ?>" onSubmit="return checkbae()">
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="2" width=50% bgcolor="<? echo "$bocolor"; ?>">
<TR>
<TD VALIGN="TOP">
<center><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="3" width=100% bgcolor="<? echo "$bgcolor"; ?>">
<TR>
<TD VALIGN="TOP" colspan=2><font face="<? echo "$font"; ?>" size="<? echo "$fontbig"; ?>" color="<? echo "$fcolor"; ?>"><b><? echo "$ptitle"; ?></b></FONT></TD>
</TR>
<TR>
<TD VALIGN="TOP"><font face="<? echo "$font"; ?>" size="<? echo "$fontsize"; ?>" color="<? echo "$fcolor"; ?>"><small>Your First Name:</FONT></TD>
<TD VALIGN="TOP"><INPUT TYPE="text" NAME="fname"></FONT></TD>
</TR>
<TR>
<TD VALIGN="TOP"><font face="<? echo "$font"; ?>" size="<? echo "$fontsize"; ?>" color="<? echo "$fcolor"; ?>"><small>Your Last Name:</FONT></TD>
<TD VALIGN="TOP"><INPUT TYPE="text" NAME="lname"></FONT></TD>
</TR>
<TR>
<TD VALIGN="TOP"><font face="<? echo "$font"; ?>" size="<? echo "$fontsize"; ?>" color="<? echo "$fcolor"; ?>"><small>Your Email:</FONT></TD> <TD VALIGN="TOP"><INPUT TYPE="text" NAME="vemail"></FONT></TD> </TR>
<TR><TD VALIGN="TOP" COLSPAN="2"><font face="<? echo "$font"; ?>" size="<? echo "$fontsize"; ?>" color="<? echo "$fcolor"; ?>"><small>Comments:</FONT></TD> </TR>
<TR> <TD VALIGN="TOP" COLSPAN="2"><TEXTAREA NAME="comments" ROWS="3"
COLS="30"></TEXTAREA></FONT></TD> </TR>
<TR><td colspan=2><INPUT TYPE="submit" NAME="action" VALUE="Send">
</FORM></TD>
</TR>
</TABLE> </CENTER></td></TR>
</TABLE>
<script language="JavaScript1.2">
var testresults
function checkemail(){
var str=document.validation.vemail.value
var filter=/^.+@.+\..{2,3}$/
if (filter.test(str))
testresults=true
else{
alert("Please input a valid email address!")
testresults=false
}
return (testresults)
}
</script>
<script>
function checkbae(){
if (document.layers||document.all)
return checkemail()
else
return true
}
</script>
</body>
</html>
<?
//This grabs the form data and formats it and sends it in an email to you
exit;
ELSEIF ($action="Send"):
mail("$adminaddress","E-Mail Foor", "FAO: Admin @ $sitename \n
First Name: $fname
Last Name: $lname
Email: $vemail
The visitor commented:
------------------------------
$comments
------------------------------
Logged Info :
------------------------------
Using: $HTTP_USER_AGENT
Hostname: $ip
IP address: $REMOTE_ADDR
Date/Time: $date","FROM:$adminaddress");
//This grabs the form data and sends a confirmation to your visitor
mail("$vemail","Thank You for visiting $sitename", "Hi $fname,\n
Thank you for your interest in $sitename!
We will read your comments as soon as we can and act accordingly.\n
Best regards,
$sitename
$siteaddress","FROM:$adminaddress");
PRINT "<html><head><title> $ptitle </title><body bgcolor=\"$bgcolor\" Link=\"$lcolor\" vLink=\"$lcolor\"><CENTER>";
PRINT "<TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"3\" width=\"60%\" bgcolor=\"$bocolor\">";
PRINT "<TR><TD VALIGN=\"TOP\">";
PRINT "<TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"3\" width=\"100%\" bgcolor=\"$bgcolor\">";
PRINT "<TR><TD VALIGN=\"TOP\"><font face=\"$font\" color=\"$fcolor\"><small>Hello, $fname.";
PRINT "<BR><BR>";
PRINT "<font face=\"$font\" color=\"$fcolor\">Thank you for your completing our form.<BR><BR>";
PRINT "<font face=\"$font\" color=\"$fcolor\">To Close the page [<A href=\"javascript:window.close()\">Click Here</A>]";
PRINT "</CENTER></td></TR></TABLE></td></TR></TABLE>";
ENDIF;
?>
</body>
</html>
|
______________________________________
Last edited by kula shakerz : 03.11.02 at 13:09:39.
|
|
|
|
|
|
Quote:
Originally posted by __Hidden_Angel
your sig makes scotland look gay u fag.
|
Your Avatar does the same for you, you don't see anyone else complaining, now shut up.  |
|
|
|
|
|
|
You avatar isn't exactly of top caliber. I wouldn't go about commenting on other people's works until you're a distinguished artist. (Of which I am.) |
______________________________________
A E R O S O L
I AM BLACK, JEWISH, AND COMPLETELY WORTHLESS, I PROMISE
|
|
|
|
|
|
| I didn't even make that avatar, i like it. I'm just defending this guy, after Hidden Angel person made some comment my 13 year old brother would make. |
|
|
|
|
|
|
| Well, I can see your logic, but I must agree with Hidden Angel, that sig is pretty flammatory. |
|
|
|
|
|
|
| im not afraid of your english posse who wants to liberate scottland...(i have no idea waht i just said) |
______________________________________
Listen To Little Brother
alright, | | |