Glubase - share your knowledge

All / Computers

Change category:



Search results
What is PHP?
PHP: Hypertext Preprocessor PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. ...

mysql_query
mysql_query Description: Sends a mySQL query to the mySQL database. Syntax: resource mysql_query ( string $query [, resource $link_identifier] ) Parameters: query - A SQL query link_identifier - The MySQL connection Return Values: ...

How do I get a user's IP address?
The users ip address is stored in the environment variable $REMOTE_ADDR, if you want to resolve the domain name for that ip (if any) use: <? $domain=GetHostByName($REMOTE_ADDR); ?> ...

What does PHP stand for?
PHP is short for "PHP: Hypertext Preprocessor". ...

When I try to connect to mysql from php I get this error: "Call to unsupported or undefined function mysql_connect();"
Either you are missing MySQL support in the php module or you need to load MySQL dynamically in your scripts by inserting: dl("mysql.so"); (on unix) dl("mysql.dll"); (on windows) ...

is_null
is_null Syntax bool is_null ( mixed var) Finds whether the given variable is NULL. Parameters var The variable being evaluated. Return Values Returns TRUE if var is null, FALSE otherwise. See also is_bool() is_nu ...

What PHP editor should i use?
This is a good site for reviews on PHP editors: http://www.php-editors.com/ ...

How do you set session timeout time?
In php.ini there is a variable called session.gc_maxlifetime that is the number of seconds that php will keep using the session. The default value is 1440 seconds. ...

How do you get the length of an array?
Use the sizeof() function like: $length = sizeof($array); ...

How do you create functions with optional variables?
You set the variable equal to the default value. Like in this example: function($var,$optional_variable="default_value") { return 1; } Here $optional_variable is optional and has the value "default_value" as default ...

Are there any good webpages with information about PHP?
A list of some good webpages: www.php.net The official webpage ...

for
for (expr1; expr2; expr3) { /* statement */} expr1 - The first expression is run once at the beginning of a loop. expr2 - The second expression is evaluated at each iteration. If TRUE the loop continues, and if FALSE the loop ends. expr ...

is_object
is_object Description Returns true if a variable is an object. Syntax bool is_object(var) Parameters var - the object to evaluate. ...

What does error "Warning: cannot modify header information - headers already sent by" mean?
This probably means that you are trying to set a cookie or doing a header redirect after posting HTML code. Theese kind of actions have to be done before any HTML or even a blank space is sent. ...

How do you convert strings to be used in a url or http address?
Use the command urlencode(string $str). Example: <?php echo '<a href="http://www.mysite.com?test=' . urlencode($mystring) . '">link</a>'; ?> ...

msql_close
msql_close Description: Closes the connection to the mSQL server. Syntax bool msql_close ( [resource $link_identifier] ) Return Values Returns TRUE on success or FALSE on failure. ...

mysql_info
mysql_info Description: Get information about the most recent query. Syntax: string mysql_info ( [resource $link_identifier] ) Returns detailed information about the last query. ...

mysql_ping
mysql_ping Description: Checks whether or not the connection to the server is working. If it has gone down, an automatic reconnection is attempted. Syntax: bool mysql_ping ( [resource $link_identifier] ) Parameters: link_identifier - T ...

stripslashes
stripslashes Description Strips a string of backslashes. Syntax stripslashes(string $str) Parameters str string Description: The string to strip from backslashes Return value Returns a string without the slashes. Example echo s ...

How do you keep text in text-inputs in forms when going back with the browser?
You can accomplish this by using session variables in for example PHP. In the webpage with the form, insert something like this: <form action="index.php" method="POST" name="formname"> <input type=&q ...

Next