RE: [PHP] GD jpg thumbnail - ugly discollored

2003-01-25 Thread Victor
That is not an option since I do not have control over the hosting
company.

-Original Message-
From: George E. Papadakis [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, January 25, 2003 3:20 PM
To: Victor; [EMAIL PROTECTED]
Subject: Re: [PHP] GD jpg thumbnail - ugly discollored

Use ImageMagick found @ http://www.imagemagick.org .
It is all you need to handle images.
Aside the binary external program take a look at this too :
http://magick.communityconnect.com/

best of luck,

--georgep

- Original Message - 
From: Victor [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, January 25, 2003 10:00 PM
Subject: [PHP] GD jpg thumbnail - ugly discollored


 I have a script that takes uploaded images (jpeg only) and makes
 proportionate thumbnails etc, and saves them in jpeg (.jpg) format
again
 (default compression of %75 I think) anyway, the thumbnails are UGLY.
 Beauty of content aside, they are discolored, and usually one
 predominant color takes over the entire picture so they come looking
 like off-black and white thumbnails. WHY? And how can I fix this/get
 around it?
 
 This is some extra info.
 
 GD Support enabled
 GD Version 2.0 or higher
 FreeType Support enabled
 FreeType Linkage with freetype
 JPG Support enabled
 PNG Support enabled
 WBMP Support enabled
 
 
 
 __

 Post your free ad now! http://personals.yahoo.ca
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] + in filenames

2003-01-25 Thread Victor
I have a file upload field, and some filename checking code, but it
breaks the code whenever a + is inside the filename it verifies space
and other tags but breaks on + in the name. Anyone know a fix for this
please? 

- Vic

__ 
Post your free ad now! http://personals.yahoo.ca

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




RE: [PHP] GD jpg thumbnail - ugly discollored

2003-01-25 Thread Victor
Thanks it worked.

- Vic

-Original Message-
From: Mark Charette [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, January 25, 2003 4:42 PM
To: Victor; [EMAIL PROTECTED]
Subject: RE: [PHP] GD jpg thumbnail - ugly discollored

make sure you use:

ImageCreateTrueColor()

to create the thumbnail image and

ImageCopyResampled()

when you copy the image.

Mark C.

 -Original Message-
 From: Victor [mailto:[EMAIL PROTECTED]]
 I have a script that takes uploaded images (jpeg only) and makes
 proportionate thumbnails etc, and saves them in jpeg (.jpg) format
again
 (default compression of %75 I think) anyway, the thumbnails are UGLY.
 

__ 
Post your free ad now! http://personals.yahoo.ca

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




RE: [PHP] + in filenames

2003-01-25 Thread Victor
Here is some sample code:



$file_name = explode(., $_FILES['picture']['name']);
$name = str_replace('', '_', $file_name[0]);

# check if file uploaded is good
if 
(
!in_array($_FILES['picture']['type'],
$file_type) 
|| trim($_FILES['picture']['tmp_name']) ==  
|| trim($_FILES['picture']['tmp_name']) ==
none
)
{
echo ('You can upload a JPG or JPEG filetype
only.');

exit;
}

# Add slashes to prevent certain errors
$picture_name = strip_tags($_FILES['picture']['name']);
$picture_name = addslashes($picture_name);
$picture_name = str_replace(\r\n, , $picture_name);
$picture_name = str_replace( , , $picture_name);



-Original Message-
From: Richard Whitney [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, January 25, 2003 5:12 PM
To: Victor
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] + in filenames

Some sample code would help, but maybe try urldecode('$filename');

RW

Quoting Victor [EMAIL PROTECTED]:

### I have a file upload field, and some filename checking code, but it
### breaks the code whenever a + is inside the filename it verifies
space
### and other tags but breaks on + in the name. Anyone know a fix for
this
### please? 
### 
### - Vic
### 
###
__ 
### Post your free ad now! http://personals.yahoo.ca
### 
### -- 
### PHP General Mailing List (http://www.php.net/)
### To unsubscribe, visit: http://www.php.net/unsub.php
### 
### 


-- 
Richard Whitney
Transcend Development
Producing the next phase of your internet presence.
[EMAIL PROTECTED]
http://xend.net
602-971-2791

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

__ 
Post your free ad now! http://personals.yahoo.ca

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




RE: [PHP] + in filenames

2003-01-25 Thread Victor
I DO want preserve the filenames, and the pluses come from the user
(beta testers that deliberately try to hack the script) . all I want to
do is make sure the the script doeasnt breack when a user uploads a file
that has the + character in it's name.

- Vic

-Original Message-
From: Richard Whitney [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, January 25, 2003 5:32 PM
To: Victor
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] + in filenames

Victor!

What are you trying to accomplish?
Do you want to preserve the original filename?
Why not give uploaded files uniformly unique names?

In other words, where are the +'s coming from?

So, a little more detail, please!

RW


Quoting Victor [EMAIL PROTECTED]:

### Here is some sample code:
### 
### 
### 
### $file_name = explode(., $_FILES['picture']['name']);
### $name = str_replace('', '_', $file_name[0]);
### 
### # check if file uploaded is good
### if 
### (
### !in_array($_FILES['picture']['type'],
### $file_type) 
### || trim($_FILES['picture']['tmp_name']) ==  
### || trim($_FILES['picture']['tmp_name']) ==
### none
### )
### {
### echo ('You can upload a JPG or JPEG filetype
### only.');
### 
### exit;
### }
### 
### # Add slashes to prevent certain errors
### $picture_name = strip_tags($_FILES['picture']['name']);
### $picture_name = addslashes($picture_name);
### $picture_name = str_replace(\r\n, , $picture_name);
### $picture_name = str_replace( , , $picture_name);
### 
### 
### 
### -Original Message-
### From: Richard Whitney [mailto:[EMAIL PROTECTED]] 
### Sent: Saturday, January 25, 2003 5:12 PM
### To: Victor
### Cc: [EMAIL PROTECTED]
### Subject: Re: [PHP] + in filenames
### 
### Some sample code would help, but maybe try urldecode('$filename');
### 
### RW
### 
### Quoting Victor [EMAIL PROTECTED]:
### 
### ### I have a file upload field, and some filename checking code, but
it
### ### breaks the code whenever a + is inside the filename it verifies
### space
### ### and other tags but breaks on + in the name. Anyone know a fix
for
### this
### ### please? 
### ### 
### ### - Vic
### ### 
### ###
###
__ 
### ### Post your free ad now! http://personals.yahoo.ca
### ### 
### ### -- 
### ### PHP General Mailing List (http://www.php.net/)
### ### To unsubscribe, visit: http://www.php.net/unsub.php
### ### 
### ### 
### 
### 
### -- 
### Richard Whitney
### Transcend Development
### Producing the next phase of your internet presence.
### [EMAIL PROTECTED]
### http://xend.net
### 602-971-2791
### 
### -- 
### PHP General Mailing List (http://www.php.net/)
### To unsubscribe, visit: http://www.php.net/unsub.php
### 
###
__ 
### Post your free ad now! http://personals.yahoo.ca
### 
### -- 
### PHP General Mailing List (http://www.php.net/)
### To unsubscribe, visit: http://www.php.net/unsub.php
### 
### 


-- 
Richard Whitney
Transcend Development
Producing the next phase of your internet presence.
[EMAIL PROTECTED]
http://xend.net
602-971-2791

__ 
Post your free ad now! http://personals.yahoo.ca

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




RE: [PHP] total file size

2003-01-23 Thread Victor
With what then? Why not? Should this be a bug filed in their bugs
database?

- Vic

-Original Message-
From: Jim Lucas [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 23, 2003 2:00 PM
To: Victor; [EMAIL PROTECTED]
Subject: Re: [PHP] total file size

yes, it is possible, but not with php.

Jim

- Original Message - 
From: Victor [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 8:10 PM
Subject: [PHP] total file size


 Is there a way to find out total upload file size from a file uploaded
 though an html form? I figure if I know the total size, then I can
just
 consistently poke at the file being uploaded and math a progress bar
for
 the file being uploaded, of course, this all hangs upon the ability of
 getting the total file size BEFORE it is uploaded. It IS possible I
have
 seen it done with JSP; anybody can help me with this? Thanks
 
 - Vic
 
 __

 Post your free ad now! http://personals.yahoo.ca
 
 -- 
 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

__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] total file size

2003-01-22 Thread Victor
Is there a way to find out total upload file size from a file uploaded
though an html form? I figure if I know the total size, then I can just
consistently poke at the file being uploaded and math a progress bar for
the file being uploaded, of course, this all hangs upon the ability of
getting the total file size BEFORE it is uploaded. It IS possible I have
seen it done with JSP; anybody can help me with this? Thanks

- Vic

__ 
Post your free ad now! http://personals.yahoo.ca

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




Re: [PHP] OOP for Web Programming Paradigm

2003-01-12 Thread Victor
olinux wrote:

I'm no OOP programmer but maybe extend your class to
include methods for each situation.

something like this:

function countSingle($cid)

function countMulti($cidArray)

function countAll() 


HTH,
olinux

Hmm, yes, that's an interesting idea. Except perhaps include the first 
arg as a by-refrence return variable, so that func can return true 
false. Yeah, I think that's not bad. Still, would have to have static 
accessors, but oh well...


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



[PHP] OOP for Web Programming Paradigm

2003-01-11 Thread Victor
Hello. I have this question. When I program, I try to create a class for 
each table. Example below.

Now what some complain about, and logically so, is that this might 
impose an overhead (I load all data even if I just need a counter and 
NOT description).

So I say we can make a STATIC version of each Accessor with $cid as 
argument; But then they say what if i want to load an array of all 2000 
counters, for example. I say first get all the $cid's, then in an array, 
load a class for each one, etc.. That however makes lots of SQL calls 
instead of one big one. I suppose I can get all data and then load it 
into classes, but that seems like a bad approach, especially for 
calculated values.

What I am curious about is what paradigms do you guys use to address 
these issues? Is my paradigm good and it's worth to just provide static 
methods for frequently necessary fields to reduce overhead, or is there 
a better way of dealing with this stuff?

class Counter
{
   var $db;

   var $cid;
   var $counter;
   var $descr;

   /**
* Default Constructor
* @param int $cid - Counter ID
*/
   function Counter($cid=false)
   {
  global $db;
  $this-db = $db;
  if (isset($cid)  $cid) $this-load($cid);
   }

   /**
* Description
* @param int $cid - Counter ID
* @return bool
*/
   function load($cid=0)
   {
  if (!$cid) return false;

  $q = SELECT * FROM counter WHERE cid = $cid;
  $r = $this-db-getRow($q); // Using PEAR here.

  if (!DB::isError($r)) {
 $this-cid = $r[cid];
 $this-counter = $r[counter];
 $this-descr   = $r[descr];
 return true;
  }
  return false;
   }

   #
   # Accessor Methods
   #
   function getCid() { return $this-cid; }
   function getCounter() { return $this-counter; }
   function getDescr()   { return $this-descr; }

   #
   # Mutator Methods
   #
   function setCid($v) { $this-iaid= $v; }
   function setCounter($v) { $this-counter = $v; }
   function setDescr($v)   { $this-descr   = $v; }

   // Many other methods, etc Static methods, etc...
}



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



[PHP] some multiple array problems...

2002-12-27 Thread Victor
I am trying to make a calculator that figures out the total price
(calculates tax sums up price for print size times quantity etc.) and
the mechanism all works fine - but only when the user checks
SEQUENTIALLY from their list of available picture. 

The user should be able to select from their list of pictures at random,
and the script should be able to calculate the total price, but after
one image is skipped, if any pictures after the skipped one is selected
the script thinks that the user chose size 4x6 and quantity of 1 for
those (those are default values) 

note that I am also using arrays and that may be what is causing
problem, - bad array data input. Please help if u can and it doesn't
take u too much time.

The page that gives me trouble is order_form.php

This is what calculated the total value:

(don't get overwhelmed by the code, at the bottom there is clearer
explanation)



# calculate pricing
if (isset($_POST['check_price'])  isset($_SESSION['f_username']) 
isset($quantity)  isset($size)) {
# if no picture checked but update submitted, then lets thell
the user how stupid they are
if (empty($check))
{   
echo ('One or more pictures must be checked in order to
verify price.');
exit;
}

# let us do some math, like taxes, discounts, etc.
for ($i=0; $isizeof($_POST['check']); $i++)
{
# if the data in the quantity is not pure numbers then
we abort
if (!is_numeric($quantity[$i]))
{   
echo ('Quantity must be defined only in
numbers.');
exit;
}

# getting the array data into variables
$ins_size = $size[$i];
$ins_quantity = $quantity[$i];

##
# 4x6 pricing matrix #
##

# less than or equal to 50
if ($ins_size == '4x6'  $ins_quantity = '50')
{
$price = '0.49';
}

# 51 to 100
if ($ins_size == '4x6'  $ins_quantity = '51' 
$ins_quantity = '100')
{
$price = '0.45';
}

# 101 to 150
if ($ins_size == '4x6'  $ins_quantity = '101' 
$ins_quantity = '150')
{
$price = '0.40';
}

# 151 to infinity
if ($ins_size == '4x6'  $ins_quantity = '151')
{
$price = '$0.30';
}

##
# 2.5x3.5 pricing matrix #
##

# less than or equal to 50
if ($ins_size == '2.5x3.5'  $ins_quantity = '50')
{
$price = '0.49';
}

# 51 to 100
if ($ins_size == '2.5x3.5'  $ins_quantity = '51' 
$ins_quantity = '100')
{
$price = '0.45';
}

# 101 to 150
if ($ins_size == '2.5x3.5'  $ins_quantity = '101' 
$ins_quantity = '150')
{
$price = '0.40';
}

# 151 to infinity
if ($ins_size == '2.5x3.5'  $ins_quantity = '151')
{
$price = '0.30';
}


# 3.5x5 pricing matrix #


# less than or equal to 50
if ($ins_size == '3.5x5'  $ins_quantity = '50')
{
$price = '0.49';
}

# 51 to 100
if ($ins_size == '3.5x5'  $ins_quantity = '51' 
$ins_quantity = '100')
{
$price = '0.45';
}

# 101 to 150
if ($ins_size == '3.5x5'  $ins_quantity = '101' 
$ins_quantity = '150')
{
$price = '0.40';
}

# 151 to infinity
if ($ins_size == '3.5x5'  $ins_quantity = '151')
{
$price = '0.30';
}

##
# 5x7 pricing matrix #
##

# less than or equal to 50
if ($ins_size == 

[PHP] Strange behaviour of generated images

2002-12-17 Thread Victor V. Evtushenko
Hi, 

I'm trying to output a set of image thumbnails in HTML table. Everything
works fine, except that performance is very poor. If I put all the
thumbnails as regular files in some directory it has expected speed. But
if I'm trying to use script to retrieve thumbnails from their actual
location (which may be database for example) speed drops down
dramatically. And what is even more strange, from apache log I see that
script is terminating very fast, less than 0.5 second for each image
(they are relatively small, ~2K), but browser is spending huge amount of
time downloading images two at a time. 

Image retrieving script is very simple:

?php
$expires = 24 * 60 * 60;
$gm_expires = gmdate('D, d M Y H:i:s', time() + $expires);
header(Cache-control: public, max-age=$expires, pre-check=$expires);
header(Expires: $gm_expires GMT);
$filename = DATA_DIR . '/' . $_REQUEST['ID'];
$fp = @fopen($filename, 'r') or die (Cannot open file $filename);
$story = fread($fp, filesize ($filename));
$packet = new Packet($story);
$content_type = substr($packet-value('IMAGE_FILENAME'), -3);
header(Content-type: image/$content_type);
header(Content-length: . strlen($packet-value('IMAGE_REGULAR')));
echo $packet-value('IMAGE_THUMBNAIL');
fclose($fp);
exit;
?

and call for images is made like this:

echo a href='$url' target='story'img src='show_image.php?ID=$ids=0' width=65 
border=0/a;

Does anyone has such a problem before and is there any solution?

Thank you,
Victor.
-- 
Infodesk S.A.
Gustavo Mejia Ricart #70
Santo Domingo, Dominican Republic

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




Re: [PHP] My first post

2002-12-04 Thread Victor Espina
Thank you a lot! That is exactly what i was looking for.

--
==
Victor J. Espina S.
Gerente de Desarrollo / Software Development Manager
Software de Venezuela, S.A.
Caracas, Venezuela

Email: [EMAIL PROTECTED]
Personal site: http://victorespina.coolfreepages.com
MSN: [EMAIL PROTECTED]
==
(Elimine 'nospam' en las direcciones email)
(Remove 'nospam' in email and MSN address)
==
Tom Rogers [EMAIL PROTECTED] escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 Tuesday, December 3, 2002, 7:37:20 AM, you wrote:
 VE Hi.

 VE I'm new in PHP. Could you point me where can i download a sample
script
 VE about how can i paginate some results?

 VE TIA
 Here is a class that will create a google like pagination of results  if
that is
 what you are after :)

 ?
 class page_class {
 var $count = 0; //total pages
 var $start = 0; //starting record
 var $pages = 0; //number of pages available
 var $page = 1;  //current page
 var $maxpages;  //shows up to 2 * this number and makes a
sliding scale
 var $show;  //number of results per page
 function page_class($count=0,$show=5,$max=9){
 $this-count = $count;
 $this-show = $show;
 $this-maxpages = $max;
 ($this-count % $this-show == 0)? $this-pages =
intval($this-count/$this-show) :$this-pages
intval($this-count/$this-show) +1;
 if(!empty($_GET['search_page'])){
 $this-page = $_GET['search_page'];
 $this-start = $this-show * $this-page -
$this-show;
 }
 }
 function get_limit(){
 $limit = '';
 if($this-count  $this-show) $limit =
'LIMIT'.$this-start.','.$this-show;
 return $limit;
 }
 function make_head_string($pre){
 $r = $pre.' ';
 $end = $this-start + $this-show;
 if($end  $this-count) $end = $this-count;
 $r .= ($this-start +1).' - '.$end.' of '.$this-count;
 return $r;
 }
 function make_page_string($words,$pre='Result Page:'){
 $r = $pre.' ';
 if($this-page  1){
 $y = $this-page - 1;
 $r .= 'a
href='.$_SERVER['PHP_SELF'].'?search_page='.$y.$words.'Previous/anbsp;
';
 }
 $end = $this-page + $this-maxpages-1;
 if($end  $this-pages) $end = $this-pages;
 $x = $this-page - $this-maxpages;
 $anchor = $this-pages - (2*$this-maxpages) +1;
 if($anchor  1) $anchor = 1;
 if($x  1) $x = 1;
 if($x  $anchor) $x = $anchor;
 while($x = $end){
 if($x == $this-page){
 $r .= 'span
class=s'.$x.'/spannbsp;';
 }
 else{
 $r.= 'a
href='.$_SERVER['PHP_SELF'].'?search_page='.$x.$words.''.$x.'/anbsp;';
 }
 $x++;
 }
 if($this-page  $this-pages){
 $y = $this-page + 1;
 $r .= 'a
href='.$_SERVER['PHP_SELF'].'?search_page='.$y.$words.'Next/anbsp;';
 }
 return $r;
 }
 }

 //Usage

 mysql_connect(**.**.**.**, **, ) or die (mysql_error());

 $Query = SELECT COUNT(*) AS cnt FROM tabletosearch WHERE fieldtosearch
LIKE '% .$searchword. %';
 $query = mysql_query($Query) or die(mysql_error());
 $row = mysql_fetch_array($result);
 $count = $row['cnt'];
 if($count  0){
   //start class total number of results,number of results to
show,max number of pages on a sliding scale (ends up as 2x this number..ie
20)
 $page = new page_class($count,5,10);
 $limit = $page-get_limit();
 $Query2= SELECT * FROM tabletosearch WHERE fieldtosearch LIKE '%
.$searchword. %' ORDER BY  whatever ASC .$limit;
 $result = mysql_query($Query2) or die(mysql_error());
 $hstring = $page-make_head_string('Results');
 $pstring =
$page-make_page_string(amp;searchword=.$searchword.amp;whatever=.$wha
tever);//add the other variables to pass to next page in a similar fashion
 echo tabletrtd.$hstring./td/tr;
 while($row = mysql_fetch_array($result)){
echo trtd.$show_data_here./td/tr;
 }
 echo trtd.$pstring./td/tr/table;
 }
 ?
 Note: the search variables on subsequent pages will be passed by GET
method








 --
 regards,
 Tom




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




Re: [PHP] My first post

2002-12-04 Thread Victor Espina
Thank you. I'm a VFP programmer (since 1989!) and have some time looking for
a way to move to the Web world. I heard about PHP about 1 year ago, but was
just a few months ago when i finally download it and started to look what is
all about.  And what i found was an incredible powerfull language, with a
great OOP implementation, an elegant sintax, a lot of native functions and
the mos important: REALLY FAST!!

So, you can bet you will see me here a lot, bothering you with stupid
questions! :-)

--
==
Victor J. Espina S.
Gerente de Desarrollo / Software Development Manager
Software de Venezuela, S.A.
Caracas, Venezuela

Email: [EMAIL PROTECTED]
Personal site: http://victorespina.coolfreepages.com
MSN: [EMAIL PROTECTED]
==
(Elimine 'nospam' en las direcciones email)
(Remove 'nospam' in email and MSN address)
==
Dl Neil [EMAIL PROTECTED] escribió en el mensaje
0f6601c29aeb$2d3deba0$c900a8c0@jrbrown">news:0f6601c29aeb$2d3deba0$c900a8c0@jrbrown...
 Hi Victor,
 Welcome to the wonderful world of PHP!

  I'm new in PHP. Could you point me where can i download a sample script
  about how can i paginate some results?


 PHP essentially exists to output HTML. You cannot paginate in HTML
(although
 there is some fancy CSS that could be employed).

 Sorry,
 =dn




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




[PHP] Problem with functions

2002-12-04 Thread Victor Halla
Hi,

I have de following code for example


?php

$username = victor;


function test() {
echo $username;
}

?

If  I call the funcion test(), echo print nothing what's is going on ?

[]´s

[EMAIL PROTECTED]



__ Victor
Halla ICQ#: 114575440 Current ICQ status: + More ways to contact me
__



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




Re: [PHP] Problem with functions

2002-12-04 Thread Victor Halla
Thanks !!!

Victor
Tom Rogers [EMAIL PROTECTED] escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 Thursday, December 5, 2002, 9:15:53 AM, you wrote:
 VH Hi,

 VH I have de following code for example


 VH ?php

 VH $username = victor;


 VH function test() {
 VH echo $username;
 VH }

 ?

 VH If  I call the funcion test(), echo print nothing what's is going
on ?

 VH []´s

 VH [EMAIL PROTECTED]



 VH ______
Victor
 VH Halla ICQ#: 114575440 Current ICQ status: + More ways to contact me
 VH __




 You need to tell the function to use the global variable like so:


 function test() {
 global $username;
 echo $username;
 }

 --
 regards,
 Tom




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




[PHP] My first post

2002-12-03 Thread Victor Espina
Hi.

I'm new in PHP. Could you point me where can i download a sample script
about how can i paginate some results?

TIA

--
==
Victor J. Espina S.
Gerente de Desarrollo / Software Development Manager
Software de Venezuela, S.A.
Caracas, Venezuela

Email: [EMAIL PROTECTED]
Personal site: http://victorespina.coolfreepages.com
MSN: [EMAIL PROTECTED]
==
(Elimine 'nospam' en las direcciones email)
(Remove 'nospam' in email and MSN address)
==



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




[PHP] some data output formatting and grouping question...

2002-12-02 Thread Victor
I just have a mental block; I cannot at all conceive the necessary
syntax to or even the theoretical algorithm that I need, to do the
following:

Consider the following table:

U | X | Y 
--|---|--
me|001|0a
me|002|0a
me|003|0a
me|002|0b
me|003|0b
me|004|0b
..|...|..

then the code says:

SELECT * FROM Y WHERE U = me

So now what?
- remember I do not know the value of Y, so it has to be an automatic
thing; I can't just say ... WHERE U = me AND Y = a.

I want this output:

0a
001
002
003
___ (hr)

0b
002
003
004 

How the h3ll do I do that? I can't think of the g0dd4mn' syntax!

__ 
Post your ad for free now! http://personals.yahoo.ca

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




[PHP] some data output formatting and grouping question...

2002-12-01 Thread Victor
I just have a fucking mental block; I cannot at all conceive the
necessary syntax to or even the theoretical algorithm that I need, to do
the following:

Consider the following table:

U | X | Y 
--|---|--
me|001|0a
me|002|0a
me|003|0a
me|002|0b
me|003|0b
me|004|0b
..|...|..

then the code says:

SELECT * FROM Y WHERE U = me

So now what?
- remember I do not know the value of Y, so it has to be an automatic
thing; I can't just say ... WHERE U = me AND Y = a.

I want this output:

0a
001
002
003
___ (hr)

0b
002
003
004 

How the hell do I do that? I can't think of the goddamn' syntax!

__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] BUG with session trans sid ?

2002-11-13 Thread Victor Soroka
I have tried to disable cookies and got strange behavior of PHP 4.0.6.

So, I use php4.0.6 in default redhat installation. My code:

ini_set('session.use_cookies', FALSE);
ini_set('session.use_trans_sid', TRUE);
ini_set('session.save_handler', 'user');

Then I set my own session handlers and start session.

session_set_save_handler(FJ_S_open, FJ_S_close, FJ_S_read, FJ_S_write, 
FJ_S_destroy, FJ_S_gc);
session_start();

TRANS SID feature doesnt working, but constant SID set
correctly (PHPSESSID=...). If I write SID in links and forms
manually, all works fine.



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




RE: [PHP] Re: PHP Session register variable not always restored with contents

2002-10-26 Thread Victor Soroka
On Thu, 24 Oct 2002 21:26:30 +, John W. Holmes wrote:

 What is supposed to be in the session? Maybe these users are just
 denying cookies?
Maybe... But my php compiled with --use-trans-sid and use this feature.
In the session i store account, access timestamp etc...

P.S. And 10% of traffic ~2000 visitors.


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




[PHP] ftp_problem - ... php_network_getaddresses: getaddrinfo failed: ...

2002-10-25 Thread victor
Any tips on trouble shooting this problem?

Warning: php_network_getaddresses: getaddrinfo failed: Name or
service not known in /xxx/xxx/xxx/xxx/new_user.php on line 121
Could not establish FTP connection.

This is the code the error refers to:

# set up basic connection
$conn_id = ftp_connect($ftp_server)
or die ('Could not establish FTP connection.');

The config file is somewhere else on the server - outside the public dir
for sec. reasons.

The info is correct. - I cannot divulge it, but it is correct (or let's
assume it is), so where to now???

- Victor | www.argilent.com  


__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] Re: PHP Session register variable not always restored with contents

2002-10-24 Thread Victor Soroka
I have same troubles!!! I use php internet trade traffic system, and
10-20% of visitors lose their sessions data. Cut from logs:

Remote address: ##
Referer: http://mydomain.com/
URI: /out.php?id=1PHPSESSID=235a91cef853e750a6b67a70375e7d88
User-agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
Session ID: 616596c44d83c581a829658b63191d7c
Session DATA: 

Remote address: ##
Referer: http://mydomain.com/music.php?0
URI: /out.php?id=1link=freemusic
User-agent: Mozilla/5.0 (Windows; U; Win98; de-DE; QXW0330l) Gecko/20011019 
Netscape6/6.2
Session ID: b7a5708d134a08c370fb5778e099d0d0
Session DATA: 

Session DATA is EMPTY ! In 10-20% of visitors. I think
this is a PHP bug, because most of visitors don't lose their session data.
I used my script on 10 different servers (BSD,Linux) and PHP 4.0.6 - PHP 4.2.1.

On Mon, 30 Sep 2002 17:34:27 +0300, Brad Hanson wrote:

 many times the value is presented. Sometimes it is a null string.
 Sometimes it takes a few refreshes before it will display anything other
 than blank.

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




[PHP] $_GLOBAL[var] or $_GLOBAL['var'] or $_GLOBAL[var]; ???

2002-09-22 Thread Victor

$_GLOBAL[var] or $_GLOBAL['var'] or $_GLOBAL[var] - I noticed that in
a mysql statement you can only use: $_GLOBAL[var].

I would like to get the advice of more experienced php programmers out
there about this. Which one of the above it the most best way to
write?
 
- Victor  www.argilent.com


__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] ending a session

2002-09-05 Thread victor

Why not unregistered the session variables first, destroy the session
second and redirect the user with a header location to a plain html page
that includes a one line JavaScript in the body tag like
onload+thiswindow cloase or something like that, and a message that
please closes this window for complete logout. That's what I do and it
works, in mozilla the script closes the window, in i.e. it asks that the
user verify if they want to close the window, if they say no, then the
user sees the message that please close this window to logout and that
would pretty much take care of everything as far as I know.

- Victor  www.argilent.com

-Original Message-
From: Raphael Hamzagic [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 05, 2002 5:32 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] ending a session

Of course Gurhan,

I have read all the php manual.
How can I send a message when the user closes the browser to destroy
the
session?

Thanks in advance

Raphael

Gurhan Ozen [EMAIL PROTECTED] wrote in message
1031261344.5091.266.camel@LOCALHOST">news:1031261344.5091.266.camel@LOCALHOST...
 You can end the session by using function session_destroy().
 See:

 http://www.php.net/manual/en/function.session-destroy.php

 For general information on how PHP handles sessions see:

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

 Hope this helps.
 Gurhan

 On Thu, 2002-09-05 at 17:17, Raphael Hamzagic wrote:
  Hi,
 
  I'm just wanna know why the session doesn't end when the user closes
the
  browser window and how can i make it.
 
  Thanks
 
  Raphael
 
 
 
  --
  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

__ 
Post your free ad now! http://personals.yahoo.ca

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




RE: [PHP] Re: ftp_put

2002-09-05 Thread victor

Ok, I'm having the same problem, see I use a form to upload but I guess
that it puts the file in temporary file, so with copy or something it
figures automatically where to take th file from how do I get the $
source and ft_put to figure out where to take this file from, or can I
get it to take it directly from the users computer through form?


- Victor  www.argilent.com

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 05, 2002 9:34 PM
To: Jason Romero
Cc: [EMAIL PROTECTED]
Subject: [PHP] Re: ftp_put

I am having problems getting the ftp_put command to upload a file to an
apache server
i get this error
Warning: error opening
C:\\WINDOWS\\Desktop\\Jason\\jjmckay\\testaudio.mp3
in /home/virtual/site31/fst/var/www/html/clientadmin/mp3upload.php on
line
32

here is the code

$dest = /var/www/html/public/$user/;
$upload = ftp_put($FTP, $dest, $source_file, FTP_BINARY);

if ($upload) echo it worked;
else echo it didnt work;


the $source_file is pulled from a form on the previous page

Need more source code to tell you exactly where, but it looks like
you're
trying to have PHP suck in the original file name rather than the
uploaded
file.

You can't do that.

If you could, PHP could be used to steal *ANY* arbitrary file off of
*ANY*
computer.  Major security problem.

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

__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] Re: How do I keep a page from caching in I.E

2002-09-04 Thread Victor V. Evtushenko

Hi,

Donpro wrote:
 Hi,
 
 Using I.E. 5.5. I can't seem to keep a page from caching.  When I click on

Have you read HOWTO: Prevent Caching in Internet Explorer?
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q234067

 the browser BACK button, I get the cached page so I have to click on Refresh
 to get the actual page content.  I've placed the following at the top of the
 HTML file but it doesn't seem to do anything. Any help would be appreciated.


Victor.


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




[PHP] emacs on win32

2002-09-04 Thread Victor

This is somewhat php related: how do you get syntax highlighting and
coloring (whatever) for php in the windows version of emacs?

- Victor  www.argilent.com


__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] continuation to the ftp story

2002-09-03 Thread Victor

The problem with my other php - well - problem was that the destination
and file variables were reversed, I think, no I changed them, but I get
this error when I try to ftp a file to a server:

Warning: ftp_put(): error opening
/home/victor/sites/kodak/user_pictures/vic

Can user permissions cause this error?

I also tried appending a '/' after the destination, but my error now
read s as:

Warning: ftp_put(): error opening
/home/victor/sites/kodak/user_pictures/vic/

It also brakes at: 

echo 'FTP upload has failed.';

so that's where the problem is, I just don't know what the problem is.

The ftp code is this:

 if someone could help it'd be nice.

# set up basic connection
$conn_id = ftp_connect($ftp_server)
   or die ('Could not establish FTP connection');

# login with username and password
$login_result = ftp_login($conn_id, $ftp_user, $ftp_pass)
   or die ('Could not login');

# check connection
if ((!$conn_id) || (!$login_result)) {
echo 'FTP connection has failed.';
exit;
}
$destination = $picture_location.$f_username.'/';
# upload the file
$upload = ftp_put($conn_id, $picture, $destination, FTP_BINARY);

# check upload status
if (!$upload) {
echo 'FTP upload has failed.';
exit;
}

# close the FTP stream
ftp_close($conn_id);

- Victor  www.argilent.com


__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] Uploading file

2002-09-03 Thread victor

?

phpinfo();

?

tell you most things about php and some things about web server and dbs

- Victor  www.argilent.com

-Original Message-
From: Clemson Chan [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, September 03, 2002 4:04 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Uploading file

Hi, I am new to this group.
I am trying to figure out how to let people to upload image files to my
website.
My ISP is using PHP 3 (I believe).
If someone can give me simple example, that will be great.
Thanks.

--Clemson

How can I tell what version of PHP is running on the system (linux)?


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

__ 
Post your free ad now! http://personals.yahoo.ca

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




RE: [PHP] ftp_put

2002-09-03 Thread victor

Well I'm having the same problem... no useful suggestions from ME yet.
:)

- Victor  www.argilent.com

-Original Message-
From: Jason Romero [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, September 03, 2002 5:13 PM
To: [EMAIL PROTECTED]
Subject: [PHP] ftp_put

I am having problems getting the ftp_put command to upload a file to an
apache server
i get this error
Warning: error opening
C:\\WINDOWS\\Desktop\\Jason\\jjmckay\\testaudio.mp3
in /home/virtual/site31/fst/var/www/html/clientadmin/mp3upload.php on
line
32

here is the code

$dest = /var/www/html/public/$user/;
$upload = ftp_put($FTP, $dest, $source_file, FTP_BINARY);

if ($upload) echo it worked;
else echo it didnt work;


the $source_file is pulled from a form on the previous page

any suggestions?

Jason Romero



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

__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] why is html code written like this? hr /

2002-09-02 Thread Victor

When I learned html it was always written like this: /hr now I see
people write it like this: hr /... why?

- Victor  www.argilent.com


__ 
Post your free ad now! http://personals.yahoo.ca

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




RE: [PHP] why is html code written like this? hr /

2002-09-02 Thread Victor

Ok, but is this kind of html compliant with old browsers like Netscape
4? Is it compliant with most new browsers?

- Victor  www.argilent.com

-Original Message-
From: Adrian Murphy [mailto:[EMAIL PROTECTED]] 
Sent: Monday, September 02, 2002 7:13 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] why is html code written like this? hr /

