Hi Everyone,
I'm having Major Issues with 2 PHP Scripts that work together.
The Error Generated is the dreaded HTTP 500 - Internal server error
The First Script is called alc_track.php, the Second is called alc_track_submit.php
Both Files have been chmod'ed to 777 Per instructions.
Thank You in Advance!
:)
--------------------------
----------
----------
----------
----------
----------
-----
Below are the Scripts in order:
--------------------------
----------
----------
----------
----------
------
alc_track.php:
--------------------------
----------
----------
----------
----------
------
<html>
<head>
<title>Affiliate Link Cloaker</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
function validate()
{
//alert("inside validate");
//alert("document.loginfor
m.email.le
ngth = " + document.loginform.email.v
alue);
if(document.form.url.value
.length == 0)
{
alert("Please enter URL");
document.form.url.focus();
return;
}
if(document.form.keyword.v
alue.lengt
h == 0)
{
alert("Please enter keyword");
document.form.keyword.focu
s();
return;
}
document.form.action="alc_
track_subm
it.php";
document.form.submit();
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form" method="post" action="">
<div align="center">
<table width="600" border="0" cellspacing="10" cellpadding="10">
<tr>
<td height="85" width="151">
<p><font face="Arial, Helvetica, sans-serif" size="2"><b>Paste the long
Url here</b></font></p>
</td>
<td height="85" width="379"> <font face="Arial, Helvetica, sans-serif" size="2">
<input type="text" name="url" size="50" maxlength="150" value="">
</font></td>
</tr>
<tr>
<td width="151"><font face="Arial, Helvetica, sans-serif" size="2"><b>Give
it a keyword</b><br>
(this will be the name of the cloaked link)</font></td>
<td width="379"><font face="Arial, Helvetica, sans-serif" size="2">
<input type="text" name="keyword" size="50" maxlength="150" value="">
<input type="button" name="cloak" value="Cloak" onClick="javascript:valida
te();">
</font></td>
</tr>
</table>
</div>
</form>
<p align="center"><font face="Arial, Helvetica, sans-serif" size="2"><a href="
http://WebmasterInABox.net" target="_blank">Powered
by the Affiliate Link Cloaker <br>
from WebmasterInABox.net</a></f
ont></p>
</body>
</html>
--------------------------
----------
----------
-
--------------------------
----------
----------
-
alc_track_submit.php:
--------------------------
----------
----------
-
<?
$siteName = "
http://www.MySite.com";
$adminName = "MySelf";
$adminEmail = "Me@MySite.com";
$cloakDir = "dir";
$fileName = "../$cloakDir/$keyword.htm
l";
if (file_exists($fileName))
{
print "Sorry, could not create cloaked link.<br>The keyword <b>$keyword</b> is already in use.<p>
Please hit the 'Back' button on your browser and select another keyword.";
exit;
}
else
{
$fp = fopen ($fileName, "w+");
if(!$fp)
{
print("<p>Cannot create <b>$fileName</b>. <br>Make sure you have created a directory by name <b>$cloakDir</b> in your root directory, and that it is chmod'ed to 777.
<p>Once you've done that, come back to this page, hit the back button on your browser, and try again.");
exit;
}
else
{
$fp = fopen ($fileName, "w+");
$data = "<html>
<frameset rows=\"0,*\" cols=\"*\" frameborder=0 framespacing=0>
<frame src=\"\">
<frame src=\"$url\">
</frameset>
<noframes><body bgcolor=\"#FFFFFF\" text=\"#000000\">
</body></noframes>
</html>";
for($count = 0; $count < strlen($data); $count++)
{
$escaped .= "%" . bin2hex($data[$count]);
}
$code = "<HTML><HEAD><SCRIPT LANGUAGE=\"javascript\">\n
<!--\ndocu
ment.write
(unescape(
\"$escaped
\"));\n//-
->\n</SCRI
PT></HEAD>
</HTML>";
//echo $code;
fwrite ($fp, $code);
fclose ($fp);
mail($adminEmail,"Link Cloaker","A new cloked link has been added:\n$url\n\nCloaked url:\n$siteName/$cloakDir/
$keyword.h
tml","From
: \"$adminName\" <$adminEmail>");
}
}
?>
<html>
<head>
<title>Thank You - Affiliate Link Cloaker</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<? if (file_exists("header.php")
) include "header.php"; ?>
<body bgcolor="#FFFFFF" text="#000000">
<p align="center"> </p>
<p align="center"><font face="Arial, Helvetica, sans-serif" size="4"><b><u>Here's
your Cloaked & Encrypted url</u></b></font></p>
<form name="form1" method="post" action="">
<div align="center">
<table width="600" border="0" cellspacing="5" cellpadding="10">
<?
$link = $siteName.'/'.$cloakDir.'/
'.$keyword
.'.html';
?>
<tr>
<td><font face="Arial, Helvetica, sans-serif" size="2">Your short url</font>:
<font face="Arial, Helvetica, sans-serif" size="2">
<input type="text" name="textfield" value = "<?=$link?>" size="50">
</font></td>
</tr>
<tr>
<td>
<font face="Arial, Helvetica, sans-serif" size="2">
<a href="<?=$link?>" target="_new"><?=$link?>
</a></font>
</td>
</tr>
<tr>
<td>
<p><font face="Arial, Helvetica, sans-serif" size="2">Go ahead, try
clicking on it
</font></p>
<p><font face="Arial, Helvetica, sans-serif" size="2">It should take
you to the right "long" url.</font></p>
<p><font face="Arial, Helvetica, sans-serif" size="2">Now you can copy
and paste the link from the above text box and use it in your emails
or on your web site.</font></p>
</td>
</tr>
</table>
</div>
</form>
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2"><a href="
http://WebmasterInABox.net" target="_blank">Powered
by the Affiliate Link Cloaker <br>
from WebmasterInABox.net</a></f
ont>
<?
if (file_exists("header.php")
) include "footer.php";
?>
</div>
</body>
</html>