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

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-09-2003, 10:24 AM
progmania's Avatar
Inspired Webmaster
 
Join Date: Aug 2003
Location: localhost PJ
Posts: 101
Rep Power: 66
progmania is on a distinguished road
Send a message via Yahoo to progmania
Question hilangkan ruang kosong setiap kali input

akum & hai

camne caranya nak hilang kan ruang kosong setiap kali input dimasukkan....

$mail = $_POST["email"];
$nama = $_POST["name"];

mysql_query ("INSERT INTO visitors (vis_name, vis_mail) VALUES ('$nama', '$mail')");

print "Welcome, $nama";

kalo saya buat cam kat atas nih. dia akan ada ruang kosong setiap kali input dimasukkan(data yg masuk 3 tapi row dlm db akan ada 6). tolong....

TQ...
__________________
Set the goal, push to the limit, reach the top and u'll be proud.. Try lah!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 09-09-2003, 10:45 AM
Ben-davis's Avatar
Senior Webmaster
 
Join Date: Jan 2002
Location: SoObHanG JhaYa
Posts: 501
Rep Power: 93
Ben-davis is on a distinguished road
Send a message via ICQ to Ben-davis Send a message via Yahoo to Ben-davis
erk... kalau kosong pon, tadak masalah pa....
__________________
<form name="jump">
<select name="menu" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" style="border:1px #393F31 solid;color:#393F31;font:10px Verdana;font-weight:bold;" >
<option value="0" style="background: #9CC8FE" selected>*SELECT-LINKS</option>
<option value="http://www.gengturbo.org/" style="background: #FF0000">GENGTURBO</option>
<option value="http://www.phixelgrafix.com/" target="new" style="background: #C6D607">PHIXELGRAFIX</option>
<option value="http://dailydigital.phixelgrafix.com/" style="background: #FCBC45">OLD-BLOG</option>
<option value="http://www.mesrahosting.net/" style="background: #FF99CC">WEBHOSTING</option>
</select>
</form>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-09-2003, 09:24 AM
progmania's Avatar
Inspired Webmaster
 
Join Date: Aug 2003
Location: localhost PJ
Posts: 101
Rep Power: 66
progmania is on a distinguished road
Send a message via Yahoo to progmania
takde masalah tu memang la takde... tapi table tu jadi besar.... padahal kosong je semua.... tak ke membazir ruang tu....

takde cara ke?

TQ...
__________________
Set the goal, push to the limit, reach the top and u'll be proud.. Try lah!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-09-2003, 09:49 AM
lcf's Avatar
lcf lcf is offline
Pro-Blogger
 
Join Date: Feb 2003
Location: Kluang, Johor
Posts: 2,376
Rep Power: 116
lcf will become famous soon enough
Send a message via ICQ to lcf Send a message via MSN to lcf Send a message via Yahoo to lcf
if you dun mind, pls display the whole page code.
the few lines do not seems to be the source of problem.
__________________
LiewCF | Malaysia Bloggers Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 10-09-2003, 11:12 AM
Ben-davis's Avatar
Senior Webmaster
 
Join Date: Jan 2002
Location: SoObHanG JhaYa
Posts: 501
Rep Power: 93
Ben-davis is on a distinguished road
Send a message via ICQ to Ben-davis Send a message via Yahoo to Ben-davis
lor.... tak membazir la.... kalau ada data baru kira space.,,.. yang kosong tu, cuma display ja... ....
__________________
<form name="jump">
<select name="menu" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" style="border:1px #393F31 solid;color:#393F31;font:10px Verdana;font-weight:bold;" >
<option value="0" style="background: #9CC8FE" selected>*SELECT-LINKS</option>
<option value="http://www.gengturbo.org/" style="background: #FF0000">GENGTURBO</option>
<option value="http://www.phixelgrafix.com/" target="new" style="background: #C6D607">PHIXELGRAFIX</option>
<option value="http://dailydigital.phixelgrafix.com/" style="background: #FCBC45">OLD-BLOG</option>
<option value="http://www.mesrahosting.net/" style="background: #FF99CC">WEBHOSTING</option>
</select>
</form>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 11-09-2003, 09:44 AM
progmania's Avatar
Inspired Webmaster
 