thats xhtml - it's xml comliant html.
tags must be closed so a tag like hr which didn't
have a closing tag is written hr / 
so,for example in php the nl2br() function now produces
br / instead of the old br
- Original Message - 
From: Victor [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 02, 2002 12:16 PM
Subject: [PHP] why is html code written like this? hr /


 When I learned html it was always written like this: /hr now I see
 people write it like this: hr /... why?
 
 - Victor  www.argilent.com
 
 
 __

 Post your free ad now! http://personals.yahoo.ca
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

__ 
Post your free ad now! http://personals.yahoo.ca

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




RE: [PHP] Re: PHP checkbox/hidden field question

2002-09-02 Thread victor

Some check box info here too:

http://www.experts-exchange.com/Web/Web_Languages/PHP/Q_20117420.html

- Victor  www.argilent.com

-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]] 
Sent: Monday, September 02, 2002 7:24 AM
To: PHP
Subject: Re: [PHP] Re: PHP checkbox/hidden field question

You are wrong, this is from HTML 4.01 specification:

value = /cdata/ cid:[EMAIL PROTECTED] [CA]
cid:[EMAIL PROTECTED]
This attribute specifies the initial value
cid:[EMAIL PROTECTED] of
the control. It is optional except when the 
type cid:[EMAIL PROTECTED] attribute has the value
radio or checkbox.

