php-general Digest 28 Nov 2002 11:26:02 -0000 Issue 1731

Topics (messages 126374 through 126397):

session problems again
        126374 by: Jason Romero
        126378 by: Rich Gray

Re: [PHP-DEV] Parse search string a la Google (Regular expression?)
        126375 by: Ernest E Vogelsinger

Re: ignoring client supplied session data
        126376 by: Justin French
        126386 by: John W. Holmes
        126387 by: John W. Holmes

Re: Password Script
        126377 by: Justin French
        126397 by: Vicky

PHP 4.3.0RC2 released
        126379 by: Andrei Zmievski

Re: printing screen without the print dialog
        126380 by: Justin French

Re: Parsing XML files, logic involved...
        126381 by: Khalid El-Kary

Re: dynamic arraynames
        126382 by: Floyd Baker
        126383 by: Floyd Baker
        126384 by: Floyd Baker
        126396 by: Hugh Danaher

Re: Streaming audio
        126385 by: olinux

Re: Show only user that variable "music"contain  "pop"
        126388 by: John W. Holmes

Error in retrieving a BLOB from DB.
        126389 by: Naif Al-Otaibi
        126390 by: Faisal Abdullah

Re: sendmail problem!
        126391 by: Manuel Lemos

getaddrinfo failed: No address associated with hostname
        126392 by: Godzilla
        126395 by: Tony Earnshaw

how to use openssl_x509_read.
        126393 by: Richard Rojas

mcrypt 2.4.x - trouble with small data fields?
        126394 by: Steve Yates

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
--when using session registered variables
--i can only get them to save as session variables for one page
--then on the next page they are gone
--far as i can tell the variables are not getting written over or unset
--and the session is not gettting destroyed
--any other ideas what it might be?

i tried the seggestions you guys had
and i came up with one more question
does the session cookie.cookie_lifetime have anything to do with the amount
of time that session variables can be stored
the session.use_cookies is on and register.globals is turned on
however session.cookie_lifetime is set to 0
so would this affect the session variable lifetime?



--- End Message ---
--- Begin Message ---
Jason

session.cookie_lifetime set to 0 means the session cookie persists until the
client browser is closed...

I'm not clear if you are still having session problems now or the advice you
got earlier sorted it?

Rich
-----Original Message-----
From: Jason Romero [mailto:[EMAIL PROTECTED]]
Sent: 27 November 2002 15:09
To: [EMAIL PROTECTED]
Subject: [PHP] session problems again


--when using session registered variables
--i can only get them to save as session variables for one page
--then on the next page they are gone
--far as i can tell the variables are not getting written over or unset
--and the session is not gettting destroyed
--any other ideas what it might be?

i tried the seggestions you guys had
and i came up with one more question
does the session cookie.cookie_lifetime have anything to do with the amount
of time that session variables can be stored
the session.use_cookies is on and register.globals is turned on
however session.cookie_lifetime is set to 0
so would this affect the session variable lifetime?




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



--- End Message ---
--- Begin Message ---
At 23:11 27.11.2002, Ernest E Vogelsinger said:
--------------------[snip]--------------------
>If I understand you correctly you want to isolate either quoted strings
>(with or without whitespace), or tokens separated by whitespace, as array
>elements?
>
>For this you would first have to isolate the first quoted sentence, then
>tokenize the part before, and loop this as long you're not done.
>
>Should work something like that:
>
> [...]
>Disclaimer: untested as usual. _Should_ behave like this:
--------------------[snip]-------------------- 

I _should_ have tested. This script actually works the way you expect it to be:

------------<code>------------
<xmp>
<?php

function tokenize_search($input) {
    $re = '/\s*(.*?)\s*"\s*([^"]*?)\s*"\s*(.*)/s';
    /* look for 3 groups:
       a - prematch - anything up to the first quote
       b - match - anything until the next quote
       c - postmatch - rest of the string
    */
    $tokens = array();
    while (preg_match($re, $input, $aresult)) {
        // aresult contains: [0]-total [1]-a [2]-b [3]-c
        // tokenize the prematch
        if ($aresult[1]) $tokens = array_merge($tokens, explode(' ',
$aresult[1]));
        array_push($tokens, $aresult[2]);
        $input = $aresult[3];
    }
    // $input has the rest of the line
    if ($input) $tokens = array_merge($tokens, explode(' ', $input));
    return $tokens;
}

