[PHP] crypt salt question

2007-08-30 Thread Andras Kende
Hello,

 

I'm trying to move some app from postgresql to mysql but unable to find out
how to authenticate

against the current crypted passwords with php..

 

insert to database:

 

$cset = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./;
$salt = substr($cset, time()  63, 1) . substr($cset, time()/64  63, 1);
$password = crypt($password, $salt);   //pass crypted version of password
for further processing



$result = pg_query (INSERT INTO users (username, password) VALUES
('$username', '$password'));

 

I read the crypt is one way encryption but how to compare the password
entered with the encrypted 

version if don't know the salt ??

 

 

Thanks,

 

Andras



RE: [PHP] crypt salt question

2007-08-30 Thread Andras Kende

I figured out finally:)
Actually the random salt is always the first 2 character of the encryoted
password,
so this works fine now :


?php
// username,saltencryptedpass
// sean,VK3bOV.yYuXfw

$cryptpass = VK3bOV.yYuXfw;

$password = $_GET[p];
$salt = substr($cryptpass, 0, 2);  

if (crypt($_GET['p'], $salt) == $cryptpass) {
  echo Password verified!;
   }
?


Thanks,

Andras



-Original Message-
From: Satyam [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 30, 2007 3:00 PM
To: Andras Kende; php-general@lists.php.net
Subject: Re: [PHP] crypt salt question

No chance.  Unless you have the salt stored along each password, your 
passwords are as good as random texts

Satyam



- Original Message - 
From: Andras Kende [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Thursday, August 30, 2007 11:42 PM
Subject: [PHP] crypt salt question


 Hello,



 I'm trying to move some app from postgresql to mysql but unable to find 
 out
 how to authenticate

 against the current crypted passwords with php..



 insert to database:



 $cset = 
 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./;
 $salt = substr($cset, time()  63, 1) . substr($cset, time()/64  63, 1);
 $password = crypt($password, $salt);   //pass crypted version of password
 for further processing



 $result = pg_query (INSERT INTO users (username, password) VALUES
 ('$username', '$password'));



 I read the crypt is one way encryption but how to compare the password
 entered with the encrypted

 version if don't know the salt ??





 Thanks,



 Andras








No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.12.12/979 - Release Date: 29/08/2007 
20:21

-- 
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] mysql_fetch_array to associative array

2007-07-16 Thread Andras Kende
Hello,

I use the following GetArray for returning an array from mysql results.

But having a hard time modifying it for returning a simple associative array

Like:

$conn-GetAssoc('SELECT id, name from manufacturers')

Array ( [2] = BMW [1] = MAZDA [9] = FORD )


function GetArray($query) {
$get = $this-Execute ( $query );

$row_id = 0;
while ( $row = mysql_fetch_array($get) ) {
foreach ( $row as $key = $value )
$result[$row_id][$key] = $value;
$row_id++;
}
mysql_free_result($get);

return $result;
}


function GetAssoc($query) {
$get = $this-Execute ( $query );

$row_id = 0;
while ( $row = mysql_fetch_array($get) ) {

?

}
mysql_free_result($get);

return $result;
}

I searched a lot but didn't find anything.

Thanks for any help :)

Andras

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



RE: [PHP] mysql_fetch_array to associative array

2007-07-16 Thread Andras Kende


-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 16, 2007 7:52 AM
To: Andras Kende
Cc: php-general@lists.php.net
Subject: Re: [PHP] mysql_fetch_array to associative array

On Mon, 2007-07-16 at 07:41 -0700, Andras Kende wrote:
 Hello,
 
 I use the following GetArray for returning an array from mysql results.
 
 But having a hard time modifying it for returning a simple associative
array
 
 Like:
 
 $conn-GetAssoc('SELECT id, name from manufacturers')
 
 Array ( [2] = BMW [1] = MAZDA [9] = FORD )
 
 
   function GetArray($query) {
   $get = $this-Execute ( $query );
   
  $result = array();
   while ( $row = mysql_fetch_array($get) ) {
  $result[] = $row;
   }
   mysql_free_result($get);
   
   return $result;
   }
 
 
   function GetAssoc($query) {
   $get = $this-Execute ( $query );
   
  $result = array();
   while ( $row = mysql_fetch_array($get) ) {
  $result[] = $row;
 
   }
   mysql_free_result($get);
   
   return $result;
   }
 
 I searched a lot but didn't find anything.
 
 Thanks for any help :)

You're welcome.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...



Hi Rob,

Thanks for your help, its associative but I forget to mention its needs
To be a single dimensional associative array.


$result = array();
while ( $row = mysql_fetch_assoc($get) ) {
$result[] = $row;
}

This creates multi dimensional like:

Array ( [0] = Array ( [0] = 3 [1] = BMW ) [1] = Array ( [0] = 1 [1] =
Mercedes ) )

I tried to play with foreach and array_push but still not perfect

Thanks,

Andras

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



RE: [PHP] mysql_fetch_array to associative array

2007-07-16 Thread Andras Kende


-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 16, 2007 1:46 PM
To: Andras Kende
Cc: php-general@lists.php.net
Subject: RE: [PHP] mysql_fetch_array to associative array

