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
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
>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
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
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/
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)
>
( 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
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
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
file outside the
webroot that I can crypt, in a database that I can crypt (can MySQL do
this)?
Thanks in advance,
// 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,
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
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]
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
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
> $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
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
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
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]">
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");
?>
// 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);
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&
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
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
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
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
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
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]...
>
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
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
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
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
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
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
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
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
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
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
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
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
://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
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]
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
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";
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
> 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
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
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
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
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
> 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
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
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
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
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
55 matches
Mail list logo