$string = "\"search for this sentence\" -NotForThisWord
ButDefinitelyForThisWord";
$tokens = tokenize_search($string);
print_r($tokens);

?>
------------</code>------------

The output of this script is:

Array (
    [0] => search for this sentence
    [1] => -NotForThisWord
    [2] => ButDefinitelyForThisWord
) 


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/


--- End Message ---
--- Begin Message ---
on 28/11/02 9:22 AM, Evan Nemerson ([EMAIL PROTECTED]) wrote:

> I'm not worried about them using the query string for malicious purposes- I
> have register_globals off... I'm worried about someone messing with their
> cookie and sedding authorized to true- that _will_ change my $_SESSION
> variable, unless I can find some way to ignore cookies, which brings us back
> to my original question- how do i ignore all client input, _especially_
> cookies???

Turn register globals off (as you have).  Then NEVER pull any data out of
the $_COOKIES array, and you're now "ignoring" cookies :)  Perhaps a further
step is to call something like unset($_COOKIES) at the top of every
script... but I'm not sure how unset() works with the super global arrays.


Justin French
--------------------
http://Indent.com.au
Web Development & 
Graphic Design
--------------------

--- End Message ---
--- Begin Message ---
> I'm not worried about them using the query string for malicious
purposes-
> I
> have register_globals off... I'm worried about someone messing with
their
> cookie and sedding authorized to true- that _will_ change my $_SESSION
> variable, unless I can find some way to ignore cookies, which brings
us
> back
> to my original question- how do i ignore all client input,
_especially_
> cookies???

Okay, you're confused. The only thing stored in a cookie with sessions
is the session id. That relates to a file or database record where the
actual data is stored. This session id is made so it's random and very
hard to guess. So they can modify it all they want, odds are very good
they'll never hit another active session id (otherwise sessions would be
useless). 

So, $_SESSION[] is data that's only stored on your server, $_GET,
$_POST, and $_COOKIE is data that's coming from the user and shouldn't
be trusted. If you have your own server, $_SESSION is safe. On a virtual
server that's shared with other people, other people's scripts on the
same server could modify your session files.

---John Holmes...


--- End Message ---
--- Begin Message ---
> What I do on my pages is perhaps a convoluted way of doing it but it
> works.  I set a username and password session variables. Every time
the
> page loads the script verifies the username and password are correct.
If
> not, they don't get to see the rest.  This, in my mind, pervents
someone
> from supplying a key variable like $_session['logged_in'].  This way
they
> have to know the username and password.

But users can't supply session variables. So if your script sets
$_SESSION['logged_in'], then only your script can change it's value. 

---John Holmes...


--- End Message ---
--- Begin Message ---
Is this a password reminder script?

Or a 'guessing'/knowledge game to get access to a certain page?

Justin


on 28/11/02 4:52 AM, Vicky ([EMAIL PROTECTED]) wrote:

> I'm looking to code a script that does the following. Please bear with me as
> I'm a total novice at this ^^!
> 
> It's sort of like a multiple password thing. Users need to type in between 3
> and 6 (I will be changing the use of this script and sometimes there will
> only be 3 answers sometimes as many as 6) things. If they get it right
> they'll be redirected to a page, if they get it wrong either a javascript
> prompt will popup saying "Incorrect" or they'll be redirected to a different
> page.
> 
> I'm not sure if I'll put a limit on how many times they can guess, so if you
> could tell me how I would put a limit (say 10 guesses a day) I'd be
> greatful.
> 
> Thank you! Please try and make your replies detailed so I can understand
> them ^_~


Justin French
--------------------
http://Indent.com.au
Web Development & 
Graphic Design
--------------------

--- End Message ---
--- Begin Message ---
A 'guessing'/knowledge game ^_^

Basically I put a picture of a dog or cat up and they try to guess the
breeds. If they get it right then they go to a page where they can download
their prize!

