[PHP] Check for doubleposts

2005-05-04 Thread Fredrik Arild Takle
Hi, what is the easiest way to check if a person i registered twice in a mysql-table. Lets assume that I only check if the last name is in the table more than once. This is in mysql 4.0 (subquery not an option). Do I have to use arrays and in_array. Or is there a more elegant solution? Best

[PHP] String replace inside img

2005-01-07 Thread Fredrik Arild Takle
I have a some problems doing a search and replace in a string. I want to replace: img ALT= src=base/image.php?id=3 border=0 with img ALT= src=image.php?id=3 border=0 Note ALT, src, border properties may come in random order. My solution today is a not good enough because I only do an

[PHP] eregi

2002-05-02 Thread Fredrik Arild Takle
Hi, I'm doing: eregi($start(.*)end, $rf, $my_var); And I want it to stop at the first presedence of $end, not the last (thats what this is doing). Any hints? Best Regards Fredrik A. Takle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] help: eregi problem (?)

2002-05-02 Thread Fredrik Arild Takle
Hi, I'm doing: eregi($start(.*)end, $rf, $my_var); And I want it to stop at the first presedence of $end, not the last (thats what this is doing). Any hints? Best Regards Fredrik A. Takle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] XML to HTML?!

2002-05-01 Thread Fredrik Arild Takle
Wrap into a output buffer. ob_start, ob_get_contents This was neat. I did: ob_start(); $myvar = ob_get_contents(); But it still outputs the page, can I disable that? Regards Fredrik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] XML to HTML?!

2002-05-01 Thread Fredrik Arild Takle
Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Wed, 1 May 2002, Fredrik Arild Takle wrote: Wrap into a output buffer. ob_start, ob_get_contents This was neat. I did: ob_start(); $myvar = ob_get_contents(); But it still

[PHP] Parsing XML

2002-04-30 Thread Fredrik Arild Takle
Hi, this might be a silly question, but I really haven't used XML alot with PHP. I've parsed som XML, when I do xml_parse it outputs the html-codes. I want to make a variable out of it.. I've tried $output = xml_parse(); -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

[PHP] XML to HTML?!

2002-04-30 Thread Fredrik Arild Takle
Hi, this might be a silly question, but I really haven't used XML alot with PHP. I've parsed some XML, when I do xml_parse it outputs the html-codes. I want to make a variable out of it, so I can write it to a file. I've tried $output = xml_parse(); -- PHP General Mailing List

[PHP] eregi_replace

2002-04-04 Thread Fredrik Arild Takle
Why won't this work? $NoteNm[$i] = eregi_replace (V:\memo\F0001\, , $NoteNm[$i]); $NoteNm[$i] = eregi_replace (\\LOBBY\VismaDok\Memo\, , $NoteNm[$i]); Best Regards Fredrik A. Takle Norway -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] eregi_replace

