?php
$globalvar1=1;
$globalvar2=2;
function globals() {
$globals = $GLOBALS;
var_dump($GLOBALS);
print_r(br /Before...);
print_r($globals);
foreach (array(
'GLOBALS',
'_ENV',
'HTTP_ENV_VARS',
'_POST',
'HTTP_POST_VARS',
'_GET',
Dear All,
I was reading the php manual for session_register, and I found the following
line there : -
$_SESSION[$var] = $$var;
Why do I need $$ there ? Can someone explain?
Thank you,
Ashim
Hi Ashim,
These are called Variable Variables. Ideally they should be avoided,
as they introduce unnecessary legibility issues.
This is what it does in a nutshell, it's actually quite simple:
$foo = 'bar';
$bar = 'foobar';
echo $$foo;//This prints foobar
What it does is, take the
It doesn't though, it creates a copy of the $_GLOBALS super global array,
removes entries that will have been set by the system (i.e. it leaves
user-defined variables) and then returns the ones that are left, so in that,
the user note is perfectly correct.
What has me puzzled is how unsetting
Unsetting doesn't leave user defined variables. Unsetting simply destroys
variables (or removes elements from an array, etc). There is nothing magic
or hidden in that script. I think the note meant exactly what it said: after
creating a local copy of the $GLOBALS array and removing super
I'll remove it.
How does one remove user notes from php.net ?
Thank you,
Ashim
Dear Ashley,
I do follow the part when it creates a local copy of $GLOBALS.
When it unsets them, is there a subtlety of unset that it ONLY unsets system
defined entries? Could you please explain this ?
Thank you,
Ashim
Dear all,
I was reading this page
http://php.net/manual/en/reserved.variables.globals.php and I found the
following script there :
Here's a function which returns an array of all user defined global
variables:
?php
function globals() {
$globals = $GLOBALS;
foreach (array(
-- Forwarded message --
From: Ashim Kapoor ashimkap...@gmail.com
Date: Thu, Mar 3, 2011 at 7:22 AM
Subject: Re: [PHP] Help needed with mysql import
To: Jim Lucas li...@cmsws.com
CREATE TABLE IF NOT EXISTS `ajax_products` (
`id` int(11) NOT NULL auto_increment,
`name` varchar
Dear all,
I am trying to make a website with php and I found the following code in a
book and I am trying to import it. The following are the beginning of the
file i am trying to import with the command
mysql -u root -pmypassword certainty dump
I get the following error : ERROR 1067 (42000) at
Dear All,
I am learning PHP by reading a book. My query pertains to the following
lines : -
$form_str = EOFORMSTR
TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 ALIGN=CENTER
WIDTH=621
TR
TD ROWSPAN=2IMG WIDTH=15 HEIGHT=1
SRC=../images/spacer.gif/TD
.
My query is that is it true that we don't
The quotes you mention are in the HTML, nothing to do with PHP. HTML will
work without the quotes in most cases (unless there's a space in the value
for the attribute) but the quotes are required in XHTML and will cause
unexpected results.
Can you elaborate on the XHTML part? Do you mean they are
Yes, in HTML the quotes are optional, but they are required in XHTML
documents:
http://www.w3.org/TR/xhtml1/diffs.html#h-4.4
Ok Thank you,
Ashim
?php
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm=My Realm');
header('HTTP/1.0 401 Unauthorized');
echo 'Text to send if user hits Cancel button';
exit;
} else {
echo pHello {$_SERVER['PHP_AUTH_USER']}./p;
echo pYou entered
-- Forwarded message --
From: Ashim Kapoor ashimkap...@gmail.com
Date: Mon, Feb 21, 2011 at 12:46 PM
Subject: Re: [PHP] HTTP Authenticaion Query
To: Peter Lind peter.e.l...@gmail.com
You are tired and not thinking straight. HTTP is a stateless thing: 1.
you request the page
Dear All,
The book PHP and MySQL bible says that the php directory should be world
executable ? I remember posting a different question earlier to this list
and one person suggesting this and another person replying that that was
incorrect.
Could someone clear the smoke on this one ?
Many
OK. Thank you Jim/Nathan.
Ashim : )
On Sun, Feb 13, 2011 at 1:26 AM, Nathan Rixham nrix...@gmail.com wrote:
Ashim Kapoor wrote:
Dear All,
I am reading PHP5 and MySQL Bible. Chapter 7 of the book says that PHP
can
use GET and POST in the SAME page! Also it says that we can use the SAME
Dear All,
I am reading PHP5 and MySQL Bible. Chapter 7 of the book says that PHP can
use GET and POST in the SAME page! Also it says that we can use the SAME
variables in GET and POST variable sets and that conflict resolution is done
by variable_order option in php.ini Can some one write a small
Dear All,
I am a beginner at PHP. I was studying the curl library and I came across
CURLOPT_URL.I think this can be used similar to wget ? What would be the
major differences in these 2 ?
Thank you,
Ashim
if nothing else I should do that.
Many thanks for your time,
Ashim.
On Sun, Nov 7, 2010 at 8:21 PM, tedd tedd.sperl...@gmail.com wrote:
At 3:39 PM +0530 11/7/10, Ashim Kapoor wrote:
Dear All,
I am a beginner looking for a project to contribute. Can someone tell me
some good quality projects
Dear All,
I am a beginner looking for a project to contribute. Can someone tell me
some good quality projects where I would learn the most? I hope this is the
right forum for this query.
Many thanks,
Ashim Kapoor
21 matches
Mail list logo