Vicky

--- End Message ---
--- Begin Message ---
The second release candidate of the inimitably fabulous PHP version 4.3.0 is
out. It can be downloaded from http://qa.php.net. Give it a good testing!

-Andrei

--- End Message ---
--- Begin Message ---
Hi,

1. did you search the archives, because this gets asked often
2. did you do a google search?

>From memory, it's POSSIBLE to print directly to the printer IF IT IS
CONNECTED TO THE SERVER, but it's more difficult (if not impossible) to
print to a client side (user's) printer... and impossible without the print
dialogue.

PHP is server-side, not client-side.


Justin




on 28/11/02 9:29 AM, Duky Yuen ([EMAIL PROTECTED]) wrote:

> I am having this problem, I want to print something directly to my printer
> without having that print dialog. What to do know? Is this possible?
> 
> Duky
> 
> 

Justin French
--------------------
http://Indent.com.au
Web Development & 
Graphic Design
--------------------

--- End Message ---
--- Begin Message --- hi,
If you are sure that all your files come with attributes double quoted (not single quoted) you may want to use this parser class:

http://creaturesx.ma.cx/kxparse/

hint: use the function has_attribute() to verify whether an attribute is available

Regards,
khalid

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail

--- End Message ---
--- Begin Message ---

Well I might be in the wrong place.  I've also asked in the HTML list
now too but I'm still stuck and need some help.  

This is pretty much as clear as I can make it.  I'm up against a
mental block and even if it's as clear as glass to others I'm dead in
the water and would appreciate some pointers.  I have a bunch of
pieces but can't seem to string them together enough to make it work.

Just trying to build an x-y array of data input fields and then send
them recursive to be used further down the program.  

I can do this fine with a fixed number of columns and rows of user
input but I cannot figure out how to make this happen using a variable
number of columns.  I'm a complete array amateur and would appreciate
a little assistance...

I want it to look something like this:

Name          Temp      Time      Offset    Etc.      As needed...   
process 1    [input]   [input]   [input]   [input]   [inputs] 
process 2    [input]   [input]   [input]   [input]   [inputs] 
process 3    [input]   [input]   [input]   [input]   [inputs] 
process 4    [input]   [input]   [input]   [input]   [inputs]

Right now, for the three *basic* columns, I have the lines below in a
'while' loop.

<INPUT TYPE='text' NAME='temp[]' VALUE='$temp' SIZE='10'
MAXLENGTH='10'> 
<INPUT TYPE='text' NAME='time[]' VALUE='$time' SIZE='10'
MAXLENGTH='10'> 
<INPUT TYPE='text' NAME='offs[]' VALUE='$offs' SIZE='10'
MAXLENGTH='10'> 

But when it comes to adding additional columns that a user
determines are needed, I am lost.  Users might want to add 0, or 4, or
10 additional items...  I would like only that number of usable
input columns be on the input-form, identified for what they contain,
and then be passed to the next page....

Again, many thanks in advance.

Floyd






On Sun, 24 Nov 2002 23:55:56 -0500, you wrote:

>I'm sorry, but I'm still confused. Can you show us a sample of the data
>in the database and what you want the resulting form to look like for
>that data? Maybe that'll help.
>
>---John Holmes...



--

--- End Message ---
--- Begin Message ---

Well I might be in the wrong place.  I've also asked in the HTML list
now too but I'm still stuck and need some help.  

This is pretty much as clear as I can make it.  I'm up against a
mental block and even if it's as clear as glass to others I'm dead in
the water and would appreciate some pointers.  I have a bunch of
pieces but can't seem to string them together enough to make it work.

Just trying to build an x-y array of data input fields and then send
them recursive to be used further down the program.  

I can do this fine with a fixed number of columns and rows of user
input but I cannot figure out how to make this happen using a variable
number of columns.  I'm a complete array amateur and would appreciate
a little assistance...

I want it to look something like this:

Name          Temp      Time      Offset    Etc.      As needed...   
process 1    [input]   [input]   [input]   [input]   [inputs] 
process 2    [input]   [input]   [input]   [input]   [inputs] 
process 3    [input]   [input]   [input]   [input]   [inputs] 
process 4    [input]   [input]   [input]   [input]   [inputs]

Right now, for the three *basic* columns, I have the lines below in a
'while' loop.

<INPUT TYPE='text' NAME='temp[]' VALUE='$temp' SIZE='10'
MAXLENGTH='10'> 
<INPUT TYPE='text' NAME='time[]' VALUE='$time' SIZE='10'
MAXLENGTH='10'> 
<INPUT TYPE='text' NAME='offs[]' VALUE='$offs' SIZE='10'
MAXLENGTH='10'> 

But when it comes to adding additional columns that a user
determines are needed, I am lost.  Users might want to add 0, or 4, or
10 additional items...  I would like only that number of usable
input columns be on the input-form, identified for what they contain,
and then be passed to the next page....

Again, many thanks in advance.

Floyd






On Sun, 24 Nov 2002 23:55:56 -0500, you wrote:

>I'm sorry, but I'm still confused. Can you show us a sample of the data
>in the database and what you want the resulting form to look like for
>that data? Maybe that'll help.
>
>---John Holmes...





--

--- End Message ---
--- Begin Message ---


Very sorry for the dupes...  Kept thinking I had pressed reply instead
of reply all.  


--

--- End Message ---
--- Begin Message ---
Floyd,
I thought about this some and started noodling out a solution for you, but
have a few questions before I go any farther on this.
1. The part about users inputting their own column headers is relatively
straight forward.  Something like this should work:

<?php
if (!isset($start_button))
    {
    print "<form action=$PHP_SELF method=get>";
    print "Input the following information";
 // these are your fixed cells
    print "Name: <input type=text name=name size=20><br>";
    print "Temp: <input type=text name=temp size=20><br>";
    print "Time: <input type=text name=time size=20><br>";
    print "Offset: <input type=text name=offset size=20><br>";
 // User inputs the number of additional cells needed
  print "Input number of additional cells needed: <input type=text
name=additional_cells size=20><br>";
  print "<input type=hidden name=start_button value=1>";
  print "<input type=submit value=\" Hit it! \">";
  print "</form>";
  }
if ($start_button=="1")
 {
 print "<form action=$PHP_SELF method=get>";
 print "Input the following information";
 // these are your fixed cells and they now contain user input
   print "Name: <input type=text name=name value=\"$name\" size=20><br>";
   print "Temp: <input type=text name=temp value=\"$temp\" size=20><br>";
   print "Time: <input type=text name=time value=\"$time\" size=20><br>";
   print "Offset: <input type=text name=offset value=\$offset\"
size=20><br>";
 print "Input the names of the desired additional cells in the spaces
provided.";
 // this is where your user will name the cells he asked to create
 for($i=1;$i<=$additional_cells;$i++)
  {
  print "$i <input type=text name=user_added[$i] size=20><br>";
  }
 print "<input type=hidden name=additional_cells value=\"$additional_cells\"
>";
 print "<input type=hidden name=start_button value=2>";
 print "<input type=submit value=\" Hit it! \">";
 print "</form>";
 }
if ($start_button=="2")
   {
    print $name."<br>".$temp."<br>".$time."<br>".$offset."<br>";
    for($i=1;$i<=$additional_cells;$i++)
    {
    print "user cell ".$i." ".$user_added[$i]."<br>";
    }
}
?>


2. Now comes the tricky part, and the part I'm unsure about.  You can
convert the user input in the above so that it becomes the names of the
input cells, or you can leave them in a numeric array.  Leaving them in a
numeric array will be easier to deal with later.
Also, other than the display of a table, what do you want the user input
for?  If you're planning on doing any data manipulation, then your coding
will get a bit hairy because you won't know what relation the user input
data has to your standard data (name, time, temp and offset).  Finally, if
you're planning on storing the data in a database table, each table will
need to be created on the fly--it can be done, but if you're struggling with
this, it'll take you some time to get the back end working.

Hope this helps,
Hugh

----- Original Message -----
From: "Floyd Baker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "'Hugh Danaher'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, November 27, 2002 5:24 PM
Subject: Re: [PHP] dynamic arraynames


>
>
> Well I might be in the wrong place.  I've also asked in the HTML list
> now too but I'm still stuck and need some help.
>
> This is pretty much as clear as I can make it.  I'm up against a
> mental block and even if it's as clear as glass to others I'm dead in
> the water and would appreciate some pointers.  I have a bunch of
> pieces but can't seem to string them together enough to make it work.
>
> Just trying to build an x-y array of data input fields and then send
> them recursive to be used further down the program.
>
> I can do this fine with a fixed number of columns and rows of user
> input but I cannot figure out how to make this happen using a variable
> number of columns.  I'm a complete array amateur and would appreciate
> a little assistance...
>
> I want it to look something like this:
>
> Name          Temp      Time      Offset    Etc.      As needed...
> process 1    [input]   [input]   [input]   [input]   [inputs]
> process 2    [input]   [input]   [input]   [input]   [inputs]
> process 3    [input]   [input]   [input]   [input]   [inputs]
> process 4    [input]   [input]   [input]   [input]   [inputs]
>
> Right now, for the three *basic* columns, I have the lines below in a
> 'while' loop.
>
> <INPUT TYPE='text' NAME='temp[]' VALUE='$temp' SIZE='10'
> MAXLENGTH='10'>
> <INPUT TYPE='text' NAME='time[]' VALUE='$time' SIZE='10'
> MAXLENGTH='10'>
> <INPUT TYPE='text' NAME='offs[]' VALUE='$offs' SIZE='10'
> MAXLENGTH='10'>
>
> But when it comes to adding additional columns that a user
> determines are needed, I am lost.  Users might want to add 0, or 4, or
> 10 additional items...  I would like only that number of usable
> input columns be on the input-form, identified for what they contain,
> and then be passed to the next page....
>
> Again, many thanks in advance.
>
> Floyd
>
>
>
>
>
>
> On Sun, 24 Nov 2002 23:55:56 -0500, you wrote:
>
> >I'm sorry, but I'm still confused. Can you show us a sample of the data
> >in the database and what you want the resulting form to look like for
> >that data? Maybe that'll help.
> >
> >---John Holmes...
>
>
>
>
>
> --
>

--- End Message ---
--- Begin Message ---
Not PHP, but here's a solution I use for streaming WMA
files on apache server. 

You'll need 3 files
audiofile.htm
audiofile.wax
audiofile.wma

 
[audiofile.htm]
<html>
<head><title>Audio Player</title></head>
<body>

<script language="JavaScript">
<!--
if ( navigator.appName == "Netscape" )
{
navigator.plugins.refresh();
document.write("\x3C" + "applet MAYSCRIPT
Code=NPDS.npDSEvtObsProxy.class")
document.writeln(" width=5 height=5 name=appObs\x3E
\x3C/applet\x3E")
}
//-->
</script> <!-- Set ShowControls, ShowDisplay,
ShowStatusBar to value 0 to not display the
corresponding thing under the video window --> <OBJECT
ID="NSPlay" WIDTH=160 HEIGHT=128
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701";
standby="Loading Microsoft Windows Media Player
components..." type="application/x-oleobject"> <PARAM
NAME="FileName"
VALUE="/interviews/applied/applied_interview_hi.wax">
<PARAM NAME="ShowControls" VALUE="1"> <PARAM
NAME="ShowDisplay" VALUE="1"> <PARAM
NAME="ShowStatusBar" VALUE="1"> <PARAM NAME="AutoSize"
VALUE="1"> <Embed type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/";
filename="/audio/audiofile.wax"
src="/audio/audiofile.wax" Name=NSPlay ShowControls=1
ShowDisplay=1 ShowStatusBar=1 width=290 height=320>
</embed> </OBJECT>

</body>
</html>


[audiofile.wax]
<ASX version = "3.0">
<Entry>
        <Ref href = "/audio/audiofile.wma" />
</Entry>
</ASX>


And audiofile.wma is of course your windows media
audio file.

olinux


> At 12:55 PM 11/27/2002 -0800, Mako Shark wrote:
> >Does anyone know how to do streaming audio with
> PHP?
> >No clue if this is even possible. I've checked
> around
> >a bit, looked at some script sites, but nothing
> seems
> >to give a clue. I *think* it might be possible to
> set
> >something like this up, but I'm not sure.
> >
> >__________________________________________________
> >Do you Yahoo!?
> >Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> >http://mailplus.yahoo.com
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--- End Message ---
--- Begin Message ---
> $req = MYSQL_QUERY("SELECT id FROM $TBL_NEWS ORDER BY nom LIMIT 0,
> $limit_news");
> $res = MYSQL_NUM_ROWS($req);
> 
> This is my lines... It's not working... :-(

Use mysql_error() to find out why. Odds are one of your variables aren't
set when you think they are.

$req = mysql_query(" ... ") or die(mysql_error());

---John Holmes...


--- End Message ---
--- Begin Message ---
Hi all,

I use the following:
1) Win XP.
2) Oracle personal eddition 8.1.6.0.0.
3) IIS.
4) php-4.2.3-Win32 runs in cgi mode.

