RE: [PHP] HELP PLEASE ! Need PHP Advice !!!

2003-02-27 Thread Victor Stan
First of all, are they paying you to automate or to repurpose the content
for the web? Taking a page designed for print and then automating it into
a page for the web is the wrong approach, your problem is not technical it
is a design problem. Technically it is easy, I think, does Quark not have
XML output? Or I think it is able to save document as HTML for the web too,
then if you want to automate all u have to do is make a script that
includes those pages inside a site shell. I actually wrote something like
this that one could save an html file from word and upload it and it would
be on the site, but again, I think it's a bad idea. You should NOT try to
automate this, you should look into hiring a fulltime repurposing designer,
at LEAST you should read designing Web Usability by Jacob Nielson, then
maybe u get a better idea of what you SHOULD do.

- Vic

-Original Message-
From: justin brenton [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 7:24 AM
To: [EMAIL PROTECTED]
Subject: [PHP] HELP PLEASE ! Need PHP Advice !!!

can anyone give me some good advise on how abouts I should go about
maintaining a newspaper website.

here is what is currently in place and how i want it to be managed

right now the newspapers are published in a quark file from that file
pictures have to be placed in photoshop and resized , croped and what not
and then inserted into a html page, the content i.e text is in this quark
file as well and is copied and pasted into a html file, what i want to do is
have the site automated to some extent so i do not have to be doing all this
copying and pasteing it's a total waste valueable time. what i would like to
have it some way to have a php script to take this info from the quark file
and the pictures and have them either transfered to a html page or to a
database from there i could call from the php script.



ANYONE HAVE ANY IDEAS ON A GOOD WAY TO GO ABOUT THIS ... PLEASE CONTACT ME

[EMAIL PROTECTED]

remove the NOSPAM from address



--
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] PHP on IIS session problems

2003-03-03 Thread Victor Stan
I get these errors from a simple session_start(); script.

Warning: session_start() [function.session-start]:
open(/tmp\sess_f4aa3ef3c537bb6327d5e7b991e91be7, O_RDWR) failed: No such
file or directory (2) in c:\inetpub\wwwroot\picoblog\admin.php on line 2

Warning: session_start() [function.session-start]: Cannot send session
cookie - headers already sent by (output started at
c:\inetpub\wwwroot\picoblog\admin.php:2) in
c:\inetpub\wwwroot\picoblog\admin.php on line 2

Warning: session_start() [function.session-start]: Cannot send session cache
limiter - headers already sent (output started at
c:\inetpub\wwwroot\picoblog\admin.php:2) in
c:\inetpub\wwwroot\picoblog\admin.php on line 2


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



RE: [PHP] PHP on IIS session problems

2003-03-03 Thread Victor Stan
Ok, thanks guys for your help, I sort of figured that's the problem, but I
didn't want to touch the ini settings without being sure, and getting some
advice from people that know. Thanks again, great help.

I made the changes, now how do I restart php? So the changes are used?

- Vic

-Original Message-
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Monday, March 03, 2003 10:23 AM
To: Victor Stan; [EMAIL PROTECTED]
Subject: Re: [PHP] PHP on IIS session problems

 I get these errors from a simple session_start(); script.

 Warning: session_start() [function.session-start]:
 open(/tmp\sess_f4aa3ef3c537bb6327d5e7b991e91be7, O_RDWR) failed: No such
 file or directory (2) in c:\inetpub\wwwroot\picoblog\admin.php on line 2

Do you have a /tmp folder on your computer? Probably not, so that's why PHP
is throwing a warning, because it can't write to a directory that doesn't
exist.

 Warning: session_start() [function.session-start]: Cannot send session
 cookie - headers already sent by (output started at
 c:\inetpub\wwwroot\picoblog\admin.php:2) in
 c:\inetpub\wwwroot\picoblog\admin.php on line 2

 Warning: session_start() [function.session-start]: Cannot send session
cache
 limiter - headers already sent (output started at
 c:\inetpub\wwwroot\picoblog\admin.php:2) in
 c:\inetpub\wwwroot\picoblog\admin.php on line 2

These are just by-products of the first error.

Set your session.save_path setting in php.ini to a folder that IIS can write
to.

---John Holmes...


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



RE: [PHP] PHP on IIS session problems

2003-03-03 Thread Victor Stan
K, thanks, I tried stopping just the web sites from the control panel, but I
guess I had to stop the whole thing and restart.

- Vic

-Original Message-
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Monday, March 03, 2003 11:07 AM
To: Victor Stan; [EMAIL PROTECTED]
Subject: Re: [PHP] PHP on IIS session problems

You need to restart IIS.

c:\ net stop iisadmin

c:\ net start w3svc

or use the control panel.

---John Holmes...

