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

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-05-2005, 05:53 PM
naero's Avatar
Novice Webmaster
 
Join Date: Mar 2005
Location: Kay Ell
Posts: 28
Rep Power: 0
naero is on a distinguished road
Arrow Audible / Turing Number

Aku dah siappp scripts untuk turing number.. korang boleh cuba scripts ni...

install.php dah run pastu delete.....
PHP Code:
<?php
include "connect.php";

$installturing="
CREATE TABLE turing (
  ip varchar(255) NOT NULL default '0',
  turing varchar(255) NOT NULL default '0'
)"
;
mysql_query($installturing) or die("Could not install voteip");
print 
"Tables installed.";
?>
connect.php Edit here
PHP Code:
<?php
$host 
"localhost";           // setkan server mysql
$user "username";            // setkan username mysql
$pass "password";            // setkan passwed mysql
$database "db_turing";       // setkan database mysql
$berapanombor '5';           // setkan berapa chars nombor nak display turing

$db mysql_connect("$host""$user""$pass");
if(!
$db
    die(
"no db");
if(!
mysql_select_db("$database",$db))
     die(
"No database selected.");
?>
form.php
PHP Code:
<?php 
include "connect.php";

// random nombor begin
$chars_for_turing = array ("1","2","3","4","5","6","7","8","9","0"); 
  for (
$i 1$i <= $berapanombor$i++) 
    {
      
$turing $turing $chars_for_turing[mt_rand (0count ($chars_for_turing)-1)];
    }
// random nombor end

$ip $_SERVER["REMOTE_ADDR"];
$checkip="SELECT * from turing where ip='$ip'";
$checkip2=mysql_query($checkip) or die(mysql_error());
$checkip3=mysql_fetch_array($checkip2);
if(
$checkip3[ip] == $ip)
    {    
    
$deleteip="DELETE from turing where ip = '$ip'";
    
mysql_query($deleteip) or die(mysql_error());
    }
$insert="Insert into turing (ip, turing) values('$ip','$turing')";
mysql_query($insert) or die("tak boleh insert into turing table");     
print
"<h1>Masukkan Nombor</h1>";    
print
"<form method='POST' action=form2.php>";
print 
"<h2>Turing = $turing</h2>";
print
"<input type='text' name='turing' size='8'>";
print
"<br><br><input type='submit' value='Submit' name='submit'>";
print
"</form>";
?>
form2.php
PHP Code:
<?php
include "connect.php";

if(isset(
$_POST['submit']))
{
  
$ip $_SERVER["REMOTE_ADDR"];
  
$turing $_POST['turing'];
  
$query "Select * from turing where ip='$ip' And turing='$turing'";
  
$result mysql_query($query); 
  
$check=mysql_fetch_array($result);
  if(
$check[turing] == $turing)
    { 
      
$deleteip="DELETE from turing where ip = '$ip'";
      
mysql_query($deleteip) or die(mysql_error());
      print 
"<STRONG><h1>Tahniah, Anda telah masukkan nombor turing yang betul</h1>";        
    }
    else
    {  
      print 
"<STRONG><FONT color=#ff3300><h1>Anda telah masukkan nombor yang salah. sila cuba lagi</h1></font></strong>";    
    }
}
?>
Jadi aku nak mintak tolong korang semua ni..sape sape yang expert php ni... macam mane nak display turing menggunakan gambar sebagai contohnya turing = 57687 dia akan output gambar 5.gif, 7.gif, 6.gif, 8.gif, 7.gif tolong la postt scriptss tu kat sini..kita sama2 tolong menolong... aku buat scripts ni pun sebab host aku tak support Image functions (GD LIBRARY) tu pasal la kena buat camni
__________________
naero.net is the place to find the best websites in Malaysia.

Last edited by naero; 08-05-2005 at 01:10 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-05-2005, 03:17 AM
naero's Avatar
Novice Webmaster
 
Join Date: Mar 2005
Location: Kay Ell
Posts: 28
Rep Power: 0
naero is on a distinguished road
Alahai lambatnya korang nak reply...aku tengah tunggu camne nak output gambar $turing ni ...tolong le bagi scripts korang tu.... aku tauu mesti ade caranyeeeee....zaimlahh...mane ko...tolongg le
__________________
naero.net is the place to find the best websites in Malaysia.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-05-2005, 11:39 AM
zaimlah's Avatar
Inspired Webmaster
 
Join Date: Jul 2001
Location: ttdi
Posts: 129
Rep Power: 92
zaimlah is on a distinguished road
sebenarnya first time aku baca aku tak faham, so aku biarkan dulu. sekarang aku datang dan baca balik, aku rasa aku faham

code yg display turing num tu ada dalam script form.php kan? part:
PHP Code:
...
print
"<form method='POST' action=form2.php>";
print 
"<h2>Turing = $turing</h2>";
... 
kan?

try this:
PHP Code:
$turing_full_img "";
for (
$i 0$i strlen($turing); $i++) {
  
$num_img $turing{$i}.'.gif';
  
$img_html "<img src=\"$num_img\">";
  
$turing_full_img .= $img_html;
}
print 
"<h2>Turing = $turing_full_img</h2>"
kalau nak/tak tau pasal syntax $turing{$i} ... nombor dalam curly braces ialah index character bagi string tersebut, contohnya: kalau $turing = "12345", so: $turing{0} == "1", $turing{1} == "2", etc. explanation lagi detail (dan lagi bagus) ada kat manual page ni: http://www.php.net/manual/en/languag....string.substr

p.s: aku not sure yg ni ke yg kau nak buat sebenarnya, mungkin tersilap langsung...
__________________
blog:zaim_bakar_blog | biz:box
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 15-05-2005, 03:41 PM
naero's Avatar
Novice Webmaster
 
Join Date: Mar 2005
Location: Kay Ell
Posts: 28
Rep Power: 0
naero is on a distinguished road
xpe...nanti aku try...aku baru je online..tapi aku rase cam bolehh jek..papehall...tenkiuuu la zaimlah..nanti aku kasi tau result die camne
__________________
naero.net is the place to find the best websites in Malaysia.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 16-05-2005, 12:48 AM
naero's Avatar
Novice Webmaster
 
Join Date: Mar 2005
Location: Kay Ell
Posts: 28
Rep Power: 0
naero is on a distinguished road
ok...aku dah check...memang boleh pakai ape yg ko bagi tu...
skang ni sape nak scripts tu boleh download kat sini http://www.naero.net/turing.zip
dah download..bagi la komenn pape..penat aku copy paste tuu...hehehehe
papehall tenkiu pada zaimlah...die yang banyak tolong aku
__________________
naero.net is the place to find the best websites in Malaysia.

Last edited by naero; 29-06-2005 at 03:09 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-07-2005, 04:08 AM
naero's Avatar
Novice Webmaster
 
Join Date: Mar 2005
Location: Kay Ell
Posts: 28
Rep Power: 0
naero is on a distinguished road
nak download kat sini http://www.naero.net/turing.zip
nak tengok demo kat sini http://www.naero.net/register.php
__________________
naero.net is the place to find the best websites in Malaysia.
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
Big Scale Number Format hymns Website Programming 2 30-08-2006 03:19 PM
Tax number , Social Security number for affliate programs cyrick Revenue and Monetization 6 28-03-2006 12:33 AM
Your fax-to-email number uniceed2005 Other Webmaster-related Services and Promotion 0 13-11-2005 11:49 PM
Floating number koisempoi Website Programming 2 12-08-2005 03:34 PM
Change number to text lina Website Programming 26 04-06-2004 04:33 PM


All times are GMT +8. The time now is 01:58 PM. 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.

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 59 60 61