[PHP] Function Misbehaving

2006-11-15 Thread Programmer
The following function is a basic user auth prep procedure for multiple
pages.  If the url desired is different than the default a url is supplied.

This function works most of the time flawlessly; except, on some pages when
the url has a value that was passed, the function still thinks url is NULL
until it is used, such as printing it or assigning another variable its
contents.  Another way to eliminate this sporadic problem is to rename the
parameter url to something else, such as url2.  There are no global or
session vars with the url name.  Why does php think url is null when it is
not, but only fault in this manner part of the time.  Any help would be
appreciated.

 

// Code

function Secure_Login($user,$pass,$db,$pg,$url=NULL)

{

//print($url);  if I uncomment this url
is no longer null or if I rename url to url2

 

$checkuser =
is_user($user,$pass,$db);

if (!$checkuser)

{

 
Secure_Email($pg);



 
if(isset($url))

{

 

 
Go_Page($url);

}

else

{

 
Go_Page(./login.php?login_error=2);

}

}

}

 

 

Jeremy Schreckhise, M.B.A.



RE: [PHP] Function Misbehaving

2006-11-15 Thread Programmer
Problem solved: the reason print($url) caused the program to work is because
the page calling Secure_Login no longer existed and therefore the print
forced a die--I assume.  I included a die in the redirect function and all
was well.  Including die in the redirect function made sure the page that
was redirected stop executing.  The final question to the PHP community with
this issue is: if a page myphppage.php has a redirect in it, how can it
execute code after the redirect if it no longer exists?  Is it because the
server side code cares not that it has been redirected and only what is
happing inside the php code?


Thanks, Jeremy Schreckhise M.B.A.



-Original Message-
From: Programmer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 15, 2006 10:53 AM
To: php-general@lists.php.net; 'Brandon Stewart'
Subject: [PHP] Function Misbehaving

The following function is a basic user auth prep procedure for multiple
pages.  If the url desired is different than the default a url is supplied.

This function works most of the time flawlessly; except, on some pages when
the url has a value that was passed, the function still thinks url is NULL
until it is used, such as printing it or assigning another variable its
contents.  Another way to eliminate this sporadic problem is to rename the
parameter url to something else, such as url2.  There are no global or
session vars with the url name.  Why does php think url is null when it is
not, but only fault in this manner part of the time.  Any help would be
appreciated.

 

// Code

function Secure_Login($user,$pass,$db,$pg,$url=NULL)

{

//print($url);  if I uncomment this url
is no longer null or if I rename url to url2

 

$checkuser =
is_user($user,$pass,$db);

if (!$checkuser)

{

 
Secure_Email($pg);



 
if(isset($url))

{

 

 
Go_Page($url);

}

else

{

 
Go_Page(./login.php?login_error=2);

}

}

}

 

 

Jeremy Schreckhise, M.B.A.

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



RE: [PHP] fwrite fopen problem

2006-08-16 Thread Programmer
Fixed by re-assigning IUSR... to directory security.

Cheers.


