[PHP] PREG-pattern, help needed

2003-09-09 Thread Tobias Talltorp
I need help with a preg-pattern for preg_replace_callback(). I need to match and replace them with . This is as far as I have come in my code: tabell2 cell1 tabell2 cell2 första cell i rad två Detta är den sista '; $counter = 0; function bla($matches) { global $counter; $counter++; re

[PHP] preg_split() - pattern problem

2002-11-11 Thread Tobias Talltorp
How would I write the pattern for this preg_split()? "/T.*O.*B/", seems to only return the first and last portion of the string (1: Once upon a time, 2: going for a walk). $string = "Once upon a time T:O.B there was a T.O,B duck who was T-O'B going for a walk"; $array = preg_split('/T.*O.*B/', $s

Re: [PHP] using pdf template

2002-07-12 Thread Tobias Talltorp
>From what I can understand, I can only use PDI to put PDFs in the background, not use the actual elements from the PDF? Example: I have created a PDF with a table with two cells in one row. The cells have the text "cell1" and "cell2". I run this PDF through the PDI. Now, can I replace the texts

[PHP] using pdf template

2002-07-11 Thread Tobias Talltorp
Is it possible to produce a PDF, use it as a template and populate predefined sections of it from a database? The PDFs I want to create are a little too complex for me to produce from scratch. // Tobias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.ne

[PHP] FDF on windows

2002-07-11 Thread Tobias Talltorp
I am interrested in experimenting a bit with FDF, but I use windows, and it seems that it is only available on Linux... According to Adobe, it should work on windows aswell, but perhaps not with PHP... Anyone got it working with windows? This is what I am talking about: http://www.php.net/manual/

[PHP] Re: Reuse cookie vars

2002-02-26 Thread Tobias Talltorp
Log in get_page($url, $user_agent, $postvars); // Get the page echo get_page($url2, $user_agent, ""); // Tobias "Tobias Talltorp" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > ( Code at the bottom of the message) >

[PHP] Curl: Reuse cookie vars

2002-02-26 Thread Tobias Talltorp
( Code at the bottom of the message) I logged in to a page, using the Curl-extension. I want to use the vars set in the cookie to continue being logged in and download another page. In regular Curl, I need to save the headers, containing the cookie information, to a file. In the next step I need

[PHP] RTF image encoding

2001-09-27 Thread Tobias Talltorp
Does anyone know what kind of encoding/decoding RTF uses for images? I tried using base64 in PHP, but it didn't do the trick. Any thoughts?, // Tobias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

[PHP] multiple domains using one cookie

2001-07-05 Thread Tobias Talltorp
Hello all. I want multiple domains to be able to read from one cookie, or set one cookie each for the different domains. Here is the case: When the user logs in to my server, I want to set a cookie that has the value $name="tobias". He specifies which domains that can read this cookie, s

[PHP] Payflo Pro and credit cards

2001-06-19 Thread Tobias Talltorp
file outside the webroot that I can crypt, in a database that I can crypt (can MySQL do this)? Thanks in advance, // Tobias Talltorp

Re: [PHP] assign values to variables, all taken from txt file

2001-05-15 Thread Tobias Talltorp
>From what I could see you want variable variables $value = $line[0]; $variable = $line[1]; $$variable = $value; // Tobias ""Alain"" <[EMAIL PROTECTED]> wrote in message 9dqrh1$23a$[EMAIL PROTECTED]">news:9dqrh1$23a$[EMAIL PROTECTED]... > Hello, > I am trying to get values assigned to variables,

[PHP] Getting referrer from other frame.

2001-05-11 Thread Tobias Talltorp
Sorry about the post before (if there was one)... It was sent by accident. Here is the complete question: I would like to tweek the getenv("REMOTE_ADDRESS"); a little. I want my top frame to print the referrer for the frame below. I'm not sure if this should be done with PHP or javascript. Sound

[PHP] Getting referrer from another frame

2001-05-11 Thread Tobias Talltorp
I would like to tweek the getenv("REMOTE_ADDRESS") a little. -- 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] session variable problem

2001-04-16 Thread Tobias Talltorp
The reason for the fatal error is that you can only store the sessions in three (or four) ways, files, in a database or in the memory. What variable has no value? Have you started the session before you try to access the values? session_start(); echo $your_value; (Or preferably) echo $HTTP_SESSIO

Re: [PHP] resource id #2