On Mon, 2007-07-16 at 13:37 -0700, Andras Kende wrote:
 
 Hi Rob,
 
 Thanks for your help, its associative but I forget to mention its needs
 To be a single dimensional associative array.
 
 
 $result = array();
 while ( $row = mysql_fetch_assoc($get) ) {
 $result[] = $row;
 }
 
 This creates multi dimensional like:
 
 Array ( [0] = Array ( [0] = 3 [1] = BMW ) [1] = Array ( [0] = 1 [1]
=
 Mercedes ) )
 
 I tried to play with foreach and array_push but still not perfect

I'm not sure I understand... you have multiple rows being returned do
you not? How to you intend to handle them in a single level array?

Let's image the following rows are returned from the database:

array
(
'title' = 'The Dragonbone Chair',
'author' = 'Tad Williams',
),
array
(
'title' = 'Sword of Shannarah',
'author' = 'Terry Brooks',
),

Show me how you would like the final array to look and I can figure out
the code you need to organize it the way you want.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

Hi Rob,

$conn-getassoc(select id,name from cars)

I would need a single array like: (its for used with pear:quickform
dropdown)

Array ( [2] = BMW [1] = FORD )

Or:

Array ( [The Dragonbone Chair] = 'Tad Williams' [Sword of Shannarah] =
'Terry Brooks' )


Thanks a lot,

Andras

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



RE: [PHP] mysql_fetch_array to associative array

2007-07-16 Thread Andras Kende


-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 16, 2007 6:12 PM
To: Andras Kende
Cc: php-general@lists.php.net
Subject: RE: [PHP] mysql_fetch_array to associative array

On Mon, 2007-07-16 at 13:37 -0700, Andras Kende wrote:
 
  function GetAssoc($query) {
  $get = $this-Execute ( $query );
  
   $result = array();
  while ( $row = mysql_fetch_array($get) ) {
   $result[] = $row;
  
  }
  mysql_free_result($get);
  
  return $result;
  }

I'll focus on the above one since that's probably what's causing your
grief... I'm also going to rename it so it's more explanatory:

?php

function GetPairs( $query, $keyField, $valueField )
{
$pairs = array();

if( ($get = $this-Execute ( $query )) )
{
while( ($row = mysql_fetch_assoc( $get )) )
{
$pairs[$row[$keyField]] = $row[$valueField];
}

mysql_free_result( $get );
}

return $pairs;
}

?

That's the function... it creates an array of pair mappings based on the
table fields $keyField and $valueField. So let's say you have the
following table in your database:

CREATE TABLE cars
(
id  int   not null  auto_increment,
namevarchar( 32 ) not null,

primary key( id )
);


Then you might issue the following function call:

?php

$query = SELECT id, name FROM cars ORDER BY name ASC ;

$pairs = GetPairs( $query, 'id', 'name' );

?

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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





Rob,

THANKS 

I also hacked together a version:

while ( $row = mysql_fetch_array($get) ) {
$result[$row[0]] = $row[1];
}



Best regards,

Andras 

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



[PHP] serving video files with php

2006-06-15 Thread Andras Kende
Hello,

 

Is there any drawback servings video files through php downloader script on
high load site?

 

Or just straight link to the videos are more efficient?

 

 

Thank you,

 

Andras Kende

http://www.kende.com

 



RE: [PHP] Add Multiple Items, Qty to Cart from html form

2006-05-18 Thread Andras Kende