- Original Message -
From: Victor Stan [EMAIL PROTECTED]
To: 1LT John W. Holmes [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Monday, March 03, 2003 12:54 PM
Subject: RE: [PHP] PHP on IIS session problems


 Ok, thanks guys for your help, I sort of figured that's the problem, but I
 didn't want to touch the ini settings without being sure, and getting some
 advice from people that know. Thanks again, great help.

 I made the changes, now how do I restart php? So the changes are used?

 - Vic

 -Original Message-
 From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 03, 2003 10:23 AM
 To: Victor Stan; [EMAIL PROTECTED]
 Subject: Re: [PHP] PHP on IIS session problems

  I get these errors from a simple session_start(); script.
 
  Warning: session_start() [function.session-start]:
  open(/tmp\sess_f4aa3ef3c537bb6327d5e7b991e91be7, O_RDWR) failed: No such
  file or directory (2) in c:\inetpub\wwwroot\picoblog\admin.php on line 2

 Do you have a /tmp folder on your computer? Probably not, so that's why
PHP
 is throwing a warning, because it can't write to a directory that doesn't
 exist.

  Warning: session_start() [function.session-start]: Cannot send session
  cookie - headers already sent by (output started at
  c:\inetpub\wwwroot\picoblog\admin.php:2) in
  c:\inetpub\wwwroot\picoblog\admin.php on line 2
 
  Warning: session_start() [function.session-start]: Cannot send session
 cache
  limiter - headers already sent (output started at
  c:\inetpub\wwwroot\picoblog\admin.php:2) in
  c:\inetpub\wwwroot\picoblog\admin.php on line 2

 These are just by-products of the first error.

 Set your session.save_path setting in php.ini to a folder that IIS can
write
 to.

 ---John Holmes...



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




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




[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




Re: [PHP] how to execute a remote command from php [done]

2004-09-28 Thread Victor Alvarez

- Original Message - 
From: Sethi, Samir (IDS DMDS) [EMAIL PROTECTED]
To: Victor Alvarez [EMAIL PROTECTED]
Sent: Monday, September 27, 2004 5:47 PM
Subject: RE: [PHP] how to execute a remote command from php



Exactly, I had to generate keys for nobody and now I am able to execute
remote commands.

Thank you so much.
 Victor.




I think when you execute the command it is run as user nobody. You may
need to generate keys for the
nobody account and update the authorized keys on the remote system.

Samir.


-Original Message-
From: Victor Alvarez [mailto:[EMAIL PROTECTED]
Sent: Monday, September 27, 2004 12:35 PM
To: [EMAIL PROTECTED]
Subject: [PHP] how to execute a remote command from php


Hello,
 Since last week I am trying  to execute a remote machine command from
php without success. Since ssh ask for a password, I managed to use ssh
with dsa authentication so it's possible to call the remote command
without password and only with one line: ssh -l victor 192.168.129.211
-i /root/.ssh/id_dsa whoami. It works perfectly from command line but
I have nothing if I try to do the same from php: exec(ssh -l victor
192.168.129.211 -i /root/.ssh/id_dsa \whoami\,$results); $results is
empty after the execution.

I wonder if somebody could answer this question. I have found no
solution googling it.

Thank you.
Regards,
 Victor.


If you are not an intended recipient of this e-mail, please notify the
sender, delete it and do not read, act upon, print, disclose, copy, retain
or redistribute it. Click here for important additional terms relating to
this e-mail. http://www.ml.com/email_terms/


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



[PHP] file upload

2004-10-25 Thread Victor C.
Hi,

I'm trying to submit a file from index.php to index2.php. I know how to
do file upload in PHP. On index.php
I have:

FORM ACTION=index2.php METHOD=POST
 ENCTYPE=multipart/form-data
INPUT TYPE=file NAME=myfile SIZE=30
INPUT TYPE=submit NAME=Upload File
/FORM

The next page would only need to use $HTTP_POST_FILES['myfile'] to access
the submitted file.

My question is: if I already know which file I want to submit, say
file1.xml.  How can I just ask index.php
to submit file1.xml to index2.php?  Without asking the users to pick the
file to upload?

Thanks a lot in advance!

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



Re: [PHP] file upload

2004-10-25 Thread Victor C.
Thanks for answering Chris..
What if I want to send a file from my web server to another site for them to
parse?  I already know what file I want to send and I do not want to have to
select the file by doing browsing.

Chris [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 You can't, at least you SHOULDN'T. Just think about what you're asking
 for, you want to download a file from a users computer, without them
 knowing about it.

 Major security/privacy issues there that browsers try to prevent.

 Chris

 Victor C. wrote:

 Hi,
 
 I'm trying to submit a file from index.php to index2.php. I know how
to
 do file upload in PHP. On index.php
 I have:
 
 FORM ACTION=index2.php METHOD=POST
  ENCTYPE=multipart/form-data
 INPUT TYPE=file NAME=myfile SIZE=30
 INPUT TYPE=submit NAME=Upload File
 /FORM
 
 The next page would only need to use $HTTP_POST_FILES['myfile'] to access
 the submitted file.
 
 My question is: if I already know which file I want to submit, say
 file1.xml.  How can I just ask index.php
 to submit file1.xml to index2.php?  Without asking the users to pick
the
 file to upload?
 
 Thanks a lot in advance!
 
 
 

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



Re: [PHP] file upload

2004-10-25 Thread Victor C.
See... basically, I have two sites. One site provides user authentication
and another one requests the authentication. The requesting site need to
send to the authentication site its request in an XML.  The authentication
site is suppose to get the XML file using $HTTP_POST_FILES.  I'm using PHP
to dynamically generate the request XML file and I need to submit it to the
authenticating site; but I don't want to use file upload and browse
functionality, because the authentication process is suppose to be
transparent to the end users.

Again, thanx for the help and any insights would be greatly appreciated. :)
Chris [EMAIL PROTECTED]
??:[EMAIL PROTECTED]
 Server to Server transfers are a bit different. There are MANY ways to
 do it. You can put the file in the document root of one server, and
 download it with the other server. Or you could FTP the file from one
 server to the other. Just 2 examples.  And, you could even POST the file
 from one to the other.

 That solution seems a bit icky to me, but it all really depends on what
 you need. Pulling is generally easier than pushing.

 Chris

 Victor C. wrote:

 Thanks for answering Chris..
 What if I want to send a file from my web server to another site for them
to
 parse?  I already know what file I want to send and I do not want to have
to
 select the file by doing browsing.
 
 
 

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



[PHP] Millisecond in PHP

2004-10-27 Thread Victor C.
Hi,

I'm trying to get PHP to display the millisecond of current time.  I can't
find that option in Date().. Any hints?

Thanks a lot

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



Re: [PHP] Millisecond in PHP

2004-10-27 Thread Victor C.
Thank you all for answering! Really appreciate it.
John Nichel [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Victor C. wrote:
  Hi,
 
  I'm trying to get PHP to display the millisecond of current time.  I
can't
  find that option in Date().. Any hints?
 
  Thanks a lot
 

 http://us4.php.net/manual/en/function.microtime.php

 --
 John C. Nichel
 ÜberGeek
 KegWorks.com
 716.856.9675
 [EMAIL PROTECTED]

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



[PHP] Timezone

2004-10-27 Thread Victor C.
Is there a way to get PHP to display the full name of time zone?
date(t) only displays in the format of 'EDT', 'PDT', etc.. But I need the
full name of the timezone, ie. Pacific daylight saving time.
I know I can hard code all of these using switch statemetns.  I'm just
wondering if there is a function that's already build in.

Thanks

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



[PHP] PHP and send XML

2004-10-28 Thread Victor C.
Hi,

I'm trying to pass XML file from Site  A to Site B for Site B to parse.
Site B is maintained by other company, so I only need to worry about sending
over the XML file. I've been hinted that fsockopen() can do the job.

I've done the following through PHP:

$port=80;
$host=134.134.134.134
$data=

POST /folder1/ HTTP/1.0
Host: 134.134.134.134
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
Content-Type: application/x-ddif
Content-Length: 301

blabla
version100/version
securityTYPE1/security
authrq
tsclient20041028065058:534Pacific Daylight TimeBR/tsclient
 appid/appid
appverappver
/authrq
profrq
localeen_CA/locale
/profrq
/blabla


then i wrote in PHP.

fclose($f);
$result=;
echo $f=fsockopen($host,$port, $errno, $errstr, 30);
fputs($f,$msg,$data);
while (!feof($f)) $result.=fread($f,32000);
fclose($f);
echo $result;

Since I still do not have the HOST info. on site B.  I'm doing testing by
setting the $host to be my own site (ie, Site A's)  host ip.
Right now when I execute the code, the page just keeps on running and
nothing shows up.. Is this how it's suppose to behave?

Thanks a lot.

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



[PHP] php array question

2004-11-01 Thread Victor C.
Hi,
I have a line of php that I don't really understand.

foreach($this-orders as $OrderID = $value) {
echo $OrderID.BR;
$OrderObject =$this-orders[$OrderID=$value];
echo $OrderObject-OrderID.--all the sameBR;
}

I know that $this-orders is an array of order objects.

the result i get from this is:

line1. 388--OrderID.
line2. 389--all the same
line3. 389--OrderID.
line4. 389--all the same

I'm really confused about why line 1 and line 3 have different OrderID, but
line 2 and 4 have the same... I've been trying to fix this bug for 3 hrs
with no luck.
Any help would be really appreciated..

Thanks a lot

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



[PHP] Re: php array question

2004-11-01 Thread Victor C.
But why would the this line generate different OrderID on lines 1 and 3?
Ben Ramsey [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Victor C. wrote:
  $OrderObject =$this-orders[$OrderID=$value];

 This line is confusing. $OrderID=$value is either a typo or is just
 plain wrong. It looks like what it's meant to say is:

 $OrderObject = $this-orders[$OrderID];

 But this will just set $OrderObject equal to $value, so you should just
use:

 $OrderObject = $value;

 Try that and see if it works.

 --
 Ben Ramsey
 Zend Certified Engineer
 http://benramsey.com

 ---
 Atlanta PHP - http://www.atlphp.org/
 The Southeast's premier PHP community.
 ---

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



[PHP] Re: php array question

2004-11-01 Thread Victor C.
I did a print_r(array_values)before calling the codes that had errors in
it.. the following content is contained in $this-orders;

Array ( [0] = order Object ( [UserObject] = user Object ( [UserID] =
E2401 [Pass] = [IsValid] = 1 [UserType] = AT [fonthtml] = [footerfile]
= resources/footer.php [headerfile] = resources/header.php [Email] =
[EMAIL PROTECTED] [FirstName] = Dennis [LastName] = 5
[Salutation] = [Phone] = 123-456-7890 [Fax] = 321-123-4567 [Address1] =
555 Testing Avenue [Address2] = Test 200 [City] = Orlando [State] = FL
[Zip] = 12345 [DisplayName] = 52II Rfc [Region] = WEST [OSJ] = 1
[Series7] = 1 [OSJAddress1] = Changed 9:55 Am [OSJAddress2] = [OSJCity]
= Des Moines [OSJState] = IA [OSJZip] =  [OSJPhone] = 43143431214
[existsindb] = 1 [firsttime] = 1 ) [OrderID] = 392 [CartID] = 90
[TemplateID] = 1 [UserID] = E2401 [completed] = 1 [ordername] = 4312
[existsindb] = 1 [cost] = 3665.2 [totalcopies] = [directmailquantity] =
[directshippingmethod] = [overprintquantity] = 4312
[overprintshippingmethod] = [rushoption] = Standard [dl1000instancefile]
=
0|C:/Inetpub/wwwroot/printsite/|0|C:/Inetpub/wwwroot/printsite/|0|0|Dennis
J. Cunningham II Rfc|Enter your company:|123-456-7890|321-123-4567|Changed
9:55 Am, Des Moines, IA,
|C:/Inetpub/wwwroot/printsite/|FALL|2004|C:/Inetpub/wwwroot/printsite/ae
gonresources/stockimages/highres/ISI_logo.jpg|Securities offered through
InterSecurities, Inc. Member NASD, SIPC and Registered Investment
Advisor|Changed 9:55 Am, Des Moines, IA, |C:/Inetpub/wwwroot/printsite/
[flashvars] = 0||0||0|0|341431|Enter your
company:|123-456-7890|321-123-4567|Changed 9:55 Am, Des Moines, IA,
||FALL|2004|http://69.44.155.247/printsite/aegonresources/stockimages/lo
wres/ISI_logo.jpg|Securities offered through InterSecurities, Inc. Member
NASD, SIPC and Registered Investment Advisor|Changed 9:55 Am, Des Moines,
IA, | [dbname] = [dbpath] = [age] = [zip] = [gender] = [income] =
[home] = [homevalue] = [length] = [children] = [childrenAge] =
[marital] = [networth] = [stock] = [listquantity] = )

[1] = order Object ( [UserObject] = user Object ( [UserID] = E2401 [Pass]
= [IsValid] = 1 [UserType] = AT [fonthtml] = [footerfile] =
resources/footer.php [headerfile] = resources/header.php [Email] =
[EMAIL PROTECTED] [FirstName] = Dennis [LastName] = Cunningham
[Salutation] = [Phone] = 123-456-7890 [Fax] = 321-123-4567 [Address1] =
555 Testing Avenue [Address2] = Test 200 [City] = Orlando [State] = FL
[Zip] = 12345 [DisplayName] = Dennis J. Cunningham II Rfc [Region] = WEST
[OSJ] = 1 [Series7] = 1 [OSJAddress1] = Changed 9:55 Am [OSJAddress2] =
[OSJCity] = Des Moines [OSJState] = IA [OSJZip] =  [OSJPhone] =
43143431214 [existsindb] = 1 [firsttime] = 1 ) [OrderID] = 392 [CartID]
= 90 [TemplateID] = 1 [UserID] = E2401 [completed] = 1 [ordername] =
4312 [existsindb] = 1 [cost] = 3665.2 [totalcopies] =
[directmailquantity] = [directshippingmethod] = [overprintquantity] =
4312 [overprintshippingmethod] = [rushoption] = Standard
[dl1000instancefile] =
0|C:/Inetpub/wwwroot/printsite/|0|C:/Inetpub/wwwroot/printsite/|0|0|Dennis
J. Cunningham II Rfc|Enter your company:|123-456-7890|321-123-4567|Changed
9:55 Am, Des Moines, IA,
|C:/Inetpub/wwwroot/printsite/|FALL|2004|C:/Inetpub/wwwroot/printsite/ae
gonresources/stockimages/highres/ISI_logo.jpg|Securities offered through
InterSecurities, Inc. Member NASD, SIPC and Registered Investment
Advisor|Changed 9:55 Am, Des Moines, IA, |C:/Inetpub/wwwroot/printsite/
[flashvars] = 0||0||0|0|432141 II Rfc|Enter your
company:|123-456-7890|321-123-4567|Changed 9:55 Am, Des Moines, IA,
||FALL|2004|http://69.44.155.247/printsite/aegonresources/stockimages/lo
wres/ISI_logo.jpg|Securities offered through InterSecurities, Inc. Member
NASD, SIPC and Registered Investment Advisor|Changed 9:55 Am, Des Moines,
IA, | [dbname] = [dbpath] = [age] = [zip] = [gender] = [income] =
[home] = [homevalue] = [length] = [children] = [childrenAge] =
[marital] = [networth] = [stock] = [listquantity] = ) ) 1Object--value.


391--OrderID.
392--going crazy
Object--value.
392--OrderID.
392--going crazy



Ben Ramsey [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Ben Ramsey wrote:
  Victor C. wrote:
 
  $OrderObject =$this-orders[$OrderID=$value];
 
 
  This line is confusing. $OrderID=$value is either a typo or is just
  plain wrong. It looks like what it's meant to say is:
 
  $OrderObject = $this-orders[$OrderID];
 
  But this will just set $OrderObject equal to $value, so you should just
  use:
 
  $OrderObject = $value;
 
  Try that and see if it works.
 

 Nevermind. I read that wrong. $this-orders is an array of objects, like
 you said, which I glanced over too quickly.

 My statement above still holds, though. $this-orders[$OrderID=$value]
 still appears to be a typo to me. It might supposed to be:

 $OrderObject = $this-orders[$OrderID]

 which will return the order object at $OrderID location in the array
 ($OrderID being

[PHP] Re: php array question

2004-11-01 Thread Victor C.
Hi Ben,
I tried your portion of code and find out what was wrong... Apparently I
used  in adding order to the array and that was messing things up...
Everything is working now.
Thanks for all the help


Victor C. [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I did a print_r(array_values)before calling the codes that had errors
in
 it.. the following content is contained in $this-orders;

 Array ( [0] = order Object ( [UserObject] = user Object ( [UserID] =
 E2401 [Pass] = [IsValid] = 1 [UserType] = AT [fonthtml] = [footerfile]
 = resources/footer.php [headerfile] = resources/header.php [Email] =
 [EMAIL PROTECTED] [FirstName] = Dennis [LastName] = 5
 [Salutation] = [Phone] = 123-456-7890 [Fax] = 321-123-4567 [Address1]
=
 555 Testing Avenue [Address2] = Test 200 [City] = Orlando [State] = FL
 [Zip] = 12345 [DisplayName] = 52II Rfc [Region] = WEST [OSJ] = 1
 [Series7] = 1 [OSJAddress1] = Changed 9:55 Am [OSJAddress2] = [OSJCity]
 = Des Moines [OSJState] = IA [OSJZip] =  [OSJPhone] = 43143431214
 [existsindb] = 1 [firsttime] = 1 ) [OrderID] = 392 [CartID] = 90
 [TemplateID] = 1 [UserID] = E2401 [completed] = 1 [ordername] = 4312
 [existsindb] = 1 [cost] = 3665.2 [totalcopies] = [directmailquantity]
=
 [directshippingmethod] = [overprintquantity] = 4312
 [overprintshippingmethod] = [rushoption] = Standard [dl1000instancefile]
 =
 0|C:/Inetpub/wwwroot/printsite/|0|C:/Inetpub/wwwroot/printsite/|0|0|Dennis
 J. Cunningham II Rfc|Enter your company:|123-456-7890|321-123-4567|Changed
 9:55 Am, Des Moines, IA,

|C:/Inetpub/wwwroot/printsite/|FALL|2004|C:/Inetpub/wwwroot/printsite/ae
 gonresources/stockimages/highres/ISI_logo.jpg|Securities offered through
 InterSecurities, Inc. Member NASD, SIPC and Registered Investment
 Advisor|Changed 9:55 Am, Des Moines, IA,
|C:/Inetpub/wwwroot/printsite/
 [flashvars] = 0||0||0|0|341431|Enter your
 company:|123-456-7890|321-123-4567|Changed 9:55 Am, Des Moines, IA,

||FALL|2004|http://69.44.155.247/printsite/aegonresources/stockimages/lo
 wres/ISI_logo.jpg|Securities offered through InterSecurities, Inc. Member
 NASD, SIPC and Registered Investment Advisor|Changed 9:55 Am, Des Moines,
 IA, | [dbname] = [dbpath] = [age] = [zip] = [gender] = [income]
=
 [home] = [homevalue] = [length] = [children] = [childrenAge] =
 [marital] = [networth] = [stock] = [listquantity] = )

 [1] = order Object ( [UserObject] = user Object ( [UserID] = E2401
[Pass]
 = [IsValid] = 1 [UserType] = AT [fonthtml] = [footerfile] =
 resources/footer.php [headerfile] = resources/header.php [Email] =
 [EMAIL PROTECTED] [FirstName] = Dennis [LastName] = Cunningham
 [Salutation] = [Phone] = 123-456-7890 [Fax] = 321-123-4567 [Address1]
=
 555 Testing Avenue [Address2] = Test 200 [City] = Orlando [State] = FL
 [Zip] = 12345 [DisplayName] = Dennis J. Cunningham II Rfc [Region] =
WEST
 [OSJ] = 1 [Series7] = 1 [OSJAddress1] = Changed 9:55 Am [OSJAddress2]
=
 [OSJCity] = Des Moines [OSJState] = IA [OSJZip] =  [OSJPhone] =
 43143431214 [existsindb] = 1 [firsttime] = 1 ) [OrderID] = 392 [CartID]
 = 90 [TemplateID] = 1 [UserID] = E2401 [completed] = 1 [ordername] =
 4312 [existsindb] = 1 [cost] = 3665.2 [totalcopies] =
 [directmailquantity] = [directshippingmethod] = [overprintquantity] =
 4312 [overprintshippingmethod] = [rushoption] = Standard
 [dl1000instancefile] =
 0|C:/Inetpub/wwwroot/printsite/|0|C:/Inetpub/wwwroot/printsite/|0|0|Dennis
 J. Cunningham II Rfc|Enter your company:|123-456-7890|321-123-4567|Changed
 9:55 Am, Des Moines, IA,

|C:/Inetpub/wwwroot/printsite/|FALL|2004|C:/Inetpub/wwwroot/printsite/ae
 gonresources/stockimages/highres/ISI_logo.jpg|Securities offered through
 InterSecurities, Inc. Member NASD, SIPC and Registered Investment
 Advisor|Changed 9:55 Am, Des Moines, IA,
|C:/Inetpub/wwwroot/printsite/
 [flashvars] = 0||0||0|0|432141 II Rfc|Enter your
 company:|123-456-7890|321-123-4567|Changed 9:55 Am, Des Moines, IA,

||FALL|2004|http://69.44.155.247/printsite/aegonresources/stockimages/lo
 wres/ISI_logo.jpg|Securities offered through InterSecurities, Inc. Member
 NASD, SIPC and Registered Investment Advisor|Changed 9:55 Am, Des Moines,
 IA, | [dbname] = [dbpath] = [age] = [zip] = [gender] = [income]
=
 [home] = [homevalue] = [length] = [children] = [childrenAge] =
 [marital] = [networth] = [stock] = [listquantity] = ) )
1Object--value.


 391--OrderID.
 392--going crazy
 Object--value.
 392--OrderID.
 392--going crazy



 Ben Ramsey [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Ben Ramsey wrote:
   Victor C. wrote:
  
   $OrderObject =$this-orders[$OrderID=$value];
  
  
   This line is confusing. $OrderID=$value is either a typo or is just
   plain wrong. It looks like what it's meant to say is:
  
   $OrderObject = $this-orders[$OrderID];
  
   But this will just set $OrderObject equal to $value, so you should
just
   use:
  
   $OrderObject = $value;
  
   Try that and see if it works.
  
 
  Nevermind. I read

[PHP] page redirect question

2004-11-09 Thread Victor C.
Hi,

Is there anyway to redirect php page other than using
HEADER(LOCATION:URL) ?
Header can only be called if nothing is written to HTML... Is there anyway
around it?

Thanks,

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



[PHP] PHP5, XPath and count()

2004-07-20 Thread Victor Boivie
Assume an XML file that looks like:
catalog
 cd
  ..
 /cd
 cd
  ..
 /cd
 ..
/catalog
... and that I would like to know the number of CDs. An xpath expression 
would look like count(/catalog/cd), but how do I run this expression?

$dom = new DOMDocument();
$dom-load(catalog.xml);
$xpath = new DOMXpath($dom);
var_dump($xpath-query(count(/catalog/cd)-item(0));
... returns NULL.
Any ideas?
Thanks in advance,
Victor
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP5, XPath and count()

2004-07-24 Thread Victor Boivie
Christian Stocker wrote:
var_dump($xpath-query(count(/catalog/cd)-item(0));

this doesn't work yet in DOM. The returned value has to be a nodeset.
Will be fixed some day ;)
Thanks, both Jason and Christian
I found something else that I think is strange.
  $dom = new DOMDocument();
  $root = $dom-createElement(test);
  $dom-appendChild($root);
  $node = $dom-createElement(foo, which entities idoes/i it 
escape  which doesn't it?);
  $root-appendChild($node);

  echo $dom-saveXML();
The result will be:
?xml version=1.0?
testfoowhich entities lt;igt;doeslt;/igt; it escape /foo/test
It stops at the , which I think is strange. It escapes the  to lt; 
and  to gt;, but not  to amp;. It would be better if it escaped none 
or all entites that can do harm.

Or what do you think?
regards,
Victor
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] syntax questoin

2004-09-16 Thread Victor C.
Hi,
I just started with PHP.  (I used to work on ASP a lot)

What does  the syntax .= do?

i see a line of code that says

$Msg .= Test is complete

I'm thinking it means concatenate $Msg with Test is complete and then
store the new string into $Msg

Am I right?

Thanks.

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



[PHP] php, mySQL query character problem

2004-09-22 Thread Victor C.
Hi,

I have a query to mysql basically saying:

 $query = select * from table1 where colum1 like '$email%';
//where $email is defined string.

When i  echo $query,  I get  the string : select * from table 1
where colum1 like 'testdata%'

If i copy paste the string into phpMyAdmin SQL, the query executes
successfully and returns one record.

However, when I just do$returnValue = QueryDatabase($query);
  echo
mysql_num_rows($returnValue);
I always get 0 for the # of records.

Does anyone know what causes this?

Also... the value i have for $email is from:
$email=explode(@,$emailAddress);

$email=$email[0];


Thanks,
Victor C.

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

2002-04-21 Thread Victor Javier Martinez Lopez

Thanks everyone for your help.





[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




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




[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] 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] 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] 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] 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] 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] 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] 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] 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] Getting LDAPS to work

2001-02-20 Thread Victor V . Evtushenko

* John Hallam [EMAIL PROTECTED] [010215 17:58]:
 I have got php 4.0.4p1 configured with openssl 0.9.6
 and ldap and I'm trying to get an ldap_connect to work
 over ldaps as described in the ldap_connect
 documentation.
 
 I have no problem connecting using
 ldap_connect(hostname) format but I do have a problem
 with the URL format. This is what I am doing :-
 
 $Host='ldaps://hostname/';
 $ds=ldap_connect($Host);
 
 What is wrong ?? any ideas ??
 
Why don't you try 
$ds = ldap_connect("hostname", 689);
where 689 is port number for SSL connection? If you use another port
number, you should change 689 to whatever you use.

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] Impossible to list attributes of xml-element?

2005-05-26 Thread Victor Spång Arthursson

Ciao!

I'm selecting an element in the xml using xpath. I know there is only  
one element matching the xpath-query, but still I get the result as a  
list. Nevermind.


This list is of the type domnodelist, on which only one action is  
allowed:  item()


Selecting [xpath-result]-item(0) gives me the only element in the  
result in the form of a domelement. This domelement should have a lot  
of attributes, but I cant find no way to get some kind of list over  
those attributes, to work further with.


Could someone please point me in the same direction?

Sincerely

Victor

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



[PHP] DOM: browse childnodes but not recursively

2005-05-27 Thread Victor Spång Arthursson

Ciao!

I really hope someone can help me on this, since I have been putting  
in to much time in it now, and I have to show off some results ;)


The problem is that I can't browse nodelists in only one dimension,  
that is, whitout getting the sub-nodes of the nodes.


My XML reads:

element id=5
element id=51Still got the blues/element
element id=52Gary Moore/element
element id=53
element id=9
element id=531Maggie May/element
element id=532Rod Stewart/element
element id=533UK/element
element id=534Pickwick/element
element id=5358.50/element
element id=5361990/element
/element
   /element
element id=54Virgin records/element
element id=5510.20/element
element id=561990/element
/element

I get this as a DOMNodeList in the variable $elements. I will write  
some examples, to describe my problem.


echo $elements-length;
// outputs 1

var_dump($elements);
// outputs object(DOMNodeList)#5 (0) { }

var_dump($elements-item(0)); // contents of element with id=5
// outputs object(DOMElement)#4 (0) { }

Here I come to the problem. What I want is to get a list of the 6  
elements inside element id=5, but not with child-childs.


echo $elements-item(0)-childNodes-length;
// Outputs 13!

So, to put it in short words; how do I do to browse the content of  
the element id=5 withuot doing it recursively? I want to receive a  
list when I call childNodes (or equivalent) that gives me the  
elements with id 51-56, and a length of 6.


Really really thankful for any input on the matter

Sincerely

Victor

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



Re: [PHP] DOM: browse childnodes but not recursively

2005-05-30 Thread Victor Spång Arthursson


28 maj 2005 kl. 19.32 skrev Jared Williams:

childNodes contains the textnodes too, in this case the whitespace  
between each of element.




So, to put it in short words; how do I do to browse the
content of the element id=5 withuot doing it recursively? I
want to receive a list when I call childNodes (or equivalent)
that gives me the elements with id 51-56, and a length of 6.




for($child = $elements-item(0)-firstChild; $child; $child =  
$child-nextSibling)

if ($child-nodeType == XML_ELEMENT_NODE)
echo $child-getAttribute('id'), \n;


Thanks for the answer!

It doesn't really work in my case, since I'm trying to create a  
recursive function according the following:


1. I perform a search using xPath and get a search result as a  
DOMNodeList.


2. This list I send to a function that takes it as input, and whats  
function is to create a multidimensional array.


3. Foreach item in the list I check if it has any children.

4. If so, I do the recursive call, with the list of children as input.

So far so good, but when I come to the second loop, when the input is  
the list from the childNodes, everything stops working...


Sincerely

Victor


[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




[PHP] Strange session-problem with php-file in img src

2003-01-31 Thread Victor Spång Arthursson
Hi everyone!

I'm having a severe session problem. I'm having a file called 
createjpg.php that creates a jpg-image and returns it as a picture, 
with the correct header. This file is included on another php-file like 
this:

img src=createjpg.php?id=xyz

What I need the file createjpg.php to do is to check wether or not the 
user is logged in and if she is so, she should be able to see some 
other picture or something that will be processed in the file 
createjpg.php when it executes.

The problem is that since the file createjpg.php is'nt loaded in the 
browser as and ordinary file, it doesnt recognizes the session 
variable… I think it's because that the web server loads it or 
something like that and it does not know that a session variable 
belongs to the user who loaded the file with the img scr on…

Please, help! How can I overcome this?

Best regards,

Victor

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



Re: [PHP] Strange_session-problem_with_php-file_in_img_src…

2003-01-31 Thread Victor Spång Arthursson

fredagen den 31 januari 2003 kl 18.08 skrev Chris Shiflett:


Instead of trying to tell us what the problem is, just
explain what trouble you are having. We can then tell *you*
what the problem is.


Ok, first I have the function

	session_start();

	function return_session_raettighet($session = null)
	{
		if ( isset($session) )
		{
			return $session;
		}
		else
		{
			return 0;
		}
	}

I ask this function to return the value of a specifik session, that is, 
if the user is logged in the value is at least 10.

Then I perform

	if(return_session_raettighet($HTTP_SESSION_VARS[session_raettighet]) 
 10)
	{
		ImageAlphaBlending($img_des, true);
		$im_copy = imagecreatefrompng(const_picture_dir . /copyright.png);
		$copy_imgsize = GetImageSize(const_picture_dir . /copyright.png);
		$copyxloc = (($imgwidth + (2*$kant))/2)-($copy_imgsize[0]/2);
		$copyyloc = (($imgheight + (2*$kant))/2)-($copy_imgsize[1]/2);
		imagecopy($img_des, 
$im_copy,$copyxloc,$copyyloc,0,0,$copy_imgsize[0], $copy_imgsize[1]);
	}

this means, that if the user is not logged in, a copyright © sign will 
appear over the image.

And this fails… Don't know why because the same code works on other 
pages…

Sincerely

Victorr


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



Re: [PHP] Strange_session-problem_with_php-file_in_img_src…

2003-02-01 Thread Victor Spång Arthursson

fredagen den 31 januari 2003 kl 18.08 skrev Chris Shiflett:



Instead of trying to tell us what the problem is, just
explain what trouble you are having. We can then tell *you*
what the problem is.


Could the problem have something to do with the fact that the function 
that returns the value of the session is called from within another 
function, and that it's defined outside this function?

Sincerely

Victor


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



Re: [PHP] Strange_session-problem_with_php-file_in_img_src…

2003-02-01 Thread Victor Spång Arthursson
Problem solved. The error came because I was calling the function 
inside another function, outside the latter it worked good. So I simply 
passed the variable with the second function - works great!

Thanks anyway for all your time trying to help me!

/V


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



[PHP] Start php-script with exec()?

2003-09-22 Thread Victor Spång Arthursson
Is it possible?

I have a file that takes 5 minutes to run, and I would like to be able 
to start it when loading a page. But I can't include it because it 
forces the browser to timeout

exec(script.php) doesn't seem to work

Sincerely

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


Re: [PHP] Start php-script with exec()?

2003-09-22 Thread Victor Spång Arthursson
måndagen den 22 september 2003 kl 14.31 skrev Jay Blanchard:

exec(php script.php); will run the script.
How does this look on a OSX/UNIX system? Can the path to php be found 
in a system variable, for convinience and portability of the script?

Sincerely

Victor

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


Re: [PHP] Start php-script with exec()?

2003-09-22 Thread Victor Spång Arthursson
måndagen den 22 september 2003 kl 14.52 skrev Jay Blanchard:

As usual for *nix type 'which php' which will return the path to the 
PHP executable. For portability you could then do something to the 
effect of (not tested)
which() doesn't resolve the path, but I found out it was 
/usr/local/php/bin/php.

But how do I make the call

		exec(/usr/local/php/bin/php process1.php);

so that the page from which the call is made doesnt wait for the result 
but instead just continues?

Sincerely,

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


Re: [PHP] Start php-script with exec()?

2003-09-22 Thread Victor Spång Arthursson
mndagen den 22 september 2003 kl 15.04 skrev Jay Blanchard:

use  (not tested, but runs other processes as background processes)

		exec(/usr/local/php/bin/php process1.php );
Think that works as well; my solution was  /dev/null 

Now the big question is if I will get it to work on a windows-server 
using exec(php script.php args NUL) ;)

Sincerely

Victor

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


Re: [PHP] Start php-script with exec()?

2003-09-22 Thread Victor Spång Arthursson
Ok, it works fine on my development server with Mac OS X. But the 
hosting server seems to be WinNT, and on this it doesnt work.

Anyone who can help me with some standard paths to php.exe? c:\php\ 
Doesnt work ;)

Sincerely

Victor

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


Re: [PHP] Start php-script with exec()?

2003-09-22 Thread Victor Spång Arthursson
måndagen den 22 september 2003 kl 16.11 skrev Marek Kilimajer:

Ask your hosting company. Are you sure they will allow you to execute 
commands? Check phpinfo - safe mode and disabled functions.
Asked them and they told it was a mistake we had php on the server - 
according to them it was either php OR asp. I quickly thanked and hung 
up.

So now the question stands to you folks on this list ;)