2001-04-16 Thread Tobias Talltorp
Sorry... Read morgans topic aswell... Didn´t see the duplicate mysql_query(). :) // Tobias ""Tobias Talltorp"" <[EMAIL PROTECTED]> wrote in message 9betpl$nb0$[EMAIL PROTECTED]">news:9betpl$nb0$[EMAIL PROTECTED]... > > $query=mysql_query("Se

Re: [PHP] resource id #2

2001-04-16 Thread Tobias Talltorp
> $query=mysql_query("Select pass from members where uname='$username'"); > $result = mysql_query($query) > or die("You are not authorized to be here."); What you are doing is checking if the query is valid. Your die() would print only if you had a faulty query (try changing pass to pass2), but

Re: [PHP] unregister part of array in session

2001-04-16 Thread Tobias Talltorp
You are registered $array as session, > You need to unset() element. I think it should work. > > Regards, > -- > Yasuo Ohgaki > > > ""Tobias Talltorp"" <[EMAIL PROTECTED]> wrote in message > 9bd8un$kqt$[EMAIL PROTECTED]">news:9bd8un$kqt$[EM

Re: [PHP] search string

2001-04-15 Thread Tobias Talltorp
to read up on regular expressions: http://www.php.net/manual/en/ref.pcre.php (Faster than ereg) http://www.php.net/manual/en/ref.regex.php // Tobias Talltorp ""Joseph Bannon"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Wh

Re: [PHP] accepting credit cards

2001-04-15 Thread Tobias Talltorp
rewarding aswell: http://www.php.net/manual/en/ref.pfpro.php http://www.php.net/manual/en/ref.cybercash.php I don´t know how much they cost or anything... Anyone who knows? // Tobias Talltorp ""Tyler Longren"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">

[PHP] unregister part of array in session

2001-04-15 Thread Tobias Talltorp
I know how to unset a specific value in an ordinary array: unset ($array["one"]); How do I do this if my array is in a session? Here is my code: "number one", two=> "Number two", three=> "Number three"); session_register("array"); ?>

Re: [PHP] Parsing HTML tags

2001-04-13 Thread Tobias Talltorp
// Get the webpage into a string $html = join ("", file ("http://www.altavista.com")); // Using eregi eregi("(.*)", $html, $tag_contents); // Using preg_match (faster than eregi) // The i in the end means that it is a case insensitive match preg_match("/(.*)<\/title>/i", $html, $tag_contents);

Re: [PHP] getting all variables from session into array

2001-04-13 Thread Tobias Talltorp
Does it act as a "normal" array like: $array = array(one => "Number One", two => "Number Two"); How would I go about to make this loop work (if I use the above array it works): while(list($key, $val) = each($HTTP_SESSION_VARS)) echo "$key - $val&

[PHP] getting all variables from session into array

2001-04-13 Thread Tobias Talltorp
I know this question has been up here before, but all the searches I did turned up with to many or no hits, so I couldn´t find anything. I want to get all the variables from a session and get them into an array like this: $sessionvar[userid] $sessionvar[user] $sessionvar[email] ... I think I re

Re: [PHP] Problem Reading session files

2001-04-12 Thread Tobias Talltorp
Just a comment... I tried your code and it worked just fine for me, I could see the session contents. The only thing that is different in my setup is that I use PHP 4.03pl1... Try downgrading and see if it works... // Tobias ""Schulz, Evan"" <[EMAIL PROTECTED]> wrote in message 919AAA764477D3118

Re: [PHP] sending mail.. PLEASE HELP!

2001-04-12 Thread Tobias Talltorp
Or just adding this to the top of the page that is taking forever to process: set_time_limit(60); // 60 seconds before timeout, change to more if you want to This way you don´t have to change the time limit for all of the pages. // Tobias Talltorp > Are you doing a bulk mail out or someth

[PHP] Updating a value in a session

2001-04-12 Thread Tobias Talltorp
On my first page I have a form that posts a value to page2 where it gets registered in a session. Works like a charm... When I try to do this again, but send another value, the session doesn´t update the new value. Why? PAGE 1 ---> PAGE 2 ---> Thanks, // Tobias -- PHP General Mail

[PHP] how much data can a session store?

2001-04-09 Thread Tobias Talltorp
Just a quick question... How much data can a session store? The reason I´m asking is that I have developed a news system and want a "preview"-thingy and for this I want to store the data in a session. The main-content can be very large. Thanks, // Tobias -- PHP General Mailing List (http://w

Re: [PHP] show mysql_query_result with php

2001-03-29 Thread Tobias Talltorp
What is the layout of your table, the names of fields etc. By the way, is it just one table? If you provide me with this information, I think I will be able to solve your problem... // Tobias ""Denis Mettler"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >

Re: [PHP] Help w/ exec() on Win2k, IIS5.

2001-03-29 Thread Tobias Talltorp
I have had this problem with exec, passthru with that configuration aswell... To read the files into an array, do this: (http://www.php.net/manual/en/function.opendir.php) "; } ?> // Tobias "SHAWN" <[EMAIL PROTECTED]> wrote in message D1FF6C0809A9D411815D0050DA841BCC3EE5@ONSITESERVER">news:D1F

Re: [PHP] Help with Posting Data

2001-03-28 Thread Tobias Talltorp
Sorry, a post MUST come from the client. The only way I know, is to use JavaScript for this... // Tobias ""Peter Phillips"" <[EMAIL PROTECTED]> wrote in message 99p6a2$vou$[EMAIL PROTECTED]">news:99p6a2$vou$[EMAIL PROTECTED]... > Hi, > I need a way to POST data to another script on another serv

Re: [PHP] HELP? HTTP HEADER GURUS etc?

2001-03-23 Thread Tobias Talltorp
Try out cURL. I think it will work for java and C aswell: http://curl.haxx.se It does posts and handles cookies and more. // Tobias "brunatex" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Hello, > > Not sure if this is exactly focused on PHP, but i thoug

Re: [PHP] Register session in function without global?

2001-03-22 Thread Tobias Talltorp
Well... Whadda ya know. Right after I sent the post I figured it out. (Solution? Variable variables!) function register_vars($reg_var) { // Make the $reg_var global $global_vars=explode("|", $reg_var); for ($i=0; $i wrote in message 99dn35$duo$[EMAIL PROTECTED]">news:99dn35$duo$[EMAI

[PHP] Register session in function without global?

2001-03-22 Thread Tobias Talltorp
I am trying to register a session variable in a function without using the global in the beginning. The reason for this is that I don´t always know how many variables I am going to register (I separate the different fields with | like this, "username|email|cellphone" and explode them). Is there s

Re: [PHP] big problem

2001-03-22 Thread Tobias Talltorp
You need to set the permissions in that folder so that you can write. PHP acts like IUSR(computernmae), so set IUSR(computername) permission to write. This is Windows, by the way... // Tobias ""Salim Meethoo"" <[EMAIL PROTECTED]> wrote in message 99c90k$83u$[EMAIL PROTECTED]">news:99c90k$83u$[EM

[PHP] linking classes together

2001-03-21 Thread Tobias Talltorp
I have two classes, one with mysql-connections and one with session-stuff. The session-class relies on the mysql to check if the user is registered and such. What is the proper way to connect/link these classes together? I got it working if I created a $db = new mysql_connect; in the function, b

Re: [PHP] addslashes Question

2001-03-21 Thread Tobias Talltorp
This seems to be more of a HTML problem. Form fields simply can´t print out ". You need to change the " to " in order for it to appear. This can be done using the function htmlspecialchars(): http://www.php.net/manual/en/function.htmlspecialchars.php In your case: "> You can test these two thing

Re: [PHP] PHP post

2001-03-21 Thread Tobias Talltorp
No can do... You can send a post to another page, but not go to that page. In order to go to the page the form was was posted, the information must come from the client. You can use javascript for this, but it is not a very stable solution. // Tobias ""Paul Juliano"" <[EMAIL PROTECTED]> wrote

Re: [PHP] function mail()

2001-03-21 Thread Tobias Talltorp
See the SMTP value in your PHP.ini and set it to a valid outgoing mail server Another thing I have noticed, perhaps this is only me, is that if the TO-address isn´t valid it will fail. Try to send an email to your own email address... // Tobias ""Eric Tonicello"" <[EMAIL PROTECTED]> wrote in m

Re: [PHP] PostToHost

2001-03-15 Thread Tobias Talltorp
be done with JavaScript... Just a tip: Check out the cURL-functions in the manual. They do the stuff that the Post-to-Host does, but much much more... Regards, // Tobias Talltorp ""Boget, Chris"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAI

Re: [PHP] creating array on variable variable (bug?)

2001-03-15 Thread Tobias Talltorp
Thanks a million man! This did the trick... Best Regards, // Tobias Talltorp ""Mahmoud Abu-Wardeh"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > try this: (you need to escape the variable part of the variable varia

Re: [PHP] FAQ

2001-03-15 Thread Tobias Talltorp
://marc.theaimsgroup.com/?l=php-general) I like this one better than the manual to search for problems similar to the ones I have... // Tobias Talltorp "Rick St Jean" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > It is there a list of most frequently

[PHP] creating array on variable variable (bug?)

2001-03-15 Thread Tobias Talltorp
bugs in my head finally gotten to my thinking area? Thanks, // Tobias Talltorp -- 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] Function, array - problem (probably easy to solve)

2001-03-14 Thread Tobias Talltorp
I am constructing a function for retrieving records from a mysql database and putting them into an array called $print_field[name][number]. My problem is that I only seem to get the first two records and I think I know where the problem is, but I can´t seem to be able to solve it. Any ideas anyo

[PHP] Verify session in function

2001-03-05 Thread Tobias Talltorp
I am building my first basic function to verify a session. If the verification is not in the function it works... What am I missing? (I couldn´t find anything about this in the mailing list archive) -- This works --> session_start(); if (isset($PHPSESSID)){ echo "ok";

[PHP] session won´t use cookies

2001-03-02 Thread Tobias Talltorp
I have a problem with the session not using cookies. The code below doesn´t seem to set a cookie even though my php.ini has it set. If I use the header after initializing the session, nothing appears in getsess.php. If I click the link on the other hand, the PHPSESSID-variable is added to the URL

Re: [PHP] session_destroy() fails...

2001-03-01 Thread Tobias Talltorp
> Why would you want to create and destroy the session data during a single > request? That simply doesn't make sense - session persistence is designed > to keep registered session data available across _a_series_ requests. This I know, but it was just to show what I wanted to do. > I believe PH

[PHP] session_destroy() fails...

2001-03-01 Thread Tobias Talltorp
I am looking into sessions at the moment and havn´t got it all working properly to continue my journey. I´m having problem with the session_destroy(), and after some searching in the archive, I found out that other people have had this problem aswell, but I didn´t find a fix... Here is the error

Re: [PHP] Getting MIME-type of file

2001-02-08 Thread Tobias Talltorp
Oops, I forgot to mention the most important part... I need to get the MIME-type (or something that can identify the file-extension) from a file ALREADY on the server, not posted through a form. I.e. How do I get the MIME-type of "tobias.zip" in my folder? I already know how to get the MIME-type

[PHP] Getting MIME-type of file

2001-02-08 Thread Tobias Talltorp
After a lot of searching on the mailing list and different resources I have come up with... nothing. My question: Can I get the MIME-type of a file using PHP? (image/gif, text/plain, application/octet-stream, ect.) Thanks, // Tobias -- PHP General Mailing List (http://www.php.net/) To unsub

Re: [PHP] List of all file extensions

2001-02-07 Thread Tobias Talltorp
http://directory.google.com/Top/Computers/Data_Formats/ > > Regards, > > Philip > > On Wed, 7 Feb 2001, Tobias Talltorp wrote: > > > > No. People use whatever file extensions they like. > > > > So, If I create a 3D-program, I could say that file extensions for

Re: [PHP] List of all file extensions

2001-02-07 Thread Tobias Talltorp
> No. People use whatever file extensions they like. So, If I create a 3D-program, I could say that file extensions for this program will be .pdf (not a prefered extension, but still)? Is it more a question of getting your file extension as widely used as possible, so other companies dont bother

[PHP] List of all file extensions

2001-02-07 Thread Tobias Talltorp
Hello. Do you know where I can find a list of all file extensions used today? Like: .gif .htm .php .doc ... Is there an organisation, like ICANN, that decide who can use these file extensions and what you need to do to register one of your own? Thanks, // Tobias -- PHP General Mailing List

Re: [PHP] How to get information out of an external page?

2001-02-07 Thread Tobias Talltorp
Try this: http://www.zend.com/codex.php?id=39&single=1 Just replace the fopen() and eregi() to suit your needs. // Tobias ""David Tandberg-Johansen"" <[EMAIL PROTECTED]> wrote in message 95onrm$dj6$[EMAIL PROTECTED]">news:95onrm$dj6$[EMAIL PROTECTED]... > Hello! > > I try to get some informatio

[PHP] Error on mail attachment

2001-02-05 Thread Tobias Talltorp
I get a strange error when I am trying to send a mail with an attachment. I used the class below, but I get two error messages. 1. Unknown has generated errors and will be closed by windows... 2. CGI ERROR The specified CGI application misbehaved by not returning a complete set of HTTP headers. Th

[PHP] POST headers

2001-01-23 Thread Tobias Talltorp
What are the HTTP Headers performing a POST? I need to simulate a POST to a webpage. NOTE: I do not want to use curl or the post-to-host function, since these get the information. What I want to do is this: I enter the page "localhost/post.php" where there are a set of HTTP Headers for sending