2002-04-04 Thread Fredrik Arild Takle
Backslashes are magic. Double them and try again (e.g., --- $NoteNm[$i] = eregi_replace (LOBBY\\VismaDok\\Memo\\, ... Well I've allready tried that one: Outputs: Warning: REG_EESCAPE:~trailing backslash (\) in D:\Inetpub\wwwroot\www_lobb\phpshop.php on line 28 Warning:

[PHP] Security Issue?!

2002-02-13 Thread Fredrik Arild Takle
Hi, I found a weekness in one of my local dev projects today. php.ini is set ut with cookies off in session handling. I asked another user to send me his url when logged in, I copied and pasted it and then I was logged in as him. What should I do? Turn cookies on? Or write ip to mysql? or...?

[PHP] PHP + GD 2.0.1 + WIN2K

2001-12-29 Thread Fredrik Arild Takle
I have a win2k machine set-up with iis 5.0, php 4.1.0 and now I want to use image_copy_resample() image_copy_resample() is not working in the version of gd included in php 4.1.0. Where should I download the .dll for version 2.0.1? Regards Fredrik A. Takle -- PHP General Mailing List

[PHP] Re: Windows 2000 Permissions error

2001-10-19 Thread Fredrik Arild Takle
I guess you have to set EVERYONE. (Don't now for sure) Fredrik A. Takle Justin King [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... While trying to use dir() on a certain directory, I get the error Warning: OpenDir: Invalid argument (errno 22) in

[PHP] Re: Checking if session has been started

2001-09-22 Thread Fredrik Arild Takle
session_start(); $valid_session = true; session_register(valid_session); OR SOMETHING LIKE THIS? if (session_is_registered($valid_session)) { // Do something?! } Gaylen Fraley [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Why not populate a

[PHP] Re: PHP EDITOR 4 WINDOWS?

2001-08-01 Thread Fredrik Arild Takle
Codewhiz is great. Remember to download php-language-files if you want syntax-highlighted-code (or something!) Best Regards Fredrik A. Takle Kyle Smith [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Does it really exist? If so could someone post some URLs for

[PHP] Re: Hmmm?

2001-08-01 Thread Fredrik Arild Takle
I think it's impossible to read/understand my own scripts if i don't do it. Do: ?php if ($submit) { echo Counting from 1-32br; for ($ii = '1'; $ii = '32' $ii++) { echo $ii. ; } } echo brAll done!; ? instead of: ?php if ($submit) { echo Counting from 1-32br; for ($ii =

[PHP] Re: function that will print the url for embedded links

2001-08-01 Thread Fredrik Arild Takle
You might wanna make a function for links: ?php function makelink($descr, $href) { global $printer; if ($printer) { $link = $descr ($href); } else { $link = a href=\$href\$descr/a; } return $link; } To echo an link in a site, do: html above ?php echo

[PHP] Re: check if user exists

2001-08-01 Thread Fredrik Arild Takle
$result = mysql_query(SELECT uname FROM users WHERE uname=\'$username@$domain\'); $numrows = mysql_num_rows($result); if ($numrows == '1') { echo User already exists; } else { echo User don't exist; } Best Regards Fredrik A. Takle Bergen, Norway Ker Ruben Ramos [EMAIL PROTECTED] wrote in

Re: [PHP] protected Images without using htaccess

2001-06-22 Thread Fredrik Arild Takle
1. Authenticate user 2. Put the pictures in a secret folder or outside http_root 3. Do this: ?php header(Content-Type: application/download\n); header(Content-Disposition: filename=\$file\); $fn = fopen($file , r); fpassthru($fn); ? I hope this helps! Fredrik A. Takle [EMAIL PROTECTED]

[PHP] Is this a joke?!

2001-06-22 Thread Fredrik Arild Takle
Is this a joke? http://www.perl.com/search/index.php *hehe* -- 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] protected Images without using htaccess

2001-06-22 Thread Fredrik Arild Takle
added the wrong script... arghh... ?php Header(Content-type: image/gif); $fp = @fopen($img,rb); fpassthru($fp); fclose($fp); ? Fredrik Arild Takle [EMAIL PROTECTED] wrote in message 9gvl19$er6$[EMAIL PROTECTED]">news:9gvl19$er6$[EMAIL PROTECTED]... 1. Authenticate user

[PHP] copy() ??

2001-01-31 Thread Fredrik Arild Takle
I'm trying to upload i file through a webpage... -- add.php3 FORM method="post" action="do_add.php3" input type="file" size=40 name="userfile" INPUT type="submit" name="pub" value="Publiser" /form -- do_add.php3 copy($userfile, "/imgs/artikler/test.jpg"); unlink($userfile); -- ERROR msg..:

[PHP] Problem!

2001-01-29 Thread Fredrik Arild Takle
1. $date = "20010101"; How could I output 01 01 2001 (or make it 3 variables, like day, month, year)? 2. What is the best way to encrypt (using PHP and MySQL)? Could you please answer me directly by mailadr. ([EMAIL PROTECTED]), because I'm currently not a member of this list at home!