Tutorials
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOtherTutorials

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old April 29th, 2004, 07:07 PM
sajuko sajuko is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Germany
Posts: 5 sajuko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to sajuko
news system -> post news

i am just beginning with php and worked through the tutorial... i tried to modify the comment-post-system, but i didnt get it :/ could anybody post a solution, so that i can understand how to do it? it's not that i want a complete script to use, but i think it would be easier if i had a solution that works so that i can reconstruct it ... thank you very much, and sorry for my german-english :p

greetz, amir

Reply With Quote
  #2  
Old April 30th, 2004, 10:01 AM
sajuko sajuko is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Germany
Posts: 5 sajuko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to sajuko
RE: news system -> post news

well, somehow i managed it to work ;)
for those who are still searching for a way:
make a form like this:
php Code:
Original - php Code
  1.  
  2.     echo "<HR width="300">";
  3.     echo "<FORM action="{$_SERVER['PHP_SELF']}" .
  4.          "?action=postnews" method=POST>n";
  5.     echo "Title: <input type="text" " .
  6.          "width="30" name="title"><BR>n";
  7.     echo "<TEXTAREA cols="100" rows="10" " .
  8.          "name="text"></TEXTAREA><BR>n";
  9.     echo "<input type="submit" name="submit" " .
  10.          "value="Add News"n";
  11.     echo "</FORM>n";

add this function:
php Code:
Original - php Code
  1.  
  2. function postnews() {
  3.     global $db;
  4.    
  5.     $query = "INSERT INTO news (title, newstext) VALUES ('$_POST[title]','$_POST[text]')";
  6.     mysql_query($query);
  7.    
  8.     echo "News posted. Thanks!<BR>n";
  9.     echo "<a href="news.php">Back</a>n";
  10. }

and this for the switch:
php Code:
Original - php Code
  1.  
  2.     case 'postnews':
  3.         postnews();
  4.         break;


greetz, amir

Reply With Quote
Reply

Viewing: Codewalkers ForumsOtherTutorials > news system -> post news


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway