Jump to content
biskut merry

Help Me With My Php

Recommended Posts

thanks bro..da jadi da..kirenye klu untk name field tu mmg xleh gune ' / ' la ek?

time kasih.. :lol:

boleh guna '/' tapi kena jadikan mcm ni -> 'i\/c_no'

Share this post


Link to post
Share on other sites

kalau ko guna tanduk satu '' memanglah ada masalah,

contoh macam nilah katakan kita guna echo

pembolehubah -> $siapa_saya

1) echo ' $siapa_saya'

2) echo " $siapa_saya"

3) echo ' '.$siapa_saya.' '

4) echo " ".$siapa_saya." "

cuba ko masukkan $siapa_saya =' said's ';

mesti keluar error :lol:

cara nak setel macam ni aje $siapa_saya =' said\'s ';

tapi leceh laa, tu pasal kalau boleh elak guna ' tapi pakai `

nak tahu tanda ` yang ada tanda ~ juga sebelah kiri keyboard 1 & !

jadi dari pandangan mata ko orang asal nampak senget sebelah

dah betul laa tu

kalau yang tegak tu, susah nak jamin

salam.

time kasih diatas penerangan amin..skang aku da paham sket2..sblom ni aku igt tanda ' sama ngan `

huhu..

boleh guna '/' tapi kena jadikan mcm ni -> 'i\/c_no'

time kasih jugak diatas penerangan anda basiccx..

Share this post


Link to post
Share on other sites

Rasa ada silap SQL kau tu. Bukan ke patutnya:

SELECT processed FROM table_name WHERE processed = 0
Dan berdasarkan code kau tu, kau nak kira berapa yang belum diuruskan, kan? Kenapa nak buat camtu? Pada pendapat aku kurang efficient. Aku rasa baik guna SQL syntax:
SELECT COUNT(*) FROM table_name WHERE processed = 0
Sekadar pendapat B)
salam terima kasih sbb bg idea..idea ni mmg leh pkai nmenjadi..cume coding ade kene edit sket..
<?php
$query="SELECT COUNT(*) FROM table_name WHERE processed = 0";
$query=mysql_query($query);
for($j=1; $j <= $row=mysql_fetch_assoc($query); $j++) {}

echo "<a href=\"process.php\">New($j)";
?>[/code]



aku edit sket sbb nilai yg die bg tu xtepat..ni selepas aku edit

[code]<?php $query="SELECT * FROM maklumat_pemohon WHERE proses = 0 "; $query=mysql_query($query); for($j=0; $j < $row=mysql_fetch_assoc($query); $j++) {} echo "<a href=\"process.php\">New($j)"; ?>

pe2 pn thanks kat korang berdua sbb idea ni mmg menjadi.. :lol:

Share this post


Link to post
Share on other sites

aku edit sket sbb nilai yg die bg tu xtepat..ni selepas aku edit

<?php
$query="SELECT * FROM maklumat_pemohon  WHERE proses = 0 ";
$query=mysql_query($query);
for($j=0; $j < $row=mysql_fetch_assoc($query); $j++) {}

echo "<a href=\"process.php\">New($j)";
?>[/code]


pe2 pn thanks kat korang berdua sbb idea ni mmg menjadi.. 

ada cara yang paling mudah laa.
dari kod ko ni, macam nak tahu berapa baris hasil result

[code]<?php $query="SELECT * FROM maklumat_pemohon WHERE proses = 0 "; $result = mysql_query($query) or die (mysql_error()."<hr>$query<hr>"); $fields = mysql_num_fields($result); // bil medan $rows = mysql_num_rows($result);// bil baris echo "<a href=\"process.php\">New($rows)"; ?>

Share this post


Link to post
Share on other sites

ada cara yang paling mudah laa.

dari kod ko ni, macam nak tahu berapa baris hasil result

<?php
$query="SELECT * FROM maklumat_pemohon  WHERE proses = 0 ";

$result = mysql_query($query) or die (mysql_error()."<hr>$query<hr>"); 
$fields = mysql_num_fields($result); // bil medan
$rows = mysql_num_rows($result);// bil baris

echo "<a href=\"process.php\">New($rows)";
?>[/code]

salam

time kasih bro amin..aku ade g nk tmbh function baru kat system aku ni..skang ni ngah pikir cmne nk wat..

nt klu ade ape2 yg aku xpaham n xle wat nt aku tanye g..harap amin n yg lain2 dpt bg idea n tunjuk ajar.. :lol:

Share this post


Link to post
Share on other sites

salam

berkenaan ngan sistem aku..aku ade nk tmbh fungsi search..fungsi ni untk membolehkn pengguna

check permohonan mereka sama ada berjaya atau tidak.so aku pn plan nk wat cmni:

1. tambah colum status(berjaya/gagal) pada database aku

2. buat satu fail untuk pengguna masukan ic no tok mulakan carian (check.php)

3. buat satu fail untuk proses carian (check_exec.php)