Upon submiting a form, only successfull checkboxes are submited,
so on the next page you only need this loop:

foreach($d_c_arr as $i) {
echo 'input type=hidden name=d_c_arr[] value='.
htmlspecialchars($i).'';
}

$d_c_arr contains only checked checkboxes.

Marek

Erwin wrote:

I am executing the follwoing statement as part of a while loop.
This is part of a form and I wish to pass the name and value of the
checkbox as a hidden field only is the checkbox is checked. Can you
suggest how I can accomplish this task?


tdinput type=checkbox name=d_c_arr[] value=?php echo
$db-f(order_id) ?/td



As you might know, checkboxes don't have the VALUE attribute. HTML
won't
even submit the VALUE attribute to the next page. You will only have an
array containing 0's and 1's, the results of the checkboxes. So, on the
next
page, you will have to lookup the values again.
Then print the hidden input's to the page in a for loop, while looping
trough $d_c_arr.

HTH
Erwin



  


__ 
Post your ad for free now! http://personals.yahoo.ca

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




[PHP] help, array values echoed as Array on loop!

2002-09-02 Thread Victor

I have tried both ways to loop through an array and output the data and
verify that the array is an array and I get no erros but I get this
value, which should not be so.


Here I'm checking if it's an array:

if (!is_array($ID_arr)) { # show error if no array
echo '$ID_arr is not an array.';
}

here I'm counting the keys but it only outputs as 1:

$key = count($ID_arr);
echo $key;

here are two loops that do the same thing and they both output Array:

for($i = 0; $i  count($ID_arr); $i++) {
echo $ID_arr[$i];
}

foreach($ID_arr as $ind_picture) {
echo $ind_picture;
}

Why? If it helps, in order to get the array, the values were taken from
a database and exploded from a coma delimited string.

$ID_arr[] = explode(',', $pictures); # make db data into array

This is the string:

15,16,17,18,19

I want each array element to contain 

= 15 
= 16
= 17
etc...

why does it echo as Array?

- Victor  www.argilent.com


__ 
Post your free ad now! http://personals.yahoo.ca

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




RE: [PHP] help, array values echoed as Array on loop!

2002-09-02 Thread Victor

Thank you, I figured it out 30 seconds after I posted the question, you
were right about the problem.

- Victor  www.argilent.com

-Original Message-
From: Chris Wesley [mailto:[EMAIL PROTECTED]] 
Sent: Monday, September 02, 2002 4:11 PM
To: 'PHP'
Cc: Victor
Subject: Re: [PHP] help, array values echoed as Array on loop!

On Mon, 2 Sep 2002, Victor wrote:

 $ID_arr[] = explode(',', $pictures); # make db data into array
 This is the string:
 15,16,17,18,19

 why does it echo as Array?

... because you've created an array ($ID_arr) with an array as the first
value (the result of the call to explode()).  Take the brackets off
$ID_arr, and you'll get what you want.  You don't want your array in an
array ... you just want an array.

$ID_arr = explode(',', $pictures);

If you really wanted your array in the array, then loop over $ID_arr[0].
(I doubt that's what you were going for, though.)

hth,
~Chris


__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] ftp question

2002-09-02 Thread Victor

I took the scriopt from php manual and adapted it to my needs, but I get
an error:

Warning: ftp_put(): user_pictures/vic/: No such file or directory in
/home/victor/argilent-www/sites/kodak/upload_picture.php on line 103

This is the code:

# set up basic connection
$conn_id = ftp_connect($ftp_server);

# login with username and password
$login_result = ftp_login($conn_id, $ftp_user, $ftp_pass);

# check connection
if ((!$conn_id) || (!$login_result)) {
echo 'FTP connection has failed.';
exit;
}
$destination = $picture_location.'/'.$f_username.'/';
# upload the file
$upload = ftp_put($conn_id, $destination, $picture, FTP_BINARY);

# check upload status
if (!$upload) {
echo 'FTP upload has failed.';
}

# close the FTP stream
ftp_close($conn_id);

I added the destination variable so that I can easily edit the
destination if I sweitch servers, I'm guessing the error occurs because
php doesn't know where to take the file from?! I'm guessing here, but it
would be nice if someone tough me a bit more about ftp with php.

user_pictures/vic is the directory the $picture has to go in, but I
dunno why it doesn't work.

- Victor  www.argilent.com


__ 
Post your free ad now! http://personals.yahoo.ca

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




RE: [PHP] Re: ftp question

2002-09-02 Thread victor

Actually, that is the correct path. Which is why I don't understand why
it's not working. And as a user I'm using myself... waitaminute, the
folders are created by the user www, and I argilent may not have write
permission, maybe that's why it's not working. I should try with a
folder I create as me to see if I can write to it.

- Victor  www.argilent.com

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Monday, September 02, 2002 9:46 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: ftp question

Hi,

Your script upload the file to
/home/victor/argilent-www/sites/kodak/user_pictures/vic/
are you sure that is the correct path name? If its not, just put the
entier
name and not only a part of it.

