[PHP] How to completly remove a file?

2001-03-07 Thread Jan Grafström

Hi!
When I run this PHP my file idb.xml returns empty but how do I do if I
then whant to remove the  file idb.xml. I just doesnt want it empty, I
want it to disappeare.?
?
$fp = fopen("idb.xml", "w");
fclose ($fp);
?
Thanks for help.
Jan


-- 
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] Can You get a file unlinked after one month?

2001-03-25 Thread Jan Grafström

Hi!
I wonder if it is possible to delete a file using unlink and a time
function.
I wont the file to be automtically unlinked after a month.

I am very thankful for any help.

Regards
Jan Grafstrom


-- 
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] login without database

2001-03-30 Thread Jan Grafström

Hi!
Can I use php to make a login system for users? I dont have a databas
on my server. I only want to have a few users. When I send variables to
php the string is always cached by IE5.5 and its very easy to se the
username and password if you look i cache. Is there a way to get this
done only on the server?


-- 
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] login without database

2001-03-30 Thread Jan Grafström

Thank You Romeo!
This may be something I can use.
Regards
Jan

Romeo Manzur wrote:

 You can do this:
 require('acces.inc.php');
 if ( (!isset($PHP_AUTH_USER)) || ! (($PHP_AUTH_USER == $st_LOGIN)  (
 $PHP_AUTH_PW == "$st_PASSWORD" )) ) {
   header("WWW-Authenticate: Basic entrer=\"Admin Basta\"");
   header("HTTP/1.0 401 Unauthorized");
   echo "Access in-autorizado...";
   exit;
 }

 where access.inc.php has the variables $st_LOGIN and st_PASSWORDS for
 authenticate you login, you have to put this code before the html tag...
 luck...

 Jan Grafstrm wrote:

  Hi!
  Can I use php to make a login system for users? I dont have a databas
  on my server. I only want to have a few users. When I send variables to
  php the string is always cached by IE5.5 and its very easy to se the
  username and password if you look i cache. Is there a way to get this
  done only on the server?
 
  --
  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]

 --
 --
 Romeo Manzur
 Web Application Developer
 iSilicom
 Av. 27 de Febrero 904-A Desp 1, Centro
 C.P.:86000
 Villahermosa, Tabasco, Mexico
 Tel.:(52)(9)3-12-4790
 --

 --
 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] How to send a mail in html format

2001-04-01 Thread Jan Grafström

Hi!
Can I add something in this string to get a htmlpage sent as mail?

mail($recipient,$subject,$corps,"From:
$admail\nReply-To:$admail\nX-Mailer: PHP/");
Thanks in advance.

Regards
Jan


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

2001-04-02 Thread Jan Grafström

Hi!
I am trying to learn about sessions and set up this file,

?
 session_start();
 $fillista = "fillista.xml";
 session_register("SID"."fillista");
 $SID = date("Y F j H:i:s");
 print "SID=".$SID;
?

This seams not to work on the file fillista.xml, I can still read it
afterwords in IE:s cache. How do I pass the session to a xml-file on
server?

Thanks for any help.

Regards
jan


-- 
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] Can php read and than print file like it is

2001-04-02 Thread Jan Grafström

Hi!
I have a file with text on 17 rows and when I let php read it ,get
filezise and than print I only get the first row.
I want all rows exatly like it is in the file, is it possible?
My file:
html
head
title/title
/head
body
some rows here
/body
/html

Thanks in advance for all help I can get.

Regards
Jan


-- 
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] Sessions php and flash5, cookies disabled

2001-12-25 Thread Jan Grafström

Hi!

I am trying to get my php-scripts to work using flash 5 and with cookies
disabled in the users browser.

At first I pass SID to flash and than I can call my php-scripts by passing
the SID back to PHP using loadvariables and get method, this works fine.

The problem is when I pass it to a php-page and than pass it to a second
php-script.

The url string looks like this on php-page (sent from flash5):
mypage.php3?SID=PHPSESSID=193a33f9b7421c17302d1bd58478b20b?.
From mypage.php3 I pass sid using .SID. than on second page the string is
changed to:
second.php3?SID=PHPSESSID%3D193a33f9b7421c17302d1bd58478b20bvar3=1.

= has changed to %3D. and php does not recognice the session.

part of code on mypage.php3:
form action=\http://myserver.com/second.php3?\; method=\get\
input type=\hidden\ name=\SID\ value=\.SID.\

Thanks for any help.


--
Jan Grafström
Lillemans Hus AB
Sweden
46 (0)611-60920
46 (0)70-6409073


-- 
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] Sessions php and flash5, cookies disabled

2001-12-25 Thread Jan Grafström

Thanks Brian!
There is no differens using only .SID. or .$SID.
and this line :input type=\hidden\ name=\SID\ value=\.SID.\
automatically givs this responsestring in the urlfield of your browser
(IE6):
second.php3?SID=PHPSESSID%3D193a33f9b7421c17302d1bd58478b20bvar3=1

I will try to manipulate the string

Regards,
Jan

Brian Clark [EMAIL PROTECTED] skrev i meddelandet
20011225165631.GF8638@ganymede">news:20011225165631.GF8638@ganymede...
* Jan Grafström ([EMAIL PROTECTED]) [Dec 25. 2001 10:41]:

 The url string looks like this on php-page (sent from flash5):
 mypage.php3?SID=PHPSESSID=193a33f9b7421c17302d1bd58478b20b?.
 From mypage.php3 I pass sid using .SID. than on second page the string
