| PHP SUPPORT TOPIC | |
|
|
|
Author | Message |
---|
^DarkLord^ Programmer
Posts : 54 Dark Points : 5483 Reputation : 6 Join date : 2009-07-03 Age : 40
Character sheet Dark Field: 200
| Subject: PHP SUPPORT TOPIC Thu Jul 30, 2009 5:12 am | |
| Anyone who encounter issues or problems regarding PHP, please do not hesitate to post your question here, I will be more than happy to help as long as I have a spare time. | |
|
| |
†Dark Prince† Programmer
Posts : 64 Dark Points : 5496 Reputation : 3 Join date : 2009-07-05 Age : 31
Character sheet Dark Field: 200
| |
| |
^DarkLord^ Programmer
Posts : 54 Dark Points : 5483 Reputation : 6 Join date : 2009-07-03 Age : 40
Character sheet Dark Field: 200
| Subject: Re: PHP SUPPORT TOPIC Thu Jul 30, 2009 10:05 am | |
| - †Dark Prince† wrote:
- im really having a hard time on coding in PHP
just like my last quiz in my php class...
i already got the logic but still dont know how to code it maybe because the syntax of php is very similar to C language... cuz when im in my C language class like 3 years ago...i did nt really like progmming back then so i always intend to absent that subject...
but now that i realize that proraming is such a cool thing... i really want to learn on how to improve my coding on PHP
is it really just Practice and memorization?
"im a slow learner...but i LOVE to learn"...
Well, I believe the answer to your questions is, Both. Memorize, since you need to put in mind the pre-built functions that PHP has, their purpose, usage, howtos, what are the arguments needed and the parameters to consider. Practice, they say that practice makes perfect and for me practice can make us get use to and understand well the rules and discover different coding style variations, techniques and logic formulation. There are many ways that can make us atleast a good programmer, just focus on what you do and what you want to be. And one of my mentor told me this and want to share with you all. "Learn 5 Everyday", meaning, learn atleast 5 functions/syntax, their usages, howtos, and implement them on sample programs source code to better understand them I tell you will gain alot! try to think of this... 5 X 30 = 150 X 12 = 1800, breakdown, 5 learnings a days times 30 (stands for the number of days in a month) and time 12 (for the number of months in a year) See! That's Alot! And above anything else I think one the greatest challenge we all faces and we need to overcome right now is how do we start doing this two (Practice and Memorize)? For me, you have to challenge yourself, to think of, this is your future we are talking about this will be your bread and butter in the near days. Begin Now! or Never! | |
|
| |
†Dark Prince† Programmer
Posts : 64 Dark Points : 5496 Reputation : 3 Join date : 2009-07-05 Age : 31
Character sheet Dark Field: 200
| Subject: .... Thu Jul 30, 2009 11:56 am | |
| | |
|
| |
Dark_MessengeR_kHai Programmer
Posts : 27 Dark Points : 5444 Reputation : -5 Join date : 2009-07-08 Age : 30 Location : MQC
| |
| |
^DarkLord^ Programmer
Posts : 54 Dark Points : 5483 Reputation : 6 Join date : 2009-07-03 Age : 40
Character sheet Dark Field: 200
| Subject: Re: PHP SUPPORT TOPIC Thu Jul 30, 2009 7:37 pm | |
| - Dark_MessengeR_kHai wrote:
- DL about XAMP!!if you dont have a IP folder inside of htdocs what u will do?? just cr8??or it will work without it??I cant run my sample codes Or bka sa browser ko lang Im using IE7
You can create any folder with any name as long as it is inside the HTDOCS folder. For example: You created a folder name, MYSITE Then, on the browser you can run that as... HTTP://LOCALHOST/MYSITE/YOURFILE.PHPor HTTP://127.0.0.1/MYSITE/YOURFILE.PHPIf this won't work try to check your XAMPP CONTROL PANEL if the Apache Web Server is working/running. Please let me know if it works. | |
|
| |
-=Dark Master=- Advanced Programmer
Posts : 102 Dark Points : 5551 Reputation : 15 Join date : 2009-07-05 Age : 37 Location : darkest corner of san roque guagua pampanga
| Subject: Re: PHP SUPPORT TOPIC Thu Jul 30, 2009 9:21 pm | |
| wow this is cool! sama ako: ot puru english naman dong! hahaha ahmmm... PHP is lovely... just post any specific question hehehe and we will all discuss about it yeah men! hehe | |
|
| |
-=Dark Master=- Advanced Programmer
Posts : 102 Dark Points : 5551 Reputation : 15 Join date : 2009-07-05 Age : 37 Location : darkest corner of san roque guagua pampanga
| Subject: Re: PHP SUPPORT TOPIC Thu Jul 30, 2009 9:36 pm | |
| Sir DL ahhmmm... lam mo ba ung ala datapager sa ASP.net? pano ung sa PHP version parang ung sa friendster messages ung may page 1,2,3,4....20, para d ngfaflood ung mga items sa isang page...
Makainggit magPHP la hehehe..... | |
|
| |
^DarkLord^ Programmer
Posts : 54 Dark Points : 5483 Reputation : 6 Join date : 2009-07-03 Age : 40
Character sheet Dark Field: 200
| Subject: Re: PHP SUPPORT TOPIC Fri Jul 31, 2009 7:55 am | |
| - -=Dark Master=- wrote:
- Sir DL ahhmmm... lam mo ba ung ala datapager sa ASP.net? pano ung sa PHP version parang ung sa friendster messages ung may page 1,2,3,4....20, para d ngfaflood ung mga items sa isang page...
Makainggit magPHP la hehehe..... I have created and using a function for that which can generate Pagination on the web page. Mejo mahaba-haba ang code para dun.. hehe.. ^_^. Nga pala "PAGINATION" ang tawag dun. | |
|
| |
-=Dark Master=- Advanced Programmer
Posts : 102 Dark Points : 5551 Reputation : 15 Join date : 2009-07-05 Age : 37 Location : darkest corner of san roque guagua pampanga
| Subject: Re: PHP SUPPORT TOPIC Fri Jul 31, 2009 3:09 pm | |
| sir sidestep lang sa thesis namin gusto ko lang malaman, i really have no time to research PHP kaya nagtanong nalang ako. May sample pa ba kayo ng code? oh yung function kasi gusto ko malaman un sa php kasi its as important as the primary control diba? kasi nagfloflood ang webpage. | |
|
| |
Dark_MessengeR_kHai Programmer
Posts : 27 Dark Points : 5444 Reputation : -5 Join date : 2009-07-08 Age : 30 Location : MQC
| |
| |
^DarkLord^ Programmer
Posts : 54 Dark Points : 5483 Reputation : 6 Join date : 2009-07-03 Age : 40
Character sheet Dark Field: 200
| Subject: Re: PHP SUPPORT TOPIC Sat Aug 01, 2009 1:01 am | |
| - -=Dark Master=- wrote:
- sir sidestep lang sa thesis namin gusto ko lang malaman, i really have no time to research PHP kaya nagtanong nalang ako. May sample pa ba kayo ng code? oh yung function kasi gusto ko malaman un sa php kasi its as important as the primary control diba? kasi nagfloflood ang webpage.
Yep, meron pa ako nung function na ginagamit ko.. hehe.. cge share ko nalang sa iyo when we meet. Anyone who needs it, just let me know. | |
|
| |
dark_kernel Programmer
Posts : 51 Dark Points : 5471 Reputation : 0 Join date : 2009-07-04 Age : 29 Location : Pampanga
Character sheet Dark Field: 200
| Subject: Re: PHP SUPPORT TOPIC Tue Aug 04, 2009 12:32 pm | |
| Just want to ask..how to validate data..in PHP I already get how to save data in DB Example: I have a textbox and Submit button I click the submit button the data will be save.. but if that data is already existing in the DB it will tell you that the data already exist..
what is the proper code for this??
tnx..ehehe | |
|
| |
^DarkLord^ Programmer
Posts : 54 Dark Points : 5483 Reputation : 6 Join date : 2009-07-03 Age : 40
Character sheet Dark Field: 200
| Subject: Re: PHP SUPPORT TOPIC Tue Aug 04, 2009 3:11 pm | |
| - dark_kernel™ wrote:
- Just want to ask..how to validate data..in PHP
I already get how to save data in DB Example: I have a textbox and Submit button I click the submit button the data will be save.. but if that data is already existing in the DB it will tell you that the data already exist..
what is the proper code for this??
tnx..ehehe First you need to determine if the record already exist by selecting values in a column where values are should be unique for example username, Validate the username if exist using SQL, - Code:
-
$sql = "SELECT * FROM USERS_TABLE WHERE username = '". $_POST['username'] . "'";
$result = mysql_query($sql);
if(mysql_num_rows($result) > 1) # If greater than 1 means there is { # an existing user with the same name echo "Record Already Exist"; } else { echo "Record Does Not Exist" } Explanation:Syntax:int mysql_num_rows ( resource $result ) Usage:Retrieves the number of rows from a result set. This command is only valid for statements like SELECT or SHOW that return an actual result set.[b] Please let me know if this works. | |
|
| |
-=Dark Master=- Advanced Programmer
Posts : 102 Dark Points : 5551 Reputation : 15 Join date : 2009-07-05 Age : 37 Location : darkest corner of san roque guagua pampanga
| |
| |
^DarkLord^ Programmer
Posts : 54 Dark Points : 5483 Reputation : 6 Join date : 2009-07-03 Age : 40
Character sheet Dark Field: 200
| |
| |
dark_kernel Programmer
Posts : 51 Dark Points : 5471 Reputation : 0 Join date : 2009-07-04 Age : 29 Location : Pampanga
Character sheet Dark Field: 200
| Subject: nyahah Tue Aug 04, 2009 11:08 pm | |
| Big thanks..DL.. ehehe... woo also DM..tnx.. more power sa Darkness.. | |
|
| |
^DarkLord^ Programmer
Posts : 54 Dark Points : 5483 Reputation : 6 Join date : 2009-07-03 Age : 40
Character sheet Dark Field: 200
| Subject: Re: PHP SUPPORT TOPIC Tue Aug 04, 2009 11:10 pm | |
| - dark_kernel™ wrote:
- Big thanks..DL..
ehehe... woo
also DM..tnx..
more power sa Darkness.. No Problem, Just keep on posting your questions in this thread regarding PHP and let's see what we can do. Thanks! | |
|
| |
-=Dark Master=- Advanced Programmer
Posts : 102 Dark Points : 5551 Reputation : 15 Join date : 2009-07-05 Age : 37 Location : darkest corner of san roque guagua pampanga
| Subject: Re: PHP SUPPORT TOPIC Wed Aug 05, 2009 6:34 pm | |
| of course ena naman kasing bangis ng DL hehehe.... let the knowledge flow! naks! makainspire parang opensource tayo d2 hehehe | |
|
| |
dark_kernel Programmer
Posts : 51 Dark Points : 5471 Reputation : 0 Join date : 2009-07-04 Age : 29 Location : Pampanga
Character sheet Dark Field: 200
| Subject: Re: PHP SUPPORT TOPIC Sat Aug 08, 2009 1:35 pm | |
| hi po..tanong ko lang pano po kunin ang value ng.. textbox pag hindi submit button ang gagamitin?? ex: <?php
$con = mysql_connect("localhost","root"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_selectdb("db_php",$con);
$_GET['user'] = $user; $_GET['pass'] = $pass;
mysql_query("INSERT INTO tbl_user(user, pass) VALUES('$user', '$pass') "); mysql_close($con); ?>
<form name="f1" method="get"> <input type="text" name="t1"> <input type="text" name="t2"> <a href='home.php?action=add&user=?????&pass=?????' >Save</a> </form>
tnx po...ehehe | |
|
| |
^DarkLord^ Programmer
Posts : 54 Dark Points : 5483 Reputation : 6 Join date : 2009-07-03 Age : 40
Character sheet Dark Field: 200
| Subject: Re: PHP SUPPORT TOPIC Tue Aug 11, 2009 7:07 am | |
| - dark_kernel™ wrote:
- hi po..tanong ko lang pano po kunin ang value ng.. textbox pag hindi submit button ang gagamitin??
ex: [color=cyan]<?php
tnx po...ehehe - Code:
-
$con = mysql_connect("localhost","root"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_selectdb("db_php",$con);
$action = $_GET['action']; //Get the ACTION, for this ex. the action is ADD. $user = $_GET['user']; // GET User $pass = $_GET['pass']; // Get Password
switch($action) { case 'ADD': // CODE FOR ADD! mysql_query("INSERT INTO tbl_user(user, pass) VALUES('$user', '$pass') "); mysql_close($con); break; }
?>
<form name="f1" method="get"> <input type="text" name="t1"> <input type="text" name="t2"> <a href='home.php?action=add&user=?????&pass=?????' >Save</a> </form>[/color]
Hope this helps... | |
|
| |
dark_kernel Programmer
Posts : 51 Dark Points : 5471 Reputation : 0 Join date : 2009-07-04 Age : 29 Location : Pampanga
Character sheet Dark Field: 200
| Subject: Re: PHP SUPPORT TOPIC Tue Aug 11, 2009 9:19 am | |
| tnx po DL. sir tanong ko lang ung right code nito ung may ????? <a href='home.php?action=add&user=?????&pass=?????' >Save</a> tnx po | |
|
| |
^DarkLord^ Programmer
Posts : 54 Dark Points : 5483 Reputation : 6 Join date : 2009-07-03 Age : 40
Character sheet Dark Field: 200
| Subject: Re: PHP SUPPORT TOPIC Tue Aug 11, 2009 9:30 am | |
| - dark_kernel™ wrote:
- tnx po DL.
sir tanong ko lang ung right code nito ung may ????? <a href='home.php?action=add&user=?????&pass=?????' >Save</a> tnx po Parameter kasi mga yan.. usually, ginagamit ang ganyang query string sa pag update ng record, bale e que-query mo muna yung IDs ng username, not necessarily yung password, question, ano ba ang gagawin mo bakit mo kailangan ng ganyan? | |
|
| |
dark_kernel Programmer
Posts : 51 Dark Points : 5471 Reputation : 0 Join date : 2009-07-04 Age : 29 Location : Pampanga
Character sheet Dark Field: 200
| Subject: Re: PHP SUPPORT TOPIC Tue Aug 11, 2009 10:56 am | |
| kc sir gusto ko sana sa halip na submit button gamitin ko..e. link nalang kpag.. mag sasave ako.. | |
|
| |
^DarkLord^ Programmer
Posts : 54 Dark Points : 5483 Reputation : 6 Join date : 2009-07-03 Age : 40
Character sheet Dark Field: 200
| Subject: Re: PHP SUPPORT TOPIC Wed Aug 12, 2009 2:22 am | |
| - dark_kernel™ wrote:
- kc sir gusto ko sana sa halip na submit button gamitin ko..e. link nalang kpag..
mag sasave ako.. Hindi ko ma-e-su-suggest yan na gawin mo.. since masyado siyang risky pagdating sa hack, kasi expose ang mga data mo like yung username and password mo sa query string mo... I suggest to use pa din ang submit button and post method... para naka hide ang data mo... | |
|
| |
Sponsored content
| Subject: Re: PHP SUPPORT TOPIC | |
| |
|
| |
| PHP SUPPORT TOPIC | |
|