Ok, here is the code for you
Processing
PHP Code:
<?php
$filename = "featured_links.txt"; // file to write to
$date = date("F j, Y"); //date format
$error = "An error occured while adding new link!";
$success = "Link successfully added, please choose the page you would like to go to below. You will be automatically redirected to the ad links page in 10 seconds.
<br />
<a href=\"http://ad_link.php\">Ad Links Page</a>
<br />
<a href=\"jexhost.com\">Site Home</a>";
// Add Text
$text = stripslashes($_POST['text']);
if (!$text) {
$text = "<b>Untitled</b>";
}
// Add Link
$link = stripslashes($_POST['link']);
if (!link) {
$link = "";
}
// Add Content
if ($content = stripslashes($_POST['content'])) {
$add = '
<!-- Text Ad, '.$date.' -->
<a href="http://'.$link.'">'.$title.'</a>
<br />
';
$links = @file_get_contents($filename).$add;
$file = @fopen($filename, "w");
@fwrite($file, $news);
@fclose($file);
$message = $success;
}
else {
$message = $error;
}
echo "
<html>
<head>
<title>Jexlinks.com | Link Added</title>
<meta http-equiv=\"refresh\" content=\"10;url=ad_link.php\">
".$message."
</head>
<body>
</body>
</html>";
?>
Add Form
PHP Code:
<form action="ad_link_process.php" method="post">
Link Text:
<br />
<input name="text" type="text" />
<br />
Link URL:
<br />
<input name="link" type="text" />
<br />
<input type="submit" value="Submit" />
</form>
Bookmarks