Sincerely

Victor

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


[PHP] Best way to create a preference-file?

2003-02-13 Thread Victor Spång Arthursson
I would like to create a file that holds the preferences for a site, 
for example the name of the database, the size of thumbnail pictures 
etc… But which is the best way to do this and to access the file?

It would be nice with an xml-file, but perhaps it is an overkill… 
Anyway it must be possible to update the file in an easy way, that is, 
not rewrite it but update it…

Sincerely

Victor

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



[PHP] Is this possible? Group related results from mysql to one field

2003-03-06 Thread Victor Spång Arthursson
Hi!

Perhaps this is a little bit of topic, but if it's not possible to fix 
directly when the result is returning from mysql I need some tips on an 
intelligent solution...

This is the problem: I'm searching the database for files and i get 
some results. In the sql I have a LIMIT to split the result up. Every 
file can have none, one or several categories associated with it. This 
is done by having an extra table between the table with the references 
to the files and the table with the categories. What I want to do is to 
get all categories associated with an file concatenated and returned in 
_one_ field together with the other data. Look below for visualisation.

I'm having this main table with references to files in it:

files
+-+-+
 |  id  |   filename   |
+-+-+
 |168 |v008-12.jpg|
+-+-+
Then I have this table to relate one file to one or several categories:

relatedtable
+-++--+
 |id   |   fromid   |   toid   |