--
Merci de nous avoir choisi. - Thanks you for your choice.
Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
[EMAIL PROTECTED]
www.GroupAKT.com - Hébergement Group.
www.WorldAKT.com - Hébergement de sites Internet
Victor [EMAIL PROTECTED] a écrit dans le message de news:
01c252ea$36e90160$[EMAIL PROTECTED]
 I took the scriopt from php manual and adapted it to my needs, but I
get
 an error:

 Warning: ftp_put(): user_pictures/vic/: No such file or directory in
 /home/victor/argilent-www/sites/kodak/upload_picture.php on line 103

 This is the code:

 # set up basic connection
 $conn_id = ftp_connect($ftp_server);

 # login with username and password
 $login_result = ftp_login($conn_id, $ftp_user, $ftp_pass);

 # check connection
 if ((!$conn_id) || (!$login_result)) {
 echo 'FTP connection has failed.';
 exit;
 }
 $destination = $picture_location.'/'.$f_username.'/';
 # upload the file
 $upload = ftp_put($conn_id, $destination, $picture, FTP_BINARY);

 # check upload status
 if (!$upload) {
 echo 'FTP upload has failed.';
 }

 # close the FTP stream
 ftp_close($conn_id);

 I added the destination variable so that I can easily edit the
 destination if I sweitch servers, I'm guessing the error occurs
because
 php doesn't know where to take the file from?! I'm guessing here, but
it
 would be nice if someone tough me a bit more about ftp with php.

 user_pictures/vic is the directory the $picture has to go in, but I
 dunno why it doesn't work.

 - Victor  www.argilent.com


 __
 Post your free ad now! http://personals.yahoo.ca



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

__
Post your free ad now! http://personals.yahoo.ca

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




RE: [PHP] calling sql results inoto variables

2002-08-31 Thread victor

The silly me, I had an exit; inside the for loop and I was wondering why
id only looped once, somebody slap me!

- Victor  www.argilent.com

-Original Message-
From: Victor [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, August 31, 2002 7:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP] calling sql results inoto variables

I'm trying to go about doing this:

While there is data in an array, get and echo individual pieces from
this array and execute a mysql query that gets the other info in the
table where arraypiece. Stop when all arraypice have been echoed.

The array gets its values from and checkbox form. I got that part: 

input type=checkbox name=check[] value='.$ID.'

So I count the number of times there is something in $check, which I
think is done like so:

for($i = 0; $i  sizeof($check); $i++) {
echo $i;
}

that should give me the number of checboxes clicked. (it does, I
verified)

so, now I say:

for($i = 0; $i  sizeof($check); $i++) {
# echo $i;
echo 'p';
$data = $check[$i]; 
echo $data;

which brings me to getting the rest of the data from the tables (the
array I was talking about holds the ID) (aka the key) but I still need
to put the key in the door.

Ok, so no I would need to loop a mysql query for as long as there is
data in the array, - since I only have one key for each row.

Let me try to write it:

for($i = 0; $i  sizeof($check); $i++) {
# echo $i;
echo 'p';
$data = $check[$i]; 
#echo $data;
mysql_query(SELECT * FROM table WHERE ID = '$data');
$db_ID = $row[ID];
$db_picture_name = $row[picture_name];
echo $db_ID;
echo $db_picture_name;
}

Now, this should do the trick, let's test it ... testing ... 

Nope, mysql can't execute that query...
Hmmm...


I get this

could not execute queryYou have an error in your SQL syntax near 'table
WHERE ID = '1'' at line 1

no shit! I actually don't have a table called table!

Fixed that, testing 

could not execute queryNo Database Selected

ok, let's do that. (I've been up all nigh what do you want!)

ok, now what?!

I get NOTHING! NOTHING! WHHHT!

I tried hardcoding the $ID, nothing, so that must be ok, as we have
proved earlier,

By this time I ended up with this code:

for($i = 0; $i  sizeof($check); $i++) {
# echo $i;
echo 'p';
$data = $check[$i]; 
#echo $data;
mysql_query(SELECT * FROM kodak_user_pictures WHERE ID = '1')
or die ('could not execute query '.mysql_error());
$db_ID = $row[ID];
$db_picture_name = $row[picture_name];
echo $db_ID;
echo $db_picture_name;
}

of course it gives me nothing! 

What the hell is $row?

Ok, let's fix that.

for($i = 0; $i  sizeof($check); $i++) {
# echo $i;
echo 'p';
$data = $check[$i]; 
#echo $data;
$db_data = mysql_query(SELECT * FROM kodak_user_pictures WHERE ID =
'1');
$row = mysql_fetch_array(db_data);
$db_ID = $row[ID];
$db_picture_name = $row[picture_name];
echo $db_ID;
echo $db_picture_name;
}

now I get this... I'm also getting tired...

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result resource

STUPID $ SIGN! (look near db_data, nope, the second one!)

Ok, let's test ... 

Ok, good, let's switch the hardcoded 1 from the query back to the
$data...
 Testing ...

Ok, now it only gets one...

Let's try a for each

for($i = 0; $i  sizeof($check); $i++) {
# echo $i;
echo 'p';
$data = $check[$i]; 
#echo $data;
foreach ($data as $check[$i]) {
$db_data = mysql_query(SELECT * FROM kodak_user_pictures WHERE ID =
'$data');
$row = mysql_fetch_array($db_data);
$db_ID = $row[ID];
$db_picture_name = $row[picture_name];
echo $db_ID;
echo $db_picture_name;
}
}

Warning: Invalid argument supplied for foreach()

Ok... 

Not better, but let's see...

Ok, now I ende up with this code:

for($i = 0; $i  sizeof($check); $i++) {
# echo $i;
echo 'p';
$data = $check[$i];
$db_data = (SELECT * FROM mytable WHERE ID = '$check[$i]');
$row = mysql_query($db_data);
# $row = mysql_fetch_array($db_data);
$db_ID = $row[ID];
$db_picture_name = $row[picture_name];
echo $db_ID;
echo $db_picture_name;
#echo $data;
}

I don';t know what to do, I get nothing, I think the error is that I do
not know how to call the mysql query results into the variables fro
echoing, please I beg you someone tell me.


- Victor  www.argilent.com




__ 
Post your free ad now! http://personals.yahoo.ca

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

__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] newest entry in db

2002-08-31 Thread Victor

How can I use php to get the newest entry from  mysql database? Ie, if I
make a timestamp and then I want to retrieve the last timestamp I made
how do I go about doing it? Any php or mysql documentation?

- Victor  www.argilent.com


__ 
Post your ad for free now! http://personals.yahoo.ca

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




[PHP] why do i get this error please tell me?

2002-08-31 Thread Victor

for($i = 0; $i  sizeof($check); $i++) { # start repating query
# turn pictures in order delete capability off
mysql_query(UPDATE kodak_user_pictures 
SET order=1 
WHERE ID='$check[$i]') # turn off pictures
or die ('Unable to turn bit off '.mysql_error());
} # end repeat

You have an error in your SQL syntax near 'order=1 WHERE ID='2'' at line
2

- Victor  www.argilent.com


__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] why do i get this error please tell me?

2002-08-31 Thread victor

Yep, figured it just now, thanks anyway, ahhh.. You'd thing they put
reserved names right besides the damn mysql command in the manual. Alas
it shall not be so.

- Victor  www.argilent.com

-Original Message-
From: Chris Knipe [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, August 31, 2002 1:30 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] why do i get this error please tell me?

 
 You have an error in your SQL syntax near 'order=1 WHERE ID='2'' at
line
 2

ORDER is a reserved word in MySQL.

Change the query and escape order aswell

'order'='1' WHERE ID='2'

Or, rename the order column to something else.



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

__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] RE: [PHP-DB] RE: [PHP] why do i get this error please tell me?

2002-08-31 Thread victor

I meant besides the UPDATE or SELECT or any filed that those words might
interfere with...

- Victor  www.argilent.com

-Original Message-
From: Mark Charette [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, August 31, 2002 2:18 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] RE: [PHP] why do i get this error please tell me?

Ahem. Why not check out the MySQL docs for reserved words (they _are_
right
there ...):

http://www.mysql.com/doc/en/Reserved_words.html

PHP Docs are for PHP. MySQL Docs are for MySQL. PHP != MySQL.

-Original Message-
From: victor [mailto:[EMAIL PROTECTED]]
Sent: Saturday, August 31, 2002 1:35 PM
To: 'Chris Knipe'; [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: [PHP] why do i get this error please tell me?


Yep, figured it just now, thanks anyway, ahhh.. You'd thing they put
reserved names right besides the damn mysql command in the manual. Alas
it shall not be so.


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

__ 
Post your ad for free now! http://personals.yahoo.ca

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




[PHP] Reg exp help

2002-08-30 Thread Victor Spång Arthursson

Hi!

I need some help with a reg exp… I'm building a little viewer for my  
http access logs, and what i'ld like to do is to clean it from alla  
hits from my own ip…

Take for example:

194.236.30.24 - - [30/Aug/2002:11:46:29 +0200] GET  
/bildgalleri/createjpg.php?url=/v044file=v044_27.jpg HTTP/1.1 200 8874
217.215.84.222 - - [30/Aug/2002:11:46:39 +0200] POST /weblogg.php  
HTTP/1.1 200 3149488
194.236.30.24 - - [30/Aug/2002:11:46:43 +0200] GET  
/bildgalleri/showpicture.php?url=%2Fv044file=v044_21.jpg HTTP/1.1 200  
450
217.215.84.222 - - [30/Aug/2002:11:46:47 +0200] POST /weblogg.php  
HTTP/1.1 200 3149705
194.236.30.24 - - [30/Aug/2002:11:46:49 +0200] GET  
/bildgalleri/createjpg.php?url=/ 
v044file=v044_21.jpgquality=bettermax_side=big HTTP/1.1 200 69110
217.215.84.222 - - [30/Aug/2002:11:47:48 +0200] POST /weblogg.php  
HTTP/1.1 200 3149813
217.215.84.222 - - [30/Aug/2002:11:48:09 +0200] POST /weblogg.php  
HTTP/1.1 200 3149902

Here I'ld like to remove all lines that looks like 217.215.84.222 some  
text ending with line break…

How should the reg exp look?

Many thanks,

Victor


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




[PHP] session encode and session decode question

2002-08-30 Thread Victor

I'm trying to get the one variable I stored insite a session, the
variable's name is $username I am trying to do it like this, but I think
it's wrong:

$PHPSESSID = session_encode();
$username = session_decode();

It tells me I have wrong parameters for session decode.

What am I supposed to encode to get the variable from the session?

- Victor  www.argilent.com


__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] Re: session_unregister - but w00t about the back button?

2002-08-30 Thread victor

K, thanks, i will sort of realized this, but I was wondering if the user
is silly enough to leave the browser window open then someone can press
the back button and go back, I will probably write a message somewhere
to tell the user to close the browser window.

To the one who asked about the session_destroy thingie, I did that and I
did session_unregiste(blah) but does the order of these two count?

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]] 
Sent: Friday, August 30, 2002 9:27 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [PHP] Re: session_unregister - but w00t about the back button?

I can logout with session_unregister - but w00t about the back button?

This is probably so trivial that it has been discussed before, if
anyone
has some knowledge or link at hand mind passing it on? Thanks.

If you are using Cookies, then everything is fine.  Their cookies will
be
gone, and the back button will not alter that.

If you pass the SID through the URL, and do session_unregister, again,
they'll see the old data maybe, but as soon as they move forward, the
new data will be in force.

If you're worried about the back button and Security, you can try some
headers() to convince the browsers not to cache (search archives for
no-cache) but the bottom line is going to be User Education  They
either
*quit* the browser, or risk that it's a stupid broken browser that
ignored
your request not to cache the data.

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

__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] Re: session_unregister - but w00t about the back button?

2002-08-30 Thread victor

I did a :

session_unregister('xxx');
session_destroy();
header(Location: http://www.xxx.com/xxx;);

and mozilla is the only browser out of ie6 netscape 4.7 and mozilla to
respect the logout and not repost the data on reload or back request.
Go mozilla. I guess the big boys somewhere are taking a nap.



-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]] 
Sent: Friday, August 30, 2002 10:32 PM
To: victor; 'Richard Lynch'; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: session_unregister - but w00t about the back
button?

If you were REALLY concerned, you could use JavaScript (JavasCrap) to
open a
new window and close the parent... this way there would be no such thing
as
a back button... it'd be disabled.

I think later version of JS can empty the history too (unsure though).

It's not going to be fool proof for those w/o JS, but it would be an
added
level of security...


Justin


on 31/08/02 12:12 PM, victor ([EMAIL PROTECTED]) wrote:

 K, thanks, i will sort of realized this, but I was wondering if the
user
 is silly enough to leave the browser window open then someone can
press
 the back button and go back, I will probably write a message somewhere
 to tell the user to close the browser window.
 
 To the one who asked about the session_destroy thingie, I did that and
I
 did session_unregiste(blah) but does the order of these two count?
 
 -Original Message-
 From: Richard Lynch [mailto:[EMAIL PROTECTED]]
 Sent: Friday, August 30, 2002 9:27 PM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: [PHP] Re: session_unregister - but w00t about the back
button?
 
 I can logout with session_unregister - but w00t about the back
button?
 
 This is probably so trivial that it has been discussed before, if
 anyone
 has some knowledge or link at hand mind passing it on? Thanks.
 
 If you are using Cookies, then everything is fine.  Their cookies will
 be
 gone, and the back button will not alter that.
 
 If you pass the SID through the URL, and do session_unregister, again,
 they'll see the old data maybe, but as soon as they move forward,
the
 new data will be in force.
 
 If you're worried about the back button and Security, you can try some
 headers() to convince the browsers not to cache (search archives for
 no-cache) but the bottom line is going to be User Education  They
 either
 *quit* the browser, or risk that it's a stupid broken browser that
 ignored
 your request not to cache the data.


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

__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] PASSWORD()

2002-08-29 Thread Victor

Is PASSWORD() still usable? I used it in my scripts a while ago to
encrypt and decript password strings that I stored into databases, but
from some time all my scripts don't work (the login part) because I
cannot do a mysql query like so: 