Join Date: Aug 2003
Location: localhost PJ
Posts: 101
Rep Power: 66
progmania is on a distinguished road
Send a message via Yahoo to progmania
ye ke? tapi tak best la... bila bukak mysqlcc... panjang jer table dia.... padahal takde pape pun.... so setiap kali ader org masuk input aku kena check balik dan buang sume ruang kosong yg tak pakai tu....

for lcf:

saya byk buat sub coding.... dan dicantumkan jadi satu pada main. tapi saya rasa bahagian lain tak ada masalah. basicly the coding just ask people to input their name and email and store it in database name employee.


<?php

//connect to server
$con = mysql_connect($server, $user, $pass)or die("Sambungan ke server gagal! ".mysql_error());

$db="employee";
mysql_select_db($db, $con);

$mail = $_POST["email"];
$nama = $_POST["name"];

mysql_query ("INSERT INTO visitors (vis_name, vis_mail) VALUES ('$nama', '$mail')");

print "Welcome, $nama";

?>
__________________
Set the goal, push to the limit, reach the top and u'll be proud.. Try lah!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 11-09-2003, 10:20 AM
Ben-davis's Avatar
Senior Webmaster
 
Join Date: Jan 2002
Location: SoObHanG JhaYa
Posts: 501
Rep Power: 93
Ben-davis is on a distinguished road
Send a message via ICQ to Ben-davis Send a message via Yahoo to Ben-davis
jap... aku tak dapat tangkap la....

dalam satu table, ada berapa row?
dalam satu row, berapa je yang ko pakai?
__________________
<form name="jump">
<select name="menu" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" style="border:1px #393F31 solid;color:#393F31;font:10px Verdana;font-weight:bold;" >
<option value="0" style="background: #9CC8FE" selected>*SELECT-LINKS</option>
<option value="http://www.gengturbo.org/" style="background: #FF0000">GENGTURBO</option>
<option value="http://www.phixelgrafix.com/" target="new" style="background: #C6D607">PHIXELGRAFIX</option>
<option value="http://dailydigital.phixelgrafix.com/" style="background: #FCBC45">OLD-BLOG</option>
<option value="http://www.mesrahosting.net/" style="background: #FF99CC">WEBHOSTING</option>
</select>
</form>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 11-09-2003, 10:29 AM
progmania's Avatar
Inspired Webmaster
 
Join Date: Aug 2003
Location: localhost PJ
Posts: 101
Rep Power: 66
progmania is on a distinguished road
Send a message via Yahoo to progmania
ok ok... aku ade satu database nama employee... dlm tu ada table visitor & personal. yg aku nak masukkan nih dlm table visitor. table visitor tu ada 2 medan je ( nama & email). setiap kali visitor(org luar yg bukan pekerja) nak lawat laman tu dia kena masukkan nama dan email baru bleh masuk. so email dan nama tu nanti akan dimasukka dlm table visitor tu la... faham? aku taktau nak xpalin camne lagi nih...
__________________
Set the goal, push to the limit, reach the top and u'll be proud.. Try lah!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 11-09-2003, 10:59 AM
Ben-davis's Avatar
Senior Webmaster
 
Join Date: Jan 2002
Location: SoObHanG JhaYa
Posts: 501
Rep Power: 93
Ben-davis is on a distinguished road
Send a message via ICQ to Ben-davis Send a message via Yahoo to Ben-davis
owh.... skang ni.... masalahnya, kalau user cuma inputkan nama, jadi email tu kosong la?


contoh :

PHP Code:
<?
$nama 
HTTP_POST_VARS['nama'];
$email HTTP_POST_VARS['email'];

if(
$nama == "" || $email == ""){
print 
"sila isi semua kotak!";
} else {
// database code here....
}
?>
camtu ka?
__________________
<form name="jump">
<select name="menu" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" style="border:1px #393F31 solid;color:#393F31;font:10px Verdana;font-weight:bold;" >
<option value="0" style="background: #9CC8FE" selected>*SELECT-LINKS</option>
<option value="http://www.gengturbo.org/" style="background: #FF0000">GENGTURBO</option>
<option value="http://www.phixelgrafix.com/" target="new" style="background: #C6D607">PHIXELGRAFIX</option>
<option value="http://dailydigital.phixelgrafix.com/" style="background: #FCBC45">OLD-BLOG</option>
<option value="http://www.mesrahosting.net/" style="background: #FF99CC">WEBHOSTING</option>
</select>
</form>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 11-09-2003, 11:03 AM
progmania's Avatar
Inspired Webmaster
 