+-++--+
 |4|   1   | 2 |
 |  257  |   2   | 2 |
+-++--+
Which lies in this table for categories:

categories
++--+
 |  id   |   categoryname   | stickword
++--+
 |   5   |   demonstrations |
 |   6   |people   |
++--+
The following sql:

SELECT DISTINCT
files.id, files.filename, categories.categoryname
FROM
files
LEFT JOIN
relatedtable
ON
files.id = relateratabell.fromid
LEFT JOIN
kategorier
ON
relatedtable.toid = categories.id
WHERE
(relatedtable.fromid IS NULL OR relatedtable.fromid IS NOT NULL)
AND
   files.stickword LIKE '%basta%' //for example
ORDER BY
filename;
Gives the following result:

+---+---+--+
 |  id  | filename |   categoryname|
+---+---+--+
 | 166| v007-86.jpg | demonstrations  |
 | 166| v007-86.jpg | people   |
 | 167| v008-03.jpg | demonstrations  |
 | 167| v008-03.jpg | people  |
+---+---+--+
This is what I expected it to, but I'ld rather get a result as this one:

+---+---+--+
 |  id  | filename |   categoryname|
+---+---+--+
 | 166| v007-86.jpg | demonstrations, people|
 | 167| v008-03.jpg | demonstrations, people|