$sql = SELECT * FROM users WHERE username = '$PHP_AUTH_USER' AND
password = PASSWORD('$PHP_AUTH_PW');

or:

$sql = SELECT * FROM users WHERE username = '$username AND password =
PASSWORD('$password');

is this wrong?

Or am I just hallucinating? 

- vic

__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] session_unregister - but w00t about the back button?

2002-08-29 Thread Victor

I can logout with session_unregister - but w00t about the back button?

This is probably so trivial that it has been discussed before, if anyone
has some knowledge or link at hand mind passing it on? Thanks.

- Victor  www.argilent.com


__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] and or statement

2002-08-28 Thread Victor

What is the and or statement in php?

I need this to see if the first statement is whatever, and or the second
statement is whatever...

if (!isset($PHP_AUTH_USER) and or blah($blah)) {}

Thank you

- vic

__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] so nobody knows how do get rid of everything outside or certain tags?

2002-08-15 Thread victor

I asked this question a while ago, and I am still seeking clarification,
I fooled with ereg_replace and they only do a piece of what I want, I
would like to know how to keep only a chunk of text defined between 2
tags let's say, div and /div and ignore everything else, I also have
to search and replace certain tags between, but I know how to do that
with ereg_replace. So can anyone help me echo only what is between the
div tags? Please? 

- Vic



__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] so nobody knows how do get rid of everything outside or certain tags?

2002-08-15 Thread victor

Thanks, I tried this code first, and I wrote my script like this:

?php 

$file_name = $page_name.$ext
or die ('Error 2');

$file = file($path.$file_name)
or die ('Error 3');

$str = implode(' ', $file)
or die ('Error 4');

// Original first tag
//div class=Section1
// Original last tag
///div

preg_match('!div class=Section1[^]+(.*)/div!Uis',$str,$regs);
$everything_between_divs=$regs[1];

$good = implode(' ', $everything_between_divs)
or die ('Error 5');

$clean = ereg_replace(o:p/o:p,   , $regs[1]);

echo $clean;

?

- Vic


-Original Message-
From: Joseph W. Goff [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 15, 2002 12:54 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] so nobody knows how do get rid of everything outside
or certain tags?

preg_match('!div[^]+(.*)/div!Uis',$info,$regs);
$everything_between_divs=$regs[1];

- Original Message -
From: Jay Blanchard [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, August 15, 2002 11:44 AM
Subject: RE: [PHP] so nobody knows how do get rid of everything outside
or
certain tags?


 [snip]
 I asked this question a while ago, and I am still seeking
clarification,
 I fooled with ereg_replace and they only do a piece of what I want, I
 would like to know how to keep only a chunk of text defined between 2
 tags let's say, div and /div and ignore everything else, I also
have
 to search and replace certain tags between, but I know how to do that
 with ereg_replace. So can anyone help me echo only what is between the
 div tags? Please?
 [/snip]

 Why not take the the beginning div, everything in the middle, and
the
end
 /div tag and explode() them into an array and then get what you want
and
 write it out? I didn't see your originl post and don't know if there
was
 more detail available, but I hope this helps.

 Jay

 I'm not tense.just terribly, terribly alert

 ***
 * Texas PHP Developers Conf  Spring 2003  *
 * T Bar M Resort  Conference Center  *
 * New Braunfels, Texas*
 * San Antonio Area PHP Developers Group   *
 * Interested? Contact [EMAIL PROTECTED] *
 ***



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


__ 
Post your ad for free now! http://personals.yahoo.ca

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




[PHP] undefined offset bad argument

2002-08-15 Thread victor

I get this error:

Notice: Undefined offset: 1 in
/home/victor/argilent-www/sites/malibu_place_2/index.php on line 104

Warning: Bad arguments to implode() in
/home/victor/argilent-www/sites/malibu_place_2/index.php on line 106
Error 5

For this code:

?php 

$file_name = $page_name.$ext
or die ('Error 2');

$file = file($path.$file_name)
or die ('Error 3');

$str = implode(' ', $file)
or die ('Error 4');

// Original first tag
//div class=Section1
// Original last tag
///div

preg_match('!div class=Section1[^]+(.*)/div!Uis',$str,$regs);
$everything_between_divs=$regs[1];

$good = implode(' ', $everything_between_divs)
or die ('Error 5');

$clean = ereg_replace(o:p/o:p,   , $regs[1]);

echo $clean;

?

there might be something wrong with the reg exptession. Or the
variables?

Please help, thanks

- Vic



__ 
Post your ad for free now! http://personals.yahoo.ca

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




[PHP] good read on regular expressions

2002-08-15 Thread victor

What is a good read on general expressions that a php programmer should
check out?

I am trying to familiarize myself with them so that I can pars the silly
ms word html pages.

- Vic



__ 
Post your ad for free now! http://personals.yahoo.ca

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




[PHP] i some more help on the whole ereg thingy please

2002-08-15 Thread victor

Hi, I hope you can help me a bit more, this is is my current script:
(look after for more messages)

?php 
$file_name = $page_name.$ext
or die ('Error 2');

$file = file($path.$file_name)
or die ('Error 3');

$str = implode(' ', $file)
or die ('Error 4');

// This is to check if the above code works
// echo $str;
// End check

// Original first tag from the document I need to parse
// div class=Section1
// Original last tag
// /div

preg_match('!div class=Section1[^]+(.*)/div!Uis',$str,$regs[1]);
$everything_between_divs = $regs[1];

//echo $everything_between_divs;

$good = implode(' ', $regs)
or die ('Error 5');

// This is for later use to edit the contents of stuff between 
// the div tags - if I get the div tags to ever work
$clean = ereg_replace(o:p/o:p,   , $good);
echo $clean;
?

it doesn't work, what do you think I'm doing wrong?

I get this error:

Notice: Undefined offset: 1 in
/home/victor/argilent-www/sites/malibu_place_2/index.php on line 104

Warning: Bad arguments to implode() in
/home/victor/argilent-www/sites/malibu_place_2/index.php on line 106
Error 5

Thanks,

- Vic



__ 
Post your ad for free now! http://personals.yahoo.ca

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




[PHP] html parsing from html file through php

2002-08-14 Thread victor

Hello, I am making an app that read from an html file outputted by MS
word (ya its for those people that need to make webpages but don't know
how o write html) anyway, using MS word is a requirement; After the user
saves their .doc file as a web page (now and htm file) the php will take
that html file from a dir on the server, open it, read it, and ignore
anything that is from the beginning of the file up to and right after
the body tag ends, then it must ignore anything at the end of the page
up and including the body tags and the closing html tag. So basically
after its done doing its thing I would have all the content of the page
ready to be echoed inside another page that would be a sort of shell or
template.

I am loocking right now at regular expressions and file_open etc, but
just to give you an idea and to see if anybody has any helpful pointers,
this (yes, can u believe it?) is the beginning of the word2html
translation that MS word does: (BAH!) (i have to get rid of this
remember?)

--

html xmlns:o=urn:schemas-microsoft-com:office:office
xmlns:w=urn:schemas-microsoft-com:office:word
xmlns:st1=urn:schemas-microsoft-com:office:smarttags
xmlns=http://www.w3.org/TR/REC-html40;

head
meta http-equiv=Content-Type content=text/html; charset=windows-1252
meta name=ProgId content=Word.Document
meta name=Generator content=Microsoft Word 10
meta name=Originator content=Microsoft Word 10
link rel=File-List href=community_files/filelist.xml
titleCommunity/title
o:SmartTagType
namespaceuri=urn:schemas-microsoft-com:office:smarttags
 name=City/
o:SmartTagType
namespaceuri=urn:schemas-microsoft-com:office:smarttags
 name=place/
!--[if gte mso 9]xml
 o:DocumentProperties
  o:AuthorJim Weathers/o:Author
  o:LastAuthorvic/o:LastAuthor
  o:Revision2/o:Revision
  o:TotalTime1/o:TotalTime
  o:Created2002-08-14T19:54:00Z/o:Created
  o:LastSaved2002-08-14T19:54:00Z/o:LastSaved
  o:Pages1/o:Pages
  o:Words79/o:Words
  o:Characters451/o:Characters
  o:Companyx-core/o:Company
  o:Lines3/o:Lines
  o:Paragraphs1/o:Paragraphs
  o:CharactersWithSpaces529/o:CharactersWithSpaces
  o:Version10.2625/o:Version
 /o:DocumentProperties
/xml![endif]--!--[if gte mso 9]xml
 w:WordDocument
  w:SpellingStateClean/w:SpellingState
  w:GrammarStateClean/w:GrammarState
 
w:DisplayHorizontalDrawingGridEvery0/w:DisplayHorizontalDrawingGridEv
ery
 
w:DisplayVerticalDrawingGridEvery0/w:DisplayVerticalDrawingGridEvery
  w:UseMarginsForDrawingGridOrigin/
  w:Compatibility
   w:FootnoteLayoutLikeWW8/
   w:ShapeLayoutLikeWW8/
   w:AlignTablesRowByRow/
   w:ForgetLastTabAlignment/
   w:LayoutRawTableWidth/
   w:LayoutTableRowsApart/
   w:UseWord97LineBreakingRules/
  /w:Compatibility
  w:BrowserLevelMicrosoftInternetExplorer4/w:BrowserLevel
 /w:WordDocument
/xml![endif]--!--[if !mso]object
 classid=clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D
id=ieooui/object
style
st1\:*{behavior:url(#ieooui) }
/style
![endif]--
style
!--
 /* Font Definitions */
 font-face
{font-family:Times;
panose-1:2 2 6 3 5 4 5 2 3 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:536902279 -2147483648 8 0 511 0;}
font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:536871559 0 0 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:;
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
mso-bidi-font-size:10.0pt;
font-family:Times;
mso-fareast-font-family:Times;
mso-bidi-font-family:Times New Roman;}
p.MsoBodyTextIndent, li.MsoBodyTextIndent, div.MsoBodyTextIndent
{margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
mso-bidi-font-size:10.0pt;
font-family:Verdana;
mso-fareast-font-family:Times New Roman;
mso-bidi-font-family:Times New Roman;
mso-ansi-language:EN-AU;
mso-fareast-language:EN-US;}
span.SpellE
{mso-style-name:;
mso-spl-e:yes;}
page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
--
/style
!--[if gte mso 10]
style
 /* Style Definitions */
 table.MsoNormalTable
{mso-style-name:Table Normal;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:;
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:Times;

[PHP] P.S. html parsing from html file through php

2002-08-14 Thread victor

Actually I think there is even less work to be done, the paragraph
spacing problem I talked about earlier can be avoided if I leave all
that foobar tags and erase only:

html xmlns:o=urn:schemas-microsoft-com:office:office
xmlns:w=urn:schemas-microsoft-com:office:word
xmlns:st1=urn:schemas-microsoft-com:office:smarttags
xmlns=http://www.w3.org/TR/REC-html40;

head
meta http-equiv=Content-Type content=text/html; charset=windows-1252
meta name=ProgId content=Word.Document
meta name=Generator content=Microsoft Word 10
meta name=Originator content=Microsoft Word 10
link rel=File-List href=community_files/filelist.xml
titleCommunity/title
o:SmartTagType
namespaceuri=urn:schemas-microsoft-com:office:smarttags
 name=City/
o:SmartTagType
namespaceuri=urn:schemas-microsoft-com:office:smarttags
 name=place/

--[Need everything here]- - in there, not the
following tags ;)

/head

body lang=EN-US style='tab-interval:.5in'

---[Need everything in here]-- - in there,
not the following tags ;)

/body

/html

Thanks, maybe if someone can tell me how to learn to work with some
search and replace function that would be neat0

- Vic


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 14, 2002 5:10 PM
To: '[EMAIL PROTECTED]'
Subject: html parsing from html file through php

Hello, I am making an app that read from an html file outputted by MS
word (ya its for those people that need to make webpages but don't know
how o write html) anyway, using MS word is a requirement; After the user
saves their .doc file as a web page (now and htm file) the php will take
that html file from a dir on the server, open it, read it, and ignore
anything that is from the beginning of the file up to and right after
the body tag ends, then it must ignore anything at the end of the page
up and including the body tags and the closing html tag. So basically
after its done doing its thing I would have all the content of the page
ready to be echoed inside another page that would be a sort of shell or
template.

I am loocking right now at regular expressions and file_open etc, but
just to give you an idea and to see if anybody has any helpful pointers,
this (yes, can u believe it?) is the beginning of the word2html
translation that MS word does: (BAH!) (i have to get rid of this
remember?)

--

html xmlns:o=urn:schemas-microsoft-com:office:office
xmlns:w=urn:schemas-microsoft-com:office:word
xmlns:st1=urn:schemas-microsoft-com:office:smarttags
xmlns=http://www.w3.org/TR/REC-html40;

head
meta http-equiv=Content-Type content=text/html; charset=windows-1252
meta name=ProgId content=Word.Document
meta name=Generator content=Microsoft Word 10
meta name=Originator content=Microsoft Word 10
link rel=File-List href=community_files/filelist.xml
titleCommunity/title
o:SmartTagType
namespaceuri=urn:schemas-microsoft-com:office:smarttags
 name=City/
o:SmartTagType
namespaceuri=urn:schemas-microsoft-com:office:smarttags
 name=place/
!--[if gte mso 9]xml
 o:DocumentProperties
  o:AuthorJim Weathers/o:Author
  o:LastAuthorvic/o:LastAuthor
  o:Revision2/o:Revision
  o:TotalTime1/o:TotalTime
  o:Created2002-08-14T19:54:00Z/o:Created
  o:LastSaved2002-08-14T19:54:00Z/o:LastSaved
  o:Pages1/o:Pages
  o:Words79/o:Words
  o:Characters451/o:Characters
  o:Companyx-core/o:Company
  o:Lines3/o:Lines
  o:Paragraphs1/o:Paragraphs
  o:CharactersWithSpaces529/o:CharactersWithSpaces
  o:Version10.2625/o:Version
 /o:DocumentProperties
/xml![endif]--!--[if gte mso 9]xml
 w:WordDocument
  w:SpellingStateClean/w:SpellingState
  w:GrammarStateClean/w:GrammarState
 
w:DisplayHorizontalDrawingGridEvery0/w:DisplayHorizontalDrawingGridEv
ery
 
w:DisplayVerticalDrawingGridEvery0/w:DisplayVerticalDrawingGridEvery
  w:UseMarginsForDrawingGridOrigin/
  w:Compatibility
   w:FootnoteLayoutLikeWW8/
   w:ShapeLayoutLikeWW8/
   w:AlignTablesRowByRow/
   w:ForgetLastTabAlignment/
   w:LayoutRawTableWidth/
   w:LayoutTableRowsApart/
   w:UseWord97LineBreakingRules/
  /w:Compatibility
  w:BrowserLevelMicrosoftInternetExplorer4/w:BrowserLevel
 /w:WordDocument
/xml![endif]--!--[if !mso]object
 classid=clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D
id=ieooui/object
style
st1\:*{behavior:url(#ieooui) }
/style
![endif]--
style
!--
 /* Font Definitions */
 @font-face
{font-family:Times;
panose-1:2 2 6 3 5 4 5 2 3 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:536902279 -2147483648 8 0 511 0;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:536871559 0 0 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:;
margin:0in;

[PHP] file_get_contents ( string filename [, int use_include_path])

2002-08-14 Thread victor

Can someone explain me more abou the usage of this code:

file_get_contents ( string filename [, int use_include_path])

I just got it from the annual, and I still don't get what they mean by 

string filename

and

int use_include_path

Thanks,

This has to do with the other question I posted earlier, yes

- Vic



__ 
Post your ad for free now! http://personals.yahoo.ca

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




[PHP] how do i continue with ereg replace?

2002-08-14 Thread victor

I want to have the ereg_replace action happen many times before the
result is echoed, how do I do this? The following is the code that I
have that obviously is flawed because the later variable as afar as ai
know cancels out the first one...

$good = ereg_replace(o:p/o:p,   , $str);
$good = ereg_replace(/head,   , $str);

//echo ereg_replace(/o:p,   , $str);
echo $good;

help appreciated.

- Vic



__ 
Post your ad for free now! http://personals.yahoo.ca

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




[PHP] frames and variables

2002-08-14 Thread victor

Has anyone here designed php sites that use a combination of php pages
and html pages? 

What I want to know is how to pass a variable from nav_frame.php (at the
top) to itself, AND to the data.php frame (lower frame, main body)

I can pass variables to itself, (with the ?page_name=content.htm
thingie attached to links, but I don't know how to make this accessible
to both frames at the same time.
Help appreciated, yes, I'm asking a lot of questions since this is a
project for college and my due data is in 2 ... ooops 1 DAY! WhooHOO!

- Vic



__ 
Post your ad for free now! http://personals.yahoo.ca

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




[PHP] count link clicks

2002-08-13 Thread victor

How do I count how many times a user clicks on a certain link? (and put
it into and array or variable I guess).

I want to be able to repeat a certain action on the same page as many
times as the user clicks on the link($PHP_SELF).

Thanks,

- Vic



__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] count link clicks

2002-08-13 Thread victor

I think I'm on the right track with:

?php

$i = $value++;

// Show first link
echo 'a href='.$PHP_SELF.'?add_form='.$value.'
New paragraph
/a
/font';

// Isert form html into $data_fields variable
$data_fields = 'html html blah blah
a href='.$PHP_SELF.'?add_form='.$value.'
New paragraph
/a';

while ($i = $value) {
echo $data_fields;
}

?

The only problem is that it runs for an infinite number of times, I want
it to run for as many times as the http://domain.com?add_form=1 (IE: 1
in this case) defines.

- Vic

__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] count link clicks

2002-08-13 Thread victor

THANK YOU! THANK YOU! This does exactly what I need it to! I wish they
thought me how to count at PHP kindergarten.


- Vic


-Original Message-
From: Dave at Sinewaves.net [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, August 13, 2002 3:20 PM
To: [EMAIL PROTECTED]; 'Rasmus Lerdorf'; 'vic'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] count link clicks



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 13, 2002 12:23 PM
To: 'Rasmus Lerdorf'; 'vic'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] count link clicks


I think I'm on the right track with:

?php
//
// CHANGE THIS:
//
// $i = $value++;
//
///
// TO THIS:
$value = $add_form + 1;


// Show first link
echo 'a href='.$PHP_SELF.'?add_form='.$value.'
New paragraph
/a
/font';

// Isert form html into $data_fields variable
$data_fields = 'html html blah blah
a href='.$PHP_SELF.'?add_form='.$value.'
New paragraph
/a';


// CHANGE THIS:
//
// while ($i = $value) {
// echo $data_fields;
// }
//

// TO THIS:
for($i=0; $i$add_form; $i++)
{
echo $data_fields;
}

?

The only problem is that it runs for an infinite number of times, I want
it to run for as many times as the http://domain.com?add_form=1 (IE: 1
in this case) defines.