-Original Message-
From: Wolf [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 17, 2006 9:47 PM
To: Andras Kende
Cc: php-general@lists.php.net
Subject: Re: [PHP] Add Multiple Items, Qty to Cart from html form

Andras,

input type=hidden name=item[] value=applesApples input type=text
name=qty[] value=0 input type=text name=price[] value=0

Will get you where you need to go on the HTML side of things, then on
the back end you need to process each array.  By setting a default value
of 0 for the qty, you force users to change the values, but you also
keep your arrays intact and easier (IMHO) to deal with.

Wolf

Andras Kende wrote:
 Hello,
 
 I trying to add multiple items to a shopping cart with selectable
 quantity and price form text field like..
 
 apple   : qty: [__]  price: [__]
 orange : qty: [__]  price: [__]
 Add Items to Cart
 
 
 I could add multiple items with checkboxes but without selecting
 quantity and price..
 
 if (isset($_POST['itemschecked'])) {
 foreach($_POST['itemschecked'] as $itemschecked = $checkeditems ){
 AddItem($checkeditems, 1);
 }
 
 Any help is appreciated..
 
 Thanks,
 
 Andras


Wolf,

The tip worked great !! All working as expected now...

$listvals=$_POST['item'];
$n=count($listvals);
$i=0;
while ( $i  $n )  {
if ($qty[$i]  0) {
AddItem($item[$i], $qty[$i]);
UpdatePrice($item[$i], $price[$i]);
}
$i++;
}

Thanks,

Andras Kende
http://www.kende.com

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



[PHP] Add Multiple Items, Qty to Cart from html form

2006-05-17 Thread Andras Kende

Hello,

I trying to add multiple items to a shopping cart with selectable quantity 
and price form text field like..


apple   : qty: [__]  price: [__]
orange : qty: [__]  price: [__]
Add Items to Cart


I could add multiple items with checkboxes but without selecting quantity 
and price..


if (isset($_POST['itemschecked'])) {
foreach($_POST['itemschecked'] as $itemschecked = $checkeditems ){
AddItem($checkeditems, 1);
}

Any help is appreciated..

Thanks,

Andras 


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



Re: [PHP] php session in ie

2005-11-11 Thread Andras Kende


- Original Message - 
From: sunaram patir [EMAIL PROTECTED]

To: php-general@lists.php.net
Sent: Friday, November 11, 2005 5:31 AM
Subject: [PHP] php session in ie


Hi, i am having problem with internet explorer. i am working on a
project on building a website where i need to keep track of the users
i.e. i use a login system in there in short. with the following code i
check whether the user is logged in or not.
?php
session_start();

$_SESSION['myurl']=$_SERVER['PHP_SELF'];
if(!isset($_SESSION['student_username']) 
!isset($_SESSION['student_password']))
   header(Location: login.php);
?

if the user is not logged in, it redirects to the login page login.php
as is shown in the above code. now the user is allowed to log in
through the following code:


?php
session_cache_limiter('private_no_expire');
session_set_cookie_params(0,/,schools.zenrays.com);
session_start();



if(isset($_POST['submit'])){
 include(../database.inc);
 $login=trim($_POST['login']);
 $pass=trim($_POST['pass']);
 $Effectivelogin=strtoupper($login);
 $auth=false;
 $connection=mysql_connect($host,$user,$password);
 mysql_select_db($database,$connection);
 $query=SELECT password FROM students WHERE userID='$Effectivelogin';
 $result=mysql_query($query);
 if(mysql_num_rows($result)){
  while($row=mysql_fetch_array($result))
 {

  if($row[0]!=$pass)
echo (Wrong Username/Password!);
   else
 $auth=true;
 }
 }


 if($auth){
   $_SESSION[student_username]=$Effectivelogin;
   $_SESSION[student_password]=$pass;
   if(isset($_SESSION['myurl']))
  header(Location: 
http://schools.zenrays.com.$_SESSION['myurl']);

   else
  header(Location: http://schools.zenrays.com/students;);

 }


}
?
html
head
titleUser Authentication/title
/head
body
form method=post
LoginID:
input type=text name=loginbr
Password:
input type=password name=passbr
input type=submit name=submit value=Login
/form


/body


/html

then the user is redirected back to the page he visited. it workd fine
in firefox and msn explorer. in internet explorer, when i visit to a
link in any page it asks for the login details again. could anyone
please help me out?!

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


Hello,

I used this article for sessions with success
http://www.sitepoint.com/article/users-php-sessions-mysql


Best regards,

Andras Kende
http://www.kende.com

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



[PHP] imagestring to picture

2005-08-22 Thread Andras Kende

Hello,

I have a some colorful pictures, Would like to add white text with black
background around the white text...

I can add the text fine but could figure out how to add black background..


$textcolor = imagecolorallocate($destimg, 255, 255, 255);
imagestring($destimg, 3, 10, 10, test text, $textcolor);
imagejpeg($destimg);



Best regards,


Andras Kende
http://www.kende.com


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.13/78 - Release Date: 8/19/2005
 

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



[PHP] build sql query struture and values from form fields

2005-08-20 Thread Andras Kende

Hello,


I would like to create the mysql insert query for my html form fields,
I have a small problem it will have an extra , at the end of $sqlstruct
And extra  at $sqldata..

Anyone can give a hint ?


foreach ($_POST as $variable=$value){
$sqlstruct.=$variable,;
$sqldata.=$value.\','\;
}

$query=insert into db ($sqlstruct) VALUES ($sqldata);




Best regards,

Andras Kende
http://www.kende.com


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.13/78 - Release Date: 8/19/2005
 

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



[PHP] Large forms to Mysql table...

2005-08-13 Thread Andras Kende
Hello,

 

I have a html page with 70+ form fields some like 40 fields are only used
for entering quantity numbers…

 

Is it a good idea to put this 50 fields of the form fields into a single
text mysql field? 

 

Somehow process it with php before, put inside of some kind of xml
structure?

 

Just don’t want to do Mysql table with 70 fields…

 

 

 

Thanks,

 

 

Andras Kende

http://www.kende.com

 


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 0.0.338 / Virus Database: 267.10.8/71 - Release Date: 8/12/2005
 


RE: [PHP] 404 Not Found - refresh to directory

2005-07-14 Thread Andras Kende


-Original Message-
From: Terry Romine [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 14, 2005 3:52 PM
To: php
Subject: [PHP] 404 Not Found - refresh to directory

I have a website that has several hundred agents in a mysql database. The
client wants to be able to enter the domain.com/agentname and be redirected
to a standard page where we show the agent information. An example would be
an agent named John Smith whose agentname would be jsmith. So the user would
enter domain.com/jsmith and get the agent's profile.

I tried initially to dummy up a 404 page, where if the link was like:
domain.com/jsmith that it would parse the agent name and pass it through to
domain.com/agent_profile.php?agent=jsmith. It failed to work, ending up with
a recursive call to the 404 page and getting hung.

Right now, I have directories set up for each agent, with an index.php that
does the redirect. It's really getting to be a mess with so many
directories.

I need to be able to check the mysql database for the agent name, and if
found, do a redirect (header(Location: agent_profile.php?agent=agentID)
and if not, continue to a standard 404 error page, or a sorry not found
page.

I think my question is: is there an easy way to use a 404 page written in
php to capture the parameters from the missing page request and test against
a db, resulting in either a valid page redirect or a not found redirect?


Terry

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



.htaccess:
RewriteEngine on
RewriteRule ^([\w-]+)$ index.php/$1

index.php:
?php
$uriparams = explode(/,$REQUEST_URI);
$uriparams = explode(?,$REQUEST_URI);
$agent = $uriparams[0];
$agent = eregi_replace(/,,$agent);

// Select from mysql where agent = agent   etc.. etc..

echo (Location: agent_profile.php?agent=.$agent); 
?



Best regards,

Andras Kende
http://www.kende.com

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



[PHP] mysql regexp select questions

2005-04-07 Thread Andras Kende

I would like to do the following:


mysql db:

andrew
anthony
joe
janice
john
simon


sql_query ( select names .



I would need only the distinct first character from the query
result would be: a,j,s

I think maybe its REGEXP but never did it before...

Thanks!!

Andras Kende

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



[PHP] fpassthru(); corrupts files on win 5.0.4 ??

2005-04-02 Thread Andras Kende

Hello,

windows 2003 server iis6 with php 5.0.4 isapi...

The following code was working perfectly on 5.0.3
since 5.0.4 upgrade dowloaded files gets corrupted..

Any hint where the problem could be?


Thanks,
Andras Kende
http://www.kende.com/


?php

$file = $_REQUEST['file'];
$company = $_REQUEST['company'];

$path = \\\server\ftpserver\\$company\\ . $file;
$size = filesize($path);

header(Cache-Control: );
header(Pragma: );
header(Content-type: application/octet-stream);
header(Content-disposition: attachment; filename=\$file\);
header(Content-transfer-encoding: binary);
header(Content-length: $size);

$fp=fopen($path, rb);
fpassthru($fp);
fclose($fp);
?

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



Re: [PHP] GIF instead of JPG..

2005-03-22 Thread Andras Kende

 Hi,
 I found this beautiful piece of code on the php site which make a
 proportional thumbnail, problem is its only working with JPEG files...and
 not with GIFs, can someone please help me convert it to GIF too?

 I tried but got a bit confused as there are no functions that are equal to
 imagecreatetruecolor that is in the below script.
 The below script works perfectly for jpgs:


 ?php
 // The file
 $filename = 'test.jpg';

 // Set a maximum height and width
 $width = 200;
 $height = 200;

 // Content type
 header('Content-type: image/jpeg');

 // Get new dimensions
 list($width_orig, $height_orig) = getimagesize($filename);

 if ($width  ($width_orig  $height_orig)) {
$width = ($height / $height_orig) * $width_orig;
 } else {
$height = ($width / $width_orig) * $height_orig;
 }

 // Resample
 $image_p = imagecreatetruecolor($width, $height);
 $image = imagecreatefromjpeg($filename);
 imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height,
 $width_orig, $height_orig);

 // Output
 imagejpeg($image_p, null, 100);
 ?


 Beautiful, isnt it? Hats off to whoever wrote it and three cheers for the
 online manual!

 Thanks,
 Ryan







 --
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.308 / Virus Database: 266.8.0 - Release Date: 3/21/2005

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





Hello Ryan,

Im using the code below and works fine ...

Best regards,

Andras Kende
http://www.kende.com

//


?php
function resample($src, $srcdir, $destdir, $width = '', $height = '')
{
  if( is_file( $destdir . $src ) )
{
 $src = $src; return;
}
  $size = GetImageSize($srcdir . $src);
  if (!$size[0] || !$size[1]) return;

  $scale = min($width/$size[0], $height/$size[1]);
  if ( $scale == 1 ) return;

  $newwidth = (int)($size[0]*$scale);
  $newheight = (int)($size[1]*$scale);
  $xpos = (int)(($width - $newwidth)/2);
  $ypos = (int)(($height - $newheight)/2);


  $format = ereg_replace(.*\.(.*)$,\\1,$src);
  $format = strtoupper($format);


  if ($format == JPG)
  {
  $destImg = ImageCreateTrueColor($width, $height);
  $backColor=ImageColorAllocate($destImg, 255, 255, 255);
  ImageFilledRectangle($destImg, 0, 0, $width, $height, $backColor);
  $sourceImg = ImageCreateFromJPEG ($srcdir . $src);
  ImageCopyResampled($destImg, $sourceImg, $xpos, $ypos, 0, 0, $newwidth,
$newheight, $size[0], $size[1]);
  imagejpeg($destImg, $destdir . $src, 90);
  }
  elseif ($format == GIF)
  {
  $destImg = ImageCreateTrueColor($width, $height);
  $backColor=ImageColorAllocate($destImg, 255, 255, 255);
  ImageFilledRectangle($destImg, 0, 0, $width, $height, $backColor);
  $sourceImg = ImageCreateFromGIF ($srcdir . $src);
  ImageCopyResampled($destImg, $sourceImg, $xpos, $ypos, 0, 0, $newwidth,
$newheight, $size[0], $size[1]);
  imagegif($destImg, $destdir . $src, 90);
  }

}
?

//

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



RE: [PHP] Apache 2.0.52 / PHP 4.3.10 Integration Question...

2004-12-31 Thread Andras Kende


-Original Message-
From: Robin Getz [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 31, 2004 1:40 PM
To: php-general@lists.php.net
Subject: [PHP] Apache 2.0.52 / PHP 4.3.10 Integration Question...

Hi.

I am trying to get Apache 2.0.52 / PHP 4.3.10 working with some scripts I 
am using.

I have a file named /www/projects which is a php script.
When I type the url: www.site/projects/variable

I want variable passed to the script projects

I have the the http.conf set up as:

Files projects
   SetInputFilter  PHP
   SetOutputFilter PHP
   AcceptPathInfo  On
/Files

Which used to work with apache 2.0.40 and php 4.2.3 - but what happens now, 
is I actually get passed the php script back as text to the browser.

Any thoughts? I poked around on google, and saw at 
http://dan.drydog.com/apache2php.html

However, SetOutputFilter / SetInputFilter no longer works for me. It used 
to work with an earlier PHP 4.x or Apache 2 version, but not with Apache 
2.0.47/PHP 4.3.3. I understand this (PHP as an Apache 2 filter) is 
experimental, so I don't use it anymore

I tried things like:
   AddType text/html   php

But I keep getting the same thing in my browser:

?php
/**
  * Projects Redirector
  *
---snip---
?

Any thoughts? Thanks in advanced.

-Robin

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


Hello,

You could also do it like this if don't want to use /

.htaccess or httpd.conf
RewriteEngine On
RewriteRule ^list-(.*) list.php
RewriteRule ^design-(.*) design.php

http://www.juhaszdesign.com/list-barstools.html
http://www.juhaszdesign.com/design-hastings-barstool.html

Andras Kende
http://www.kende.com

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



[PHP] newbie web services

2004-11-28 Thread Andras Kende
Hello,

I want to create a simple web service.
So far tried NuSoap but don't know how to modify its default xml envelope..

I could create REST for response but not sure about how to process the
request,
maybe with simplexml ?

RAW DATA:

Request:
XML
ID5/ID
/XML

Response:
XML
NAMEJones/NAME
/XML

?php: select * from users where id = $ID ?

Please give any info for an easy implementation..

It will hosted on IIS6 PHP5.

Thanks,

Andras Kende
[EMAIL PROTECTED]

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



RE: [PHP] PHP Session Variables Not Being Set For Certain Browsers

2003-12-27 Thread Andras Kende
-Original Message-
From: Andy Higgins [mailto:[EMAIL PROTECTED] 
Sent: Saturday, December 27, 2003 6:04 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP Session Variables Not Being Set For Certain Browsers

Hello All,

I have been racking my head over a problem where a large percentage of users
are unable to log into my php site due to what seems to be a problem with
setting php session variables on certain end user browsers (certain versions
of AOL seem to be particularly problematic). Below are some snippets of code
that are used to do the authentication/ login.

Has anyone encountered the same problem and if so do you have a solution?
The only solution I can think of is to pass the session using PHPSESSION in
the URL however I would like to avoid this if at all possible as it involves
a major re-write of the code (as session variables are used elsewhere in the
session) and if I am not mistaken if a user accesses a non-php page then the
session is lost requiring them to log in again.

Currently the following code is used to check whether a user is logged in:

?php

$notAuthenticated = !isset($HTTP_SESSION_VARS['authenticatedUser']);

$notLoginIp = isset($HTTP_SESSION_VARS['loginIpAddress']) 
($HTTP_SESSION_VARS['loginIpAddress'] != $_SERVER[REMOTE_ADDR]);

if ($notAuthenticated || $notLoginIp) {

 if (!session_is_registered(targetURL))
   session_register(targetURL);

 $HTTP_SESSION_VARS['targetURL'] = $_SERVER[REQUEST_URI];

 header(Location: /smartbid/php/Login.php);

}

?

And in Login.php after doing a check on the username and password the
following session variables are set:

   session_start();

   session_register(authenticatedUser);
   $HTTP_SESSION_VARS['authenticatedUser'] = $userId;

   session_register(loginIpAddress);
   $HTTP_SESSION_VARS['loginIpAddress'] = $_SERVER[REMOTE_ADDR];

It is the setting of the above session variables in Login.php that appears
to be failing for some browsers resulting in users using these browsers
continually being redirected to the Login page when the above check to see
if they are logged in is done.

Any help that could be supplied would be greatly appreciated.

Thank you.

Regards,
Andy



-

Andy,

Not sure, but maybe AOL users on proxy and their ip address can change.

Andras Kende
http://www.kende.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] Insert into array...

2003-12-26 Thread Andras Kende

Hello All,

I would like to put 1 new field into this multidimensional array...

$orders =

1 = Array (11)
  Name = JUDY
  Order = 334455
2 = Array (11)
  Name = MARY
  Order = 12590

TO:

$orders =

1 = Array (11)
  Name = JUDY
  Order = 334455
  Newitem = someting
2 = Array (11)
  Name = MARY
  Order = 12590
  Newitem = something


I can do one at the time like:
$orders[1]['Newitem'] = something;

But not for the whole array

Thanks,

Andras Kende

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



[PHP] beginner: cut text after

2003-08-28 Thread Andras Kende

Hello All,

I have a very simple question:

Want to remove the string after the first whitespace like:

here is a text what i have
to:
here


Thanks !!

Andras Kende

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



[PHP] beginner: remove the string after the first whitespace

2003-08-28 Thread Andras Kende

Hello All,

I have a very simple question:

Want to remove the string after the first whitespace like:

here is a text what i have
to:
here


Thanks !!

Andras Kende

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



[PHP] Maximum execution time exceeded when using dial up

2003-03-06 Thread Andras Kende

Hello,

I have database while query which populates cells in a html table, but
noticed if using a slow dial up connection its times out... 

Fatal error: Maximum execution time of 60 seconds exceeded in
D:\website\eis-vieworderlookup.php on line 75

What's the best way to deal with this??


Thanks,

Andras Kende



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



[PHP] PHP 4.3 JPG Support. Whats needed?

2002-12-30 Thread Andras Kende
Hello,

I'm trying to upgrade to php4.3 on a cobalt raq4
I have 4.1.2 with gd 1.6, but would like to use gd 2.0

Compiled 4.3 from source, everything seems to be fine 
except the JPG Support.

http://www.kende.com/phpinfo.php

'./configure' '--prefix=/usr' '--with-apxs=/usr/sbin/apxs' '--with-gd'
'--with-gettext=/usr' '--enable-safe-mode'
'--with-config-file-path=/etc/httpd' '--with-exec-dir=/usr/bin'
'--with-zlib' '--with-mysql' '--enable-magic-quotes'
'--with-regex=system' '--with-ttf' '--enable-mbstring'
'--enable-mbstr-enc-trans' '--enable-track-vars' '--enable-wddx=shared'
'--enable-mm=shared' '--enable-xml' '--enable-ftp' '--disable-debug'
'--with-libdir=/usr/lib' '--with-ldap' '--with-imap-ssl'
'--with-pdflib=shared'

Can you tell me what's required for JPG Support?

./configure ??


Thanks :)

Andras Kende


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




[PHP] php zip/store locator code.....

2002-05-03 Thread Andras Kende

Hello All,

I looking for a zip / store locator based with php/mysql
I find this 2 similar but no luck yet.

http://px.sklar.com/author.html?author_id=296
http://www.sanisoft.com/ziploc/

Any where should I look around...


Thank,

Andras Kende



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




[PHP] ZIP/STORE LOCATOR

2002-04-25 Thread Andras Kende

Hello All,

I looking for a php ZIP/STORE LOCATOR for website..

Anyone knows where to look??


Thanks,

Andras Kende



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




[PHP] Got an error reading communication packets

2002-04-15 Thread Andras Kende

I noticed some of my websites written in php with mysql are freezing looked
around the logfiles:

MYSQL ERROR LOG
020413 14:38:59  Aborted connection 1 to db: 'riderx' user:
'riderx' host: `localhost' (Got an error reading communication packets)

APACHE ERROR LOG:
[Sun Apr 14 22:23:32 2002] [notice] child pid 29360 exit signal Segmentation
fault (11)

Cobalt Raq4i
Apache version 1.3.20
PHP 4.1.2
MySQL 3.23.37

Where is the problem ?? Is the apache, php or mysql settings are
misconfigured??

Any idea what would be the best way to fix it??

Best regards,

Andras Kende




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




[PHP] meta tags from mysql

2002-04-15 Thread Andras Kende

Hello All,

I looking to to generate different meta tags from mysql for each page on a
dynamic
site which has about 400 pages from mysql database .

Searched around but didnt find anything which will give me some hint whats
the best way doing it

Any help appreciated :)

Thanks,

Andras Kende
[EMAIL PROTECTED]



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




[PHP] str_replace question

2002-04-15 Thread Andras Kende

Is a nicer way to remove any number 1-0 from a string???

Currently:
$metakeywords=str_replace(1,'',strtolower($metakeywords));
$metakeywords=str_replace(2,'',strtolower($metakeywords));
$metakeywords=str_replace(3,'',strtolower($metakeywords));
$metakeywords=str_replace(4,'',strtolower($metakeywords));
$metakeywords=str_replace(5,'',strtolower($metakeywords));
$metakeywords=str_replace(6,'',strtolower($metakeywords));
..

Thanks :)

Andras Kende



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




[PHP] PDF creation with PDF-LIB samples?

2002-02-28 Thread Andras Kende

Hello,

Trying to create some pdf documents on the fly with php and mysql..

I search the web but not yet found any easy way to do this...

Tried Yaps but it requires ghostscript which didnt install on a cobalt raq4
because it it requires some more programs (glibc...etc..)...

Anyone can give some hint where to start?

Thanks,

Andras Kende



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




[PHP] Mysql Curdate problem

2002-01-01 Thread Andras Kende

Hello,

I have a php page which list a table from a mysql database.

Dates can be selected like last 7 days, last 14 days .etc

It worked perfect till midnight :(

The query is something like:
$aresult=mysql_query(select * from orders WHERE (a3 = CURDATE()-$datec)
,$db);


I looking for some advice hos to modify my query or the php code..

Thanks

Andras Kende





-- 
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] substr trim functions..

2001-12-14 Thread Andras Kende

I trying to convert some full names to last names only like:
-get the subtext from the end until the space

joe blue - blue
bill western - western

Looked around at php.net docs but im not sure... 

Thanks

Andras




-- 
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] string conversion

2001-09-20 Thread Andras Kende

Hi,

I trying to cut the last 4 char of a string but sometimes its cut 3 sometime
4 char

$pic1=$amyrow[picture];
$pic2 = substr($pic1, 0, -4);

Actually I have some pictures where I need to cut off the extensions...

amamm.jpg
33.jpg
321.gif

to

amamm
33
321

Is any other way than substr to do this ??

Thanks

Andras


-- 
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] insert space to a string (newbie)

2001-09-08 Thread Andras Kende

Hi,

I have a simple question...
How can a space inserted to a string after the 3rd char ??

washington   -  was hington 


Thanks :)


Andras


-- 
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] search engine friendly php + form

2001-08-24 Thread Andras Kende

Hello,

I was successfully created  search engine friendly php from a tutorial on
zend site.. like:
salescomps.php?city=Canadamonth=febyear=2000
to
salescomps.php/cityCanada/month/feb/year/2001


Is there any way to modify a submit form to result a page with search engine
friendly format  without using GET or POST ( / ) ??


Thanks,

Andras


-- 
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] insert hyperlink to mysql query result

2001-08-22 Thread Andras Kende

Hello,

I have a mysql query with addresses , trying to insert a link to a map

line 51
echo /tdtdfont face=verdana size=1pa
href=http://www.expedia.com/pub/agent.dll?qscr=mcststrt1=$amyrow[address;]
city1=$amyrow[city]stnm1=CAzipc1=cnty1=4Map/p;
echo /td;

Error Message:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in /home/sites/site15/web/salescomps.php on line 51


I think its the   character is the problem like :$amyrow[address]

Any help apprecciated,
Thanks

Andras


-- 
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] begginer how to make integer ?

2001-08-21 Thread Andras Kende

Hello,
 
 I have a query but it not creating integer result:
 
 $saleprice=$amyrow[saleprice]+$saleprice;
$squarefeet=$amyrow[squarefeet]+$squarefeet; 
 $dom=$amyrow[dom]+$dom; 
  result:
Total listings: 18 -- Average Price: $339166.6667
Average Square Foot: 1596.61
Average DOM: 52.5556
Average Price Per Square Feet: 212.42910330909
 
But I need Integer numbers like 339166 , 1596 

Thanks :)
 
Andras


-- 
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] php authentication system

2001-08-10 Thread Andras Kende

Hello,

I need to password protect some webpages right now its passwords
everywhere

Probably need some cookie based php authentication system where users login
once 
Where can I find a simple but good script??

Thanks :)
Andras



-- 
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] Alternative to phpMyAdmin

2001-07-11 Thread Andras Kende

Steph,

This one is cgi based and works well too..
http://www.gossamer-threads.com/scripts/mysqlman/index.htm

Why phpMyAdmin doesn't work on the new server? maybe you need newer
development versions?


Andras

- Original Message -
From: Steph [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 11, 2001 9:00 PM
Subject: [PHP] Alternative to phpMyAdmin


Hi all! I love phpMyAdmin, just makes life so easy :) But I just moved my
site, and phpMyAdmin isnt working on my server yet, so does any one have any
solid alternatives that I can install??

Thanks, Steph



-- 
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] Question about /tmp/php* files

2001-07-08 Thread Andras Kende

Hello,

I noticed there are a lot of php temp files (session files) under /tmp
Whats the best way to dealing with this...

Thanks

Andras


-- 
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] totals from a mysql query

2001-06-22 Thread Andras Kende

Hello,

I have a php page which pull data from myusql database...
I'm new to php so I looking for some advice ...
I have a field which contains numbers and needed to have them totaled after
the query below the table...

Database:
|text1|text2|total|
|some|tfdfd|100|
|string|adfa|250|
|made|tofd|150|

total should be : 100+250+150

Query:
{$aresult=mysql_query(select * from testdb  ,$db);}
while($amyrow = mysql_fetch_array($aresult))
{
echo Trtd;
{echo $amyrow[text1];}
echo /tdtd;
{echo $amyrow[text2];}
echo /td;
}
echo /td/tr/table;
echo all together : total;

total is : 500


Thanks,

Andras Kende


-- 
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] PHP Mysql query data conversion newbie

2001-05-09 Thread Andras Kende

Hello,

I pull some data from mysql with the php code below.
On the date field if there is no date on mysql it displays : -00-00
00:00:00

I would like to change this -00-00 00:00:00 to no date for example..

Or if the cel is empty to   (because otherwise the tableborders are messed
up)

I tried to put an if statement inside the while {} but i cannot figured
out...


Thank You,

Andras



{$aresult=mysql_query(select * from media where d like '$city' order by i
,$db);}

while($amyrow = mysql_fetch_array($aresult))
{
  echo /tdtdfont face=verdana size=1;
 echo $amyrow[i];
   echo /tdtdfont face=verdana size=1;
 echo $amyrow[j];
   echo /tdtdfont face=verdana size=1;
 echo $amyrow[f];
   echo /td;
}


-- 
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] if else and or ?

2001-05-07 Thread Andras Kende

Hello,

I started to do a php page with mysql connection..

My problem is:

I do query from a mysql, I try to setup usernames + passwords
to protect the database

They would need to use specific user+password+cities to be able to connect.
Bad passwd would just print an access denied messsage..

http://www.cmtsite.com/schedules/
name=1 passwd=1 city=HOU
name=2 passwd=2 city=LAX
name=3 passwd=3 city=TAM
pl: http://www.cmtsite.com/schedules/media.php?city=HOUname=1passwd=1

Actually its working ok but i have add more user+pass but then it just goes
to the }else statement ??

I really would like to store  the usernames, passwords in the php code for
simplicity...

ATLWL  31128595
ATLSM  31128576
DFWSS  31133977
HOUFA  31146832
HOUBL  31146825
LAXSC  31152972
MIAJJ  31164255
TAMVH  31182684
TAMTK  31182685


Below my php file...

Thanks for any help!

Andrew

 ?
 include ('../menu.html');

 if
 (
 (($name==1) and ($passwd==1) and ($city==HOU))
 or
 (($name==2) and ($passwd==2) and ($city==LAX))
 or
 (($name==3) and ($passwd==3) and ($city==TAM))
 )
 {

 echo br;

 echo centerfont face=verdana color=red size=2b;

 if (strstr($city,HOU)) {
 echo Market: Houston, Texas;
 }
 if (strstr($city,LAX)) {
 echo Market: Los Angeles, California;
 }
 if (strstr($city,ATL)) {
 echo Market: Atlanta, Georgia;
 }
 if (strstr($city,TAM)) {
 echo Market: Tampa, Florida;
 }
 if (strstr($city,ORL)) {
 echo Market: Orlando, Florida;
 }
 if (strstr($city,DFW)) {
 echo Market: Dallas/Fort Worth, Texas;
 }
 if (strstr($city,BIR)) {
 echo Market: Birmingham, Alabama;
 }
 if (strstr($city,MIA)) {
 echo Market: Miami, Florida;
 }

 echo /b/fontcenterbr;

 $db=mysql_connect(zz.com:3306,zz,zz);
 mysql_select_db(cmt,$db);

 if (strstr($city,HOU)) {
 $aresult=mysql_query(select * from media where d like '%HOU%' or d like
'%MCA%' or d like '%BMT%' order by i ,$db);
 }
 else {
 $aresult=mysql_query(select * from media where d like '$city' order by i
,$db);
 }

 echo 
 table align=center width=95% cellspacing=0 cellpadding=2 border=1
 tr
 tdfont face=verdana size=2bMarket/b/td
 tdfont face=verdana size=2bStation/b/td
 tdfont face=verdana size=2bLocal Date/b/td
 tdfont face=verdana size=2bTV Date/b/td
 tdfont face=verdana size=2bLog Action/b/td
 tdfont face=verdana size=2bLog Date/b/td
 /tr;

 while($amyrow = mysql_fetch_array($aresult))
 {
   echo Trtdfont face=verdana size=1;
echo $amyrow[d];
 echo /tdtdfont face=verdana size=1;
  echo $amyrow[c];
 echo /tdtdfont face=verdana size=1;
  echo $amyrow[i];
 echo /tdtdfont face=verdana size=1;
  echo $amyrow[j];
 echo /tdtdfont face=verdana size=1;
  echo $amyrow[f];
 echo /tdtdfont face=verdana size=1;
  echo $amyrow[k];
 echo /td;
 }

 echo /td/tr/table;

 echo br;

 include ('../sql-bottom.html');

 } else {

 echo brbrcenterfont face=verdana size=2bAccess Denied. Please
check your password./b/fontcenterbrbr;

 }

 echo br;


 ?


-- 
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] passing variables + if case

2001-05-04 Thread Andras Kende


Hi All,

I new to php trying to do a php page which gets a variables from an html
form
Somehow this if case not working 100%

Is this is a correct format ???

Thanks :)

Andrew


if
(
(($name==1) and ($passwd==1) and ($city==HOU))
or
(($name==2) and ($passwd==2) and ($city==LAX))
or
(($name==3) and ($passwd==3) and ($city==TAM))
)
{

echo bla bla ..etc.;

} else {

echo Access Denied. Please check your password.;

}

?


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