is
 changed to:
 second.php3?SID=PHPSESSID%3D193a33f9b7421c17302d1bd58478b20bvar3=1.

 = has changed to %3D. and php does not recognice the session.

 part of code on mypage.php3:
 form action=\http://myserver.com/second.php3?\; method=\get\
 input type=\hidden\ name=\SID\ value=\.SID.\

I'm sure you meant for that line to be:

input type=\hidden\ name=\SID\ value=\.$SID.\

Right? (note the $) Eventhough I don't think that has anything to do
with your problem.

 Thanks for any help.

Why are you using SID=PHPSESSID= instead of just SID=? If you
absolutely have to leave it the way you have it, you could always
explode('%3D',$SID); to get the correct session ID.

--
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
If your life is a hard drive, Christ can be your backup.



-- 
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] page3 will not work

2001-12-26 Thread Jan Grafström

Hi!
I am trying to get my script working on IE6 with cookies disabled by the
user.
You can turn cookies off under Properties Securitysettings.
Page2 is no problem but when going from a form and send sid as a hidden var
doesen´t work.
Is there any way to work around this?
page1.php:
?php
session_start();
$myvar1 = test;
session_register(myvar1);
?
To continue, A HREF=page2.php??=SID?click here/A
--
page2.php:
?php
session_start();
if (session_is_registered(myvar1) == FALSE) {
Header(Location: nopermission.htm);
}
?
htmlhead/headbody
form action=page3.php? method=get
input type=hidden value=?=SID? name=SIDbr//this code doesn´t
work
input type=text value= name=namnbr
input type=submit value=send
/form/body/html
--
page3.php//I can´t get the session recogniced so I always get
nopermission.htm
?php
session_start();
if (session_is_registered(myvar1) == FALSE) {
Header(Location: nopermission.htm);
}
?
htmlhead/headbody
p?echo $namn;?
/body/html

Thanks for any help.
Regards,
Jan
--
Jan Grafström
Lillemans Hus AB
Sweden
46 (0)611-60920
46 (0)70-6409073


-- 
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] Change column in mysgl

2002-01-15 Thread Jan Grafström

Hi!
Can I change this column adress VARCHAR(25)
to adress VARCHAR(40) afterwards.
I use mysql.
Thanks for any help

Regards,
Jan
--
Jan Grafström

Lillemans Hus AB

Bredsäter 2091
87010 Älandsbro
0611-60920
070-6409073


-- 
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] Create Image on the fly

2002-01-17 Thread Jan Grafström

Hi!
How do I change this if I will use the Image direct in my html-code?
Do I need to save it first.
?php
$im = @ImageCreate (240, 80)
or die (Cannot Initialize new GD image stream);
$background_color = ImageColorAllocate ($im, 255, 255, 230);
$text_color = ImageColorAllocate ($im, 0, 0, 0);
ImageString ($im, 3, 10, 20,  Some text.., $text_color);
ImagePng ($im);

//this doesn´t work
echo img src=\$im\ width=240 height=80;
?
Thanks in advance.
--
Regards
Jan Grafström

Lillemans Hus AB

Bredsäter 2091
87010 Älandsbro
0611-60920
070-6409073


-- 
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] Create Image on the fly

2002-01-17 Thread Jan Grafström

Thanks Val!
Now I understand.
Jan
Val Petruchek [EMAIL PROTECTED] skrev i meddelandet
000801c19f4a$49862950$[EMAIL PROTECTED]">news:000801c19f4a$49862950$[EMAIL PROTECTED]...

 in index.html you write
 img src=aaa.php


 in aaa.php you write

 ?php
 $im = @ImageCreate (240, 80)
or die (Cannot Initialize new GD image stream);
 $background_color = ImageColorAllocate ($im, 255, 255, 230);
 $text_color = ImageColorAllocate ($im, 0, 0, 0);
 ImageString ($im, 3, 10, 20,  Some text.., $text_color);
 ImagePng ($im);
  ?

 You have to create separate php script for creating image and then use it
in
 you html (php) file.

 
  Hi!
  How do I change this if I will use the Image direct in my html-code?
  Do I need to save it first.
  ?php
  $im = @ImageCreate (240, 80)
  or die (Cannot Initialize new GD image stream);
  $background_color = ImageColorAllocate ($im, 255, 255, 230);
  $text_color = ImageColorAllocate ($im, 0, 0, 0);
  ImageString ($im, 3, 10, 20,  Some text.., $text_color);
  ImagePng ($im);
 
  //this doesn´t work
  echo img src=\$im\ width=240 height=80;
  ?
  Thanks in advance.



 Valentin Petruchek (aki Zliy Pes)
 http://zliypes.com.ua
 mailto:[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] Protect your code

2002-01-21 Thread Jan Grafström

Hi!
Using the method to build a html-page from png s you can in a way make it
inconviniant for the user
to reuse the html-code.
The problem is that the textquality is not very good and my host doesn´t
have support for gif with fontfiles.

I wonder if there is any other way to put text on your page, something like:
$string = include (textmaker.php3?text=testword);