When I retrieve a blob from my DB, I got the following error:

Fatal error: Call to undefined function: load() in 
c:\inetpub\wwwroot\php1\ora52.php on line 6

-------------------------------------------
This is my code:

<?php
$conn = OCILogon("system","manager","naif.localhost");
$stmt = OCIParse($conn,"select binary_junk from images where img_id=7");
OCIExecute($stmt);
OCIFetchInto($stmt, $lob);
$content=load($lob);
OCIFreeStatement($stmt);
OCILogoff($conn);
header("Content-type: image/gif\n\n");
echo $content;
?>

--- End Message ---
--- Begin Message ---
I've never used load() before, but I can't find it in the function list
in php.net


On Thu, 2002-11-28 at 11:05, Naif Al-Otaibi wrote:
> Hi all,
> 
> I use the following:
> 1) Win XP.
> 2) Oracle personal eddition 8.1.6.0.0.
> 3) IIS.
> 4) php-4.2.3-Win32 runs in cgi mode.
> 
> When I retrieve a blob from my DB, I got the following error:
> 
> Fatal error: Call to undefined function: load() in 
> c:\inetpub\wwwroot\php1\ora52.php on line 6
> 
> -------------------------------------------
> This is my code:
> 
> <?php
> $conn = OCILogon("system","manager","naif.localhost");
> $stmt = OCIParse($conn,"select binary_junk from images where img_id=7");
> OCIExecute($stmt);
> OCIFetchInto($stmt, $lob);
> $content=load($lob);
> OCIFreeStatement($stmt);
> OCILogoff($conn);
> header("Content-type: image/gif\n\n");
> echo $content;
> ?>
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Faisal Abdullah                 [EMAIL PROTECTED]
Systems Developer               Magnifix Sdn. Bhd.