- Vic

__ 
Post your ad for free now! http://personals.yahoo.ca

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

__ 
Post your ad for free now! http://personals.yahoo.ca

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




[PHP] mysql error

2002-08-13 Thread victor

I get this error:

Error submiting paragraph.You have an error in your SQL syntax near
'WHERE page_name='features' AND par_id='13' ' at line 1


But my code, I think is fine:

// Insert the form information into the database
mysql_query(INSERT INTO malibu_data SET heading='$heading',
paragraph='$paragraph' 
WHERE page_name='$page_name' AND par_id='$par_id' )
or die ('Error submiting paragraph.'. mysql_error());


- Vic



__ 
Post your ad for free now! http://personals.yahoo.ca

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




RE: [PHP] mysql error

2002-08-13 Thread victor
Yes, thank you very much, I shouldn$B!G(Bt code late at night without any
caffeine in me.

- Vic


-Original Message-
From: @ Edwin [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 14, 2002 12:29 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] mysql error

Looks like you're updating your table so instead of "INSERT INTO...",
try: 
"UPDATE malibu_data SET ..."

HTH,

- E



I get this error:

Error submiting paragraph.You have an error in your SQL syntax near
'WHERE page_name='features' AND par_id='13' ' at line 1


But my code, I think is fine:

// Insert the form information into the database
   mysql_query("INSERT INTO malibu_data SET heading='$heading',
paragraph='$paragraph'
WHERE page_name='$page_name' AND par_id='$par_id' ")
   or die ('Error submiting paragraph.'. mysql_error());


- Vic



__
Post your ad for free now! http://personals.yahoo.ca

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




_
$B%O%$%;%s%9$J>$r5$7Z$K9XF~(B MSN $B%7%g%C%T%s%0(B http://shopping.msn.co.jp/

__
Post your ad for free now! http://personals.yahoo.ca

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


[PHP] trim away x 1 number of spaces from a strin

2002-07-24 Thread Victor Spång Arthursson

Hi!

Could someone help me with a replace that takes all occurances of  , 
that is space more than one, and replaces them with …?

Sincerely

Victor


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




[PHP] Write EXIF - is it possible?

2002-07-12 Thread Victor Spång Arthursson

Is it possible to write to exif-headers in pictures?

Wonders:

Victor


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




[PHP] EXIF and thumbnails

2002-07-09 Thread Victor Spång Arthursson

Hello!

I know it's possible to read thumbnails from the EXIF-headers in for 
example jpeg-images.

But is it also possible to _write_ EXIF-data, that is, if I want to 
create a thumbnail where there is none?

Sincerely

Victor


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




[PHP] How to copy a transparent png over an existing image using GD?

2002-07-06 Thread Victor Spång Arthursson

Hi!

I'm trying to copy a transparent (copyright) image over an existing 
using GD, but can't get it to work…

The copyright image is a png, and can be found here: 
http://adversus.no-ip.com/copyright.png.

Does anyone either know how to perform this, or knows a link to some 
tutorial who explains this step by step…?

My problem is that the transparent image loses its transparens when I do 
the copyimageresized…

Thankful for any help,

sincerely

Victor


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




[PHP] Nothing will execute after calling imagejpeg.

2002-07-04 Thread Victor Spång Arthursson

This thread has been up before, but there was never sent a reply to it, 
and I'm having the same problem…

Anyone who knows what to do?

Sincerely

Victor

 -Original Message-
 From: Kris Johnson [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, June 01, 2002 11:11 PM
 To: Leotta, Natalie (NCI/IMS)
 Subject: Nothing will execute after calling imagejpeg.


 Hello, My name is Kris Johnson. I 'm hoping you can give me some 
 direction
 on a problem I am having.

 After calling imagejpeg nothing else will work. I have tried echoing 
 html,
 echoing just a word in quotes, as well as a using a location header. I 
 do
 not get any errors or warnings, but whatever command I use simply 
 doesn't
 work. As a test I remarked imagejpeg out of the code and as soon as I 
 did
 this the commands after worked fine. I tried changing the filetype to 
 png
 but still get the same problem.

 Have a nice day
 Kris


 --
 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] Why can't I get imagepstext to work?

2002-07-03 Thread Victor Spång Arthursson

No matter what I try, it doesn't work…

I have GD installed and my phpinfo is on this link: adversus.no-
ip.com/test/phpinfo.php

Please, someone, help…

Sincerely

Victor


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




[PHP] PHP-mysql: affected rows

2002-05-31 Thread Victor Spng Arthursson

Hi!

If I use the LIMIT 0, 9 at the end of a SQL-query, mysql will only return the first 
9 records from the database... But to determine wether or not to print out the next 
page, I need to know the total number of records matching the query... Is there a way 
of doing this without having to do a new query with COUNT in it..?

Sincerely

Victor


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




[PHP] arrays and same index

2002-05-30 Thread Victor Spång Arthursson

Hi!

I want to create an array that looks like follows:

$array[untitled_1.jpg][] = 0
$array[untitled_1.jpg][] = 3
$array[untitled_1.jpg][] = 4
$array[untitled_2.jpg][] = 0
$array[untitled_3.jpg][] = 1

What I'm thinking about is accessing all untitled_1.jpg values by 
doing the following:

$newarray = $array[untitled_1.jpg];

and receive an array with 3 indexes which has the values 0,3,4...

This doesn't works...

$array[untitled_1.jpg][] = 3 seems to overwrite 
$array[untitled_1.jpg][] = 0 and then $array[untitled_1.jpg][] = 4 
overwrites $array[untitled_1.jpg][] = 3...

How should I solve this?

Sincerely

Victor


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




[PHP] How to create this login page in a good way?

2002-05-29 Thread Victor Spång Arthursson

Hello!

I'm sitting here trying to create a loginpage, but it doesn't look very 
nice. So now I'ld use some help to decide whether the following solution 
is possible to create...

I want to create a little script which will be included on every page 
and do the following:

1 does the user come from the log in part?

1.1 If so, veryfy the user against the database

1.1.1 If this succeeds, set the session 'is_logged_in'

1.2 If not, is the session set, that is, is the user already logged in?

1.2.1 If not, show a login form that has the action php_self 
_and halt_

1.2.2 If so, show the rest of the page, that is, what follows 
after the include of this script

In this, my problem are

1.2.1 How to stop loading the page.

1.2.2 How to show the rest of the page without having to supply a } on 
the end of each page...

Perhaps I've thought wrong, but if so, please help me with ideas...

Best regards,

Victor


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




Re: [PHP] Need some advice concerning forms (multi select pulldown) and arrays

2002-05-26 Thread Victor Spång Arthursson

Hello and thanks for your fast answer!

I'ld like to know if there is any possibility to distinguish the selects 
if I've multiple multiple selects, that is, more than one on the same 
page? What I'm loooking for is the possibility to have an unknown number 
of multiple selects on the same page

Is it possible? Anyone who can describe how to do this or provide a link 
to some tutorial? And also, where in the manual can I read about this?

Sincerely,

Victor

On lördag, maj 25, 2002, at 08:59 , Miguel Cruz wrote:

 Have a play with this little program - it should demonstrate all of the
 things you'd want to do with getting data in and out of mult selects. If
 it doesn't work, you may have an older version of PHP - in that case,
 change $_REQUEST to $HTTP_POST_VARS and $_SERVER['PHP_SELF'] to
 $PHP_SELF.

 ---
   ?

   $choices = array(1 = 'dog', 2 = 'cat', 3 = 'mouse', 4 = 'frog');

   if (is_array($_REQUEST['animals']))
   {
 print 'pYou chose:/pul';
 foreach ($_REQUEST['animals'] as $animal_id)
   print li{$choices[$animal_id]}/li;
 print '/ulhr';
   }

   ?form method=post action=?= $_SERVER['PHP_SELF'] ?
   select multiple name=animals[]?

   foreach ($choices as $id = $name)
 print 'option '
   . (in_array($id, $_REQUEST['animals']) ? 'selected ' : '')
   . value='$id'$name/option;

   ?/selectinput type=submit/form



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




Re: [PHP] Need some advice concerning forms (multi select pulldown) and arrays

2002-05-26 Thread Victor Spång Arthursson


On Sunday, May 26, 2002, at 01:14 PM, John Holmes wrote:

 Just give each select its own name.

Can't do that, don't know from time to time how many there'll be And 
I've to have some case which iterates on the following page...

 Or name them all the same followed
 by an [] and you'll end up with a multi-dimensional array if things go
 right...

Sounds better - but I've a lot of items and I'ld like to know which of 
the arrays that go to which item... Can I just write 
…name=array[whateverid] and then in some way reveal the whateverid's?

Sincerely

Victor


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




Re: [PHP] Need some advice concerning forms (multi select pulldown) and arrays

2002-05-26 Thread Victor Spång Arthursson

Ok, I can't get this right...

Have the following code:

   ?

   $choices = array(1 = 'dog', 2 = 'cat', 3 = 'mouse', 4 = 'frog');

if (is_array($_REQUEST['animals']))
{
// get the number of selectcases
echo get the number of selectcases:  . count($animals) . br;

// get the number of provided selects from select with name 2
echo get the number of provided selects from select with name 
\2\:  . count($animals[2]) . br;

// test to print some data
echo $animals[2][0]. br;
echo $animals[2][1]. br;
echo $animals[2][2]. br;
echo $animals[2][3]. br;
}
   ?
form method=post action=?= $_SERVER['PHP_SELF'] ?
select multiple name=animals[2]
option value='1'dog/option
option value='2'cat/option
option value='3'mouse/option
option value='4'frog/option
/select

 select multiple name=animals[4]
option value='1'dog/option
option value='2'cat/option
option value='3'mouse/option
option value='4'frog/option
 /select
input type=submit/form

Why does it not work?

// get the number of selectcases
echo get the number of selectcases:  . count($animals) . br;

This works great

// get the number of provided selects from select with name 2
echo get the number of provided selects from select with name 
\2\:  . count($animals[2]) . br;

But this doesn't...

Thankful for any help,

/Victor

On Sunday, May 26, 2002, at 05:35 PM, John Holmes wrote:

 You can supply an whateverID for the select if you want to.

 select name=select[]
 option ...
 /select

 select name=select[]
 option ...
 /select

 etc...

 That will give you an array $select[] on the processing page. If the
 selects are multi-selects, you'll have a multidimensional array. The
 first chosen element in the first select box can be referenced like this

 $select[0][0]

 You can get a count of how many select boxes there are by doing

 count($select);

 You can get a count of how many elements were selected within a select
 you can do this:

 count($select[x]);

 Where x is the number of the select box you want to know about.

 Confusing, eh?

 ---John Holmes...

 -Original Message-
 From: Victor Spång Arthursson [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, May 26, 2002 7:44 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Need some advice concerning forms (multi select
 pulldown) and arrays


 On Sunday, May 26, 2002, at 01:14 PM, John Holmes wrote:

 Just give each select its own name.

 Can't do that, don't know from time to time how many there'll be
 And
 I've to have some case which iterates on the following page...

 Or name them all the same followed
 by an [] and you'll end up with a multi-dimensional array if things
 go
 right...

 Sounds better - but I've a lot of items and I'ld like to know which of
 the arrays that go to which item... Can I just write
 …name=array[whateverid] and then in some way reveal the whateverid's?

 Sincerely

 Victor




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




[PHP] Validating forms and showing errors

2002-05-26 Thread Victor Boivie

Hi everybody,

This might be a RTFM or STFW-question, but I haven't found it.

I want to validate a form (in page1.php) to check if the user has entered a
correct email-adress and more, and if he needs to correct some fields, I'd
like to display the form again with all correct values filled in and the
incorrect fields hightlighted.

To make it a bit more difficult I've decided to POST to another file
(post.php) which validates the information and redirects the user (with
Header - Location) to page1.php if he has to correct the errors. If the form
is correctly filled in then he will be redirected to page2.php. This is to
prevent the browser for asking him if he wants to repost data if he hits
'Refresh'. Now I want to know how to pass information from post.php to
page1.php since the form page (page1) needs to know what was incorrect and
what was correct so that it can hightlight the bad fields. I don't want to
stick it in the URL since it would be too ugly, but I do have session
variables I can stick them in. Is this the way to go? Or is there a better
solution?

I guess many of you have fought with this before so I know you can help me
;)

Thanks in advance,
Victor

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




[PHP] Need some advice concerning forms (multi select pulldown) and arrays

2002-05-25 Thread Victor Spång Arthursson

Hello!

I know it's possible to use arrays in combination with forms, but I need 
some advice about where to find some information/tutorial concerning how 
to use arrays together with multi-select-tags...

Sincerely

Victor


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




[PHP] Can anyone help me save img from URL?

2002-05-16 Thread Victor Polyushko

Hi,

I was wondering if someone knows how to save the image from the given  url 
http://domain.com/image.gif   into a file on a local machine

Any suggestion will be greatly appreciated.
Thank you in advance


Victor Polyushko





Re: [PHP] Can anyone help me save img from URL?

2002-05-16 Thread Victor Polyushko

Hi Guys,

Thank you fo your input. I am sorry I am new to the list so + English is not
my first language :-( anyhow., I shoudl 've made my question more clear.

I am trying to save the image from the given URL
(http://domain.com/image.gif) running a PHP script on the page. I have tried
fread() and it does not allow me to accomplish that :-((


Have you guys ever come across such a problem?

Again thank you very much for your suggestions

Best Regards,
Victor Polyushko




- Original Message -
From: Robert Cummings [EMAIL PROTECTED]
To: Miguel Cruz [EMAIL PROTECTED]
Cc: Victor Polyushko [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Thursday, May 16, 2002 2:01 PM
Subject: Re: [PHP] Can anyone help me save img from URL?


 Miguel Cruz wrote:
 
  On Thu, 16 May 2002, Victor Polyushko wrote:
   I was wondering if someone knows how to save the image from the given
   url http://domain.com/image.gif into a file on a local machine
 
  lynx -source -dump   image.gif

 If there were actually an image I'd use:

 wget http://domain.com/image.gif

 Cheers,
 Rob.
 --
 .-.
 | Robert Cummings |
 :-`.
 | Webdeployer - Chief PHP and Java Programmer  |
 :--:
 | Mail  : mailto:[EMAIL PROTECTED] |
 | Phone : (613) 731-4046 x.109 |
 :--:
 | Website : http://www.webmotion.com   |
 | Fax : (613) 260-9545 |
 `--'



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




Re: [PHP] Done w/ PHP - VB or C# ?

2002-05-16 Thread Victor Polyushko

Does anyone know if there is any global reliable and free :-) statistics on
usage of PHP vs ASP. I am having the same dilemma.,  do I need to stick to
going deeply into PHP (which in my opinion rulez!!) or start paying more
attention to ASP...

Best Regards,
Victor Polyushko







- Original Message -
From: Peter [EMAIL PROTECTED]
To: Php [EMAIL PROTECTED]
Sent: Thursday, May 16, 2002 4:52 PM
Subject: FW: [PHP] Done w/ PHP - VB or C# ?



 For me personally I find working with ASP  .NET to be a pain in the butt,
 yeah sure you can to use all the fancy GUI's that can take care of some
code
 for you etc..  but then there's the argument about php and having to write
 the code your self.  Personally I find that a better approach as for me
it's
 all about learning and achieving because at the end of the day you can sit
 back and look at it and go wow I did that from scratch  from line 1 of
code
 etc.

 Basically it all comes down to personal preference.  I'm coming from a
back
 ground which doesn't include much programming at all (which can  be seen
by
 some of the dumb q's i've posted in here...) and I guess that using
 something with a prodominately (think that's how it's spelt) gui workings
 and that takes care of alot of code for me should be more appealing  but
 it's not  any way basically YOU have to decide what's best for you and
 that your happy with the choices that you've made as in the end it's you
 that's got to live with them.


  that's my 2 cents

 Peter

 -Original Message-
 From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, 16 May 2002 7:03 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Done w/ PHP - VB or C# ?


 I know I'll get mauled big-time on this mailing list but I'm thinking
 about putting PHP on hold for a while and learning ASP.NET

 I love PHP and open-source computing but if one wants to get a job in
 web development, you'll have a much better time find a job with both PHP
 and ASP (among others) skills.

 I'm going to hop on the ASP bandwagon but I'm not sure if I should
 first learn ASP w/ VB or w/ C#

 Any thoughts on this?  What are the pros and cons of both?

 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] Can anyone help me save img from URL?

2002-05-16 Thread Victor Polyushko

BINGO!! thank you guys for your input
I used a very simple command to accomplish that and it works!!
?
$command=wget http://domain.com/images/somepic.gif;;
system( $command, $result);
echo $result; ?

Victor Polyushko

- Original Message -
From: Robert Cummings [EMAIL PROTECTED]
To: Victor Polyushko [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, May 16, 2002 2:25 PM
Subject: Re: [PHP] Can anyone help me save img from URL?


 Victor Polyushko wrote:
 
  Hi Guys,
 
  Thank you fo your input. I am sorry I am new to the list so + English is
not
  my first language :-( anyhow., I shoudl 've made my question more clear.
 
  I am trying to save the image from the given URL
  (http://domain.com/image.gif) running a PHP script on the page. I have
tried
  fread() and it does not allow me to accomplish that :-((
 
  Have you guys ever come across such a problem?

 $imageData = implode( '', file( 'http://domain.com/image.gif' ) );
 $length = strlen( $imageData );

 if( $length  0 )
 {
 if( (fh = fopen( 'destination', 'w' )) )
 {
 fwrite( fh, $imageData );
 }
 }


 Cheers,
 Rob.
 --
 .-.
 | Robert Cummings |
 :-`.
 | Webdeployer - Chief PHP and Java Programmer  |
 :--:
 | Mail  : mailto:[EMAIL PROTECTED] |
 | Phone : (613) 731-4046 x.109 |
 :--:
 | Website : http://www.webmotion.com   |
 | Fax : (613) 260-9545 |
 `--'

 --
 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] Done w/ PHP - VB or C# ?

2002-05-16 Thread Victor Polyushko

hmm.. good question,
I guess number of active job openings will be the best measure :-))
(or websites using PHP vs ASP)




- Original Message -
From: Miguel Cruz [EMAIL PROTECTED]
To: Victor Polyushko [EMAIL PROTECTED]
Cc: Php [EMAIL PROTECTED]
Sent: Thursday, May 16, 2002 5:11 PM
Subject: Re: [PHP] Done w/ PHP - VB or C# ?


 On Thu, 16 May 2002, Victor Polyushko wrote:
  Does anyone know if there is any global reliable and free :-) statistics
on
  usage of PHP vs ASP. I am having the same dilemma.,  do I need to stick
to
  going deeply into PHP (which in my opinion rulez!!) or start paying more
  attention to ASP...

 I think it's pretty hard to measure usage... what would a meaningful
 metric be? Number of servers with ASP available? Number of virtual hosts?
 Number of page views served by ASP vs PHP? Number of active developers?

 miguel


 --
 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] Failed to compiled w/ T1lib

2002-04-27 Thread Victor Boivie

To make a long story short: I'm trying to compile PHP 4.2 with Apache, GD,
T1lib and more. This is what I'm using:

[configuring apache first]

./configure  --with-apache=../apache_1.3.24 --enable-ftp --with-mysql=/usr/l
ocal/mysql/ --enable-track-vars --enable-inline-optimization --disable-debug
 --enable-memory-limit --with-xml --enable-t1lib --with-t1lib=/usr/local/lib
 --with-gd=../gd-2.0.1  --with-freetype-dir=/usr --enable-gd-native-ttf --en
able-gd-imgstrttf --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib

make
make install
cd ../apache_1.3.24
./configure --activate-module=src/modules/php4/libphp4.a --enable-module=rew
rite

make

And this is what I get:

/usr/libexec/elf/ld: warning: libpng.so.4, needed by
/usr/local/lib/libgd.so, may conflict with libpng.so.5
modules/php4/libphp4.a(gd.o): In function `zif_imagecreatetruecolor':
/usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0xd9e): undefined reference to
`gdImageCreateTrueColor'
modules/php4/libphp4.a(gd.o): In function `zif_imagetruecolortopalette':
/usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0xf2b): undefined reference to
`gdImageTrueColorToPalette'
modules/php4/libphp4.a(gd.o): In function `zif_imagesetthickness':
/usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x1032): undefined reference to
`gdImageSetThickness'
modules/php4/libphp4.a(gd.o): In function `zif_imagefilledellipse':
/usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x136a): undefined reference to
`gdImageFilledEllipse'
modules/php4/libphp4.a(gd.o): In function `zif_imagefilledarc':
/usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x1836): undefined reference to
`gdImageFilledArc'
modules/php4/libphp4.a(gd.o): In function `zif_imagealphablending':
/usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x193a): undefined reference to
`gdImageAlphaBlending'
modules/php4/libphp4.a(gd.o): In function `zif_imagecolorresolvealpha':
/usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x1bd1): undefined reference to
`gdImageColorResolveAlpha'
modules/php4/libphp4.a(gd.o): In function `zif_imagecolorclosestalpha':
/usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x1e61): undefined reference to
`gdImageColorClosestAlpha'
modules/php4/libphp4.a(gd.o): In function `zif_imagecolorexactalpha':
/usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x20f1): undefined reference to
`gdImageColorExactAlpha'
modules/php4/libphp4.a(gd.o): In function `zif_imagecopyresampled':
/usr/tmp/www/php-4.2.0/ext/gd/gd.c:882: undefined reference to
`gdImageCopyResampled'
*** Error code 1

Stop in /usr/tmp/www/apache_1.3.24/src.
*** Error code 1

Stop in /usr/tmp/www/apache_1.3.24.
*** Error code 1

Stop in /usr/tmp/www/apache_1.3.24.


Any ideas? It worked good before I installed t1lib and messed around with
it.
Thanks in advance,
Victor


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




[PHP] Thanks

2002-04-21 Thread Victor Javier Martinez Lopez

Thanks everyone for your help.





[PHP] Learning PHP

2002-04-20 Thread Victor Javier Martinez Lopez

I'm started with PHP and I'm interested in find any place
with some docs and example code. Can anyone help me?

Thanks in advance.




[PHP] Problems with maximum execution time

2002-03-09 Thread Victor Usjanov

Hello

I got a problem with php and apache. I have installed latest
squirrelmail(1.2.5), that uses php. When i point browser to the webfolder of
squirrelmail, i get the login form just fine. This means that php works ok.
But when i try to log on, the only thing i get is:

Fatal error: Maximum execution time of 30 seconds exceeded in
/home/squirrel/functions/imap_general.php on line 117

I have tried to increase timeout value in the php.ini to 300, and to 0
(unlimited, as far as i understand), but it just took longer time to get
this error message.

System information: RH72, 2.4.9-31 kernel, apache-1.3.22-2, php-4.0.6-12,
imap-2000c-15, php-imap-4.0.6-12. System is
intalled from RH7.2 CD and updated with help of up2date.

What is strange is that i have another RH7.2 computer with the same versions
of packages, and there squirrel works just fine. I have compared php.ini and
httpd.conf between these two computes, and they are identical.

I do not get anything in apache`s error_log, but in access log i get this:

Computer wherer squirrel does not work:
pc51-119.hiof.no - - [09/Mar/2002:10:27:14 +0100] GET /mail HTTP/1.1 301
322
pc51-119.hiof.no - - [09/Mar/2002:10:27:15 +0100] GET /mail/ HTTP/1.1 302
5
pc51-119.hiof.no - - [09/Mar/2002:10:27:17 +0100] GET /mail/src/login.php
HTTP/1.1 200 1470
pc51-119.hiof.no - - [09/Mar/2002:10:27:18 +0100] GET
/mail/images/sm_logo.png HTTP/1.1 304 -
pc51-119.hiof.no - - [09/Mar/2002:10:27:54 +0100] POST
/mail/src/redirect.php HTTP/1.1 200 160

and nothing more

Computer where squirrel does work:
my_hostname - - [09/Mar/2002:10:30:22 +0100] GET /mail HTTP/1.1 301 316
my_hostname  - - [09/Mar/2002:10:30:24 +0100] GET /mail/ HTTP/1.1 302 5
my_hostname  - - [09/Mar/2002:10:30:25 +0100] GET /mail/src/login.php
HTTP/1.1 302 5
my_hostname  - - [09/Mar/2002:10:30:34 +0100] GET /mail/src/login.php
HTTP/1.1 200 1502
my_hostname  - - [09/Mar/2002:10:30:39 +0100] GET /mail/images/sm_logo.png
HTTP/1.1 304 -
my_hostname  - - [09/Mar/2002:10:30:44 +0100] POST /mail/src/redirect.php
HTTP/1.1 302 0
my_hostname  - - [09/Mar/2002:10:30:44 +0100] GET /mail/src/webmail.php
HTTP/1.1 200 204
my_hostname  - - [09/Mar/2002:10:30:46 +0100] GET /mail/src/right_main.php
HTTP/1.1 200 15956

Someone got any ideas about what can be wrong ?

Thank you in advance

--
Victor



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




Re: [PHP] RANT: Why doesn't PHP have built-in support for dynamic image generation?

2002-02-03 Thread Victor Boivie

PEAR? I think it would be better if someone did a real PHP module for ImageMagick, 
just like PerlMagick is for Perl. There is one at http://php.chregu.tv/imagick/, but 
it's far from complete. If someone would like to help him with the project then it 
would be great.

ImageMagick is so much easier to install than GD, and it's a lot better too.

// Victor.

- Original Message - 
From: Weston Houghton [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, February 03, 2002 8:45 AM
Subject: Re: [PHP] RANT: Why doesn't PHP have built-in support for dynamic image 
generation?


 
 Anybody interested in working on a PEAR module to interface PHP with
 something like ImageMagick directly? I would love to see it. Maybe if I am
 unemployed long enough soon I can work on it myself. Not that I really want
 that to happen...
 
 I think that might be the best solution for PHP's lack of image
 functionality though...
 
 Wes
 
 
 
  Hi Erica,
 
  I feel your pain - I've been dealing with the same thing this week.  I
  finally got the compile to complete and the system up and running, but it
  was painful.  It seemed like everything was finished, but I've noticed high
  server loads (.8), trouble accessing web pages (I tested using wget and it
  had to try 6 times to get the page and kept reporting EOF in headers), and
  my MySQL server keeps reporting errors communicating with the web server,
  and dropped connections to the MySQL server.  Safe to say, something didn't
  work and I need to start over and pray for the best.
 
  Have you gotten it to work properly?  If so, what files did you use and
  what steps did you take in the install?
 
  -Ed
 
 
  At 11:24 PM 2/2/2002 -0800, Erica Douglass wrote:
  Forgive my grumpiness, but I've spent the last several hours trying to
  install GD, etc.
 
  Let's be honest. PHP needs built-in support for creating dynamic images. JSP
  already has this. Heck, you could even make it a configure option. As it
  stands now, you have to do the following:
 
  -- Install GD
  -- Install all of GD's numerous dependencies
  -- Install zlib
  -- Install freetype
  -- Install libttf
 
  THEN you have to compile PHP with all of the requisite options to enable GD
  here and Freetype there, and PHP often won't compile without specifying
  /path/to/various/options, so you have to dig around your system to find out
  where everything was installed. This results in a long and unwieldy
  configure statement which often does not work.
 
  PHP needs to have a simple configure option called --enable-dynamic-images
  or something similar. This should use built-in libraries that are downloaded
  with the PHP source to create PNG images. Images can then be created with
  standard PHP functions. This would be much more useful than relying on
  several third-party solutions which do not easily work with each other. This
  would also have the benefit of being more portable -- as I plan to release
  my code to several different people running different types of servers, I
  would like to minimize compatibility issues.
 
  If anyone has a better solution, feel free to email me. As it stands, I am
  very frustrated with this, and I haven't yet seen the light at the end of
  the tunnel.
 
  Thanks,
  Erica
 
 
 
  --
  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] multiple replaces...

2002-01-12 Thread Victor Boivie

If you only want to replace strings, then drop the regular expression functions! (a 
common mistake)

Use for example str_replace, or in this case, strtr which is better because it accepts 
an array as replacement pattern.

For example: 
  $foo = array(foo = apple, bar = banana);
  $string = I like foos and bars;
  $string = strtr($string, $foo);
  echo $string;

output:
  I like apples and bananas

// Victor

- Original Message - 
From: 'Nick Wilson' [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, January 12, 2002 1:17 PM
Subject: Re: [PHP] multiple replaces...


 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 
 * On 12-01-02 at 13:02
 * Lauri Vain said
 
  Hi Nick,
 
  Yes, I thought about that. But, what should I do when the markers are absolutely 
NOT in any sequence.
 
  I also thought about something like
  $replace[1][1] = !one!; //marker
  $replace[1][2] = hehee; //replace with
  $replace[1][1] = test; //marker
  $replace[1][2] = foobar; //replace with
  $replace[1][1] = repl; //marker
  $replace[1][2] = humpty-dumpty; //replace with
  $replace[1][1] = blah; //marker
  $replace[1][2] = boo; //replace with
 
  Now, when I would do a loop thingie that goes through all those, then it would be 
a pretty nice and compact solution...
 
  What about speed issues regarding this solution?
 
 I don't think speed will be an issue unless you have thousands of
 markers, in which case you'll need to re-think the whole thing.
 
 Can you not put all of your markers in an array like
 
 $markers=array(m1, m2, m_whatever);
 
 and all your replacements likewise
 
 $replace=array(r1, r2, r_whatever);
 
 and then loop through like that?
 
 If not, explain a little more about the context of the problem and let's
 see if we can come up with an alternative.
 - --
 
 Nick Wilson
 
 Tel: +45 3325 0688
 Fax: +45 3325 0677
 Web: www.explodingnet.com
 
 
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)
 Comment: For info see http://www.gnupg.org
 
 iD8DBQE8QCk+HpvrrTa6L5oRAozIAJ4opVPFNwawBmQNIAHLZN/gdCt+lgCeLgmC
 5hurUMezrXCg3cVtYgieGGE=
 =xRPE
 -END PGP SIGNATURE-
 
 --
 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] Object sharing

2001-10-24 Thread Victor Hugo Oliveira

Does anyone know a way to share an object with all sessions ?
The idea is to access the same database connection poll.

Thanks,
Victor


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

2001-10-24 Thread Victor Hugo Oliveira

Is there an easy way to save an object in this section ?
The object will have something like an open file or a database connection...

Thanks,
Victor

-Original Message-
From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
Sent: quarta-feira, 24 de outubro de 2001 16:43
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Object sharing


sharedMemory on *nix


--
Andrey Hristov
Web Developer
Icygen Corporation
BUILDING SOLUTIONS
http://www.icygen.com

On Wednesday 24 October 2001 09:35 am, you wrote:
 Does anyone know a way to share an object with all sessions ?
   The idea is to access the same database connection poll.

 Thanks,
 Victor

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

2001-10-24 Thread Victor


I'm trying to access an object as a Singleton. Here is the source code I'm
using.
The problem is that the member objFile from the $test variable is set to an
open file in the class constructor. It works fine, but when I recover it
from the memory, the file handler gets lost in starts being considered an
int.

Has anyone done this before ?

?php
echo(htmlbody);
include (./ConcreteErrorLog/SingletonTest.inc);
$test = new Singleton;
$test-testCreateSingleton();
echo(Creating shared memory.br);
$attachkey=1;
$memorykey = shm_attach($attachkey);
$variablekey=1;
echo(Getting variable from memory. br);
$test2=shm_get_var($memorykey,$variablekey);
echo(Got the variable  . get_class($test2) .  br);
if(!isset($test2) || empty($test2)){
echo(Putting in memory. br);
shm_put_var($memorykey,$variablekey,$test);
$test-testCreateSingleton();
}
echo(The variable must be there by now. br);
$test = shm_get_var($memorykey,1);
echo(Got it. br);
echo(member is now =  . $test-intMember . br);
$test-testCreateSingleton();
if($HTTP_GET_VARS[clear]==yes){
echo(Will remove shared object. br);
shm_remove_var($memorykey,$variablekey);
echo(Shared object removed. br);
}
echo(/body/html);
?


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

2001-10-23 Thread Victor Hugo Oliveira

I'd like to to make a Singleton object in PHP4.
  I'm trying to use a static variable in a function to do that.
Every time I use the reload in the Browser client, the file doesn't seem to
keep the information (I kind of expected that).

I could think only 2 ways to do that.
1. Using shared memory - which I don't think is really an option for it
would make the code to difficult to manage later on.
2. Using environment variables - which would not be good to store any kind
of data, such as a pointer to an open file.

Any suggestions anyone ?

Thanks,
Victor


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

2001-10-23 Thread Victor Hugo Oliveira

This would be very good to access a Singleton with one user, but how would
it be done for all users to acess the same object. Is it possible to hold
and open file pointer in this object ?

Thanks,
Victor

-Original Message-
From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
Sent: terça-feira, 23 de outubro de 2001 19:03
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Singleton


Use sessions (like session_start() )

--
Andrey Hristov
Web Developer
Icygen Corporation
BUILDING SOLUTIONS
http://www.icygen.com

On Tuesday 23 October 2001 11:55 am, you wrote:
 I'd like to to make a Singleton object in PHP4.
   I'm trying to use a static variable in a function to do that.
   Every time I use the reload in the Browser client, the file doesn't seem
 to keep the information (I kind of expected that).

   I could think only 2 ways to do that.
   1. Using shared memory - which I don't think is really an option for it
 would make the code to difficult to manage later on.
   2. Using environment variables - which would not be good to store any
 kind of data, such as a pointer to an open file.

   Any suggestions anyone ?

 Thanks,
 Victor


--
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] Detect if javascript is enabled

2001-09-20 Thread Ole Victor

Hi,

Does anyone know a simple trick to get PHP detect if the user's browser has
javascript enabled?

--
Olé



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

2001-07-06 Thread Victor Spång Arthursson

Hi!

Still new on PHP, converting from vb$cript, I wonder how I do a 
redirect...

In vbscript:

%
response.redirect(page.extension)
%

In PHP???

Sincerely

Victor


-- 
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] How to prevent people from downloading images

2001-07-03 Thread Victor Spång Arthursson

There is only one way to prevent people from steeling images, and that 
is to print a logo all over the image:

http://www.agefotostock.com/age/sueco/enim01.asp?foto=29580light=

If you write a javascript that disables the right mouse button, I'ld be 
able to steel it anyway cause I'm a Mac user and we don't have right 
buttons =)

Or if you printed it as a binary I'ld still be able to take a screendump 
using Cmd (applekey) + Shift + 3 =)

Sincerely, Victor


-- 
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] New on PHP, need help with sessions

2001-07-02 Thread Victor Spång Arthursson

Hi!

I'm converting from ASP/VBScript, and need to know how to declare a 
session variable.

In VBScript I just type in:

%
session(any) = victor
%

Then I can print that variable on any page on the same webpage using:

%
response.write session(any)
%

as long as I don't close the browser or the variable times out.

Question: How do I achieve the same thing in PHP..?

Thanks in advance,

Sincerely Victor

PS Using PHP 4 on Mac OS X DS

-- 
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] FORM input type=image ... with a posting value

2001-04-08 Thread Victor Gamov

"Johnson, Kirk" wrote:
 
 Oops. You do need the type=image and src= attributes, instead of what I
 wrote in the example. Good thing it's Friday :)
 
  -Original Message-
  From: Johnson, Kirk
  Sent: Friday, April 06, 2001 1:29 PM
  To: [EMAIL PROTECTED]
  Subject: RE: [PHP] FORM input type=image ... with a posting value
 
 
  Yes, but you no longer check the value of "value" to
  determine which button
  was clicked. Instead, give each button a unique *name*
  attribute, then check
  if $name_x is set. The browser returns the x,y coordinates of
  the point
  where the user clicks the button, in variables named name_x
  and name_y.

To create unique name for many input type=image ... elements you can
use array

FORM method=post ...
input type=image name=images[1] ...
input type=image name=images[2] ...
input type=image name=images[3] ...
/FORM

and so on.  When you submit this form the $images array will be set and
sizeof($images) == 1.

-- 
CU, Victor Gamov

-- 
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] newbie question about variables

2001-04-08 Thread Victor

Hello,

 Is there any (easy) way to let a user to set the value of a
 variable by simply clicking on a hyperlink on a web page?
 I mean if I have a 3 links on a page if the user clicks on image1 to
 set a variable $var=1,if clicks on image2 to set it as
 $var=2,etc.

 Any suggestions (including RTFMs ;-)) are wellcome.


Best regards,
  Victor



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




<    1   2   3   >