I am trying to build blanks for use as a memberservice and want it difficult
to reuse my code.
Any tips?

Thanks in advance

Regards,
Jan
-
filename=index.php
?
$head = img
src=\imgtext.php3?text=testtextleft=340c3=0textsize=5imheight=20\
width=750 height=20br;
echo $head;
?
---
filename=imgtext.php3
?php
$im = @ImageCreate (750, $imheight)
or die (Cannot Initialize new GD image stream);
$background_color = ImageColorAllocate ($im, 255, 255, 255);
$black = ImageColorAllocate ($im, 0, 0, $c3);
ImageString ($im, $textsize, $left, 5,  $text, $black);
ImagePng ($im);
?

--
Jan Grafström
Lillemans Hus AB

Bredsäter 2091
87010 Älandsbro
0611-60920
070-6409073


-- 
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] Store array into mysql?

2002-02-14 Thread Jan Grafström

Hi!

I have an array called $myarray and now I want to store it in a mysql table.
I tried to just, insert into mytable values('$id', '$myarray') but just got
Array when I run
while ($row = mysql_fetch_array ($result))
$myarray= $row[myarray];
echo $myarray
--
Do I need to first make a string commaseparated or like and than insert that
string?

Thanks in advance.

Regards,
Jan Grafström


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




[PHP] get out of frameset?

2002-02-25 Thread Jan Grafström

Hi!

I have build a webshop inside a framset using sessions, and move around in
my mainframe.
I wonder how to get out of the mainframe when I logg out and destroy the
session.
It doesen´t work with:
 Header(Location: /naba/logout.php?.SID.);
Can I use target or something with Location?

Thanks in advance.
--
Regards,
Jan Grafström



Bredsäter 2091
87010 Älandsbro
Sweden


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




[PHP] Can mysql add qty directly?

2002-02-27 Thread Jan Grafström

Hi!
I have a product table and want to update the qty.
$insert = UPDATE products SET soldqty='$sqty' WHERE
articelno='$articleno';
$result = mysql_query ($insert);
I want the code to automatically add $sqty to soldqty and not overwrite it
like I do above.

Do I need to first make a separate query on soldqty or is there an easyer
way?

Thanks in advance.
--
Regards,
Jan Grafström

Härnösand
Sweden


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




[PHP] sessions and netscape 6.2

2002-03-08 Thread Jan Grafström

Hi!

I am building a shop and on first page I set a sessions var
$_SESSION['myvar']=myword;

On the same page I have links like,
a href=product1.php??php echo SID?items=1id=? echo $prodnr[0]?Put
in the basket/a
and those works normal in navigator 4.7 and IE 6 but in Netscape 6.2
the links open in a new window. I worked around this setting target=_top in
all links.

Now I wonder if there is any other way solving this problem?
Thanks in advance.
--
Regards
Jan Grafström



87010 Älandsbro
Sweden


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




[PHP] Re: Finding variable names in strings, and replacing with values?

2002-03-08 Thread Jan Grafström

Hi Nick!

http://www.php.net/manual/en/function.str-replace.php

Regards,
Jan
Nick Richardson [EMAIL PROTECTED] skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Been working on this one for quite awhile, and it's probably a fairly easy
 solution, but i can't find it... so thought i would ask.

 I'm opening a file, and going through it line by line.  I need for find
 places where the line contains %value% and replace it with $value.

 So if the line says body bgcolor=%bgcolor% text=%textcolor%
 link=%linkcolor%, i need to replace the text where the %% stuff is and
set
 it to $bgcolor,$textcolor,or $linkcolor respectively. -

 I'm sure this can be done, but i'm just no good w/ the pattern matching
 stuff... so if anyone has any ideas on this, please let me know!!!

 Thanks

 //Nick Richardson
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 --
 --   We must come to see that the end we seek, is a society --
 -- at peace with itself.  A society that can live with its  --
 -- concience.  That will be a day not of the white man, not --
 -- of the black man... That will be the day of man, as man! --
 --  -Dr. Martin Luther King Jr. --
 -- -March 25th, 1965--
 --



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




[PHP] Re: just a link in php email

2002-03-08 Thread Jan Grafström

Hi Andrea!

I use this.
$message=a href=\http://www.sever.com\;link/a;

$message = stripcslashes($message);
$headers .= Return-Path: [EMAIL PROTECTED]\n;
$headers .= Reply-To:$admail\n;
$headers .= From: $admail\n;
$headers .= X-Mailer: PHP\n;
$headers .= Content-Type: text/html; charset=iso-8859-1\n;
mail($recipient, $subject, $message, $headers);

Regards,
Jan

Andrea Caldwell [EMAIL PROTECTED] skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi All,

 I've been researching the mail() function and from what I've read, some
 people embed HTML into their mail() without using classes.  All I need to
do
 is add a link in an email... can anyone advise how I would do this?  Which
 headers would I need?  I was using:

 $headers = MIME-Version: 1.0\r\n;
 $headers .= Content-type: text/html; charset=iso-8859-1\r\n;

 but getting a wrong parameter count for mail.  How do I add more than one?
 Then how do I code the link in the $mailcontent?  I was using single
quotes
 for the anchor tags, is that correct?  Not sure if that works since my
 headers weren't working.

 Thanks for your help w/ a novice,
 ~AC







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