Tel : 603-4142 1775             Fax : 603-4142 1550

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Isn't it time you browse through a different window?"


______________________________________

--- End Message ---
--- Begin Message ---
Hello,

On 11/27/2002 09:01 PM, Siamak wrote:
I use PEAR to send mails to my users through "sendmail", my mails sometimes
are delivered immediately, sometimes after some minutes and sometimes after
some hours and sometimes never! I tried to identify the cause but I wasn't
successful, is there someone out there who can help me? I want to send an
immediate message to my newly signed up users.
You need to use some switches to enable immediate deliver.

You may want to try this class with the sendmail_message subclass that calls sendmail directly using the necessary switches to enable the immediate delivery mode.

http://www.phpclasses.org/mimemessage

I use that class with this other class for the same purpose as you to use the direct delivery mode using SMTP directly, thus without relying on SMTP:

http://www.phpclasses.org/smtpclass


--

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
I have a php script setup which downloads a file from a remote server via
FTP. It worked fine for a couple months until I went to use it one day and
it returned the error below. I hadn't made any changes to the script in that
time. It was no big deal so I wrote it off as it wasn't really an important
script. Today I went to use the "fopen" command in another php script with a
remote http file and it returned the same error. I'm not sure if this is a
php config thing or something else.

Warning: php_network_getaddresses: getaddrinfo failed: No address associated
with hostname