-Original Message-
From: Jeremy Schreckhise [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 16, 2006 10:59 AM
To: php-general@lists.php.net
Subject: [PHP] fwrite fopen problem

System Windows XP:

PHP 5

 

I have a folder in which I want to write files.  The IUSR_... user has full
control, yet I am still getting failed to open stream and permission dined
errors.

 

Any suggestions?

 

I have done this same task on many XP machines and 2003 servers.  I am
totally stumped.

 

 

Jeremy Schreckhise, M.B.A.

 

 

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



RE: [PHP] Unique Names for Variable in Loop

2006-02-02 Thread Programmer


$x = 0;
my_name_array = array();

While($row=mysql_fetch_array($result))
{
my_name_array[$x] = $row[last_name];
}

Jeremy Schreckhise

-Original Message-
From: Albert Padley [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 02, 2006 1:15 PM
To: php-general@lists.php.net
Subject: [PHP] Unique Names for Variable in Loop

I must be brain dead today since I can't get my syntax correct.

Simple MySQL query to return a list of last_name. No problem. Each  
last name returned needs to be assigned to a unique variable like  
name1, name2, name3, etc.

Somebody just kick me in the right direction.

Thanks.

Al Padley

-- 
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] Unique Names for Variable in Loop

2006-02-02 Thread Programmer
Oops you might want to increment $x++ after the assignment.



-Original Message-
From: Programmer [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 02, 2006 1:49 PM
To: 'Albert Padley'; php-general@lists.php.net
Subject: RE: [PHP] Unique Names for Variable in Loop



$x = 0;
my_name_array = array();

While($row=mysql_fetch_array($result))
{
my_name_array[$x] = $row[last_name];
}

Jeremy Schreckhise

-Original Message-
From: Albert Padley [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 02, 2006 1:15 PM
To: php-general@lists.php.net
Subject: [PHP] Unique Names for Variable in Loop

I must be brain dead today since I can't get my syntax correct.

Simple MySQL query to return a list of last_name. No problem. Each  
last name returned needs to be assigned to a unique variable like  
name1, name2, name3, etc.

Somebody just kick me in the right direction.

Thanks.

Al Padley

-- 
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

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



RE: [PHP] php4 vs. php5

2006-02-02 Thread Programmer
The only complaint I have with 5 is that the mysql libraries are not
bundled with the new version.  However, there are a lot of third party
bundles such as apache friends.

Jeremy Schreckhise

-Original Message-
From: Grae Wolfe - PHP [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 02, 2006 1:18 PM
To: php-general@lists.php.net; php-install@lists.php.net
Subject: [PHP] php4 vs. php5

Hey there...  I am setting up a new test server for one of my clients to

use, and I am curious if there is a reason to go with php4.xx over
php5.xx, 
or the other way around.  I would think that I would want to go with the

newest one, but my client requested that 4.xx be installed.  I don't
know if 
he is worried that his code won't be compatible, or if he just doesn't
know 
that there is a php5.xx available.

Thanks in advance for any advice you can offer!! 

-- 
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 vars to JS?

2006-02-01 Thread Programmer

You can also fixed the two languages as so:

script languageJavaScript
var myvar;
myvar = ?php echo $somephpvar; ?;
/script


-Original Message-
From: tedd [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 01, 2006 10:38 AM
To: php-general@lists.php.net; William Stokes
Subject: Re: [PHP] PHP vars to JS?

William:

I'm not sure if I can answer your question, but I know you can mix 
javascript with php just like you can with html.

For example, I use (below code from a working example):

script language=javascript alert(=== + 
document.form.f.what_db.value + ===); /script

where what_db (above) is a variable generated in php -- really!

So, I would play around with the idea and I think you'll find that 
variables pass through to javascript very well as-is. I was 
surprised at how easy it was.

As to your problem described below, I'm doing something very similar 
and I'm not using javascript at all. I just generate a form with the 
images (from mySQL) in thumbnails with checkbox beside them.

The user selects what they want, clicks submit, and then I do my thing.

HTH's

tedd


Hello,

How can I get my PHP variable values to a javascript?

Here's the code:

SCRIPT
function btnOKClick($file) {
   DO STUFF TO IMAGE
/SCRIPT

input type=submit name=btnOK value=OK
onClick=javascript:btnOKClick($txtFileName)
BUTTON ID=btnCancel type=reset
onClick=window.close();Cancel/BUTTON

?php
$sql=SELECT * FROM images ORDER BY 'date' DESC;
$result=mysql_query($sql);
$num = mysql_num_rows($result);
$cur = 1;
while ($num = $cur) {
$row = mysql_fetch_array($result);
$id = $row[id];
$iso = $row[iso];
$thumpnail = $row[thumpnail];
$date = $row[date];

echo div class=\float\;
echo div align=\center\img src=\$thumpnail\/abr //div;
echo div align=\left\$ladattu/div;
  // File path as value here. I need to send this to Javascript
echo div align=\left\input type=\checkbox\ name='txtFileName'
value='$thumpnail'ADD/div;
  // File path as value here. I need to send this to Javascript
echo /div;
$cur++;
}
?

There's two buttons OK/Cancel at the top of the page. Then image
thumpnails
are looped to screen as many times there are DB entries. Under each
thumpnail there's checkbox with ADD text. The checkbox value is/should
be
path to the image file. So I need this path info in the javascript to
handle
the image when user clicks OK button but I don't know how?

Thanks
-Will

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


-- 


http://sperling.com/

-- 
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 vars to JS?

2006-02-01 Thread Programmer
Oops! I meant mix the two languages.

-Original Message-
From: Programmer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 01, 2006 10:50 AM
To: php-general@lists.php.net; 'William Stokes'
Subject: RE: [PHP] PHP vars to JS?


You can also fixed the two languages as so:

script languageJavaScript
var myvar;
myvar = ?php echo $somephpvar; ?;
/script


-Original Message-
From: tedd [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 01, 2006 10:38 AM
To: php-general@lists.php.net; William Stokes
Subject: Re: [PHP] PHP vars to JS?

William:

I'm not sure if I can answer your question, but I know you can mix 
javascript with php just like you can with html.

For example, I use (below code from a working example):

script language=javascript alert(=== + 
document.form.f.what_db.value + ===); /script

where what_db (above) is a variable generated in php -- really!

So, I would play around with the idea and I think you'll find that 
variables pass through to javascript very well as-is. I was 
surprised at how easy it was.

As to your problem described below, I'm doing something very similar 
and I'm not using javascript at all. I just generate a form with the 
images (from mySQL) in thumbnails with checkbox beside them.

The user selects what they want, clicks submit, and then I do my thing.

HTH's

tedd


Hello,

How can I get my PHP variable values to a javascript?

Here's the code:

SCRIPT
function btnOKClick($file) {
   DO STUFF TO IMAGE
/SCRIPT

input type=submit name=btnOK value=OK
onClick=javascript:btnOKClick($txtFileName)
BUTTON ID=btnCancel type=reset
onClick=window.close();Cancel/BUTTON

?php
$sql=SELECT * FROM images ORDER BY 'date' DESC;
$result=mysql_query($sql);
$num = mysql_num_rows($result);
$cur = 1;
while ($num = $cur) {
$row = mysql_fetch_array($result);
$id = $row[id];
$iso = $row[iso];
$thumpnail = $row[thumpnail];
$date = $row[date];

echo div class=\float\;
echo div align=\center\img src=\$thumpnail\/abr //div;
echo div align=\left\$ladattu/div;
  // File path as value here. I need to send this to Javascript
echo div align=\left\input type=\checkbox\ name='txtFileName'
value='$thumpnail'ADD/div;
  // File path as value here. I need to send this to Javascript
echo /div;
$cur++;
}
?

There's two buttons OK/Cancel at the top of the page. Then image
thumpnails
are looped to screen as many times there are DB entries. Under each
thumpnail there's checkbox with ADD text. The checkbox value is/should
be
path to the image file. So I need this path info in the javascript to
handle
the image when user clicks OK button but I don't know how?

Thanks
-Will

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


-- 


http://sperling.com/

-- 
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

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



RE: [PHP] Warning: Missing argument 7 calling a function

2006-01-06 Thread Programmer
This should work; however, it sounds like you may want to think about
using an array or creating an object.  



-Original Message-
From: enediel gonzalez [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 06, 2006 3:58 PM
To: php-general@lists.php.net
Subject: [PHP] Warning: Missing argument 7 calling a function

Hello
I've a function with 6 arguments that works properly.

Trying to add a 7th argument an being sure that calling the function I
pass 
that one I received the following message (several times) on my web page

Warning: Missing argument 7 for getcommanddeclaration() in 
/var/www/cp/apply.php on line 56

It's only one place where this function is called

Thanks in advance for any help
Enediel
Linux user 398956
Debian GNU/Linux

-- 
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] PROGRESS SQL_CUR_USE_ODBC

2005-10-04 Thread Programmer
I don't know if this will help you.

I use an openlink ODBC driver to connect to Progress via PHP like so:


$dbconn  =
odbc_connect(MyDB_ODBC,$username,$password,SQL_CUR_USE_ODBC);
$strQry  = SELECT * FROM mytable WHERE mytable.field = .$somevar;

$rsTable = odbc_do($dbconn, $strQry);

while (odbc_fetch_row($rsTable))
{
// do stuff;
}

Jeremy Schreckhise

-Original Message-
From: cybermalandro cybermalandro [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 04, 2005 11:48 AM
To: php-general@lists.php.net
Subject: [PHP] PROGRESS SQL_CUR_USE_ODBC

I am connecting to a PROGRESS DB through the MERANT ODBC driver, When I
have
the 4th parameter SQL_CUR_USE_ODBC as shown, my queries return nothing
but
if I have the 4th parameter as lower case it returns my query results
but
with a PHP error complainning
*Notice*: Use of undefined constant sql_cur_use_odbc - assumed
'sql_cur_use_odbc'

Wtf? I don't get it, most of the documentation from people connecting to
PROGRESS do have the 4th parameter uppercase can someone help me out ?

Thanks!

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



RE: [PHP] How Can I send mail in php in HTML format?

2005-07-28 Thread Programmer
You can use mail() to send html, but you need to set the headers first.
I hope this helps.

Jeremy Schreckhise

 $email_addr = [EMAIL PROTECTED];
 $email_from = [EMAIL PROTECTED];

 $email_subj = About What;

 // Set Content-type header
 
$headers  = 'MIME-Version: 1.0' . \r\n;
$headers .= 'Content-type: text/html; charset=iso-8859-1' . \r\n;
 
$email_mess = htmlhead/headbodyStuff/body/html;
 
ini_set('sendmail_from',$email_from);
mail($email_addr,$email_subj,$email_mess,$headers);


-Original Message-
From: Tomás Rodriguez Orta [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 28, 2005 2:31 PM
To: php-general@lists.php.net
Subject: [PHP] How Can I send mail in php in HTML format?

Hello friends.

How Can I send mail from php in HTML format?.
I use the mail() function, but I dont know doing.somebody can I help me?


Best regards TOMAS



-
Este correo fue escaneado en busca de virus con el MDaemon Antivirus
2.27
en el dominio de correo angerona.cult.cu  y no se encontro ninguna
coincidencia.

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



RE: [PHP] RE: [SPAM 6.0] [PHP] Session help!?

2005-07-22 Thread Programmer
I did not specify all versions; older versions worked fine, but I.E.
that shipped with WINXP, before any service packs had these issues.  

J

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 21, 2005 9:04 PM
To: Programmer
Cc: 'Richard Baldwin'; php-general@lists.php.net
Subject: Re: [PHP] RE: [SPAM 6.0] [PHP] Session help!?

On Thu, July 21, 2005 2:21 pm, Programmer said:
 The biggest gotcha that I have ran into concerning sessions is this:

 If your client's browser is I.E. and the domain is named with
 _(underscores), -(dashes), etc.  I.E. discards the session and starts
a
 new one.  I don't know if this is fixed under SP2.

This cannot be true for many versions of IE...

I would have noticed. :-)

Though IE *is* giving me fits on this page:
http://uncommonground.com/artist/

They login okay, but can't get to following pages.

These are users for whom the question: what browser version do you
have?
yields answers like Windows 2000...

Is it that goofy mini privacy policy crap?  Like the bad guys won't just
LIE.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] RE: [SPAM 6.0] [PHP] Session help!?

2005-07-21 Thread Programmer
The biggest gotcha that I have ran into concerning sessions is this:

If your client's browser is I.E. and the domain is named with
_(underscores), -(dashes), etc.  I.E. discards the session and starts a
new one.  I don't know if this is fixed under SP2.

Example: a domain name http://my-domain.com will cause I.E. to lose
sessions; however, there is a way around this if your are developing
this for an internal website, you can simply add a host file record to
utilize the actual IP.
Example:
http://my-domain.com225.225.225.1

If your client's browser is not I.E. then make sure all of your php.ini
variables are as they need to be regarding sessions.


Hope this helps.


-Original Message-
From: Richard Baldwin [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 10, 2005 3:46 PM
To: php-general@lists.php.net
Subject: [SPAM 6.0] [PHP] Session help!?

Hey,

I have a site where I am using session_start() at the beginning of each 
page. The session id is passed transparently from the first page but 
after that it dissapears from the links and I lose all my session
variables.

Is there something elementary I'm missing? This is my first stab at PHP 
so I could be overlooking something really obvious or not really 
understanding how its supposed to work.

The trans_id thingy is enabled by the way.

Thanx in advance,
Rich

-- 
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



[PHP] Removing special characters

2005-07-13 Thread Computer Programmer
Is there a PHP built-in function to retrieve only the alphanumeric 
characters from a given string?


I know that I can check for alphanumeric characters using the 
function ctype_alphanum () but it won't retrieve the alphanum characters.


I also know that I can use str_replace to replace an array of special 
characters such as the example below:


$str = I*m using html tags with special/chars like | how to get 
rid of it???;

$removeChars = array ('*','?','|','','','/','\\');
$str = str_replace ($removeChars, , $str);

However, could there be a specific function for just retrieving 
alphanumeric characters? or a specific function for just stripping 
special characters? Or maybe a better way to do those things from the 
example given above?


Thanks in advance. :)

___
PHP Version: 4.4.0

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



[PHP] Re: WebHosting suggestions

2005-07-02 Thread Computer Programmer

Here are some sites that list free PHP web host:
http://www.oinko.net/freephp/
http://www.free-php-hosting.com/
http://www.web-hosting.com.bz/

I do agree with the other people who replied that you should pay for 
your web hosting needs. However, when I was starting out with PHP, I 
had to rely on several of the free PHP web host provider out there. 
Sure, they won't last long but I don't really need them to last long. 
I just need them so that I would be able to learn PHP. Back then, I 
don't even know how to install PHP in my computer. Those free PHP web 
host provider really did help me get hooked with PHP. ^_^


I was first hosted at F2S (Freedom 2 Surf) but they don't offer free 
hosting anymore. I'm not sure if they still offer their services.


You could also try Lycos UK (http://www.lycos.co.uk). However, Asian 
countries are banned from registering.


There's also 90Megs.com and a lot of others like them that uses 
advertisement to power their site. Not sure how long they will last though.


Ang sabi sa akin ni John Jairo Vega Angulo noong 01:05 PM 7/2/2005...

Hi, hope you have a good programming:
 I'm still a novice in php topics and I'm looking forward to find a FREE
hosting site to publish my .php's, so I hope you could give me an advise,
and if the service provides MySQL hosting too, it would be great. That's
all, greetings from a really php fan.
 Thanks in advance.
 John


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



[PHP] Finding out their server type

2005-05-04 Thread Pinoy Programmer
I asked a question at Apache.org mailing list about how to hide my server 
type; and now I'm asking here how can I know someone's server type using PHP? 

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


[PHP] Finding out their server type

2005-05-04 Thread Computer Programmer
I asked a question at Apache.org mailing list about how to hide my server 
type; and now I'm asking here how can I know someone's server type using PHP?

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


[PHP] RE: Finding out their server type

2005-05-04 Thread Computer Programmer
How do I use that to find out the server type of yahoo.com or google.com or 
cnn.com, etc.?

Ang sabi sa akin ni Jay Blanchard noong 09:14 PM 5/4/2005...
Check here
http://us4.php.net/manual/en/reserved.variables.php#reserved.variables.e
nvironment
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] RE: Finding out their server type

2005-05-04 Thread Computer Programmer
Why?
Ang sabi sa akin ni Jay Blanchard noong 09:33 PM 5/4/2005...
Ah, now we get to the real question...and the answer is that you don't.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Need libmcrypt.dll for Windows PHP 4.3.9

2005-04-09 Thread Computer Programmer
Go to http://ftp.emini.dk/pub/php/win32/mcrypt/

On Apr 9, 2005 2:05 PM, HarryG [EMAIL PROTECTED] wrote:
 Need libmcrypt.dll for Windows PHP 4.3.9. Can anyone send it to me?
 
 Thanks
 
 HarryG

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



Re: [PHP] Storing password in cookie

2005-04-09 Thread Computer Programmer
Thanks for all of your reply. :)

Just like what trlists said, I'd like to create an auto-login at least
with a maximum of 30 days. Users will have the option to choose
whether to logout and/or prompt for their password for the next 1
hour, 4 hours, etc. just like what Yahoo! is doing.

What is the difference between what Richard Lynch has suggested (using
sessions) and the one suggested by Andy (using table links)?

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



[PHP] Storing password in cookie

2005-04-08 Thread Computer Programmer
What is a better way to store password in a cookie?

md5()?
base64_encode()?
mhash()?
mcrypt_generic()?
crypt()?

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



[PHP] Why are Session Variables carried over into a brand new browser window?

2004-04-17 Thread Bob Bruce - Programmer
This is my first posting to this group, so I am not familiar
with any special etiquette for it, please bear with me. . .

I maintain the PHP code for the website for the murals of Winnipeg and
have found a situation where I have a session open with the state of
the user's search results saved in the session and link to a location
with the following link:

A target=blank
href=http://www.themuralsofwinnipeg.com/Mpages/index.php?action=gotomuralm
uralid=179

so this opens a new browser window, but it is inheriting the session values
from the browser window that called it and is causing problems in the new
window. When I open a new browser window shouldn't it start a whole new
session and not get anything from the previous browser.

Thanks in advance for your help,

Bob Bruce,
Winnipeg, Manitoba
Canada

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



[PHP] Variable Problem

2002-01-18 Thread programmer



How do I combine the following so it is treated as one variable

$i=10

$result$i=test;


I want this to be:


$result10=test;


$i changes so I cannot just put in 10 instead of I.


anybody know how i can do that?

TIA
Randy


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP] Compiled version of PHP 4.1.1 for Mandrake 8.1

2002-01-07 Thread Programmer

I am looking for with compiled version of the newest PHP 4.1.1 for
Linux Mandrake 8.1.

--
Jaroslaw


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Putting PHP info into a variable

2001-09-19 Thread Power Programmer

How do I store the phpinfo() data into a variable so I can mail it to
myself?


Thanks

Randy

-Original Message-
From: ZeNDeR-X [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 19, 2001 8:59 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Odp: Returning a specific 'record' from an XML file


hi ;)
it's pretty simple to do something like this using the DOM functions that
handle XPath expressions.
when you have that xml loaded in a variable $xml_source all you have to do
is:
$doc=xmldoc($xmlsource);
$xpath_ctx = xpath_new_context($doc );
// show all objects
echo Xpath All;
$result = xpath_eval($xpath_ctx, '//child::*');
print_r($result); // this will show you the structure of the output
// all books objects
$result = xpath_eval($xpath_ctx, '//book::*');
print_r($result);
// book number one:
$result = xpath_eval($xpath_ctx, '//book[1]');
print_r($result);

xpath is much more powerful than that and i'm pretty sure you can use it the
way you want it.
some more info about XPath is available here:
http://www.zvon.org/xxl/XPathTutorial/General/examples.html

Good Luck with that ;)
ZeNDeR-X

-= www.ipro.pl =-



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.281 / Virus Database: 149 - Release Date: 9/18/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.281 / Virus Database: 149 - Release Date: 9/18/2001


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Permissions on File

2001-09-14 Thread Power Programmer

What permissions would I set a php file to that could only be ready by
somebody logged into the server as root but still be executed via a website?
is this possible?


Thanks

Randy

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.277 / Virus Database: 146 - Release Date: 9/5/2001


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Extracting hidden Fields

2001-09-12 Thread programmer

I use curl to do a form submit and then the data is submitted back to me.   I now need 
to know how to extract the hidden variables from the webpage and put one the name of 
the hidden field in one field and the value of the hidden field in another.   there is 
5 hidden fields that i need to extract from the page.   Can anybody help me or point 
me into the right direction, example code maybe...


Randy

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Perl to PHP

2001-09-12 Thread programmer

Here is a chunk of code:

while( /hidden name=(.*?)/gs ) {
   # see if there was some kind of error



   if(index($1, ERROR) == 0) {
  $errstring = $1;
  $errstring =~ ( /value=(.*)/ );
  print Error on preview is: $1\n;
  exit -1;

###


Can anybody convert the code to PHP surounded by #

Thanks,

Randy


   }


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Extracting Data

2001-09-12 Thread programmer

Here is a line of data:

hidden name=PAYMENT_UNITS value=1



How could I extract data from the above to get the following


$PAYMENT_UNITS=1


Thanks,


Randy 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PERL TO PHP

2001-09-11 Thread programmer

Can anybody help me convert this perl code to PHP

This line in particular
while( /hidden name=(.*?)/gs ) {

but I have included more of the source below:

Thanks in Advanace

Randy


undef $/;
#print p$curlargsp;
#print p$sysstringp;
open(foo, $sysstring|)  ||  die (Failed FO $!_);
while(foo){
# pull out the hidden fields...the pattern starts with hidden name= and
# ends with 
while( /hidden name=(.*?)/gs ) {
# see if there was some kind of error
if(index($1, ERROR) == 0) {
$e=yes;
$errstring = $1;
$errstring =~ ( /value=(.*)/ );

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Zend or not to Zend

2001-09-10 Thread Power Programmer

Anybody using the zend optimizer in a production environment?

Is Zend Cache worth the money?

thanks

Randy


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.268 / Virus Database: 140 - Release Date: 8/7/2001


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] mcrypt

2001-08-28 Thread Power Programmer

I use mcrypt to encrypt passwords,  I saw somewhere international users had
trouble with the high ascii.  is the any functions that can convert the high
ascii to hex or something ?

Thanks

Randy

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.268 / Virus Database: 140 - Release Date: 8/7/2001


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] mcrypt

2001-08-28 Thread Power Programmer

I looked at those and still don't know which one i should use   any ideas??

-Original Message-
From: Jason Brooke [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 28, 2001 6:49 AM
To: Power Programmer
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] mcrypt


 I use mcrypt to encrypt passwords,  I saw somewhere international users
had
 trouble with the high ascii.  is the any functions that can convert the
high
 ascii to hex or something ?

 Thanks

 Randy

Have a squiz here:

http://www.php.net/manual/en/ref.strings.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.268 / Virus Database: 140 - Release Date: 8/7/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.268 / Virus Database: 140 - Release Date: 8/7/2001


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] mcrypt

2001-07-08 Thread Power Programmer

I have compiled PHP with mcrypt   and it works fine if I run a script from
the command line but through a browswer such as IE   I get the following
error:



Fatal error: Call to undefined function: mcrypt_module_open() in
/home/wheit/html/test.php on line 6


What do I need to do to be able to use these functions through a browser   I
use apache as a web server


Randy



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Mcrypt Part2

2001-07-08 Thread Power Programmer

What causes this error when apache is starting?


# ./apachectl startssl
Syntax error on line 238 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/libexec/libphp4.so into server:
libmcrypt.so.4: cannot open shared object file: No such file or directory
./apachectl startssl: httpd could not be started


Libphp4.so does exist.


Thanks

Randy



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] mcrypt

2001-07-08 Thread Power Programmer


Here is an error I get now when it is doing the make  any ideas what is
going on:?



make[1]: Entering directory `/tmp/php-4.0.6'
/bin/sh /tmp/php-4.0.6/libtool --silent --mode=link
gcc  -I. -I/tmp/php-4.0.6/ -I/tmp/php-4.0.6/main -I/tmp/php-4.0.6 -I/usr/loc
al/apache/include -I/tmp/php-4.0.6/Zend -I/usr/local/include -I/tmp/php-4.0.
6/ext/mysql/libmysql -I/tmp/php-4.0.6/ext/xml/expat/xmltok -I/tmp/php-4.0.6/
ext/xml/expat/xmlparse -I/tmp/php-4.0.6/TSRM  -DLINUX=2 -DMOD_SSL=207101 -DU
SE_HSREGEX -DEAPI -DUSE_EXPAT -DSUPPORT_UTF8 -DXML_BYTE_ORDER=12 -g -O2   -o
libphp4.la -rpath /tmp/php-4.0.6/libs -avoid-version -L/usr/local/lib  -R
/usr/local/lib stub.lo  Zend/libZend.la sapi/apache/libsapi.la
main/libmain.la regex/libregex.la ext/mcrypt/libmcrypt.la
ext/mysql/libmysql.la ext/pcre/libpcre.la ext/posix/libposix.la
ext/session/libsession.la ext/standard/libstandard.la ext/xml/libxml.la
TSRM/libtsrm.la -lpam -ldl -lmcrypt -lltdl -lcrypt -lresolv -lm -ldl -lnsl -
lresolv
stub.lo: file not recognized: File truncated
collect2: ld returned 1 exit status
make[1]: *** [libphp4.la] Error 1
make[1]: Leaving directory `/tmp/php-4.0.6'
make: *** [all-recursive] Error 1




-Original Message-
From: Ben Bleything [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 08, 2001 3:36 PM
To: 'Power Programmer'; [EMAIL PROTECTED]; 'Keyser Soze';
[EMAIL PROTECTED]
Subject: RE: [PHP] mcrypt


Have you made sure that the php on the command line and the php that
apache is using are indeed the same one?  It's possible that apache is
looking at a module somewhere and that the php on the command line is
the binary you built.

Just a thought.
Ben

-Original Message-
From: Power Programmer [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 08, 2001 12:29 PM
To: [EMAIL PROTECTED]; Keyser Soze; [EMAIL PROTECTED]
Subject: [PHP] mcrypt

I have compiled PHP with mcrypt   and it works fine if I run a script
from
the command line but through a browswer such as IE   I get the following
error:



Fatal error: Call to undefined function: mcrypt_module_open() in
/home/wheit/html/test.php on line 6


What do I need to do to be able to use these functions through a browser
I
use apache as a web server


Randy



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] url without a query string?

2001-07-08 Thread another programmer

What are the requirements?  Can you allow JS code?  Meta refresh tags?

- Original Message -
From: Jon Yaggie [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 09, 2001 2:22 PM
Subject: [PHP] url without a query string?


the problem

i have a page that uses a query string to determine content.  ie index.php?id=2  in 
this page there is a link
to a memebership area that uses a remote service.  this service requires that thee be 
the exact same refering
url.  is the refering url must always be index.php.  how can i do this?  can i do this?







Thank You,

Jon Yaggie
www.design-monster.com

And they were singing . . .

'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code

101 little bugs in the code . . .'

And it continued until they reached 0





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: url without a query string?

2001-07-08 Thread another programmer

IE 5.5 keeps the referer of the original page you clicked.  I ran a quick test, but my 
computer is a weird
setup, so it may not be the case with other setups.

- Original Message -
From: Inércia Sensorial [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 09, 2001 4:15 PM
Subject: [PHP] Re: url without a query string?


  I am not sure if the header(); function still maintain the referer, but if
it does:

  You could make the first link lead to any named page, like: gate.php

  On gate.php you put: header(Location: index.php);

  On index.php you put:

if ($HTTP_REFERER == 'http://www.your_domain.com/gate.php') {
header (Location: http://www.where_users_really_will_go.com;)
}

  Maybe a few protections on gate.php so users don't call it directly are
nice too...

--


  Julio Nobrega.

Yes, I am developing another 'Portal-System'
Have a look:
http://sourceforge.net/projects/toca

Jon Yaggie [EMAIL PROTECTED] wrote in message
02e801c1082e$c48e6a30$0100a8c0@piiimonster">news:02e801c1082e$c48e6a30$0100a8c0@piiimonster...
the problem

i have a page that uses a query string to determine content.  ie
index.php?id=2  in this page there is a link to a memebership area that uses
a remote service.  this service requires that thee be the exact same
refering url.  is the refering url must always be index.php.  how can i do
this?  can i do this?







Thank You,

Jon Yaggie
www.design-monster.com

And they were singing . . .

'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code

101 little bugs in the code . . .'

And it continued until they reached 0






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] hotmail, yahoo..why can't me?

2001-07-05 Thread another programmer

I'm being quick, so pseudo code:
on message display page:
form method=post
!loop till end of messages
input type=checkbox name=deleteList value=!whateverid!whateverMessageName
!endloop
input type=submit name=notRequired value=Delete Selected Mail
/form

what happens is on sending, deleteList will be a list of all selected checkbox's 
values.

on action page: (I'd also check deleteList isonly numeric characters and numbers, use 
a Regular Expression to
cleanse the variable)
!if Length of deleteList  0
! runSQL = delete from messages where ID in (  deleteList  ) 
! end if


- Original Message -
From: Dhaval Desai [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 05, 2001 5:04 PM
Subject: [PHP] hotmail, yahoo..why can't me?


Hi!

I wanna do something like in ur mailboxes. if u check
ur hotemail or yahoo a/c u can find checkboxes on the
left side of each message. U can check the boxes and
delete the messages..

I want to delete certain rows that come out of a
database. So if I have 20 records coming out of the
databases i want a checkbox on the left of each
message so that I can delete some of them if i want.


Is there a way.. i don't seem to get the logic to do
this..

Please help me out...


Thank You
Dhaval Desai

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Program execution functions doesn´t work in my system

2001-06-24 Thread Beginning PHP Programmer



Hi 

In the PHP manual there are some program execution 
functions like passthru(), exec() and system().
I´ve got PHP4 installed on IIS 5.0 on Windows 2000 
Server, and it works fine.

I tried with a very simple script like the 
following:

? $commandstring = 
"cmd"; 
passthru($commandstring);?

But it doesn´t work. You can see this warning in 
the explorer:

Warning: Unable to fork [cmd] in 
d:\inetpub\wwwroot\nntpadm\creategroup.php on line 3

I need to run some external programs from a PHP 
script. 
How could I do that?

Thanks in advance.
Rub


[PHP] Running external programs

2001-06-23 Thread Beginning PHP Programmer



Hi:

I´m using PHP4 on IIS 5 on Windows 2000 Server and 
it works fine. 
The Microsoft NNTP Service from IIS 5 can be 
managed from command shell with commands like this bellow:

cscript d:\\temp\\rgroup.vbs -t a -g 
new.group.01
And it works also fine in my system.


But, when I try to run a program from a simple PHP 
script like the following:

? $commandstring = 
"cscript d:\\temp\\rgroup.vbs -t a -g new.group.01"; 
passthru($commandstring);?

I get this Warning..

Warning: Unable to fork [cscript 
d:\temp\rgroup.vbs -t a -g new.group.01] in 
d:\inetpub\wwwroot\nntpadm\creategroup.php on line 3

Whatam I doing 
wrong?

Thanks in advance.