[PHP] Netscape 6.2 session problem?

2002-03-11 Thread Jan Grafström

Hi !

Anybody else haviing problem with netscape opening link in new window?
On first page I do session start and set $_SESSION['myvar']=myword;

Then clicking any other link on that page causes Netscape to open it in a
new window.
my links looks like this: a href=page.php??echo SID?link/a

Thanks for any help.


--
Regards
Jan Grafström

Minisoft Sweden

Bredsäter 2091
87010 Älandsbro
0611-60920
070-6409073


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




[PHP] Somebody knows about SecureLink?

2002-03-15 Thread Jan Grafström

Hi!
I wonder if this script can be written in PHP?
I know nothing about asp.

SCRIPT LANGUAGE=VBScript RUNAT=Server
Sub Application_OnStart
Set SecureLink = Server.CreateObject(SecureLinkActiveX.SecureCnx.1)
Set Application(SecureLink) = SecureLink
SecureLink.SetTransacServer specifiedserver.com, 443, 80
SecureLink.SetContentServer www.webshop.com, 80,/webshop/
SecureLink.SetKeyFileName c:/programs/securelink/secrets/flat_o.kf
SecureLink.SetOfrFileName c:/programs/securelink/osl40.ofr
SecureLink.SetApplStoreID 00
SecureLink.SetApplMiofferName shopingcart
End sub
/SCRIPT

--
Regards,
Jan Grafström

Sweden

Bredsäter 2091
87010 Älandsbro



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




[PHP] How do I make tab spaces in a mail?

2002-03-19 Thread Jan Grafström

Hi!
I have read several tricks of how to remove white spaces but how to create
them?

I wan´t to build a normal textmail like this:
$message=
productitemspriceamount
book22550
cd-rom 31545;

mail($recipient, $subject, $message, $headers);

How do I write to get the tab spaces?
--
Regards
Jan Grafström

sweden


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




[PHP] Can I get back a deleted row from mysql?

2002-06-06 Thread Jan Grafström

Hi,
I wonder if you can get back or view the deleted data in a delted row in
mysql?

DELETE FROM $table WHERE id=$id

I used the above code to delete.
Thanks for any help.
--
Regards,
Jan Grafström
Sweden


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




[PHP] ssl security question

2002-06-08 Thread Jan Grafström

I have made a file wich start a session and set a session variable if user
and pass are verifyed.
Than I use the session variable to protect all other userfiles.


To run the file I enter:
http://myserver.com/start.php3?user=xpass=yy

What is the differans using SSL and enter the same url?
If a hacker sniff the ssl-string can he send that string and start the file
anyway?

--
Regards,
Jan Grafström
Sweden


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




[PHP] File extension inc?

2001-10-03 Thread Jan Grafström

Hi!
How does server handle the .inc extension and for what do I use it ?
Where can I read about it?
Thanks in advace
Jan Grafström



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

2001-10-03 Thread Jan Grafström

Regards
Jan
Jason Stechschulte wrote:

 On Wed, Oct 03, 2001 at 02:13:54PM +0200, Jan Grafström wrote:
 
How does server handle the .inc extension and for what do I use it ?
Where can I read about it?

 
 This depends on the setup of the web server.  On some servers, it is set
 up to be parsed just as a .php extension would be.  On these servers,
 people put PHP code into these files and then include() them.
 



-- 
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] Re: User authentication?

2001-11-04 Thread Jan Grafström

Hi Daniel!
Phpbuilder have some articles with examples under security.
http://www.phpbuilder.com/columns/

Regards
Jan Grafstrom
Lillemans Hus AB
Sweden
Daniel alsén [EMAIL PROTECTED] skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 do aonyone know of any comprehensive tutorial for user authentication
 session managment with php4 sessions and mysql? Preferably with some sort
of
 code examples?

 I have tried searching the larger code libraries but haven´t found
anything
 that suits me (the ones i actually got interested in was dead links).

 Regards
 # Daniel Alsén| www.mindbash.com #
 # [EMAIL PROTECTED]  | +46 704 86 14 92 #
 # ICQ: 63006462   |  #




-- 
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] Re: .inc files

2001-11-04 Thread Jan Grafström

Hi Rudi!
Check out this example from Hotscripts.
http://www.hotscripts.com/cgi-bin/dload.cgi?ID=12367

Regards
Jan Grafstrom
Rudi Ahlers [EMAIL PROTECTED] skrev i meddelandet
008401c16534$dcb77580$0c00a8c0@camelot">news:008401c16534$dcb77580$0c00a8c0@camelot...
 Hi

 I was wondering, is there a different way using .inc files? I have a lot
of
 .inc files, which are displayed as normal text when you call it in the
 browser. I would like to still have a file with the username / password /
 database / etc in, but make it say config.inc.php. How would I get the app
 to read a file like that, where say $admin=rudi;
 But also, how would I be able to change the values from another file? ie.
 write to it, and delete lines in it?
 I'm still learnin PHP, and it's great and a lot of fun.
 Regards

 Rudi Ahlers





-- 
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] copy image from database

2001-12-08 Thread Jan Grafström