-kat fail ni nt sistem akan check ic no yg dimasukan

-pastu check status (berjaya/gagal)

-jika berjaya-pg ke page permohonan_berjaya.php

-jika gagal-pg ke permohonan_gagal.php

adakah cara aku ni btol?ble ke aku wat cmni?cmne care untk aku tulis file check_exec.php tu? :lol:

Share this post


Link to post
Share on other sites

salam

berkenaan ngan sistem aku..aku ade nk tmbh fungsi search..fungsi ni untk membolehkn pengguna

check permohonan mereka sama ada berjaya atau tidak.so aku pn plan nk wat cmni:

1. tambah colum status(berjaya/gagal) pada database aku

2. buat satu fail untuk pengguna masukan ic no tok mulakan carian (check.php)

3. buat satu fail untuk proses carian (check_exec.php)

-kat fail ni nt sistem akan check ic no yg dimasukan

-pastu check status (berjaya/gagal)

-jika berjaya-pg ke page permohonan_berjaya.php

-jika gagal-pg ke permohonan_gagal.php

adakah cara aku ni btol?ble ke aku wat cmni?cmne care untk aku tulis file check_exec.php tu? :lol:

kalau aku, carian tu aku buat dalam satu page aje

maksudnya aku akan paparkan hasil carian dalam check.php

dalam hasil carian tu aku hanya bagi mesej aje

berjaya atau gagal

lepas tu bagi pilihan kepada user ...

Share this post


Link to post
Share on other sites

kalau aku, carian tu aku buat dalam satu page aje

maksudnya aku akan paparkan hasil carian dalam check.php

dalam hasil carian tu aku hanya bagi mesej aje

berjaya atau gagal

lepas tu bagi pilihan kepada user ...

tp klu nk wat macam yg aku ckp tu pn bleh jgk kn?

aku klu ble nk wat camtu tp aku xtau nk tulis arahan yg btol..

blex ko ajar cmne nk wat..ape yg aku ptt tulis..

Share this post


Link to post
Share on other sites

salam

berkenaan ngan sistem aku..aku ade nk tmbh fungsi search..fungsi ni untk membolehkn pengguna

check permohonan mereka sama ada berjaya atau tidak.so aku pn plan nk wat cmni:

1. tambah colum status(berjaya/gagal) pada database aku

2. buat satu fail untuk pengguna masukan ic no tok mulakan carian (check.php)

3. buat satu fail untuk proses carian (check_exec.php)

-kat fail ni nt sistem akan check ic no yg dimasukan

-pastu check status (berjaya/gagal)

-jika berjaya-pg ke page permohonan_berjaya.php

-jika gagal-pg ke permohonan_gagal.php

adakah cara aku ni btol?ble ke aku wat cmni?cmne care untk aku tulis file check_exec.php tu? laugh.gif :rolleyes:

Share this post


Link to post
Share on other sites

salam

berkenaan ngan sistem aku..aku ade nk tmbh fungsi search..fungsi ni untk membolehkn pengguna

check permohonan mereka sama ada berjaya atau tidak.so aku pn plan nk wat cmni:

1. tambah colum status(berjaya/gagal) pada database aku

2. buat satu fail untuk pengguna masukan ic no tok mulakan carian (check.php)

3. buat satu fail untuk proses carian (check_exec.php)

-kat fail ni nt sistem akan check ic no yg dimasukan

-pastu check status (berjaya/gagal)

-jika berjaya-pg ke page permohonan_berjaya.php

-jika gagal-pg ke permohonan_gagal.php

adakah cara aku ni btol?ble ke aku wat cmni?cmne care untk aku tulis file check_exec.php tu? laugh.gif :rolleyes:

Perlu ke kau ulang soalan yang sama dua kali?

Dan bukan ke amin dah bagi cadangan tu. Agak OK la cadangan dia tu.

Macam kau kata, buat satu column baru, contohnya status dengan nilai boolean.

Kau tak perlu la nak buat banyak-banyak file. Belajar penggunaan IF STATEMENT, atau pun switch. Untuk masukkan carian tu, guna HTML pun dah cukup.

Share this post


Link to post
Share on other sites

ni contoh logik carian

<?php if (! isset($_POST['simpan'])){ ?>
...
<input type="submit" value="Cari" name="simpan">
...
<? } else { ?>
...
<? } ?>
atau ko boleh buat macam ni
<?php 
if (! isset($_POST['simpan']))
{... } 
else {... } 

?>
<html>
...
<input type="submit" value="Cari" name="simpan">
...
</html>

harap dapat membantu

Share this post


Link to post
Share on other sites

ni contoh logik carian

<?php if (! isset($_POST['simpan'])){ ?>
...
<input type="submit" value="Cari" name="simpan">
...
<? } else { ?>
...
<? } ?>
atau ko boleh buat macam ni
<?php 
if (! isset($_POST['simpan']))
{... } 
else {... } 

?>
<html>
...
<input type="submit" value="Cari" name="simpan">
...
</html>

