| | I created this topic mainly because I wanna get a clear interpretation about those listed PHP functions. The first function is while($row=mysql_fetch_array($query)) { |
|
I created this topic mainly because I wanna get a clear interpretation about those listed PHP functions. The first function is while($row=mysql_fetch_array($query)) { You have called a sql and loaded it into variable $query. And by that line, you have loaded all coulombs into the variable $row as an array from the variable $query. After this, it is easy to call a coulomb by the variable $row. For example: if there is a coulomb "username" in the table, you can call it by $row['username'] . This is the easiest way to call a coulomb. And each while repeats the next row will be loaded into the variable $row until all rows finishes. Explain me the following line; $user=trim($_POST['user']) trim function is a combine of left trim and right trim. trim deletes the spaces in the left and in the right of the variable. Here variable $user has been set to $_POST['user'] without spaces around it. For example: $_POST['user'] is CODE ' user\'s name ' trim function will give you the result CODE 'user\'s name' and set it to $user.
I did not get it clearly! For which puposse the function is used?!
I did not get it clearly! For which puposse the function is used?! The trim function erases the spaces,tabs, at the start and at the end. For example: in your code: CODE 1. if ($_GET['login']) { #checks for admin login 2. $user=trim($_POST['user']); #trim user in case of mistake 3. $pass=trim($_POST['pass']); 4. str_replace("username", "password", $srt); 5. if (($user == "username") && ($pass="password")) { Think that the user's name is CODE "username" .If the member enters CODE " username " //there are some spaces at the beginning and end.And if you didn't use trim and directly set, like this CODE 2. $user=$_POST['user']; At the 5th line the user's name will not equals. Like this CODE if (" username "=="username") { the two value is not equal butif you used trim function CODE 2. $user=trim($_POST['user'];) and so CODE if ("username"=="username") { yes the two value is equal, because we used trim function.Briefly if you use trim, the if match will be true even the member adds around the his username.
Thanks. I think I am going to try it soon and then post a reply concerning such issues.
Thanks. I think I am going to try it soon and then post a reply concerning such issues. try using php's documentation. it might help you on some other issues you have in mind. http://www.php.net/docs.php
Yeah, just use http://www.php.net to search for most functions. Or if you need a different function just google it. Or ask here. Whichever you are most comfortable with.
Recent Queries:-
Keywords : functions,
(9) Which other methods to send mail from a form? I just know mail function, like: mail(string to, Need to have arrays available to all functions. (3) I've got a bunch of arrays that i want to use for more then 1 function. when i declear the (0) Here is my 3rd Code: By this code you can encrypt your text: CODE $a = md5("hello"); $b = Really simple example on how to combine values with function (2) I just learned this simple method on how to use functions to combine two values from a form. First Questions (2) Hi all I want begin a new project , my new project is Photo blog ( weblog and image album ) in one I will place here usefull php snippets and functions that i learn/use (13) Here is a function you can use to generate a simple random password for whatever use ;-) CODE (2) Can some one please tell me what is the purpose of the following functions , although there's a (4) I've got the following function, that has a function inside of it, when I run it I get the Specifically, lines or regular polygons. (4) I've been experimenting a little with PHP's image functions and I was trying to see if I how do i write php functions that takes arguments in php? (2) I'll set up the background for the question: I have a separate file that I include on all the some php functions that i am confused (5) First of all, if you have answers to the following QUOTE Looking for functions,
|
![]() Functions - ??? |
| ADD REPLY / Got an Opinion! | a humble request :-) | RAPID SEARCH! | Free Hosting | [X] |
|
Express your Opinions, Thoughts or Contribute your information that might help someone here. Ask your Doubts & Queries to get answers.. "Together, We enlight each other!" |
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP. | 500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE |
|