Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok dito

Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

help naman po jan, i need some code example on how to make a an admin that has feauture of editing the registred users information..
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

UPDATE OR ALTER FIELD FROM A TABLE USING CODE

gyx try moto.. nga pala nitz nlang tawag mo sakin.. hehe xenxa kana minsan nlng ako maka OL sa symbian.. busy kasi sa office lage.. dmi ko pa project na tinatapos.. hmm don't have a facebook account.. di ko lang trip ang FB.. ^_^

[CODE ]
<form action = "newproduct.php" method = "POST">
<div><b>Enter the name of the product: </b><input type = "text" name = "product_name"></div>
<div>         
        
<input type = "submit" name = "submit" value = " Add " ></div>

</form>


<?php

if(isset($_POST['submit']))

{
$product_name = $_POST['product_name'];
$product_field = mb_strtolower($product_name );
$product_field = preg_replace("/\s+/", "_", $product_field);

$query_string = "ALTER TABLE inventory ADD '" .$product_field . "' TINYINT NULL ";

$query = mysql_query($query_string);

if(!$query){
die(mysql_error());
}else
{
$query2 = mysql_query("INSERT INTO products (product_field, product_name)VALUES ('$product_field', '$product_name' ) ");

if(!$query) {die(mysql_error());}
else
{
echo " <p style = \" color:CC0033; font-weight:bold \"> Product has been added successfully</p>";
}




}




}


?>
[/CODE]
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

Guys paano ba ung halimbawa online exam. Ung mag set ka ng time let say 30 minutes after that mag lock ung program oh kaya may message mag sasabi time expired. Kailangan javascript dito.diba? Kasi sa php wala namang dynamic page refresh.
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

dapat sir recorded yung time access..

Tas every submit button for the questions, merong control check..

If starttime > 30mins
the submit query
else
times up
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

ayun sir..ngwan q n ng paraan..hehehe.THANK YOU PO..:dance:

sorry for late reply..:slap:
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

Check mo ang mga lines na to

dapat pag tinatawag yan di babalik sa file na tumawag sa kanya. This was raise in order to prevent infinite loop or redirection.

base sa code mo. yong else statement, don't redirect. Just stay with the page. Then put ka nalang condition to display an error. Not redirecting kasi parang bumabalik cya sa file na to eh.

AYUN..working na po..hehe..THANK YOU PO..:dance:

sorry po for late reply:slap:

Ay Sir 1 pa po problem q..ask q lng po if my alm kyo n mga fieldname n hnd tnatanggap ng mysql..

bale s form.php q i have 5 textfield in a <form action="code.php">
named: fname,lname,user,pass,type;



=========
in code.php:

include("../../../connection/connection.php");
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$user=$_POST['user'];
$pass=$_POST['pass'];
$type=$_POST['type'];

$sql="INSERT INTO tblaccount( fname,lname,user,pass ) VALUES ( '$fname','$lname','$user','$pass','$type' )";

$result=mysql_query($sql);


if($result)
{
echo "Success!";
//header("location:success_add.php");
}

else
{
echo "Failed!";
//header("location:error_add.php");
}

?>
============
then plgi po undefined index dw s fname,lname,user,pass,type. prang d nya po nffetch ung mga field q..:weep:

ano po kya problem jn? please help me po..:praise:

THANKS IN ADVANCE! :salute:
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

Sir try mo po palitan ng $_GET yung $_POST.

yung method po pala nung submission nung form? post o get?
 
Last edited:
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

Sir try mo po palitan ng $_GET yung $_POST.

yung method po pala nung submission nung form? post o get?

method="post" po..

mron n po kc aq unang form n gnyan dn..eh working nmn po..

then copy paste q nlng po at edit..tpos aun..dont work..:slap:

eh naicp q po bka po s fieldname q..pro try q rn po GET method..thanks po..!:salute:
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

method="post" po..

mron n po kc aq unang form n gnyan dn..eh working nmn po..

then copy paste q nlng po at edit..tpos aun..dont work..:slap:

eh naicp q po bka po s fieldname q..pro try q rn po GET method..thanks po..!:salute:

Aw, sa pagkakaalam ko po you must use $_GET function in order to retrieve the value from an assigned variable . Mamaya po pag uwi ko sa bahay kakalkalin ko yung mga lumang files ko. :)
 
Last edited:
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

Aw, sa pagkakaalam ko po you must use $_GET function in order to retrieve the value from an assigned variable . Mamaya po pag uwi ko sa bahay kakalkalin ko yung mga lumang files ko. :)

hahahha! cge po sir..hehhee..

eh un nga po pinagtataka ko eh..gumagana nmn xa s $_POST dun s una qng form..copy q lng kc ung 2nd form q dun tpos edit q lng..tpos aun..ayw n gumana..hayyyy...:upset:

try q change fieldname..bka gagana..ehhehe..:p
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

AYUN..working na po..hehe..THANK YOU PO..:dance:

sorry po for late reply:slap:

Ay Sir 1 pa po problem q..ask q lng po if my alm kyo n mga fieldname n hnd tnatanggap ng mysql..

bale s form.php q i have 5 textfield in a <form action="code.php">
named: fname,lname,user,pass,type;



=========
in code.php:

include("../../../connection/connection.php");
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$user=$_POST['user'];
$pass=$_POST['pass'];
$type=$_POST['type'];

$sql="INSERT INTO tblaccount( fname,lname,user,pass ) VALUES ( '$fname','$lname','$user','$pass','$type' )";

$result=mysql_query($sql);


if($result)
{
echo "Success!";
//header("location:success_add.php");
}

else
{
echo "Failed!";
//header("location:error_add.php");
}

?>
============
then plgi po undefined index dw s fname,lname,user,pass,type. prang d nya po nffetch ung mga field q..:weep:

ano po kya problem jn? please help me po..:praise:

THANKS IN ADVANCE! :salute:

ok na yung POST method ang ginamit mo, since supposedly dapat secured yung password field...

anyway, yung problem mo ay nandito
Code:
$sql="INSERT INTO tblaccount( fname,lname,user,pass ) VALUES ( '$fname','$lname','$user','$pass','$type' )";


4 lang yung fields na ini-specify mo, pero 5 yung parameters / values na ipinapasa mo... ang kulang mo na field ay yung para sa type
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

ok na yung POST method ang ginamit mo, since supposedly dapat secured yung password field...

anyway, yung problem mo ay nandito
Code:
$sql="INSERT INTO tblaccount( fname,lname,user,pass ) VALUES ( '$fname','$lname','$user','$pass','$type' )";


4 lang yung fields na ini-specify mo, pero 5 yung parameters / values na ipinapasa mo... ang kulang mo na field ay yung para sa type

:lol: di ko napansin, tama si sir. sa query pala yung mali. Pero sir, di po ba sa method ng submission ng form dapat post para hindi nya ipapass yung value tru url, pero kapag ire retrieve yung value dapat $_GET yung gagamitin?
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

AYUN..working na po..hehe..THANK YOU PO..:dance:

sorry po for late reply:slap:

Ay Sir 1 pa po problem q..ask q lng po if my alm kyo n mga fieldname n hnd tnatanggap ng mysql..

bale s form.php q i have 5 textfield in a <form action="code.php">
named: fname,lname,user,pass,type;



=========
in code.php:

include("../../../connection/connection.php");
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$user=$_POST['user'];
$pass=$_POST['pass'];
$type=$_POST['type'];

$sql="INSERT INTO tblaccount( fname,lname,user,pass ) VALUES ( '$fname','$lname','$user','$pass','$type' )";

$result=mysql_query($sql);


if($result)
{
echo "Success!";
//header("location:success_add.php");
}

else
{
echo "Failed!";
//header("location:error_add.php");
}

?>
============
then plgi po undefined index dw s fname,lname,user,pass,type. prang d nya po nffetch ung mga field q..:weep:

ano po kya problem jn? please help me po..:praise:

THANKS IN ADVANCE! :salute:

Code:
<?php
    include("../../../connection/connection.php");

    /* Form submission validation.*/
    if ($_POST["submit"]) /* Replace ["submit"] into the name of your submit button. */
    {
        /* Need condition above else you will recieve notices on this codes below */
        /* Notice: undefine index fname ... */
        $fname = $_POST["fname"];
        $lname = $_POST["lname"];
        $user = $_POST["user"];
        $pass = $_POST["pass"];
        $type = $_POST["type"];

        /* You can add also validations in here. */

        if ($fname == "")
        {
            echo "First name is required.";
        }

        if ($lname == "")
        {
            echo "Last name is required.";
        }

        if ($user == "")
        {
            echo "Username is required.";
        }

        if ($pass == "")
        {
            echo "Password is required.";
        }

        if ($type == "")
        {
            echo "Account type is required.";
        }

        /* Some more variants of validations bla bla blah... */

        /* Fixed mo yong field names na e.insert mo. 4vs5 */
        $sql = "INSERT INTO tblaccount(fname, lname, user, pass, type) VALUES ('$fname', '$lname', '$user', '$pass', '$type')";
        $result = mysql_query($sql);

        if ($result)
        {
            echo "Success!";
        }
        else
        {
            echo "Failed!";
        }
    }

?>
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

:lol: di ko napansin, tama si sir. sa query pala yung mali. Pero sir, di po ba sa method ng submission ng form dapat post para hindi nya ipapass yung value tru url, pero kapag ire retrieve yung value dapat $_GET yung gagamitin?

Information sent from a form with the POST method is invisible to others and has no limits on the amount of information to send.

However, because the variables are not displayed in the URL, it is not possible to bookmark the page.

When using method="get" in HTML forms, all variable names and values are displayed in the URL.

Note: This method should not be used when sending passwords or other sensitive information!

However, because the variables are displayed in the URL, it is possible to bookmark the page. This can be useful in some cases.

Note: The get method is not suitable for very large variable values. It should not be used with values exceeding 2000 characters.

yan ang gawin mo guide kung kailan gagamitin ang GET or POST...

anyway, dun uli sa question mo, kung post method ang ginamit mo, $_POST ang gagamitin mo para ma-retrieve yung value, kung get method, $_GET ang gamitin mo... :)
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

Aw ok sir, thanks po. Nakita ko narin yung mga lumang books ko po. Hehe :) nabasa ko na po. Tama medyo nalito lang po ako sa differences nun dalawang function ($_POST & &_GET). Sir, pa add pala as friend. :lol:
 
Last edited:
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

sure no problem, just add me up
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

Question po: panu ko gagawin na pagnagclick sa $(".ffthumb"), hindi pwede magclick sa $("#gall-wrapper") hanggat di pa natatapos yung lahat ng effects sa $(".ffthumb")

$(".ffthumb").click(function(){
$("#gall-pop").fadeIn(1000);
$("#gall-wrapper").fadeIn();
});
$("#gall-wrapper").click(function(){
$(this).hide();
$("#gall-pop").hide();
$("#gall-pop li").remove();
});
 
Approval of request (php)

cno po kya my idea pra s process of approval of request? gus2 q po sna mangyari eh gn2:
idea#1:
tblitem with link n approve and reject. then kpg click mo ung approve punta xa approve.php then select nya ung name ng item then update nya.
==question:
possible po ba na pgkaSELECT q ng item then UPDATE na automatic na ppsok n agad qng approve o reject (based from the link chose)?

idea#2:
gwa aq ng new table n pra s approve item then i-mmove nya ung mga chosen item n approved s approve item. possible ba un?:noidea:

PLEASE HELLLLPPPPPP MEEEEEEEEEE!!! :pray:
 
Re: Mga Tanong tungkol sa PHP, CSS, jquery, HTML at MySQL pasok D2

$(".ffthumb").click(function(){

$("#gall-pop").fadeIn(1000);
$("#gall-wrapper").fadeIn();
$("#gall-wrapper").click(function(){
$(this).hide();
$("#gall-pop").hide();
$("#gall-pop li").remove();
});

});

try mo daw ito, ilagay sa loob yung gall wrapper
 
Back
Top Bottom