+---+---+--+
Where the categories have been collected together into the same field, 
so that I don't get multiple rows for the same file Is this possible 
to achieve?

Many many thanks to the one who can give me some input!

Sincerely

Victor

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


[PHP] php/GD/t1lib problem

2003-03-11 Thread Victor Spång Arthursson
God morning!

I'm creating a jpg in al folder locally on my webserver. There is no 
problems with this at all. But now I'm about to make some updates and 
have therefore made a copy of the folder just next to the original 
which is called something like foldercopy. But in this identical folder 
and subfolders GD/t1lib is not working anymore. It is the imagePsText 
thats failsError message:

Warning:  libt1 returned error 3 in 
/Users/user/Sites/katalogkopia/createjpg.php on line 124

What can be the problem? As far as I can see the folders and files have 
identical priviligies

Sincerely:

Victor

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


[PHP] provide flag -X when connecting to mysql

2003-10-13 Thread Victor Spång Arthursson
Using the command line client when connecting to mysql makes it 
possible to provide the flag -X to get the result as XML directly 
from mysql.

What I wonder is if its possible in some way to provide this flag via 
php to get the result as it appears in the command line client, that 
is, as xml?

Best regards from Copenhagen/Malmoe

Victor

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


Re: [PHP] provide flag -X when connecting to mysql