Any help would be greatly appreciated. Thanks!

-Tim

Here is a snippet of the ftp script:
----------------------------------------------------------------------------
-----

$ftp_server="domain.com";
$ftp_user_name="user";
$ftp_user_pass="password
$localfile="/home/usernam/www/filename.txt";
$remotefile="/paht/to/remotfile/filename.txt";
$hostname_softcart = "mysqlhostname";
$database_softcart = "dbasename";
$username_softcart = "user";
$password_softcart = "password
$dbase_name = "dbase";
$file=$PHP_SELF;




// Connect to FTP server
$conn_id = ftp_connect($ftp_server);

// Login with username and password

$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// Check Connection
if ((!$conn_id) || (!$login_result)) {
        echo "FTP connection has failed!";
        echo "Attempted to connect to $ftp_server for user $ftp_user_name";
        die;
    } else {
        echo "Step 1:  Connected to $ftp_server Succesfully.<br>";
    }

// Set Passive Transfer Mode.
ftp_pasv($conn_id, pasv);

// Display Download Button
  echo "<form action=$file>";
  echo "<input type=hidden name=download value=true>";
  echo "Step 2: <input type=submit value=\"Click Here to download Database
file\"><br>";
  echo "</form>";

// Download the file
if (isset($download)) {

$download = ftp_get($conn_id, $localfile, $remotefile, FTP_ASCII);

// Check download success...if its OK do some stuff
if (!$download) {
     echo "FTP Download has failed!";
} else {
     echo "STUFF ";
 }
  }

