Go Back   Novahq.net Forum > phphq.Net > phphq.Net Forums
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-05-2004, 03:45 PM
varg
Unregistered

Posts: n/a

need some help

I folowed this tutorial on how to make a news system, it works pretty nice, but its not exactly 100% what im looking for.
I would like to make a script that adds a link to each news listing, using the title of the news listing as the link. when the user clicks that link, that news listing will be opened in a new page..

Basicly this is going to be used as a script where people can submit tutorials on mapmaking..

the form:
[code:1:66709816e9]<?
if($HTTP_POST_VARS['submit']) {
if($HTTP_POST_VARS['password'] == 'password') {
if(!$HTTP_POST_VARS['name']) {
echo "You must enter a name";
exit;
}
if(!$HTTP_POST_VARS['news']) {
echo "You must enter some content";
exit;
}
if(strstr($HTTP_POST_VARS['name'],"|")) {
echo "Name cannot contain the pipe symbol - |";
exit;
}
if(strstr($HTTP_POST_VARS['news'],"|")) {
echo "News cannot contain the pipe symbol - |";
exit;
}
$fp = fopen('news.txt','a');
if(!$fp) {
echo "Error opening file!";
exit;
}
$line = date("m.d.y") . "|" . $HTTP_POST_VARS['name'];
$line .= "|" . $HTTP_POST_VARS['news'];
$line = str_replace("\r\n","<BR>&quot ;,$line);
$line .= "\r\n";
fwrite($fp, $line);
if(!fclose($fp)) {
echo "Error closing file!";
exit;
}
} else {
echo "Bad Password";
}
}

?>
<FORM ACTION="<?=$PHP_SELF?>" METHOD="POST" NAME="newsentry">
Your name:<BR>
<INPUT TYPE="text" SIZE="30" NAME="name"><BR>
The tutorial:<BR>
<TEXTAREA NAME="news" COLS="120" ROWS="50"></TEXTAREA><BR><BR>
Password:<BR>
<INPUT TYPE="password" SIZE="30" NAME="password"><BR>
<INPUT TYPE="submit" NAME="submit" VALUE="Post it!"><BR>
</FORM>[/code:1:66709816e9]

Any help on this will be grreatly appreciated
Reply With Quote
  #2  
Old 09-06-2004, 07:23 PM
varg
Unregistered

Posts: n/a

Nevermind, I got it fixed
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:16 PM.




Powered by vBulletin®