harap dapat membantu

salam

thanks..da jadi da. :rolleyes:

Share this post


Link to post
Share on other sites

salam

mintak bantuan lagi skali..camne nk wat mesej error tu kuar kat tempat yg kita nk? contoh cmni

ssssss.jpg

aku da try wat, tp die kuar kat atas.

aaaaabbbbb.jpg

ini aku nye coding

<?php require_once('../Connections/aku.php'); ?>
<?php
mysql_select_db($database_aku, $aku);
$query_rsAdmin = "SELECT * FROM `admin`";
$rsAdmin = mysql_query($query_rsAdmin, $aku) or die(mysql_error());
$row_rsAdmin = mysql_fetch_assoc($rsAdmin);
$totalRows_rsAdmin = mysql_num_rows($rsAdmin);
?>
<?php

if (!isset($_SESSION)) {
  session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['username'])) {
  $loginUsername=$_POST['username'];
  $password=$_POST['password'];
  $MM_fldUserAuthorization = "";
  mysql_select_db($database_aku, $aku);

  $LoginRS__query=sprintf("SELECT username, password FROM admin WHERE username='%s' AND password='%s'",
    get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password)); 

  $LoginRS = mysql_query($LoginRS__query, $aku) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
     $loginStrGroup = "";


    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;	      

    if (isset($_SESSION['PrevUrl']) && false) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];	
    }
    header("Location: untitled.php "  );
  }
  else {
    echo "username and password not match. Please login again.";

  }
}
?>

k terima kasih lagi skali pada mereka yang telah banyak membantu aku sebelum ini. :rolleyes:

Edited by biskut_merry

Share this post


Link to post
Share on other sites

Bukan struktur layout nih. Kod untuk layout tu dengan kod bahagian log-in yang sepatutnya output keluar.

Cuba tgk dkt screenshoot tu. Nampak tak layout lari? Output keluar pada layout bahagian atas. Cuba betulkan.

Edited by BasicCX

Share this post


Link to post
Share on other sites

Bukan struktur layout nih. Kod untuk layout tu dengan kod bahagian log-in yang sepatutnya output keluar.

Cuba tgk dkt screenshoot tu. Nampak tak layout lari? Output keluar pada layout bahagian atas. Cuba betulkan.

owh..yeke..cmne ek nk btolkn? code tu nk letak katne?

aku ni sebenarnye baru nk berjinak2 ngan php..byk yg aku xtau..sory la yek.. :rolleyes:

Share this post


Link to post
Share on other sites

erm..aku rasa kat sini :

else {
echo "username and password not match. Please login again.";

}[/code] boleh ubah jadi cmni :
[code]else {
$ErrorMsg = "username and password not match. Please login again.";

}
so dari situ ko boleh echo $ErrorMsg kat mana. Let say kita nak kuarkan kat bahagian content , so cari part bahagian content tu letak je :
<?php

if(isset($ErrorMsg))
echo $ErrorMsg;

?>[/code]

Share this post


Link to post
Share on other sites

erm..aku rasa kat sini :

else {
echo "username and password not match. Please login again.";

}
boleh ubah jadi cmni :
else {
$ErrorMsg = "username and password not match. Please login again.";

}
so dari situ ko boleh echo $ErrorMsg kat mana. Let say kita nak kuarkan kat bahagian content , so cari part bahagian content tu letak je :
<?php

if(isset($ErrorMsg))
echo $ErrorMsg;

?>

terima kasih FryShadow..da jadi da..terima kasih banyak2..

terima kasih gk kat BasicCX sbb sudi bantu.

Share this post


Link to post
Share on other sites

biskut_merry, boleh tahan ko punya interface.

tapi mesej error tu rasanya ko boleh pakai javascrip

tak pun ajax ker

kalau nak echo .... B)

Share this post


Link to post
Share on other sites

biskut_merry, boleh tahan ko punya interface.

tapi mesej error tu rasanya ko boleh pakai javascrip

tak pun ajax ker

kalau nak echo .... B)

time kasih..hihi..

klu gune javascript nt die kuar popup mesej kn? aku xbrpe suke..huhu..

aku lagi suke stail cmni.. :rolleyes:

Share this post


Link to post
Share on other sites

time kasih..hihi..

klu gune javascript nt die kuar popup mesej kn? aku xbrpe suke..huhu..

aku lagi suke stail cmni.. :rolleyes:

Tidak juga. Boleh juga kalau tak nak bagi dia popup. Bak kata amin, AJAX B)

Share this post


Link to post
Share on other sites

lor..yeke..igtkan xleh..huhu.. :blush:

ini salah satu js yang agak gempak sikit

http://jquery.com/demo/thickbox/

kalau ada error aje

alih2 background jadi hitam

dan ada mesej di tengah-tengah

oleh tu salam idulfitri

raya rumah ko jangan-jangan makan biskut merry aje tak :D???

ker ko buat sendiri biskut merry tu hehehe

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...