[PHP] Session Problem

2007-02-15 Thread LoneWolf
I am having a problem where it appears that the session is not being saved 
properly.

While on a page, I can start a session and set variables to it. however, 
when I go to the next page.. the session variables appear to have been 
cleared out.

first page:
session_start();

$_SESSION[user_level] = test;



second page:

session_start();

echo $_SESSION[user_level] ;



We just installed php on the 2003 server.  Is there maybe a problem with the 
php.ini file that I need to fix?

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



Re: [PHP] Is echo tag reasonably portable?

2005-11-15 Thread lonewolf
Every server I work on is set to not allow short tags, and I work on
about 7 different state, federal, and commercial ones.  Some of them
don't even read .htaccess files in the directories where my scripts
reside, so trying that type of hack would get you booted.

just my $.02

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



Re: [PHP] Is echo tag reasonably portable?

2005-11-15 Thread lonewolf

  Every server I work on is set to not allow short tags, and I work on
  about 7 different state, federal, and commercial ones.
 
 Why turn off short tags? Does that make things more secure?

In some respects it does because it means shortcuts are not allowed, it
also means that someone trying to hack through your site is going to be
held to a higher standard (ASP tags are cut off as well, the only thing
recognized and executed is PHP).  Even CGI scripts reside in their own
directory and are called/executed from others.

for instance most of my scripts/functions are run from a
/share/php/functions directory instead of from the spot on the server. 
Portability.  :)

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



Re: [PHP] Unable to send variables to MySQL table

2005-11-09 Thread lonewolf
I code all my apps to look for an empty variable and dump and empty set
into it.  That way when I code the rest of the information into the
database, the files are cleaner and I don't have to worry about users
and bad sets.

$var = '';

Robert

- Original Message -
From: Stewart Priest [EMAIL PROTECTED]
Date: Wednesday, November 9, 2005 2:43 pm
Subject: Re: [PHP] Unable to send variables to MySQL table

 snip
 print $add_to_db;
 /snip
 
 Thanks for all your replies! I didn't expect to get one so quick, 
 so thanks!
 
 After I did the above, I pasted the output into MySQL. Guess what? 
 It didn't
 work!
 
 I was only sending values for $item1_desc and $item1_cost. Because 
 I was not
 sending values for the other columns, I was getting an error 
 message saying
 the data was truncated for the empty variables.
 
 Now I need to figure out how to send empty values... would NULL do 
 the job?
 
 Thanks again!
 Stewart
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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



Re: [PHP] security code

2005-11-09 Thread lonewolf
www.phpclasses.org - There was just one pushed out recently in fact.  I
am not sitting in front of my archive or I could give you a direct URL
to it, but they have them there.

If you can't find it there, email me back directly and I'll send the
link when I get back from my conference.

Robert

- Original Message -
From: Clive [EMAIL PROTECTED]
Date: Wednesday, November 9, 2005 0:53 am
Subject: [PHP] security code

 Hi
 does any one have a class/function to generate those security code 
 images.
 Yhe ones that you see on website that you must enter to submit a form
 
 thanks
 
 clive
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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



Re: [PHP] Clean variables sent from forms

2004-09-04 Thread lonewolf
I did this a lot when I built my quote program for my previous company.  I have all my 
code at home, hence no way to give examples that I know work, however what I did was 
dump the form to a php page which processed the form and then used the header.location 
pieces to dump the user to the page they needed to go.  

If you want to play with it some:
http://lonewolf.homelinux.net/quoter/

None of the information contained in it is accurate (to my knowledge) however it works 
to play with for a bit.  Every page you interact with (when adding items and such) 
puts information into a MySQL db, but as it moves through, you can't hit the pages 
doing the work.

HTH,
Robert

- Original Message -
From: Dre [EMAIL PROTECTED]
Date: Saturday, September 4, 2004 1:35 pm
Subject: [PHP] Clean variables sent from forms

 Hi,
 
 I'm trying to perform a database insertion for a new record from 
 data I
 receive from a HTML form
 
 I send the data to the file containing the insertion script and 
 insert the
 values using the $_POST['variable_name']
 
 every thing works fine, and the record get inserted correctly
 
 the problem is when I refresh this page (the one containing the 
 databaseinsertion script) a new record with the same data is 
 inserted in the same
 table
 (I'm using an auto increamented id for this table) ..
 
 I was wondering if there is a way that I can delete all values 
 sent from the
 form after the first insertion successeded
 Thanks in advance
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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



Re: [PHP] PHP Linux locate to html script?

2004-09-03 Thread lonewolf
?php
$items = passthru('locate whatever');
echo htmlbodyP;
echo $items;
echo /P/body/html;
?

- Original Message -
From: BOOT [EMAIL PROTECTED]
Date: Friday, September 3, 2004 1:46 pm
Subject: [PHP] PHP Linux locate to html script?

 Does anyone have a script that can be used to call linux's locate 
 commandand display the results in a browser?
 
 I don't think it would be that hard and will make an effort today...
 
 
 Thanks!
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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



Re: [PHP] PHP Linux locate to html script?

2004-09-03 Thread lonewolf
Aww, I answered this one already too...   I thought I beat everyone in as well, but 
maybe the list is still slow??

Passthru() is better then exec() in this case, since he wants everything from locate, 
I couldn't get the explode to work on my system because it didn't catch the \n 
character very well, or I messed up in the code somewhere.  

What would the explode look like for this:
?php
$item = passthru('locate whatever');
$items = explode(\n,$item);
echo htmlbodyP;
echo $items[0];
echo /P/body/html;
?


- Original Message -
From: Ben Ramsey [EMAIL PROTECTED]
Date: Friday, September 3, 2004 2:44 pm
Subject: Re: [PHP] PHP Linux locate to html script?

 According to the manual, exec() does not output anything. It 
 simply 
 returns the last line from the result of the command. The OP 
 wants to 
 display the output of 'locate' to the browser, so he should use 
 passthru(), which displays all raw output.
 
 Jay Blanchard wrote:
  [snip]
  Does anyone have a script that can be used to call linux's locate
  command
  and display the results in a browser?
  
  I don't think it would be that hard and will make an effort today...
  [/snip]
  
  exec(locate foo);
 
 -- 
 Regards,
 Ben Ramsey
 http://benramsey.com
 
 ---
 http://www.phpcommunity.org/
 Open Source, Open Community
 Visit for more information or to join the movement.
 ---
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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