Join Date: Aug 2003
Location: localhost PJ
Posts: 101
Rep Power: 66
progmania is on a distinguished road
Send a message via Yahoo to progmania
<?
$nama = HTTP_POST_VARS['nama'];
$email = HTTP_POST_VARS['email'];

if($nama == "" || $email == "")
{
print "sila isi semua kotak!";
}
?>

yup lebih kurang la tu... kalo kotak tu kosong, dia akan pegi balik ke form login. nama akan dimasukkan dlm medan nama, dan email akan dimasukkan dlm medan email.... dua2 mesti ada nilai (NOTNULL). baru bleh masuk. camne ade cara ke??
__________________
Set the goal, push to the limit, reach the top and u'll be proud.. Try lah!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 11-09-2003, 11:05 AM
Ben-davis's Avatar
Senior Webmaster
 
Join Date: Jan 2002
Location: SoObHanG JhaYa
Posts: 501
Rep Power: 93
Ben-davis is on a distinguished road
Send a message via ICQ to Ben-davis Send a message via Yahoo to Ben-davis
aku rasa ko kena buat code yang check db, kalau ada kosong, delete je row tu...
__________________
<form name="jump">
<select name="menu" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" style="border:1px #393F31 solid;color:#393F31;font:10px Verdana;font-weight:bold;" >
<option value="0" style="background: #9CC8FE" selected>*SELECT-LINKS</option>
<option value="http://www.gengturbo.org/" style="background: #FF0000">GENGTURBO</option>
<option value="http://www.phixelgrafix.com/" target="new" style="background: #C6D607">PHIXELGRAFIX</option>
<option value="http://dailydigital.phixelgrafix.com/" style="background: #FCBC45">OLD-BLOG</option>
<option value="http://www.mesrahosting.net/" style="background: #FF99CC">WEBHOSTING</option>
</select>
</form>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 11-09-2003, 11:09 AM
progmania's Avatar
Inspired Webmaster
 
Join Date: Aug 2003
Location: localhost PJ
Posts: 101
Rep Power: 66
progmania is on a distinguished road
Send a message via Yahoo to progmania
ye ke... ade tak kod yg mana kalo kita masukkan data dia akan susun row, row yg empty tu yg dia akan masukkan. cam loop ke?? kalo kita masukkan data dia akan periksa setiap row dan pegi ke row terakhir pastu dia masukkan kat situ...
__________________
Set the goal, push to the limit, reach the top and u'll be proud.. Try lah!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 11-09-2003, 08:29 PM
hymns's Avatar
Senior Webmaster
 
Join Date: Nov 2001
Location: Johor
Posts: 768
Rep Power: 100
hymns is on a distinguished road
Send a message via ICQ to hymns Send a message via Yahoo to hymns
aler pakai punksian SELECT yg guner LIKE tuh ehehheek... takkan tau tau kot? hihihi
__________________
I hate when:

vBulletin Message:
Sorry! The administrator has specified that users can only post one message every 60 seconds
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 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

BB 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
Jawatan kosong di KL atmosfera Job Vacancies 2 30-08-2005 05:06 PM
Kerja Kosong nazmanazly Job Vacancies 0 12-05-2005 12:17 AM
Kerjaya Yang Saya Nantikan Selepas Berdepan Dengan Komputer Setiap Hari.. mycs2u Revenue and Monetization 0 07-09-2004 12:37 AM
Jimat 50% Belanja Dapur Setiap Bulan & Dapat Ganjaran Hebat e-tokey Other Webmaster-related Services and Promotion 2 20-08-2004 12:36 PM
howto?: hilangkan apache konsol kat winNT r0kc Website Programming 4 22-05-2002 10:30 AM



All times are GMT +8. The time now is 05:29 AM. Powered by vBulletin® Version 3.7.3
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.