View Full Version : How do I fix this problem?
yongobongo
05-19-2006, 04:50 AM
:confused: Here is my website
http://psp-download-centre.tripod.com/demos/links/links.html (http://psp-download-centre.tripod.com/demos/links/links.html)
It is a website for adding links to files to download.
The add button does everything except for add the link :confused: Why won't the link add?
I followed all the instructions in the ReadMe! :mad:
Heres the files i used to make it and the ReadMe :
Here (http://www.scriptarchive.com/links.html)
Plz help!
yongobongo
05-19-2006, 05:23 AM
plz help ppl
djr33
05-19-2006, 05:24 AM
When you say "everything" except adding the link, what is "everything"?
I mean.... isn't the link the only thing added?
So... it does nothing?
Relax... someone will figure it out... give it a bit of time... a lot more than half an hour :)
yongobongo
05-19-2006, 06:01 AM
I deleted the site because i tried everything and it didn't work so im trying some other files.
Do you have any recommendations for a link sharing site?
djr33
05-19-2006, 06:10 AM
From what I can tell, it doesn't seem like you want to code it yourself.
A while back, someone wanted a script for comments, and this might work for you.
http://dynamicdrive.com/forums/showthread.php?t=8786
The files are there, if not perfect. They work pretty well, but don't have too many features.
You could adapt it to your site in two ways:
1. Make it add the "comment" to the text file as a link... use php something like this:
$comment = '<a href="'.$inputtext.'">'.$inputtext.'</a>';
That would make a link out of the submitted URL.
2. Then you could use a different text file for each type and relate to that to what is displayed for each.
There's no validation option... so links might be submitted incorrectly.
However... code could be added to the php to check if a file exists at the URL supplied... meaning it is valid (at least to something).
Anyway, might be somewhat helpful.
Writing something like this with a database would be pretty easy too... if you want to take that on.
there may also be more scripts out there.... not sure.
yongobongo
05-19-2006, 06:26 AM
Lol, i know but I really don't know very much about PHP that's why i dont want to code it myself.
Here is an example of what im looking for:
http://files.psphacks.net (http://files.psphacks.net)
djr33
05-19-2006, 06:32 AM
The script is a really good base to start with. Not much more I can do... don't know of any other scripts, sorry.
Try google... there's probably something out there.
And, really, php isn't that hard to learn... it's a bit of work, but certainly possible :)
yongobongo
05-19-2006, 06:36 AM
I don't understand how i can make that into what im looking for?
Could i get those files in a .zip?
djr33
05-19-2006, 06:39 AM
Well... "those files" are just some code. You'd just need to save them as pages... I believe the page names are in the thread.
yongobongo
05-19-2006, 06:45 AM
Where do i put the code you put in this thread in the script on the other thread?
djr33
05-19-2006, 07:10 AM
(NOTE: See the end... got too tired to finish this... maybe later...)
I'm busy... sorry.
But... here's a general summary of what to do with a couple modifications...
I'm reposting the code here for ease of reference.
CREATE A FILE CALLED "sent.php". (this name, like the ones below, CAN change, but you MUST change all references to "sent.php", not just this)
In that page, use this code:
<?php
if ($_POST['type'] != "") {
$filename = $_POST['type'].".phpdata";
if ($name = stripslashes($_POST['url'])) {
$hr = "";
if (strlen(@file_get_contents($filename)) > 0) $hr = "\n<hr>";
$add = $hr."<a href=\"".$url."\">".$url."</a>";
$urls = @file_get_contents($filename).$add;
$file = @fopen($filename, "w+");
@fwrite($file, $urls);
@fclose($file);
$message = "Your URL was successfully added.<br>Redirecting to index.php";
}
else {
$message = "You either entered no data or it was entered incorrectly.<br>Redirecting to index.php";
}
}
else $message = "You must select a type of link.";
?>
<html>
<head>
<title>Link Added Demo</title>
<meta http-equiv="refresh" content="3;url=index.php">
</head>
<body>
<div align="center">
<p><font size="+1">Link Added Demo:</font></p>
<?php echo $message; ?>
</div>
</body>
</html>
NOTE: The refresh to "index.php" needs to be the main page. So... change that to whatever.
Also, the display at the end is obviously simple. Change the html however you want, but leave the php alone. You could include the php into your layout if you needed, etc.
Grr.... I'm so tired. Been messing with this code for a bit.
Get the other pages from there.
What I did with the type setup is that $type.phpdata will be the file containing the urls...
so... the form sent must include a name="type" field.. probly a dropdown.
In that, you might have "information" and information.phpdata would be the text file containing the data.
Right now, this code probably DOESN'T work. But... it's a start... and, with the other page, might make enough sense to use.
At this point, I'm giving up for the night... can't deal with coding any more :p
g'night/good luck.... lemme know if you want more help with this.
In the end, you might just want another script anyway.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.