
December 20th, 2003
01:37 PM

Script problem?
Okay guys, i have this script for posting news on my site. The problem is i don't know how to post links! I was using the regular <a href> thing, but that didn't work at all. Do you guys know how to do this?
This was the code in one file:
<body bgcolor="black"><font face="verdana" size="1" color="white">
<?PHP
$data = file('news.txt');
$data = str_replace("\\'","'",$data);
$data = str_replace("\\\"",""",$data);
$data = array_reverse($data);
foreach($data as $element) {
$element = trim($element);
$pieces = explode("|", $element);
echo $pieces[2] . "<BR>" . "<b>Posted by " . $pieces[1] . " on " . $pieces[0] . "</b><BR><BR>";
}
?>
Then this is the code in another where the form is:
<FORM ACTION="<?=$PHP_SELF?>" METHOD="POST" NAME="newsentry">
Your name:<BR>
<INPUT TYPE="text" SIZE="30" NAME="name"><BR>
The News:<BR>
<TEXTAREA NAME="news" COLS="100" ROWS="30"></TEXTAREA><BR><BR>
News Password:<BR>
<INPUT TYPE="password" SIZE="30" NAME="password"><BR>
<INPUT TYPE="submit" NAME="submit" VALUE="Post it!"><BR>
</FORM>
Help!!
___________________


January 2nd, 2004
01:05 AM
Then this is the code in another where the form is:
<FORM ACTION="<?=$PHP_SELF?>" METHOD="POST" NAME="newsentry">
Your name:<BR>
<INPUT TYPE="text" SIZE="30" NAME="name"><BR>
The News:<BR>
<TEXTAREA NAME="news" COLS="100" ROWS="30"></TEXTAREA><BR><BR>
News Password:<BR>
<INPUT TYPE="password" SIZE="30" NAME="password"><BR>
<INPUT TYPE="submit" NAME="submit" VALUE="Post it!"><BR>
</FORM>
[/QUOTE]
Im not the best at this, but try takin out the <?=$PHP_SELF?> in the form action. That was the only thing that stood out to me.
___________________
"To Become Different From What We Are, We Must Have Some Awareness Of What We Are"
-Bruce Lee

January 2nd, 2004
01:48 AM
thinking of something witty to put here
Status: Offline!
Where are you trying to put the link?

January 2nd, 2004
01:56 AM
Originally posted by Radley
Where are you trying to put the link?
In the text field where i write the news. For example, "Here's an interview with Joe Schmoe. You can find it HERE." The HERE word is where i want the link to be. Problem is i don't know how to. Any clearer?
___________________


January 2nd, 2004
02:07 AM
thinking of something witty to put here
Status: Offline!
You can't put links in text fields.

January 2nd, 2004
11:04 AM
Originally posted by Radley
You can't put links in text fields.
Okay how do news websites do it then?
___________________


January 2nd, 2004
05:10 PM
thinking of something witty to put here
Status: Offline!
Could you show me an example?

January 2nd, 2004
05:10 PM
thinking of something witty to put here
Status: Offline!
Could you show me an example?