Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 18-03-2005, 12:51 AM
Novice Webmaster
 
Join Date: May 2003
Location: Kedah
Posts: 15
Rep Power: 0
jepp is on a distinguished road
Nak tanya sket

Alo..

Nak tanya sket.. aku ada buat 1 coding utk shoutbox. Form ada kat shoutbox.php dan form process ada kat process.php. Masalahnye sekarang, aku terpaksa klik kat button send utk shout. Kalau aku just enter je, dia akan stuck kat process.php , tapi kalau aku klik button send, ok la plak. Berfungsi dgn elok je..

Kat form lain takde plak jadi camni, bleh tolong tak sesapa yg tau apa masalahnye dgn shoutbox aku?

tq
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 18-03-2005, 12:59 AM
mysticmind's Avatar
Super Moderator
 
Join Date: Jun 2001
Location: Mystic Kingdoms
Posts: 2,602
Rep Power: 141
mysticmind will become famous soon enough mysticmind will become famous soon enough
Send a message via Yahoo to mysticmind
lenkali tuh kalau tanya.
paste la kod dia sekali..
senang sikit kawan2 nak 'Edisi Siasat'kan

Quote:
Originally Posted by jepp
Alo..

Nak tanya sket.. aku ada buat 1 coding utk shoutbox. Form ada kat shoutbox.php dan form process ada kat process.php. Masalahnye sekarang, aku terpaksa klik kat button send utk shout. Kalau aku just enter je, dia akan stuck kat process.php , tapi kalau aku klik button send, ok la plak. Berfungsi dgn elok je..

Kat form lain takde plak jadi camni, bleh tolong tak sesapa yg tau apa masalahnye dgn shoutbox aku?

tq
__________________
Personal's Blog! - Malaysian Artist!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 18-03-2005, 01:05 PM
Novice Webmaster
 
Join Date: May 2003
Location: Kedah
Posts: 15
Rep Power: 0
jepp is on a distinguished road
Sorry...

ni coding utk shoutbox :

<table width="100%" border="0">
<tr>
<td>Shoutboxs</td>
</tr>
</table>
<?

by time desc limit 5");
$q = "SELECT * FROM shout LEFT JOIN users ON shout.name=users.id ORDER BY time DESC LIMIT 5";
$result = $database->query($q);
while ($data = mysql_fetch_assoc($result)) {
$name = $data['username'];
$id = $data['name'];
$message = $data['message'];
$date = date("h:i:s A" , $data['time']);

echo "<div><br>
<a href=\"userinfo.php?info=$id&amp;profile=$name\">$ name</a>
<br>
$message
<br>
$date
</br></div>";
}

echo $session->logged_in ?
"<div><form action='".PAGE_BASE."membership/process.php' method='post' name='shout'>
<input name='message' type='text' value='' size='23' maxlength='100' class='register_form'>
<input name='subshout' type='hidden' value='1'>
<input name='shout' type='submit' value='Shout!' class='register_form'></form></div>"
: '<p>Only registered member can shout'

?>

ni coding utk form process

=== coding kat process.php=========

function procShouts() {
global $session, $database;
if (isset($_POST['shout'])) {
$database->Shouts();
header("Location: ".$session->referrer);
}
}

========coding kat database.php==============================

function Shouts() {
global $session;
if ($_POST['message'] && $session->logged_in) {
$name = $session->id;
$message = filter( substr( wordwrap( nl2br( stripslashes($_POST['message'])),32,'<br />',1),0,250));
$this->updateShouts();
$q = "INSERT INTO ".TBL_SHOUT." VALUES ('$name', ".time().", '$message')";
return mysql_query($q, $this->connection);
}
}

function updateShouts() {
global $session;
$username = $session->username;
$q = "SELECT shout_post FROM ".TBL_USERS." WHERE username = '$username'";
$result = mysql_query($q, $this->connection);
$shout = mysql_result($result,0);
$shout++;
$q = "UPDATE ".TBL_USERS." SET shout_post = '$shout' WHERE username = '$username'";
return mysql_query($q, $this->connection);
}


Aku dah try tukar jadi mcm ni kat form:

echo $session->logged_in ?
"<div><form action='".PAGE_BASE."membership/process.php' method='post' name='shout'>
<input name='' type='text' value='' size='23' maxlength='100' class='register_form'>
<input name='message' type='text' value='' size='23' maxlength='100' class='register_form'>
<input name='subshout' type='hidden' value='1'>
<input name='shout' type='submit' value='Shout!' class='register_form'></form></div>"
: '<p>Only registered member can shout'

Aku tambah lagi 1 lagi input, shoutbox ni bleh jln dgn tekan button enter je, tapi, bila aku buang blank input tu, terus tak bleh jln, kena klik button shout baru bleh jln. Apasai aa?

Tak kan kena ada sekurang-kurangnya 2 input baru bleh jln?

Tolongg....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
chart... tolong sket... ridz_021 Website Programming 4 08-02-2006 01:19 PM
tlg check sket code ni prozone Website Programming 3 04-08-2005 10:17 PM
tolong sket pasal style... YajivMalhotra Website Design 2 02-11-2004 12:40 PM
kasi guideline sket.... spicy_girl Website Programming 78 16-02-2004 03:55 PM
Nak tanya ni LydBytes Graphic Design 12 18-06-2002 07:27 PM



All times are GMT +8. The time now is 11:27 AM. Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58