Hi!
I have images in my DB and want to write them to disk. I tried to copy but
nothing happend,
the image only pops up in my browser with echo. I want it saved in a
directory on my server.
-
$query = select bin_data,filetype from $table where id=$id;
$result = @MYSQL_QUERY($query);
$image = @MYSQL_RESULT($result,0,bin_data);
echo $image;
$destfile=image.jpg;
copy($image,$destfile)
-
Thanks for any help
Regards,
Jan
--
Jan Grafström
Lillemans Hus AB
Sweden
46 (0)611-60920
46 (0)70-6409073


-- 
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] error with php 4.1

2001-12-11 Thread Jan Grafström

Hi!
My webhost has just updated to PHP 4.1 and now this loggin script does not
work.
 I get page can´t be found...
---
if ( (!isset($PHP_AUTH_USER)) || ! (($PHP_AUTH_USER == $st_LOGIN) 
($PHP_AUTH_PW == $st_PASSWORD )) )
{
  header(WWW-Authenticate: Basic entrer=\Admin Basta\);
  header(HTTP/1.0 401 Unauthorized);
  echo Access in-autorizado...;
  exit;
}
It worked well under PHP 4.04.
Anbody knows why?

Thanks in advance for any help.
Regards,
Jan


--
Jan Grafström
Lillemans Hus AB
Sweden
46 (0)611-60920
46 (0)70-6409073


-- 
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] for and emailmessage

2001-09-02 Thread Jan Grafström

Hi!
I have this file and it doesen´t write my tablerows:
$message .= table
$message .= trtdbVarunamn/b/td/tr;
$i = 0;
$ii = count($vn);
for ($i=0;$i$ii;$i++) {
$message .= trtd.$vn[i]./td/tr;
}
$message .= trtdbSum/b/td/tr;
$message .= /table;
I am trying to build a htmlmail but how do I write the for script for all
tablerows?

Thanks in advance for any help.
Regards
Jan



-- 
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] How to list 2-6 in while script?

2001-09-11 Thread Jan Grafström

Hi!
I have this script and wonder how to change it to get it list only number 2 to number 
6 and 
not each?
while (list ($key,$val) = each ($headers)) {
print pb.$val./b/p;
 }
Thanks in advance.
Regards
Jan


-- 
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] Stop if word is found?

2001-05-08 Thread Jan Grafström

Hi!
I am searching some files for a word and if word is found I will stop
the script.
I tried with die, but I have never used it before and it didn´t work
perhaps I used it in a wrong way..

$fd = fopen($filename1, r);
$string = fread($fd, filesize($filename1));
$fruits = explode ( , $string);
fclose($fd);
while (list ($key, $val) = each ($fruits)) {
if (eregi($word, $val)) {
print $filename1.,.$key;
}
}
$fd = fopen($filename2, r);
$string = fread($fd, filesize($filename2));
$fruits = explode ( , $string);
fclose($fd);
while (list ($key, $val) = each ($fruits)) {
if (eregi($word, $val)) {
print $filename2.,.$key;
}
}
--
If I put in a word wich is found in both files than I got two answers
but I only wan´t
to know the first one. Can I prevent it to run if the word is found in
file1?

Thanks in advance for helping me.
Regards
Jan


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




[PHP] php and xml

2001-02-13 Thread Jan Grafström

Hi!
I have this php:
$message = ereg_replace("\r","", $message);
$message =
"med$message/mednam$name/namadr$adress/adrtel$tele/tel";
$fp = fopen (basename($PHP_SELF) . ".comment", "a");
fwrite ($fp, $message);
fclose ($fp);
There must be something wrong in first line beacause the value of message is
not writed.
I also want the output to contain a customer nr ?in beginning.

Thanks for any help
Jan Grafstrom



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

2001-02-16 Thread Jan Grafström

Hi! I have this php answer on the request sent from flash5 to serverside
php-file:

records=8score0=14name0=jannamed0=hej4date0=16:11:32score1=13name1=jannamed1=hej3date1=16:06:52score2=12name2=jannamed2=hej2date2=16:06:42score3=11name3=jannamed3=hejdate3=16:06:31score4=10name4=Jannamed4=hej
antondate4=10:24:00score5=9name5=Antonmed5=8date5=23:31:26score6=8name6=Antonmed6=7date6=23:31:21reply=Thanks!
Updatedupdated=1