// close the FTP stream
ftp_close($conn_id);

----------------------------------------------------------------------------
-----


--- End Message ---
--- Begin Message ---
tor, 2002-11-28 kl. 05:22 skrev Godzilla:

> Warning: php_network_getaddresses: getaddrinfo failed: No address associated
> with hostname

Your DNS doesn't work any more?

Best,

Tony

-- 

Tony Earnshaw

When all's said and done ...
there's nothing left to say or do.

e-post:         [EMAIL PROTECTED]
www:            http://www.billy.demon.nl



--- End Message ---
--- Begin Message ---
Hi,

   Does anybody know how to use this function?

            openssl_x509_read(mixed x509certdata)

   Is x509certdata the certificate submitted by the browser to the server?

Richard

--- End Message ---
--- Begin Message ---
    On my current project I am saving personal info into a MySQL database
for later retrieval.  I have discovered that I have trouble with a few
specific data entries, though the other ~20 work fine.  The two I have
trouble with are a char(2) and a varchar(4) field, the smallest ones in the
table, and they return garbage when decrypted.  Is there a minimum field
size for using mcrypt?  Sample code:

// to encrypt, init once
$mykey = 'keytext';
$td = mcrypt_module_open(MCRYPT_TRIPLEDES,'', MCRYPT_MODE_ECB, '');
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), 1234567890);
$ks = mcrypt_enc_get_key_size ($td);
$key = substr(md5($mykey), 0, $ks);
mcrypt_generic_init($td, $key, $iv);
(...)
$CreditCardExpMonth = mcrypt_generic($td, $_POST['Credit_Card_Exp_Month']);
(...)
// then save to database as part of insert query

    If I save/retrieve the fields to/from the database w/o encryption they
save & retrieve fine.  This field is two digits ('02', '11', etc.).  The
other is the year (4 digits).

// to decrypt
// I wrote a function to truncate the returned string at the
// first \0 since mcrypt's decrypt pads the result
echo mydecrypt($data['CCExpMonth']);

function mydecrypt($enc) {
  global $td;
  $str = mdecrypt_generic($td, $enc);
  $pos = strpos($str, "\0");
  if ($pos !== false) {
    $str = substr($str, 0, $pos);
  }
  return $str;
}

    Also as long as I'm posting, mcrypt_generic_deinit() seems to be
undefined on my system?  Is that an mcrypt issue or an interaction between
PHP 4.1.2 and mcrypt 2.4.x?

 - Steve Yates
 - Do trees moving back and forth make the wind blow?

~ Taglines by Taglinator - www.srtware.com ~



--- End Message ---

Reply via email to