2003-10-13 Thread Victor Spång Arthursson

2003-10-13 kl. 16.39 skrev Marek Kilimajer:
No, it is not. But there are plenty of classes that can do it for you.
Can you recommend any?

Sincerely

Victor

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


[PHP] fetch entire mysql-result to an array immediately

2003-10-15 Thread Victor Spång Arthursson
Is that possible? The mysql_fetch_array fetches the result by one row 
each time, but I dont want to iterate through a result but only just 
fetch it right away

Regards

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


[PHP] replace special chars

2003-11-05 Thread Victor Spång Arthursson
Are there any good function to replace special characters, for example 
double qoutes, with something that are more html-safe?

For example:

option
label=Dekora Marilet Amerikano (9859)
value=98590
/option
The above is generated with PHP and fetched from a database 
(postgresql). I'ld like to have the double qoutes replaced with 
something else ;) There could be other strange characters as well 
that needs to be replaced, so some sort of universal function would be 
really nice to get tips on ;)

Sincerely

Victor

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


Re: [PHP] replace special chars

2003-11-05 Thread Victor Spång Arthursson

2003-11-05 kl. 16.07 skrev Pavel Jartsev:
Try htmlspecialchars() and/or htmlentities().
htmlentities() did it best!

Thanks,

/.v

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


[PHP] XML and PHP

2003-11-06 Thread Victor Spång Arthursson
Hi!

I've been looking at the XML-parserfunctions in the manual, and they 
seems nice enough.

But I'm currently in a project where there is need to read from, write 
to and edit in XML-files, in some smart way. Our ISP is supporting the 
following:

xml

XML Support
active
XML Namespace Support
active
EXPAT Version
1.95.6
I suppose the answer to my questions lies in the expath-part, but where 
do I start, where can I read more about the above expat and which is 
the best approach for me in this project? We're going to import som 
data from Navision, XML-formatted, to postgresql, and meanwhile 
documents are edited they are, until finished, going to be saved as 
xml-documents on the server.

Sincerely

Victor

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


Re: [PHP] Re: XML and PHP

2003-11-06 Thread Victor Spång Arthursson
2003-11-06 kl. 13.42 skrev pete M:

http://www.zend.com/zend/art/parsing.php
http://www.zend.com/zend/tut/tutbarlach.php
in fact a google search for php,xml, expat, tutorial
Well, interesting articles but not really what I was searching for. I'm 
rather looking for something like the parser in Flash, which can open 
nodes like parent.nextsiebling.nextsibling

Anyone have an idea?

Sincerely

Victor

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


[PHP] easy and simple way to read xml into array

2003-11-17 Thread Victor Spång Arthursson
Hi!

Need to read a xml-file into an array, but searching around I havent 
found a way that's easy and simple Arent there an easy way in PHP to 
accomplish this?

Sincerely

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


Re: [PHP] easy and simple way to read xml into array

2003-11-18 Thread Victor Spång Arthursson
2003-11-17 kl. 17.06 skrev Chris Hayes:

Need to read a xml-file into an array, but searching around I havent 
found a way that's easy and simple Arent there an easy way in PHP to 
accomplish this?
have you been at http://se.php.net/xml ?
Well, I've, and I also have to say that the XML-support in PHP lacks 
any usability

2 pages code later I still cannot get it to work, and the manual is 
pretty thin on this chapter...

For example, I've the following XML:

		ingrediens
			ingrediensnummer1234/ingrediensnummer
			maengde3,4/maengde
			enhedkg/enhed
		/ingrediens

Here I thought that the startelementfunction should be called upon 
every start tag, the character_data_handler on every text string and 
the endelement function on every endelement.

But what seems to happen is that the character data handler is called 
to randomly number of times, and if I output the current element every 
time it gets called I get the following output for the xml above:

ingrediens
ingrediens
ingrediens
ingrediensnummer
ingrediensnummer
ingrediensnummer
ingrediensnummer
maengde
maengde
maengde
maengde
enhed
enhed
enhed
enhed
enhed
enhed
What I expected to get was:

