php-windows Digest 13 Feb 2006 14:32:42 -0000 Issue 2886

Topics (messages 26687 through 26691):

Re: SESSIONS and include()
        26687 by: Luis Moreira
        26688 by: Fredrik Tillman

Can't install
        26689 by: Ing. Tomás Liendo
        26690 by: Luis Moreira

PDO with prepared statements
        26691 by: Travis Raybold

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
Actually it does not make that much sense.
I use includes, with PHP extension, and never had a problem.
Take a look at how you communicate between modules, ergo if you have globals
on or off, the scope of variables, etc.
It seems as if "user_level" is not known within the module.

Luis

-----Original Message-----
From: Armando [mailto:[EMAIL PROTECTED] 
Sent: quinta-feira, 9 de Fevereiro de 2006 4:41
To: [email protected]
Subject: Re: [PHP-WIN] SESSIONS and include()

Read the user post (currently 2nd) from greatmagicalhat [at] gmail [dot] 
com at the link below. I've never tried including a php file myself so 
cannot verify their information, but it makes sense. When I use 
includes, I use a specific file extension and store the files in a 
protected directory (so they are not just able to be viewed by browsing 
directly to the file) and it works fine. If you do it with a different 
file extension, make sure you configure your web server to make PHP 
process pages with that extension. Cheers.

http://ca3.php.net/manual/en/function.include.php

Armando

Fredrik Tillman wrote:
> Hi
> 
> PROBLEM:
> 
> I want to let certain users use certain funcions on my page. To manage 
> that I start a session and define $_SESSION[user_level] to a value from 
> a mySQL table. So far so good. Users with $_SESSION[user_level]=="1" can 
> access things on the .php page they are on. I made a simple if-statement 
> to handle that.
> 
> Now the problem is that i want to use include("page.php") and let the 
> users with user_level=1 access special things on that included page. The 
> if statements that let them change things work if I access the page 
> directly from my browser but not when it is included in that main page.
> 
> Whats am I missing?
> 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
PROBLEM SOLVED!

Hi and thanks for all your input and help.

I solved the problem. There was one little thing I just didn't think about.

What I actually did was include a variable (include($page)) and let the last page the user was on send a value for $page. Now, the pages I wanted to include, I included to different pages in different folders/directories so the variable $page was actually set to the full URL of the page to avoid confusions. But apearantly PHP drops all $_SESSION variables when inluding a full URL. Even when the URL-home is idetical to the page the user are on... Relative paths like $page="../folder/thispage.php" works fine when including $page.




Luis Moreira wrote:

Actually it does not make that much sense.
I use includes, with PHP extension, and never had a problem.
Take a look at how you communicate between modules, ergo if you have globals
on or off, the scope of variables, etc.
It seems as if "user_level" is not known within the module.

Luis

-----Original Message-----
From: Armando [mailto:[EMAIL PROTECTED] Sent: quinta-feira, 9 de Fevereiro de 2006 4:41
To: [email protected]
Subject: Re: [PHP-WIN] SESSIONS and include()

Read the user post (currently 2nd) from greatmagicalhat [at] gmail [dot] com at the link below. I've never tried including a php file myself so cannot verify their information, but it makes sense. When I use includes, I use a specific file extension and store the files in a protected directory (so they are not just able to be viewed by browsing directly to the file) and it works fine. If you do it with a different file extension, make sure you configure your web server to make PHP process pages with that extension. Cheers.

http://ca3.php.net/manual/en/function.include.php

Armando

Fredrik Tillman wrote:
Hi

PROBLEM:

I want to let certain users use certain funcions on my page. To manage that I start a session and define $_SESSION[user_level] to a value from a mySQL table. So far so good. Users with $_SESSION[user_level]=="1" can access things on the .php page they are on. I made a simple if-statement to handle that.

Now the problem is that i want to use include("page.php") and let the users with user_level=1 access special things on that included page. The if statements that let them change things work if I access the page directly from my browser but not when it is included in that main page.

Whats am I missing?



--- End Message ---
--- Begin Message ---
Hi I can't install PHP on Windows XP.
The error: "Windows Can't found c:\Windows\System32\issext.vbs"

What Can I do?

Please Help me!

Thnaks, Tom. 

--- End Message ---
--- Begin Message ---
That error is related to IIS
I am not an expert on IIS, but on the Internet there are reports of exactly
the same error (very few, I'm afraid)

Luis

-----Original Message-----
From: Ing. Tomás Liendo [mailto:[EMAIL PROTECTED] 
Sent: quinta-feira, 9 de Fevereiro de 2006 14:48
To: [email protected]
Subject: [PHP-WIN] Can't install

Hi I can't install PHP on Windows XP.
The error: "Windows Can't found c:\Windows\System32\issext.vbs"

What Can I do?

Please Help me!

Thnaks, Tom. 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message --- i'm using PHP 5.1.2, and trying to manipulatre a database with PDO_ODBC accessing a MS SQL Server database. i can execute normal queries with no problem. but when i start executing prepared statements i run into problems. has anyone successfully used multiple parameter prepared statements with MSSQL and PDO? one thing that would help is if i could get the full text of whatever PDO is trying to send to SQL Server, does anyone know of a way to get that?

i set up a test table zTestTable, with a TestID autoincrement primary key int, a Test (nvarchar(200)) and a TestNumber(int). when i execute the following code, it inserts a row with the value 1 for Test and TestNumber. the same thing happens if i try to use ? parameters instead of named parameters.

$oConnection = new PDO($sDSN);
$sSQL = 'INSERT INTO zTest_TBL (Test, TestNumber) VALUES (:Test, :TestNumber) ';
$oStatement = $oConnection->prepare($sSQL);
$s='test insert string passing an array to execute';
$i=1;
$oStatement->execute(array(':Test'=>$s,':TestNumber'=>$i));
print_r($oStatement->errorInfo());

the second bit of code is an attempt to bind parameters and run the same insert. this one inserts a row with NULLs for Test and TestNumber.

$oConnection = new PDO($sDSN);
$sSQL = 'INSERT INTO zTest_TBL (Test, TestNumber) VALUES (:Test, :TestNumber) ';
print $sSQL;
$oStatement = $oConnection->prepare($sSQL);
$s2='test insert string binding a parameter';
$oStatement->bindParam(':Test', $s2, PDO::PARAM_STR);
$oStatement->bindParam('TestNumber', $i, PDO::PARAM_INT);
$oStatement->execute();

thanks in advance,

--travis

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


--- End Message ---

Reply via email to