My problem is that IE5.5 cache this file.
Anybody know if it`s possible to set some code in the php-file to
prevent this.
I have tried with metatags on both the php and the html in which the swf
resides with no result.
Thanks
Jan


-- 
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] How to get new row on top?

2001-02-17 Thread Jan Grafström

Hi!
I have this code:
$message = ereg_replace("\r\n\r\n", "\nP", $message);
And the new rows are placed under the old ones.
I want to change so the old messages get placed under is that possible?
Thanks for help.
Jan


-- 
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 get new row on top?

2001-02-17 Thread Jan Grafström

Hi Mukul!
Thanks for the answers.
My server has php4.04 and there is no difference after I put in fseek.
The output in the .comment-file i still sorted with latest message at the
end.
Regards
Jan
Mukul Sabharwal wrote:

 if ($message)
 {
 /* uncomment the next two lines to strip out html
 from input */
 /* $name = strip_tags($name); */
 /* $message = strip_tags($message); */
 $message = ereg_replace("\r\n\r\n", "\nP",
 $message);
 $date = date("l, F j Y, h:i a");
 $message = "B$name /B -- $dateP $message
 BRHR";
 $fp = fopen (basename($PHP_SELF) . ".comment",
 "a");
 fseek($fp, 0); // works both with php4.0.1pl1 , 
 fwrite ($fp, $message);
 fclose ($fp);
 }
 @readfile(basename(($PHP_SELF . ".comment")));

 --- Jan Grafstrm [EMAIL PROTECTED] wrote: 
  Thank You for the answer.
 
  Here is my file:
 
  if ($message)
  {
  /* uncomment the next two lines to strip out
  html from input */
  /* $name = strip_tags($name); */
  /* $message = strip_tags($message); */
  $message = ereg_replace("\r\n\r\n", "\nP",
  $message);
  $date = date("l, F j Y, h:i a");
  $message = "B$name /B -- $dateP $message
  BRHR";
  $fp = fopen (basename($PHP_SELF) . ".comment",
  "a");
  fwrite ($fp, $message);
  fclose ($fp);
  }
  @readfile(basename(($PHP_SELF . ".comment")));
  -
  And here is a html form  placed.
  -
  When I submit the form I can se the result on the
  top of the same page with newest message at the
  bottom.
 
  I you know how to get latest message at the toprow I
  am greatful for an answer.
 
  Regards
  Jan
 
  2001-02-16 18:38:36, Mukul Sabharwal
  [EMAIL PROTECTED] wrote:
 
  I'm not quite sure what that code has to do with
  anything, but anyway,
  
  incase you're using files,
  
  you can open the file with the 'a' flag, using
  fseek
  goto 0byteth, and append from there.
  
  $fp = fopen('file', 'a');
  fseek($fp, 0);
  fwrite... or whatever here.
  
  
  --- Jan Grafstrm [EMAIL PROTECTED] wrote: 
  Hi!
   I have this code:
   $message = ereg_replace("\r\n\r\n", "\nP",
   $message);
   And the new rows are placed under the old ones.
   I want to change so the old messages get placed
   under is that possible?
   Thanks for help.
   Jan
  
  
   --
   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]
  
  
  
  =
  To find out more about me :
  http://www.geocities.com/mimodit
  My bookmarks are available @ http://mukul.free.fr
  
  __
  Do You Yahoo!?
  Get personalized email addresses from Yahoo! Mail -
  only $35
  a year!  http://personal.mail.yahoo.com/
  
  
 
  Jan Grafstrm
  Lillemans Hus AB
  Sweden
  +46 (0)611 60920
  +46 (0)70 6409073
 
 

 =
 To find out more about me : http://www.geocities.com/mimodit
 My bookmarks are available @ http://mukul.free.fr

 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail - only $35
 a year!  http://personal.mail.yahoo.com/

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


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




[PHP] php flash and textfile in chatapp.

2001-02-17 Thread Jan Grafström

Hi!
I am trying to build a flashchat and got problems with browser cache.
Every 2 sec flash send these variables to server
loadVariablesNum ("http://www.myserver.com/eget9.php3?name=" add name
add "...) and gets the answer from server. All files are cached by IE5.5
and looks like this: http://www.myserver.com/eget9.php3?name=" carl and
so on.
The variables are stored in a textfile on sever controled by thePHP.
Is there any way to stop IE to chache theses files.  If I have the
appliction running several hours it fills up my cache. My thought was to
use it to be online on my homepage ready to answer questions.

Thanks for answer.
Regards

Jan


-- 
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] trying to get xml-file

2001-02-19 Thread Jan Grafström

Hi!
I have this PHP:
-
$message = ereg_replace("\r","", $message);
$message =
"listmed$message/mednam$name/namemail$email/emailadr$adress/adrtel$telefon/tel/list";

$fp = fopen (basename($PHP_SELF) . ".xml", "a");
fwrite ($fp, $message);
fclose ($fp);
--
I want to getbokat the beginning and /bokat the end, inside the bok
I want several list. is  it possible to do?

Thanks for any help?

Jan


-- 
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] unlik by sending variabel?

2001-02-20 Thread Jan Grafström

Hi!
I am trying to get a file deleted when I send a variabel with the value
"delete".
I have this file:

-
$message = ereg_replace("\r","", $message);
$message = "listmed$message/mednam$name/nam/list;
$fp = fopen (basename($PHP_SELF) . ".xml", "a");
fwrite ($fp, $string);
fclose ($fp);
-

and the file I want unlnked is the .xml-file

I am very thankful if I can get any help with this.
Regards jan


-- 
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] Can you make a file empty?

2001-02-20 Thread Jan Grafström

Hi!
I am trying to delete all text in a file.
$yourfile = "file.txt";
$fp = fopen($yourfile,w)
"is there any good code to put in here?"
fclose($fp);

Thanks for any help.

Regards

Jan


-- 
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] Adding new data at beginning.

2001-02-22 Thread Jan Grafström

Hi!
I am trying to put in a new data at the beginning of a file.
I have started like this;



$yourfile = "test.xml";  (abcdef/c this is the file.)
$fp = fopen ($yourfile, r);
$message  = array(1 = 'a', 'b', 'c', 'd', 'e', 'f',
'/c');
Here I need some code to get the output look like
this"abnewcdef/c"

print_r($message);
fwrite ($fp, $message);
fclose ($fp);

I am thankful for any help.

Regards
Jan


-- 
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] problem with php-ftp ftpbuf?

2001-04-04 Thread Jan Grafström

Hi!
I tryed the ftp script found in php manual.
I got this errormessage:

---
Warning: Unable to find ftpbuf 0 in
/home/myName/public_html/sess/ftpfile.php3 on line 6
---
What does ftpbuf mean?

Thanks for any help.

Regards
Jan


-- 
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] How to don´t write if exist

2001-04-05 Thread Jan Grafström

Hi!
I want php to check if a word already exist and then dont write it to
the file.
This is my file list.txt:
car, cat, dog, ...
and my php which need some more function:
--
$fp = fopen("list.txt", "a");
$string = "$word".","." ";
fwrite ($fp, $string);
fclose ($fp);
---
I want to add: If the variable word exist, dont add it to the string.

Thanks for any tips.

Regards
Jan


-- 
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] Array of words in textfile?

2001-04-05 Thread Jan Grafström

Hi!
I want to read a textfile (cat, dog, rat,) and get it like this:
$namesArray = array("cat,", "dog,", "rat,");
If I can do this than I can go on and make changes in my array.
Like the examples in php manual.


Thanks in advance for any tips.

Regards
Jan



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




[PHP] php search xml-file

2001-04-09 Thread Jan Grafström

Hi!
I have this xml:
list
varacar/vara
bskrford/bskr
price3600/price
nr/nr
/list
-
and this php:
$filename = "list.xml";
$fp = fopen($filename, "r");
$string = fread($fp, filesize($filename));
$string = strip_tags($string);
$refined_string = explode(" ", $string);
if (in_array($needle." ", $refined_string)) {
print "found";
} else {
print "notfound";
}
fclose ($fp);
---
I always get notfound when I set $needle to a word inside the xml-file.
My script doesnt work.
Is it possible also to write a script wich can find the word "ford" if
You only ask for "for"?
I have just started to learn about php search and I am very thankful for
any help.

Regards
Jan


-- 
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] problem search in array

2001-05-03 Thread Jan Grafström

Hi!
This file will not work for me.
I have tried in several ways and I want it to print Got word if it
find $word.

$filename = test.xml;
$fp = fopen($filename, r);
$string = fread($fp, filesize($filename));
$string = strip_tags($string);
$refined_string = explode( , $string);
if (in_array ($word, $refined_string)){
print Got word;
}
fclose ($fp);
--
If You know what is wrong I am very thankful for help.

Regards
Jan


-- 
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] Can php give me row number?

2001-05-06 Thread Jan Grafström

Hi!
First I wan´t to thank those kind guys who helped me with the search for
words in a string. It works fine and here goes my file:
---
$fd = fopen($filename1, r);
$string = fread($fd, filesize($filename1));
fclose($fd);
if (eregi($word, $string)) {
print found the word;
}
-
Now I also wan´t to know to in which row the word was found.
Is there a simple way to add some code?

Thanks for any tips.
Regards
Jan


-- 
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] can I mail unlimited in one click?

2002-12-16 Thread Jan Grafström
Hi,

I wonder if I can mail 300 customers in one click?

part of script:

while($listrow = mysql_fetch_array($listresult))  {

$recipient = $listrow[epost];
$subject = $subj;
$message = $mess;
$headers .= From: $admail\n;
$headers .= Reply-To: $admail\n;
$headers .= X-Mailer: PHP\n;
mail($recipient, $subject, $message, $headers);
}

or is there a limit?

Thanks for any help
Jan Grafstrom



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




[PHP] backslash t

2003-01-22 Thread Jan Grafström
Hi,

I want php to print  \tab
but when I do,  I only get ab as output.
How do I keep the \t?

Thanks in advance.

Jan Grafström



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




[PHP] Re: Can't pass query string from HTML to PHP

2003-06-20 Thread Jan Grafström
Hi Robby,
try to add this line to your php-file:
$name=$_GET['name'] ;
change to:
?php
$name=$_GET['name'] ;
echo Welcome, . $name.!;
?

Good luck!
Jan


Robby Ku [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]
 Hi,

 I've got a problem passing a query string from a HTML file to a PHP file.
I created a HTML file called welcome.html with the following link:

   a href=welcome.php?name=Andy Hi, I'm Andy /a

 I am trying to pass the query string Andy to a PHP file called
welcome.php with the following command:

  ?php echo (Welcome, $name!); ?

 After i load welcome.html in my browser, i try linking it to
welcome.php through the hyperlink i created. But the result i got was

  Welcome, !

 Where is Andy? If the code has got no problem, could it be the Web server
(IIS) or the browser (IE) im using? Or the configuration of the Web server
is not correct? Pls help!

 Thank You

 Beginner,
 Robbie


 -
 Do you Yahoo!?
 SBC Yahoo! DSL - Now only $29.95 per month!



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



[PHP] Re: really simple problem with GET

2003-03-12 Thread Jan Grafström
Try

...test.php?test=0 //no $ before test=

/Jan

Kelvin Poon [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]
.ca...
 Hi,

 I am sorry if the level of this question is too simple but I can't figure
 out what's wrong.  I want to pass a variable value through the URL using
the
 Get method.

 FOr example http://.../test.php?$test=0

 and my test.php code are as follow:

 html
 body
 ?php

 if (!empty($_SERVER))
   extract($_SERVER);

 if (!empty($_GET)) {
 extract($_GET);
 } else if (!empty($HTTP_GET_VARS)) {
 extract($HTTP_GET_VARS);
 }

 if (!empty($_POST)) {
 extract($_POST);
 } else if (!empty($HTTP_POST_VARS)) {
 extract($HTTP_POST_VARS);
 }

 echo hello $test;
 ?


 /body
 /html


 BUt my outcome is

 hello

 so therefore my $test variable isn't passing through, does anybody know
what
 I did wrong?

 Thanks

 Kelvin





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



[PHP] Re: Multiple values per variable

2003-03-12 Thread Jan Grafström
user1 abc

$user1_array=array();
array_push($user1_array, a,b,c);

//check user_array
$cat=;
for ($i=0;$icount($user1_array);$i++) {
$cat .= $user1_array[$i];
}
echo user1 .$cat;

/Jan

Erich Kolb [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]
 I am working on some logic where users are categorized based on the
results
 from a few questions.  So far everything is working properly, but I would
 like to be able to assign multiple categories to each user.  Any ideas on
 how to accomplish this?
  I am assuming that an array would be in order, but not to sure on the
 syntax, or how to explode the array (eg.  User is a member of $cat[1],
 $cat[2], $cat[3], etc.





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



[PHP] Re: replace string in array

2003-03-16 Thread Jan Grafström

Chris,

you can splice an array
http://www.php.net/manual/sv/function.array-splice.php

Jan Grafstrom



Chris Winters [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]
 I'm having a bit of trouble...

 I have an array that consists of a string like this:

 string1\rstring2\rstring3\rstring4

 I want to REMOVE STRING3, and keep the rest of the array intact - but
cannot
 figure on how to do it. I tried using functions such as preg_replace,
strstr
 and so forth...

 In my code this is how I go thru the array...

 //snippet...

 //search for carriage return, split it...
  $line = preg_split( /[\r]+/ ,$line);
  reset($line);

 //Line will consists of array...
 while (list ($key, $val) = each ($line))
  {
echo br$key = $val;

if(strstr($val,$newmail))
 {
   echo brFound! and trying to deletebr;
  //What to do form this point, I have the slightest foggy...
 }
 }

 It finds it without ANY problems, but I cannot seem to go to the
position
 of found string, delete it, then keep the rest of the array.
 I did manage to find this on php.net, but it doesnt seem to work:
 function stri_replace2 ($search,$replace,$text)
 {
if (!is_array($search))
 {
   $search = array($search);
   $replace = array($replace);
 }
  foreach($search AS $key = $val)
   {
 $search[$key]  = '/'.quotemeta($val).'/i';
   }
 echo $search $replace $text;

return preg_replace($search,$replace,$text);
 }

 Could anyone help me with this?

 Thanks in advanced!

 Chris






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



[PHP] Warning: Failed to write session data ?

2002-10-16 Thread Jan Grafström

Hi,

I get this message when I load my webshopsite into a frame on onother server
but not until I press a form button:
Warning: Failed to write session data (files). Please verify that the
current setting of session.save_path is correct
(/var/apachefs/sessions) in Unknown on line 0

I can´t change settings on my webhost.

If I load another page first wich start the session and sets a sessionvar,
it works fine.
Is there a way to workaround this problem.
I use input type =hidden name=PHPSESSID value=echo $PHPSESSID.to pass the
session in my form.
I also noticed that You can´t view source of this frame loaded from another
server.

I have my mainsite on one server and shopsite on another.

Thanks in advance for any help.
--
Regards,
Jan Grafström

Sweden


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




[PHP] mysql row num, offset?

2003-11-24 Thread Jan Grafström
Hi,

can I get the rownumber (offset) from mysql?

After I have made a select I want to generate an update query wich works for
any table.


Thanks in advance for any help.

Jan



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



[PHP] Re: PHP, MySQL problem

2004-01-14 Thread Jan Grafström
Hi

Add records with this code.
?php
$name=isset($_POST['name']) ? $_POST['name'] :'';
$address=isset($_POST['address']) ? $_POST['address'] :'';
if (!empty($name)) {
mysql_connect($server,$user,$pass) or die (Error conecting);
mysql_select_db($dbnamn,$conection) or die (no db .$dbnamn);
$query = insert into mytable (name, address) values ('$name', '$address');
$result = mysql_query ($query) or die(bad query);
}
?
html
head/head
body
form action= method=post
name input name=name
address input name=address
input type=submit value=add record
/form
/body/html

Hope this helps.
Jan


Nicolai Elmqvist [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]
 Hi

 I have just started working with PHP and MySQL and have gone through 3
 tutorials on how to add and delete records from a database. Nearly
 everything is working, as it should except for the communication between
 HTML form and PHP. If I try to add a record to my database by pushing a
 submit the text in the textboxes are deleted but no record is inserted
in
 the database. I have copied the code directly form the tutorials so
spelling
 mistakes should not be the problem.



 It is possible to add records manually in the code so the connection to
and
 from the database is ok.



 So, does anybody know what I the problem might be?



 I'm using PHP 4.3.4, MySQL 4.0.17 and an Apache server.



 On before hand, thank you.

 Nicolai Elmqvist

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