ingrediensnummer
maengde
enhed
So, couldnt anyone please bring some clarity into this matter?

Sincerely

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


[PHP] include-problem

2003-12-01 Thread Victor Spång Arthursson
Hi!

I'm having a problem with including files. What I want to achieve is to 
execute a PHP-script on another server, and then to include the result 
(which will be XML-output) in another PHP-script (currently on my local 
computer).

On the server I have the file http://server.com/test/echo.php with the 
content

---
?php
echo 'xyz';
?
---
Locally I've a file with the following content:

---
?php
echo !!!;
include (http://server.com/test/echo.php;);
echo ???;
?
---
I was expecting the output from my locally testfile to be something 
like:

---
!!!???
---
but rather it is

---
!!!xyz???
---
I've also tried with a $fp = readfile(http) with the same result, 
which is output of the echo-statement in the remote file which I am 
expecting to be evaluated remotely.

How can I do to include the PHP-script and have it to be ran before it 
is included?

Sincerely

Victor

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


[PHP] XML, strings and foreign (swedish/danish) characters

2003-12-02 Thread Victor Spång Arthursson
I'm on the point of almost giving up trying to get XML and PHP to sing 
along, but I'll throw out a question here first.

I'm having severe problems getting PHP and XML to work with XML-files 
that contains foreign characters. Doesnt matter if i type the foreign 
characters in by myself hardcoded in the PHP-script, or if I get them 
from external XML-files, or if I get them directly from the database.

utf8_encode() helps a bit, in the way that it makes the script work at 
least, but instead of the string mngde PHP outputs mngde

Is there any way to get XML to work together with PHP, or should I 
simply resign and try with ASP instead?

Very thankful for any help that points in the right direction

Sincerely

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


[PHP] Re: XML, strings and foreign (swedish/danish) characters

2003-12-03 Thread Victor Spång Arthursson
2003-12-02 kl. 12.23 skrev Manuel Lemos:

You just need to use the proper input/output encodings.
Doesn't work at all

The code

// Prepare the content of the xml-file to go to the xsl-parser
$xml = str_replace(?, chr(63), $contents);
$xml = str_replace(empty/, $kurt, $xml);
$xml = trim($xml);
$xml = utf8_encode($xml);
echo $xml;

makes the string
?xml version=1.0 encoding=utf-8?

become

?xml version=1.0 encoding=utf-8?

And the crap in fron of the string, which seems to come from nowhere, 
makes the parser complain about not well formed markup in the 
xml-source

Regards,

Victor

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


Re: [PHP] Re: XML, strings and foreign (swedish/danish) characters

2003-12-03 Thread Victor Spång Arthursson
2003-12-02 kl. 22.08 skrev Manuel Lemos:

The code
// Prepare the content of the xml-file to go to the xsl-parser
$xml = str_replace(empty/, $tempxml, $xml);
$xml = trim($xml);
$xml = utf8_encode($xml);
echo $xml;
makes the string
?xml version=1.0 encoding=utf-8?
become
?xml version=1.0 encoding=utf-8?
And the crap in fron of the string, which seems to come from nowhere, 
makes the parser complain about not well formed markup in the 
xml-source
I think it does not make any sense to do what you are doing. You 
should only encode XML data or attribute values. You should not encode 
the whole XML document.
Well, I have some xml in which I want to place som new xml-data, just 
for the specific output, which I does by replacing an empty dummy-tag.

After this, I want to send the xml to the parser.

Anyway, if you try this class, you can see that it generates correct 
XML code in UTF or even ISO-8859-1.
Well, but I don't want to download and evaluate classes, especially 
since they tend to be big and I just want to be able to do this with 
the few lines of code that should be enought

Should it really be this troublesome working with XML from PHP?

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


Re: [PHP] Re: XML, strings and foreign (swedish/danish) characters

2003-12-03 Thread Victor Spång Arthursson
2003-12-03 kl. 10.22 skrev Victor Spng Arthursson:

makes the string

?xml version=1.0 encoding=utf-8?

become

?xml version=1.0 encoding=utf-8?
Temporarely solved the problem using substring to trim the crap-chars 
away, but I'ld prefer to solve it in a more beautiful way, but perhaps 
this behaviour is a bug and therefore not possible to solve in any 
other way

Sincerely

Victor

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


Re: [PHP] Re: XML, strings and foreign (swedish/danish) characters

2003-12-04 Thread Victor Spång Arthursson
2003-12-03 kl. 11.18 skrev Victor Spng Arthursson:

Temporarely solved the problem using substring to trim the crap-chars 
away, but I'ld prefer to solve it in a more beautiful way, but perhaps 
this behaviour is a bug and therefore not possible to solve in any 
other way
But do we think it works when uploaded to the production server? No It 
runs php on Wintendo though, but shouldn't make any difference - 
should it?

2 days just to apply a xsl-stylesheet on a xml file!? :(

If anyone successfully has succeeded doing this, please give me some 
hints.

Sincerely

Victor

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


Re: [PHP] Re: XML, strings and foreign (swedish/danish) characters

2003-12-04 Thread Victor Spång Arthursson
Here is the error message, that the code produces:

http://tosti.dk/xml/error.php

And here is a copy of the code:

http://tosti.dk/xml/error.txt

I really cant figure what is wrong, especially not since it works on 
the dev-server and the outputted xml is valid, at least as far as IE 
concerns

Sincerely

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


[PHP] Regexp help (simple)

2004-01-20 Thread Victor Spång Arthursson
Hi!

Anyone who could help me with this regexp problem?

I want to verify that a string is made up of 2-3 letters, (a-z + åäö, 
A-Z + ÅÖÄ), directly followed by 4 or 5 digits, which could, but may 
not, be followed by a minus and one or two digits.

Examples of valid strings:

abc12345
ABC12345
abc1234
ABC12345-1
ABC12345-01
I would also like to split them into an array consisting of 2 elements;

[0] = the first 2 or 3 letters
[1] = the rest
Example:

string = ab12345
[0] = ab
[1] = 12345
string = åäö1234-66
[0] = åäö
[1] = 1234-66
Lots of thanks in advance,

sincerely

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


Re: [PHP] connecting PHP to MS Access

2004-01-20 Thread Victor Spång Arthursson
Export the data you are interested in as comma separated file.

Then use the LOAD DATA INFILE - command in mysql, via the terminal or 
phpmyadmin.

From the manual:

13.1.5 LOAD DATA INFILE Syntax

LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name.txt'
[REPLACE | IGNORE]
INTO TABLE tbl_name
[FIELDS
[TERMINATED BY '\t']
[[OPTIONALLY] ENCLOSED BY '']
[ESCAPED BY '\\' ]
]
[LINES
[STARTING BY '']
[TERMINATED BY '\n']
]
[IGNORE number LINES]
[(col_name,...)]
Read more here: http://www.mysql.com/doc/en/LOAD_DATA.html

Sincerely

Victor

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


Re: [PHP] Regexp help (simple)

2004-01-21 Thread Victor Spång Arthursson
2004-01-20 kl. 10.41 skrev Dagfinn Reiersl:

[EMAIL PROTECTED] wrote:

$string = 'ab12345-1';
if (preg_match('/^([a-z]{2,3})([0-9]{4,5}(\-[0-9]{1,2}){0,1})$/i',
$string,
$m='')) {
  echo $m[1]; // - ab
  echo $m[2]; // - 12345-1
}
g. martin luethi

You can replace {0,1} with a question mark and [0-9] with \d (digit).  
Also, and I
think this is not in the PHP documentation, you can use POSIX  
character classes
inside the brackets. If you want to match alphabetical characters  
including
the Swedish and various other international ones like  or , you can  
use [:alpha:].
You may not need it in this example, but it's excellent for  
internationalized regex matching.

if (preg_match('/^([[:alpha:]]{2,3})(\d{4,5}(\-\d{1,2})?)$/i',
Have been playing around a bit with this code, but I can't get it to  
work with international characters For example, if I feed my function:

	function split_bokid($bokid)
	{
		if  
(preg_match('/^([a-z]{2,3})([0-9]{4,5}(\-[0-9]{1,2}){0,1})$/ 
i',$bokid,$m='')) {
			return $m;
		}
		else
		{
			return false;
		}
	}

returns, with the following code:

$test = split_bokid(123);
echo $test[1];
echo $test[2];
the values:

12345
So, is there any way I can set the encoding on the incoming values,  
which will come from url's and databases, so that they don't fuck up?

Sincerely,

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


Re: [PHP] Regexp help (simple)

2004-01-22 Thread Victor Spång Arthursson
2004-01-22 kl. 10.40 skrev Dagfinn Reiersl:

I assume you mean:

$test = split_bokid(12345);
Yes!

I don't know. It works fine on my computer. The letters display 
correctly on the command line and even in Mozilla.
Hmmm try the following: 
http://adversus.no-ip.com/function_split_bokid.php?bokid=12345

Sincerely:

Victor

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


[PHP] PDFlib, transparency and TIFF images

2004-02-04 Thread Victor Spång Arthursson
Hi everyone - hope there's someone good at PDFlib out there

I'm trying to use a picture, a TIFF image, with transparency, in a PDF 
created by a PHP-script...

The manual says that only explicit transparency can be used when 
working with TIFF images, and that this operation requires two steps 
But then the manual loses me, and I don't understand what the two 
steps that seems to be required actually meens

Isn't it sufficiant to have a TIFF image with transparency, or do I 
have to have some kind of second image and use that as some kind of 
mask to acquire transparency effects? Will this, if so, require two 
image files per image instead as one?

Hope this is not OT, if so, i apologize

Sincerely

Victor Spng Arthursson
Sweden / Denmark
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Major problems trying to use load data local infile

2004-02-24 Thread Victor Spång Arthursson
Hi!

Been trying all day to be able to fire off a load data local infile 
using php, but haven't yet succeded

The setup is as follows: the client should upload a .csv-file to the 
webserver. Here, php shall issue a load data local infile-statement to 
load the data into a mysql-database.

The database, on the other hand, is located on another server, which is 
the reason to do a local insert

So far I haven't managed to get it to work, other than from the 
terminal mysql client.

My SQL is as follows (works in the client, locally, when I connect to 
the remote server):

LOAD DATA LOCAL INFILE 
'd:\\home\\host\\www\\test\\ejerskifte\\output.txt' INTO TABLE table 
FIELDS TERMINATED BY '\\t' ESCAPED BY '\\' LINES TERMINATED BY '\r'

PHP-code:

?php
include(includes/settings.php);
include(includes/db_connect_and_choose.php);
$strSQL = LOAD DATA LOCAL INFILE ' . 
addslashes(realpath(output.txt)) . ' INTO TABLE table FIELDS 
TERMINATED BY ' .addslashes('\t') . ' ESCAPED BY '\\' LINES 
TERMINATED BY ' . '\r' . ';
echo $strSQL;
mysql_query($strSQL) or die (mysql_error());
?

Would be very thankful if anyone had any input on this,

sincerely

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


[PHP] function for backing up mysql

2004-04-14 Thread Victor Spång Arthursson
Hi!

Wonder if anyone knows if there somewhere out there are any good 
functions that streams out data from mysql as a sql-file, like 
phpmyadmin does?

The best would be one which I told which database and which tables to 
dump, and which directly stared streaming the data

Sincerely

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


Re: [PHP] function for backing up mysql

2004-04-14 Thread Victor Spång Arthursson

2004-04-14 kl. 09.57 skrev Hawkes, Richard:
PhpMyAdmin (www.phpmyadmin.net) is a great MySQL admin tool, and 
utilises the MySQL backup functions.
Yes, and it is the same functionability I want. But I want a 
php-function to implement in various scripts I have, and since I 
probably aint the first to want this, I thought that there perhaps were 
some good scripts out there to use.

Sincerely

Victor

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


Re: [PHP] function for backing up mysql

2004-04-14 Thread Victor Spång Arthursson
2004-04-14 kl. 11.26 skrev Burhan Khalid:

Just redirect the output from mysqldump.

mysqldump -u username -ppassword database  dump.sql

and then send that dump.sql file. Or, you can just read the output 
from the mysqldump command directly, using output buffering to make 
sure your script doesn't just stall (if its a big database).
But the database is on a hotel to which I have no remote access to 
mysql My client want to be able to click a link and get a backup 
file in return

Is it possible to redirect the output from mysqldump using only php, 
and with no command line access?

Sincerely

Victor

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


[PHP] strange urlencode/decode problem

2004-04-21 Thread Victor Spång Arthursson
Perhaps I'm tired, perhaps I've missed something obvious, but I can't 
get this simple thing which I practically does every week to work

Ok, here is what I do:

?php

$foo = urlencode(Delete from whatever where ditten = 'datten');
echo 'a href=foo.php?strSQL=' . $foo . 'Click here to test/a';
?

I sidan foo.php skriver jag:

?php

echo urldecode($_GET[strSQL]);

?

and gets the result:

Delete from whatever where ditten = \'datten\'

The question is why PHP escapes the single qoutes? This has never 
happened to me before, except if I have been using addslashes() or 
similiar functions

And they occur even if I don't urlencode at all

Why!?!?!?!?

Sincerely

Victor Spng Arthursson - Copenhagen

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


[PHP] Alternative to freetype?

2004-06-03 Thread Victor Spång Arthursson
Hi!
Since it's almost impossible to find a web server which has freetype 
installed, I wonder which the alternatives are to put text on an 
image?

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


[PHP] Resize an image with transparency

2004-06-28 Thread Victor Spång Arthursson
Hi!
I'm having big GD-problems
I want to open, resize and output a png-file with transparency.
Ad I have undestood it, the steps to follow is:
* open the image
* read the size
* create new image
* copy the image resized/resampled to the new image
* output the new image
But the problem that occurs is that the new image is not transparent, 
even though I specify

ImageAlphaBlending($img_des,true);
The only way I've succeeded to make the background transparent is to 
fill the image with a color and explicitly tell GD that that color 
(black for example) is transparent. But then all black pixels in the 
finished image, the one for output, become transparent as well, which 
is not what I want

So, please, deadline before vacation, help if you know!
Sincerely
Victor Spng Arthursson / Denmark-Sweden
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Want to save png to file

2004-07-06 Thread Victor Spång Arthursson
Hi!
Creating a transparent png using GD and PHP is (almost) no problem, but 
it's impossible to save

No matter what I try, the saved image wont remember that it's 
transparent. I suspect the reason it works on the fly is because I 
manually set the header to image/png, but if I try so save the stream 
to a file, the transparency disappears

Please please please somebody help!
Sincerely
Victor
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Want to save png to file

2004-07-16 Thread Victor Spång Arthursson

2004-07-08 kl. 06.25 skrev Wudi:
int imagepng ( resource image [, string filename])
Back on track again!
What I don't know is how to save the file - do I read the datastream 
from imagepng and then create a file and write the stream to it?

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


Re: [PHP] Want to save png to file

2004-07-19 Thread Victor Spång Arthursson
2004-07-16 kl. 15.12 skrev Jason Wong:
If you already have an image resource then calling imagepng() with a 
filename
will create and write the file for you.
Thanks!
Now my only problem is that it doesn't seem possible to use 
imagecopyresized() with a transparent png; it doesn't become 
transparent

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


[PHP] resize transparent png - impossible?

2004-07-19 Thread Victor Spång Arthursson
Hi everybody!
Is it really impossible to resize a transparent png? I've tried 
everything, but can't get the transparency (in the outputted image) to 
work either in Photoshop or in Internet Explorer (using filter)

Does anyone have some feedback on this, or is it a known bug in GD?
Sincerely
Victor
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Transparent png and TrueColor?

2004-07-19 Thread Victor Spång Arthursson
Seems like the problem I'm experiencing with transparent png-files are 
that they are in TrueColor - is it not possible to create a 
trueColor-file and make it transparent?

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


<    1   2   3   >