php-general Digest 20 Jun 2003 08:31:10 -0000 Issue 2128

Topics (messages 152226 through 152283):

Re: Month loop
        152226 by: CPT John W. Holmes
        152228 by: David Nicholson
        152229 by: Dan Joseph
        152230 by: drparker
        152236 by: Tyler Lane

SNMP v2
        152227 by: Russell Handorf

OOT Payflow Urgent
        152231 by: Haseeb Iqbal

Re: header(); Issue
        152232 by: Chris Shiflett

Cookies- peanut butter or chocolate??
        152233 by: Sparky Kopetzky
        152234 by: David Nicholson
        152237 by: Henning Sittler
        152238 by: Brent Baisley
        152239 by: CPT John W. Holmes
        152240 by: Dan Joseph
        152241 by: Milan Reznicek
        152242 by: Steve Keller
        152259 by: Joseph Szobody

Re: exec() and passthru()
        152235 by: Mignon Hunter

securing a graphic
        152243 by: Ryan Holowaychuk
        152244 by: Haseeb Iqbal
        152248 by: Steve Keller
        152266 by: Hugh Bothwell

Problem while retrieving data from cookie with unserialize
        152245 by: Sævar Öfjörð

strange crypt() problem
        152246 by: Huzz
        152247 by: Sævar Öfjörð
        152250 by: Huzz
        152253 by: Sævar Öfjörð
        152254 by: Jeff Harris
        152258 by: Huzz

explode, split, or what?
        152249 by: Kyle Babich
        152251 by: Sævar Öfjörð
        152252 by: Steve Keller

How to UPDATE only certain fields
        152255 by: Matt Hedges
        152256 by: Thorsten Körner
        152257 by: Sævar Öfjörð

Pre-4.1 / register_globals=off
        152260 by: Lee Herron QCS
        152261 by: Sævar Öfjörð

safe mode and mail
        152262 by: Senih Ö.

email pipe -> attachment problem (zip files)
        152263 by: Duncan

When to escape slashes, and when not to???
        152264 by: Gerard Samuel
        152283 by: Marek Kilimajer

Re: CRM for website
        152265 by: YC Nyon

Re: [Newman] Passing an image through a php file.
        152267 by: Mark Tehara

Multiple Submission of the Same Form
        152268 by: Miranda, Joel Louie M
        152269 by: CPT John W. Holmes
        152270 by: Leif K-Brooks
        152271 by: Miranda, Joel Louie M

Image Border Help
        152272 by: Nilaab Y.

preg_match
        152273 by: Aaron Axelsen

Can't pass query string from HTML to PHP
        152274 by: Robby Ku
        152275 by: Martin Towell
        152277 by: Jan Grafström
        152280 by: Robby Ku

How to secure site?
        152276 by: Andrew Afliatunov

Configuring PHP5 in IIS 6.0
        152278 by: Roberto Ramírez

file problem
        152279 by: Adina
        152282 by: Jason Wong

Authentication: Addressing the user variable
        152281 by: Jason End

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 ---
> Is there any way I could loop thru and print all the month names (i.e.
> January, February)?

Just make an array and loop through the array. You know the rest of the
names, right? :)

---John Holmes...


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


This is a reply to an e-mail that you wrote on Thu, 19 Jun 2003 at 20:58,
lines prefixed by '>' were originally written by you.

> Is there any way I could loop thru and print all the month names (i.e.
> January, February)?

for($i=1;$i<13;$i++){
    echo date("F",mktime(0,0,0,$i,1,1));
}

For more info:
http://uk.php.net/manual/en/function.mktime.php
http://uk.php.net/date

HTH

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

          Professional Web Development by David Nicholson
                    http://www.djnicholson.com/

    QuizSender.com - How well do your friends actually know you?
                     http://www.quizsender.com/
                    (developed entirely in PHP)

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

> Is there any way I could loop thru and print all the month names (i.e.
> January, February)?

        I suppose you could do something like:

        for ($i = 1; $1 >= 12; $i++) {
                echo date("F", mktime(0, 0, 0, $i, 1, 2003)) . "<br>";
        }

        Unless you just want to manually create an array with the month's names in
it.

-Dan Joseph


--- End Message ---
--- Begin Message ---
that's what I'm looking for - thanks.

David Nicholson wrote:

> Hello,
>
> This is a reply to an e-mail that you wrote on Thu, 19 Jun 2003 at 20:58,
> lines prefixed by '>' were originally written by you.
>
> > Is there any way I could loop thru and print all the month names (i.e.
> > January, February)?
>
> for($i=1;$i<13;$i++){
>     echo date("F",mktime(0,0,0,$i,1,1));
> }
>
> For more info:
> http://uk.php.net/manual/en/function.mktime.php
> http://uk.php.net/date
>
> HTH
>
> David.
>
> --
> phpmachine :: The quick and easy to use service providing you with
> professionally developed PHP scripts :: http://www.phpmachine.com/
>
>           Professional Web Development by David Nicholson
>                     http://www.djnicholson.com/
>
>     QuizSender.com - How well do your friends actually know you?
>                      http://www.quizsender.com/
>                     (developed entirely in PHP)


--- End Message ---
--- Begin Message ---
<?php
$months = array("", "January", "February", "March", "April", "May",
"June", "July", "August", "September", "October", "November",
"December");

foreach( range( 1, 12 ) as $month )
{
    print $months[ $month ];
}

?>
On Thu, 2003-06-19 at 12:57, drparker wrote:
> Is there any way I could loop thru and print all the month names (i.e.
> January, February)?
-- 
Tyler Lane <[EMAIL PROTECTED]>

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---
--- Begin Message ---
i'm having a heck of a time getting snmpv2 to work with php. does anyone else
have it working yet?

i'm on rh 7.3 with apache v 1.3.23-14 and php v 4.1.2-7.3.6 on a test system
not on the internet.

what i'm trying to accomplish is a mib walk with php on a device that only
supports snmpv2.

here is the code i'm currently using:

<?
$a = snmpwalk("10.10.1.1", "cn", "");
for ($i=0; $i<count($a); $i++) {
     echo $a[$i] . "<br>";
}
?>

works great on snmpv1 devices- but snmpv2 returns this:
Warning: snmpwalk() [function.snmpwalk]: No response from 10.10.1.1
in /home/httpd/html/snmp.php on line 2

r

--- End Message ---
--- Begin Message ---
hi all,
i am using curl to post data to the payflow link server.
now here are the questions that i want to ask.
here is the server stats
Linux+ php + mysql + curl + ssl
1) now i want to know if curl is safe to use?
i know about the payflow sdk but i also know that i can execute the sdk by
exec call and if anyone is loged on the computer at the time of the
transection he/she can view all the data passed to the sdk by simply one
command.(i.e. ps.). as

also don't want to show the user any page from verisign. but when i send the
data i get back html output. i want some kind of error codes.how can i
achieve this. know there must some way around this problem.
i want to collect all the information on my page send the data to the
payflow link without leaving my site the get back the result from the
transection and show the result to the user.

thanx in advance
Haseeb



--- End Message ---
--- Begin Message ---
--- SpyProductions Support Team <[EMAIL PROTECTED]> wrote:
> 
> I have this in a script:
> 
> header("Location: $Relative/outstanding.php?pdd=1&pddid=$poid");

A good way to make sure you are sending the header you think you are is to use
echo instead of header() for a quick debugging run. For example:

echo "Location: $Relative/outstanding.php?pdd=1&pddid=$poid";

If the resulting URL is something you can paste into your browser to arrive at
the right place, then your Location header is properly formatted.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

--- End Message ---
--- Begin Message ---
Yes, this question is about PHP cookies.

Two questions: 
1. How do you setup a cookie that will not expire?? 
2. How do you put 2 items that you want to save in the cookie and retrieve?? Examples 
in the PHP manual only show how to work with a single value.

Thanks!

Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net


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


This is a reply to an e-mail that you wrote on Thu, 19 Jun 2003 at 21:13,
lines prefixed by '>' were originally written by you.
> Yes, this question is about PHP cookies.
> Two questions:
> 1. How do you setup a cookie that will not expire??

You can't, but you can use an expiry date in the distant future.

> 2. How do you put 2 items that you want to save in the cookie and
> retrieve??

Have two seperate cookies, one for each value.

All the best,

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

          Professional Web Development by David Nicholson
                    http://www.djnicholson.com/

    QuizSender.com - How well do your friends actually know you?
                     http://www.quizsender.com/
                    (developed entirely in PHP)

--- End Message ---
--- Begin Message ---
1. Set a big value in seconds for the time argument

2. Send 2 cookies 
OR 
Create one string value containing the two values you want to save,
seperated by a a sepcific character of your choice and send this new value
as your cookie.  Remember to parse the cookie's value when you request it in
your script, so that you determine the two seperatevalues actually stored
there.


Henning Sittler
www.inscriber.com



-----Original Message-----
From: Sparky Kopetzky [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 19, 2003 4:10 PM
To: PHP General
Subject: [PHP] Cookies- peanut butter or chocolate??


Yes, this question is about PHP cookies.

Two questions: 
1. How do you setup a cookie that will not expire?? 
2. How do you put 2 items that you want to save in the cookie and retrieve??
Examples in the PHP manual only show how to work with a single value.

Thanks!

Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net


--- End Message ---
--- Begin Message --- Both.
1. If you don't specify an expiration date, it's good for the session. Usually this means until the exit the browser. Otherwise you must set a date far into the future.
2. You can name cookies, thus storing multiple values in multiple cookies. Or you can store multiple values in one cookie by using your own delimiter. A nice PHP function to look at is serialize() and unserialize(), which would allow you to store an array in a single cookie.

Keep in mind cookie are limited to 4K. Not that you would even want to store that much on the client side.

On Thursday, June 19, 2003, at 04:10 PM, Sparky Kopetzky wrote:

Yes, this question is about PHP cookies.

Two questions:
1. How do you setup a cookie that will not expire??
2. How do you put 2 items that you want to save in the cookie and retrieve?? Examples in the PHP manual only show how to work with a single value.

Thanks!

Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net


--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


--- End Message ---
--- Begin Message ---
> 1. How do you setup a cookie that will not expire?? 

You can't. 

> 2. How do you put 2 items that you want to save in 
> the cookie and retrieve?? Examples in the PHP manual 
> only show how to work with a single value.

You can't. Use an array or two cookies. 

---John Holmes...

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

> > 1. How do you setup a cookie that will not expire??
>
> You can't....

        .... however you could just set the year into the distance future a few
years.

-Dan Joseph


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

    this is an extract from setcookie documentation - how to handle a cookie
array.

    Is this what you were looking for??



You may also set array cookies by using array notation in the cookie name.
This has the effect of setting as many cookies as you have array elements,
but when the cookie is received by your script, the values are all placed in
an array with the cookie's name:


setcookie ("cookie[three]", "cookiethree");
setcookie ("cookie[two]", "cookietwo");
setcookie ("cookie[one]", "cookieone");
if (isset ($cookie)) {
    while (list ($name, $value) = each ($cookie)) {
        echo "$name == $value<br>\n";
    }
}

----- Original Message -----
From: "Sparky Kopetzky" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Thursday, June 19, 2003 10:10 PM
Subject: [PHP] Cookies- peanut butter or chocolate??


Yes, this question is about PHP cookies.

Two questions:
1. How do you setup a cookie that will not expire??
2. How do you put 2 items that you want to save in the cookie and retrieve??
Examples in the PHP manual only show how to work with a single value.

Thanks!

Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net




--- End Message ---
--- Begin Message --- At 6/19/2003 02:10 PM, Sparky Kopetzky wrote:

> 2. How do you put 2 items that you want to save in the cookie and retrieve??

Smuch 'em together into a single variable with a delimiter you're sure won't show up in either value, something like "#@@#", between them. Then, when you read the cookie value in, just explode it by your delimiter.

--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


--- End Message ---
--- Begin Message ---
For (2) you could even build an array, object, etc. if you need to store several 
values and use serialize() right before setting the cookie, and unserialize when you 
retrieve the cookie.

Joseph


"Henning Sittler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> 1. Set a big value in seconds for the time argument
> 
> 2. Send 2 cookies 
> OR 
> Create one string value containing the two values you want to save,
> seperated by a a sepcific character of your choice and send this new value
> as your cookie.  Remember to parse the cookie's value when you request it in
> your script, so that you determine the two seperatevalues actually stored
> there.
> 
> 
> Henning Sittler
> www.inscriber.com
> 
> 
> 
> -----Original Message-----
> From: Sparky Kopetzky [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 19, 2003 4:10 PM
> To: PHP General
> Subject: [PHP] Cookies- peanut butter or chocolate??
> 
> 
> Yes, this question is about PHP cookies.
> 
> Two questions: 
> 1. How do you setup a cookie that will not expire?? 
> 2. How do you put 2 items that you want to save in the cookie and retrieve??
> Examples in the PHP manual only show how to work with a single value.
> 
> Thanks!
> 
> Robin E. Kopetzky
> Black Mesa Computers/Internet Services
> www.blackmesa-isp.net
> 


--- End Message ---
--- Begin Message ---
Thanks everybody

system() worked in this case, but safe mode off, had to switch machines
but at least i got something.

The below produced my output:
system('/var/www/html/vertex/a.out');



---------------------------------------------
not is more easy use system ?
$output = system('/path/to/a.out');

--
----------------------------------------------
            Alberto Ferrer
    [EMAIL PROTECTED]
  http://www.barrahome.org


On Thu, 2003-06-19 at 13:55, Mignon Hunter wrote:
> Still no out put here's my script test.php:
> $output = shell_exec("/var/www/htdocs/vertex_test/a.out"); 
>   echo $output;
> 
> 
> tried "" and ''.  Both test.php and a.out are in same directory and both
> have 777 perms.
> 
> also tried $output = shell_exec("./a.out");
> 
> 
> 
> *************************************************
> In that case what you want is shell_exec():
> 
>   $output = shell_exec('/path/to/a.out'); // note the whole command line has
>                                           // to be enclosed in '' or "".
>   echo $output;
> 
> 
> 
> On Thu, 2003-06-19 at 12:56, Mignon Hunter wrote:
> > Jason,
> > 
> > I'm only subscribed to digest and found your reply in archives and
> > couldnt figure out how to reply  :{
> > 
> > Anyway, right now I'm just trying to get something to work.  The c exe
> > is as follows:
> > ******************************
> > #include <stdio.h>
> > #define NAME "Mignon"
> > int main(void)
> > {
> > 
> >   int q;
> > 
> >   q = 5;
> >   printf("Hello, %s,%d \n", NAME,q);
> >   return 0;
> > }
> > *********************************
> > 
> > I'm trying to return the "Hello, Mignon, 5" which is what's outputted on
> > the command line.
> > 
> > After I get this to work, I'll be needing it to execute a complex
> > function in c, and bring variables back to my php shopping cart.
> > 
> > Here's my test.php:
> > <?
> > error_reporting (E_ALL);
> > error_reporting  (E_ERROR | E_WARNING | E_PARSE);
> > 
> > echo "Here it comes:";
> > 
> > /*$var1 = exec(a.out);
> > echo $var1;//produces:Here it comes:
> >                 //tried "a.out"'a.out'"./a.out"'./a.out'
> >                 //./a.out
> > */
> > //*******************************************
> > 
> > /*$var = passthru(a.out, $ret);
> > echo $var;//produces:(nothing)
> > echo $ret;//produces: 127
> > */
> > //**********************************
> > 
> > /*$var2 = system(a.out);
> > echo $var2; //produces:(nothing)
> > */
> > //******************************
> > 
> > /*$var6 = "./a.out";
> > $var7 = exec($var6, $var_array[], $ret_var);
> > echo $var7;//produces:(nothing)
> > echo $var_array[];//produces:Array
> > echo $ret_var;//produces:127
> > echo $var6;//produces:(nothing)
> > */
> > 
> > //*******************************************
> > 
> > /*$var3 = exec(`/var/www/htdocs/vertex_test/a.out`, $var_array[],
> > $ret_var);
> > echo $var3;//produces:Here it comes
> > echo $ret_var;
> > echo $var_array[0];
> > */
> > //****************************************
> > 
> > passthru("/var/www/htdocs/vertex_test/a.out", $res);
> > echo $res;
> > 
> > ?>
-- 
Mignon Hunter
Web Master and Developer
Toshiba International
713.466.0277 x 3461


--- End Message ---
--- Begin Message ---
Is there a way in PHP that I can secure a graphic, so that when the page is
loaded it will show the graphic, but is not able to be right clicked on or
downloaded to there desktop.

Thanks
Ryan



--- End Message ---
--- Begin Message ---
yeah there is a way you have to use some third party tools for that.
http://www.antssoft.com/htmlprotector/index.htm
.php can't do this AFAIK
----- Original Message -----
From: "Ryan Holowaychuk" <[EMAIL PROTECTED]>
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Sent: Friday, June 20, 2003 2:26 AM
Subject: [PHP] securing a graphic


> Is there a way in PHP that I can secure a graphic, so that when the page
is
> loaded it will show the graphic, but is not able to be right clicked on or
> downloaded to there desktop.
>
> Thanks
> Ryan
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message --- At 6/20/2003 02:33 AM, Haseeb Iqbal wrote:

> yeah there is a way

No there is not a way. The way the web works is by sending your content to someone else' computer. Once it's there, they have a copy, whether it's in their cache or actually saved as a file. There's no way to prevent a determined user from stealing your images, trust me on this one, a good number of my photoshops are being sent around as anonymous "funny" emails.

You can disable right-clicking with javascript, but this is pointless. In IE, the user can just drag your image up to the address bar and poof, your javascript is gone. And on browsers that can't do that, there's still the cache. Even if, by some scripting voodoo you manage to keep your images from ending up in the cache, what's the keep the user from just doing a screen capture?
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


--- End Message ---
--- Begin Message ---
> From: "Ryan Holowaychuk" <[EMAIL PROTECTED]>
> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> Sent: Friday, June 20, 2003 2:26 AM
> Subject: [PHP] securing a graphic
>> Is there a way in PHP that I can secure a graphic, so that when the page
is
>> loaded it will show the graphic, but is not able to be right clicked on
or
>> downloaded to there desktop.
>>
>> Thanks
>> Ryan
>
>
>"Haseeb Iqbal" <[EMAIL PROTECTED]> wrote in message
news:LAW15->[EMAIL PROTECTED]
> yeah there is a way you have to use some third party tools for that.
> http://www.antssoft.com/htmlprotector/index.htm
> .php can't do this AFAIK


This "security tool" will stop 95% of the general public,
mostly by looking scary.  Anyone who knows what they're
doing will go through it in about 20 seconds.


They work in three steps:

  first, they have a decryption function which is url-encrypted:


    function hp_d01(s) {
      var
        o="",
        ar = new Array(),
        os = "",
        ic = 0;

      for ( i = 0; i < s.length; i++ ) {        // for each char in the
encrypted string
        c = s.charCodeAt(i);                // get the ascii value

        if ( c < 128 )                    // if 7bit ie all alphanumberics
and punctuation
          c = c^2;                        // XOR with 00000010    ie flip
second-lowest bit

        os += String.fromCharCode(c);        // cast back to char and append
to working string

            // this stuff is for working around Javascript's slow string
concatenation:
            // work with a temporary string until it gets up to 80
characters long,
            // then store it and start a new working string.
        if ( os.length > 80 ) {
          ar[ic++] = os;
          os=""
        }
      }

            // concatenate all the temporary strings to get the final
decrypted string
      o = ar.join("") + os;
      document.write(o)
    }



  second, they use their decryptor to expand a block of code
  which tries to lock down the browser to as great an extent
  as possible, encrypted in their custom code.


  third, in the body of the page, they use their decryptor to
  expand the actual body of the page.


Here is the page code with all the decryption/lockdown junk
stripped out:


<html>
<head><meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Sample page protected by HTMLProtector</title>
<STYLE type=text/css>
<!--

  body, p, td, dd, dt, ul, ol, li, blockquote {font-family: "verdana",
"arial", "sans-serif"; font-size: 9pt; color: 111111;}
  div.sidebar {font-size: 8pt; margin: 0}
  h1, div.title {color: 000079; font-size: medium; font-weight: bold;
margin-bottom: 0}
  h2 {color: 000079; font-size: small; font-weight: bold; margin-bottom: 0}
  dt {color: 000079; font-weight: bold; margin-bottom: 0.5em; margin-top:
2em}

  A:aalink {font-weight:bold; text-decoration: none}
-->
</STYLE>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<h1 align="center">Sample page protected by HTMLProtector<br>
  <br>
</h1>
<table width="100%" border="0">
  <tr>
    <td width="120">
      <div align="center"><img src="/image/sample.gif" width="80"
height="80"></div>
    </td>
    <td width="874">
      <p align="center">It's a sample text paragraph.<br>
        <a href="/htmlprotector/index.htm">It's a sample link</a>.<br>
        <a href="mailto:[EMAIL PROTECTED]">It's a sample email
link</a>.</p>
    </td>
  </tr>
</table>
<p>This page has been protected by HTMLProtector with follow features:</p>
<ul>
  <li>Protect BODY section</li>
  <li>Make page expire immediately</li>
  <li>Disable Internet Explorer 6 image toolbar<br>
  </li>
  <li>Disable right mouse button</li>
  <li>Disable text select</li>
  <li>Disable off-line viewing</li>
  <li>Don't display links in status bar</li>
  <li>Disable page printing</li>
  <li>Disable clipboard and printscreen</li>
  <li>Disable drag and drop</li>
  <li>Disable adobe acrobat web capture<br>
  </li>
  <li>Kill frame</li>
  <li>Domain lock</li>
  <li>URL lock</li>
</ul>
<p>Please take a look on what HTMLProtector can do for you!</p>
<p>&nbsp; </p>
</body>
</html>



As you are looking specifically for image
protection, notice the line
<img src="/image/sample.gif" width="80" height="80">

Try visiting
http://www.antssoft.com/image/sample.gif

Real secure, eh?


The bottom line is, the web page and graphic must
be publically available and decryptable in order for
people to view it in a browser.  If the browser can
decode it, so can just about anyone that knows what
they're doing.

Also note, this scheme adds about 4 1/2 kb to
the size of your page and makes it unusable by
non-Javascript-enabled browsers.  Why bother?

--
Hugh Bothwell     [EMAIL PROTECTED]     Kingston ON Canada
v3.1 GCS/E/AT d- s+: a- C+++ L++>+++$ P+ E- W+++$ N++ K? w++ M PS+
PE++ Y+ PGP+ t-- 5++ !X R+ tv b++++ DI+++ D-(++) G+ e(++) h-- r- y+




--- End Message ---
--- Begin Message ---
Hi, I’m having this problem:

I set a cookie using this:

                        $sql = "UPDATE member SET cookie=$cookie WHERE
".
                          "id = $this->id";
                        $this->mysql->query($sql);
                        $cookie =
urlencode(serialize(array($_SESSION['username'], $cookie)));
                        setcookie('auth', $cookie, time() + 31104000,
'/', 'www.reddast.is');

And then when I check the cookie using this:

                list($username, $cookie) =
@unserialize(urldecode($cookie));


using this query:

                "SELECT * FROM member WHERE (username = $username) AND
(cookie = $cookie)";

it looks like this when I debug the script and see the actual query that
is sent to Mysql:

                "SELECT * FROM member WHERE (username = 'ofjord') AND
(cookie = '\'86aa5f7e6469efe09a17089957f59b0f\'')";


I hope someone has any answers on this.

Best regards,
Sævar Öfjörð Magnússon
[EMAIL PROTECTED]
ICELAND


--- End Message ---
--- Begin Message ---
I have this bit of code to crypt user password in user registration as shown
below.

 $cryptpass=crypt($makepass);
which generated crypted password like eg 37Q9fppLHc4fQ with php 4.0

And am using the codes below to check for valid login..
// $pass -  from login page
// $dbpass - from the database
     $pass=crypt($pass,substr($dbpass,0,2));
        }
        if (strcmp($dbpass,$pass)) {
                        return(0);
        }


Recently i have moved the same file to a new server with php 4.3.1 the
problem is the same piece of codes above generates completely differen
crypted  value eg.$1$RjZHv7qx$h/L9ZUNT48rilHB6fGoMP/  .. hence the login
codes above does not work... :(

Please someone tell me that  i am not going mad....

please help
huzz




--- End Message ---
--- Begin Message ---
Try using md5() instead because it is more widely supported than crypt()
and it leaves no room for errors.

Hope it helps,
Sævar ICELAND


-----Original Message-----
From: Huzz [mailto:[EMAIL PROTECTED] 
Sent: 19. júní 2003 21:43
To: [EMAIL PROTECTED]
Subject: [PHP] strange crypt() problem 

I have this bit of code to crypt user password in user registration as
shown
below.

 $cryptpass=crypt($makepass);
which generated crypted password like eg 37Q9fppLHc4fQ with php 4.0

And am using the codes below to check for valid login..
// $pass -  from login page
// $dbpass - from the database
     $pass=crypt($pass,substr($dbpass,0,2));
        }
        if (strcmp($dbpass,$pass)) {
                        return(0);
        }


Recently i have moved the same file to a new server with php 4.3.1 the
problem is the same piece of codes above generates completely differen
crypted  value eg.$1$RjZHv7qx$h/L9ZUNT48rilHB6fGoMP/  .. hence the login
codes above does not work... :(

Please someone tell me that  i am not going mad....

please help
huzz




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



--- End Message ---
--- Begin Message ---
I already have about 1000 members their password crypted using crypt();
would they able to login using their password or they have to change it
again??

Thanks


"SævË Ölêöyp" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Try using md5() instead because it is more widely supported than crypt()
and it leaves no room for errors.

Hope it helps,
Sævar ICELAND


-----Original Message-----
From: Huzz [mailto:[EMAIL PROTECTED]
Sent: 19. júní 2003 21:43
To: [EMAIL PROTECTED]
Subject: [PHP] strange crypt() problem

I have this bit of code to crypt user password in user registration as
shown
below.

 $cryptpass=crypt($makepass);
which generated crypted password like eg 37Q9fppLHc4fQ with php 4.0

And am using the codes below to check for valid login..
// $pass -  from login page
// $dbpass - from the database
     $pass=crypt($pass,substr($dbpass,0,2));
        }
        if (strcmp($dbpass,$pass)) {
                        return(0);
        }


Recently i have moved the same file to a new server with php 4.3.1 the
problem is the same piece of codes above generates completely differen
crypted  value eg.$1$RjZHv7qx$h/L9ZUNT48rilHB6fGoMP/  .. hence the login
codes above does not work... :(

Please someone tell me that  i am not going mad....

please help
huzz




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




--- End Message ---
--- Begin Message ---
Well, if you don't find another solution for this, you could generate
random passwords for each member and mail them to them. Then you would
md5() them and update the DB with new md5()'ed passwords... This is not
the easy way out so I hope someone finds out why the crypt() is behaving
strangely.

Sævar - ICELAND

-----Original Message-----
From: Huzz [mailto:[EMAIL PROTECTED] 
Sent: 19. júní 2003 22:43
To: [EMAIL PROTECTED]
Subject: Re: [PHP] strange crypt() problem 

I already have about 1000 members their password crypted using crypt();
would they able to login using their password or they have to change it
again??

Thanks


"SævË Ölêöyp" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Try using md5() instead because it is more widely supported than crypt()
and it leaves no room for errors.

Hope it helps,
Sævar ICELAND


-----Original Message-----
From: Huzz [mailto:[EMAIL PROTECTED]
Sent: 19. júní 2003 21:43
To: [EMAIL PROTECTED]
Subject: [PHP] strange crypt() problem

I have this bit of code to crypt user password in user registration as
shown
below.

 $cryptpass=crypt($makepass);
which generated crypted password like eg 37Q9fppLHc4fQ with php 4.0

And am using the codes below to check for valid login..
// $pass -  from login page
// $dbpass - from the database
     $pass=crypt($pass,substr($dbpass,0,2));
        }
        if (strcmp($dbpass,$pass)) {
                        return(0);
        }


Recently i have moved the same file to a new server with php 4.3.1 the
problem is the same piece of codes above generates completely differen
crypted  value eg.$1$RjZHv7qx$h/L9ZUNT48rilHB6fGoMP/  .. hence the login
codes above does not work... :(

Please someone tell me that  i am not going mad....

please help
huzz




-- 
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



--- End Message ---
--- Begin Message ---
It looks like "Some operating systems support more than one type of
encryption. In fact, sometimes the standard DES-based encryption is
replaced by an MD5-based encryption algorithm. The encryption type is
triggered by the salt argument. At install time, PHP determines the
capabilities of the crypt function and will accept salts for other
encryption types. If no salt is provided, PHP will auto-generate a
standard two character salt by default, unless the default encryption type
on the system is MD5, in which case a random MD5-compatible salt is
generated. PHP sets a constant named CRYPT_SALT_LENGTH which tells you
whether a regular two character salt applies to your system or the longer
twelve character salt is applicable."

The first server you were using was using DES, this new server is using
MD5. Since hashes are one-way algorithms, you appear to be SOL. However,
you might be able to work something with mcrypt and someone who knows
anything about it.

http://www.php.net/manual/en/ref.mcrypt.php

Jeff

On Jun 19, 2003, "Sævar Öfjörð" claimed that:

|
|Well, if you don't find another solution for this, you could generate
|random passwords for each member and mail them to them. Then you would
|md5() them and update the DB with new md5()'ed passwords... This is not
|the easy way out so I hope someone finds out why the crypt() is behaving
|strangely.
|
|Sævar - ICELAND
|
|-----Original Message-----
|From: Huzz [mailto:[EMAIL PROTECTED]
|Sent: 19. júní 2003 22:43
|To: [EMAIL PROTECTED]
|Subject: Re: [PHP] strange crypt() problem
|
|I already have about 1000 members their password crypted using crypt();
|would they able to login using their password or they have to change it
|again??
|
|Thanks
|
|
|"SævË Ölêöyp" <[EMAIL PROTECTED]> wrote in message
|news:[EMAIL PROTECTED]
|Try using md5() instead because it is more widely supported than crypt()
|and it leaves no room for errors.
|
|Hope it helps,
|Sævar ICELAND
|
|
|-----Original Message-----
|From: Huzz [mailto:[EMAIL PROTECTED]
|Sent: 19. júní 2003 21:43
|To: [EMAIL PROTECTED]
|Subject: [PHP] strange crypt() problem
|
|I have this bit of code to crypt user password in user registration as
|shown
|below.
|
| $cryptpass=crypt($makepass);
|which generated crypted password like eg 37Q9fppLHc4fQ with php 4.0
|
|And am using the codes below to check for valid login..
|// $pass -  from login page
|// $dbpass - from the database
|     $pass=crypt($pass,substr($dbpass,0,2));
|        }
|        if (strcmp($dbpass,$pass)) {
|                        return(0);
|        }
|
|
|Recently i have moved the same file to a new server with php 4.3.1 the
|problem is the same piece of codes above generates completely differen
|crypted  value eg.$1$RjZHv7qx$h/L9ZUNT48rilHB6fGoMP/  .. hence the login
|codes above does not work... :(
|
|Please someone tell me that  i am not going mad....
|
|please help
|huzz
|
-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED



--- End Message ---
--- Begin Message ---
Thanks guys for your suggestions ...

"Jeff Harris" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
It looks like "Some operating systems support more than one type of
encryption. In fact, sometimes the standard DES-based encryption is
replaced by an MD5-based encryption algorithm. The encryption type is
triggered by the salt argument. At install time, PHP determines the
capabilities of the crypt function and will accept salts for other
encryption types. If no salt is provided, PHP will auto-generate a
standard two character salt by default, unless the default encryption type
on the system is MD5, in which case a random MD5-compatible salt is
generated. PHP sets a constant named CRYPT_SALT_LENGTH which tells you
whether a regular two character salt applies to your system or the longer
twelve character salt is applicable."

The first server you were using was using DES, this new server is using
MD5. Since hashes are one-way algorithms, you appear to be SOL. However,
you might be able to work something with mcrypt and someone who knows
anything about it.

http://www.php.net/manual/en/ref.mcrypt.php

Jeff

On Jun 19, 2003, "Sævar Öfjörð" claimed that:

|
|Well, if you don't find another solution for this, you could generate
|random passwords for each member and mail them to them. Then you would
|md5() them and update the DB with new md5()'ed passwords... This is not
|the easy way out so I hope someone finds out why the crypt() is behaving
|strangely.
|
|Sævar - ICELAND
|
|-----Original Message-----
|From: Huzz [mailto:[EMAIL PROTECTED]
|Sent: 19. júní 2003 22:43
|To: [EMAIL PROTECTED]
|Subject: Re: [PHP] strange crypt() problem
|
|I already have about 1000 members their password crypted using crypt();
|would they able to login using their password or they have to change it
|again??
|
|Thanks
|
|
|"SævË Ölêöyp" <[EMAIL PROTECTED]> wrote in message
|news:[EMAIL PROTECTED]
|Try using md5() instead because it is more widely supported than crypt()
|and it leaves no room for errors.
|
|Hope it helps,
|Sævar ICELAND
|
|
|-----Original Message-----
|From: Huzz [mailto:[EMAIL PROTECTED]
|Sent: 19. júní 2003 21:43
|To: [EMAIL PROTECTED]
|Subject: [PHP] strange crypt() problem
|
|I have this bit of code to crypt user password in user registration as
|shown
|below.
|
| $cryptpass=crypt($makepass);
|which generated crypted password like eg 37Q9fppLHc4fQ with php 4.0
|
|And am using the codes below to check for valid login..
|// $pass -  from login page
|// $dbpass - from the database
|     $pass=crypt($pass,substr($dbpass,0,2));
|        }
|        if (strcmp($dbpass,$pass)) {
|                        return(0);
|        }
|
|
|Recently i have moved the same file to a new server with php 4.3.1 the
|problem is the same piece of codes above generates completely differen
|crypted  value eg.$1$RjZHv7qx$h/L9ZUNT48rilHB6fGoMP/  .. hence the login
|codes above does not work... :(
|
|Please someone tell me that  i am not going mad....
|
|please help
|huzz
|
-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED




--- End Message ---
--- Begin Message ---
Thank you to those of you who helped me with my last problem earlier today.

Now I have a text file (setup.txt) that has a series of values all seperated by 
\r\n's.  Inside of another file I'm trying to read setup.txt into $rawSetupData and 
explode that with \r\n's into an array called $setupData.  My problem is that the 
explode function doesn't seem to be doing anything, and neither is split which I tried 
also.  Here is my code:

setup.txt
***
John\'s X Log
10
5
example.com
treeclimber56
ab3c45def
***

test.php
***
<?php

if (file_exists("setup.txt")) {
        $rawSetupData = readfile("setup.txt");
        $setupData = explode("\r\n", $rawSetupData);
        echo $setupData[0];
}
else echo "Error opening \"setup.txt\"";

?>
***

Actual results of running test.php
***
John\'s X Log 10 5 example.com treeclimber56 ab3c45def 61
***

Desired reults of running test.php
***
John's X Log
***

Other problem:
In the actual results of running test.php where is the 61 coming from?

Thank you,
--
Kyle

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

why don't you just do this?

***
<?php
if(file_exists("setup.txt")){
  $lines=file("setup.txt");
  echo stripslashes($lines[0]);
}
else echo "Error opening \"setup.txt\"";
?>
***

file() returns the file in an array, each line as new value, so line nr.
1 is $line[0], line nr. 2 is $line[1] etc...
I added stripslashes() on the output so that you won't get "John\'s X
Log"


Sævar - ICELAND


--- End Message ---
--- Begin Message --- At 6/19/2003 10:41 PM, Kyle Babich wrote:

> Inside of another file I'm trying to read setup.txt into $rawSetupData and explode that with \r\n's
> into an array called $setupData.

Why on earth?

http://us4.php.net/file


> <?php > > if (file_exists("setup.txt")) { > $rawSetupData = readfile("setup.txt"); > $setupData = explode("\r\n", $rawSetupData); > echo $setupData[0]; > } > else echo "Error opening \"setup.txt\""; > > ?>

No no nonono

<?
        if ($file_exists("setup.txt")) {
                $setupData = file("setup.txt");
        }
        else {
                echo 'Error opening "setup.txt"';
        }
?>

--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


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

I am building an database of wines.  I have fields of stuff like year,
grape, etc.  However, I want to be able to go in and change something
without having to retype every field.  As I have it right now, I use the
UPDATE where id=$id function.  However, this changes EVERY field. For
example, if I want to only change the grape field and leave everything else
the same (so I thus leave those fields blank) it overwrites the others with
a blank field.

Is there anyway to where if it reads a blank field instead of deleting the
old information, the update php file just leaves it the same?


thanks very much for any help,
Matt Hedges





-- 
___________________________
| Matt Hedges
| http://hedgesinnovations.com
|



--- End Message ---
--- Begin Message ---
Hi Matt
Am Freitag, 20. Juni 2003 01:06 schrieb Matt Hedges:
> Hello,
>
> I am building an database of wines.  I have fields of stuff like year,
> grape, etc.  However, I want to be able to go in and change something
> without having to retype every field.  As I have it right now, I use the
> UPDATE where id=$id function.  However, this changes EVERY field. For
> example, if I want to only change the grape field and leave everything else
> the same (so I thus leave those fields blank) it overwrites the others with
> a blank field.
 UPDATE tablename SET grape = 'someNewGrape' WHERE id = '$id'
This updates only the grape-field and leaves everything else as is.

CU
Thorsten
-- 
Thorsten Körner         http://www.123tkShop.org

--- End Message ---
--- Begin Message ---
The right SQL syntax would be:

UPDATE $table SET type='$type', year='$year' WHERE id='$id';

Sævar - ICELAND



-----Original Message-----
From: Matt Hedges [mailto:[EMAIL PROTECTED] 
Sent: 19. júní 2003 23:07
To: [EMAIL PROTECTED]
Subject: [PHP] How to UPDATE only certain fields

Hello,

I am building an database of wines.  I have fields of stuff like year,
grape, etc.  However, I want to be able to go in and change something
without having to retype every field.  As I have it right now, I use the
UPDATE where id=$id function.  However, this changes EVERY field. For
example, if I want to only change the grape field and leave everything
else
the same (so I thus leave those fields blank) it overwrites the others
with
a blank field.

Is there anyway to where if it reads a blank field instead of deleting
the
old information, the update php file just leaves it the same?


thanks very much for any help,
Matt Hedges





-- 
___________________________
| Matt Hedges
| http://hedgesinnovations.com
|



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



--- End Message ---
--- Begin Message ---
If register_globals is turned off, and the php version being used is pre-4.1
(meaning no $_SESSION array) how do you access sessions values? How do you
"register" them?



--- End Message ---
--- Begin Message ---
>From manual on www.php.net:
"Use $HTTP_SESSION_VARS with PHP 4.0.6 or less"

Sævar - ICELAND


-----Original Message-----
From: Lee Herron QCS [mailto:[EMAIL PROTECTED] 
Sent: 20. júní 2003 00:01
To: [EMAIL PROTECTED]
Subject: [PHP] Pre-4.1 / register_globals=off

If register_globals is turned off, and the php version being used is
pre-4.1
(meaning no $_SESSION array) how do you access sessions values? How do
you
"register" them?



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



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

safe mode on and mass mailing wished. I know that it's not possible to set
the time limit, when safe mode is on. Sure mass mailing using mail function
takes longer than default execution time of the script. My codes should be
portable, that why modification of php.ini is not an option. The users
shouldn't be experinced and authorized to do this. In brief, I have to find
a solution without a need to work in shell.
So, due to my theoratical knowledge it seems to be a solution, to queue the
mails to sendmail by using popen. Is it true? Or what could be your
suggestion for this issue.

Thanks in advance,

Senih

---
Outgoing mail is certified Virus Free.
Bu mesaj virüs taramasından geçmiştir.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.489 / Virus Database: 288 - Release Date: 10.06.2003

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

I just wrote an script, which scans emails passed to it via a pipe and adds the content to a MySQL database.
Attachments are also supported, however, zip files simply don't work. They get processed & saved into the database just fine, but once i grab such a zip file from the database, it shows up as being empty, whereas it still has the same filesize as the file attached to the email.
I checked and the zip file attachment gets base64 encoded, which the script supports as well, so i am quite clueless, what could be causing the zip file to appear empty.

I only found some similar posts in the net, but none offered a solution.

If anyone knows, what could be the possible problem with those zip files, then please let me know :)

Thanks,
Duncan



--- End Message ---
--- Begin Message ---
I have a class method that does one thing and one thing only.
Escape characters before going to the DB.
Part of it is ->
if (!get_magic_quotes_gpc())
{
   $string = pg_escape_string( $string );
}

return "'" . $string . "'";

In everyday get/post operation it seems to work flawlessly.
I've come across a situation where Im parsing an XML file to insert into the DB.
The content needed to be escaped, so I modified the above to ->
if (!get_magic_quotes_gpc() || !get_magic_quotes_runtime())
{
$string = pg_escape_string( $string );
}

return "'" . $string . "'";

And the XML data is escaped correctly for DB insertion.

Now going back to my everyday get/post operation, the code is broken somehow, as content,
that is not normally escaped is escaped, and breaking stuff, like serialized data in the DB.
Is the above code valid for escaping characters in get/post/cookie and external data operation?
Can they be safetly used together as in my example above. (Where if one condition doesn't meet, and the other does, escape characters).
Or there may be something else in my code that is messing things up.

Any pointers/experience would be greatly appreciated.
Thanks


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

Gerard Samuel wrote:
I have a class method that does one thing and one thing only.
Escape characters before going to the DB.
Part of it is ->
if (!get_magic_quotes_gpc())
{
   $string = pg_escape_string( $string );
}

return "'" . $string . "'";

In everyday get/post operation it seems to work flawlessly.
I've come across a situation where Im parsing an XML file to insert into the DB.
The content needed to be escaped, so I modified the above to ->
if (!get_magic_quotes_gpc() || !get_magic_quotes_runtime())
{
$string = pg_escape_string( $string );
}

return "'" . $string . "'";

And the XML data is escaped correctly for DB insertion.

Now going back to my everyday get/post operation, the code is broken somehow, as content,
that is not normally escaped is escaped, and breaking stuff, like serialized data in the DB.
Is the above code valid for escaping characters in get/post/cookie and external data operation?
Not really. You check if either one is false, and then you escape. But you don't know where the data come from. The data might be from POST and are already escaped by magic quotes, but magic_quotes_runtime is off, so it's escaped once more.
So you need to make two class methods, one for escaping gpc variables, another one for escaping runtime variables. Then you only need to check get_magic_quotes_gpc() or get_magic_quotes_runtime() respectively.

Can they be safetly used together as in my example above. (Where if one condition doesn't meet, and the other does, escape characters).
Or there may be something else in my code that is messing things up.

Any pointers/experience would be greatly appreciated.
Thanks




--- End Message ---
--- Begin Message ---
this is slightly off-topic. I run a nonprofit website where people are
invited to contribute articles, papers, etc.
i'm in search of a system where i can manage all this website maintainence
(backups, restarting servers) and on-going correspondence. in some cases,
they ask me to contact them 2 months later, etc. What i don't need is a
content management system.
I need a system to hold all this task together. It doesn't have to be
web-based.
thanks.

Rgds
nyon


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.463 / Virus Database: 262 - Release Date: 17/03/2003


--- End Message ---
--- Begin Message ---
<?php

$myimage="..//..//site//images//2.jpg";

header("Content-type: image/jpeg");
fopen ("$myimage", "r");
readfile("$myimage") ;
fclose("$myimage");

?>

This seemed to do the trick for me.  Thank you.

/ Mark

----- Original Message -----
From: "CPT John W. Holmes" <[EMAIL PROTECTED]>
To: "Awlad Hussain" <[EMAIL PROTECTED]>; "Mark Tehara"
<[EMAIL PROTECTED]>; "PHP" <[EMAIL PROTECTED]>
Sent: Friday, June 20, 2003 1:14 AM
Subject: Re: [PHP] [Newman] Passing an image through a php file.


> > try this:
> > <?php
> >
> > header("Content-type: image/jpeg");
> > fopen ("d:/crushme/images/1.jpg", "r");
>
> Just my opinion, but maybe you should try reading the file and echoing the
> data instead of just opening it. :)
>
> ---John Holmes...
>
>
> > I would like to pass an image throught
> > http://server/newman/ImageTEST/image.php
> >
> > 1. I need the headers (Assuming) <? header("Content-type: image/jpeg");
> ?>
> > would make the computer think its a image file.
> > 2. load the image using fopen ("d://crushme//images//1.jpg", "r");
> >
> >
> > <?php
> >
> > header("Content-type: image/jpeg");
> > fopen ("d://crushme//images//1.jpg", "r");
> >
> > ?>
> >
> >
> >  The image "http://server/newman/ImageTEST/image.php"; cannot be
displayed,
> > because it contains errors.
> >
> > This returns this error (above)
> >
> > Yes 1. Image is in the right location.
> > Yes 2. I'm stuck.
> >
> > Any Suggestions would be very good.
>
>



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

Any ideas on this? I have a form some users try and try to reload and it
floods my mailbox

Thanks,
Louie

--- End Message ---
--- Begin Message --- Miranda, Joel Louie M wrote:
Any ideas on this? I have a form some users try and try to reload and it
floods my mailbox

Restrict them from submitting the form for X seconds?

or

Use a middle-man page that processes your form and then redirects back to the form with a clean URL; the refresh will only refresh the form.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com





--- End Message ---
--- Begin Message --- Miranda, Joel Louie M wrote:

Hello,

Any ideas on this? I have a form some users try and try to reload and it
floods my mailbox

This is one of the most asked questions, right behind "OMG! MY VARIABLES DONT PASS!!!!111". Search the archives.

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.



--- End Message ---
--- Begin Message ---
Do you have examples?

-----Original Message-----
From: Mark Tehara [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 20, 2003 11:33 AM
To: Miranda, Joel Louie M
Subject: Re: [PHP] Multiple Submission of the Same Form


Use a Databace and have a DateStamp String and an IP string, then when the
post has happened it cheks for the IP and Time and if its with in the last
minute or something the email won't send ...

/ Mark

----- Original Message -----
From: "Miranda, Joel Louie M" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 20, 2003 3:31 PM
Subject: [PHP] Multiple Submission of the Same Form


> Hello,
>
> Any ideas on this? I have a form some users try and try to reload and 
> it floods my mailbox
>
> Thanks,
> Louie
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Hey guys,

I want to know how I can add different border "styles" around an image.
Here's what I do to create an image:

function output_new_img () {

    $new = $this->calc_new_size ($this->max_w, $this->max_h);
    $new_w = $new[0];
    $new_h = $new[1];

    $src_img = ImageCreateFromJPEG ($this->temp_img);
    $dst_img = ImageCreateTrueColor ($new_w, $new_h);
    ImageCopyResampled ($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h,
ImageSX($src_img), ImageSY($src_img));

    if (ImageJPEG($dst_img, $this->dst_path . $this->img_name, 95)) {
        return true;
    }
}

Now, what I want to do is draw a border style around that certain image. The
border can be different widths. It can either be created outside the borders
of the image, or on the inside of the borders of the image, I need to have
it both ways. Since this is a .jpg file being created, I want to do this
"while" I'm creating this image before it saves it to file. The reason for
this is that a *.jpg image compresses itself each time it is saved, which
results in poor quality the more you change it and save it.

Now to the question. Which combinations of image functions do I need to
achieve this goal? And how will each of these functions help me. For
example, will a certain function overlap a border style on top of the image
itself? Or does a certain function just draw lines around the image. Just
need an explaination of why I must use a certain function that any of you
would recommend. I think maybe Jason Wong would be a good candidate to
answer this one for me. He's good at pointing out references. I just need a
starting point and some suggestions on the different ways to achieve my
goal.

Thanks guys...


--- End Message ---
--- Begin Message ---
Title: preg_match

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I am trying to code a search, and i need to get my matching
_expression_ to work right.  The user can enter a value swhich is
stored in the vraible $search.

What the below loop needs to do, is search each entry of the array
for any occurance of the $search string.  If i hard code in the
string it works, but not when passed as a varaible.  Is there
something I am missing? Do i need to convert the $search variable to
soetmhing?

        if (preg_match ("/.*?\\\$search.*?/i",$date[$i])) {
                print "$date[$i]<br>";
        }

- ---
Aaron Axelsen
AIM: AAAK2
Email: [EMAIL PROTECTED]

Want reliable web hosting at affordable prices?
www.modevia.com

Web Dev/Design Community/Zine
www.developercube.com



-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPvKWA7rnDjSLw9ADEQIfGQCgwAO5ikh/RIN5OXoVkC8F4FH/YAoAoJE5
zMxHkRssHbU2Vm4svv2hId8O
=DJOi
-----END PGP SIGNATURE-----


--- End Message ---
--- Begin Message ---
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!

--- End Message ---
--- Begin Message ---
check your php.ini file to see if you have register_globals set to "on" or
"off" (probably "off")

You can either turn it "on" or use $_GET["name"]

-----Original Message-----
From: Robby Ku [mailto:[EMAIL PROTECTED]
Sent: Friday, 20 June 2003 4:06 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Can't pass query string from HTML to PHP


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!
__________ Information from NOD32 1.436 (20030612) __________

This message was checked by NOD32 for Exchange e-mail monitor.
http://www.nod32.com




--- End Message ---
--- Begin Message ---
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!



--- End Message ---
--- Begin Message ---
Hi again,
 
Thanks for the fast response given. I tried both Jan's and Martin's method but it 
won't solve the problem. 
 
I've tried to change "register_globals = On" in php.ini and i got the same result.
 
I've tried using $_Get['name'] instead of $name but i got the following error:
 
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or 
T_VARIABLE or T_NUM_STRING in c:\inetpub\wwwroot\Welcome.php on line 5

and I've tried Jan's method and was still unable to pass the query string
 
Pls help!
 
Beginner,
Robbie



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

--- End Message ---
--- Begin Message ---
Hello!
I have an Apache web-server with PHP-4.3.2 installed. Directory
structure of my DocRoot is as follows:
www/
    docs/
    tm/
    tts/
    cache/
    lib/
    index.html

docs, tm, tts are directories of projects, published through ftp by
different people,
lib - common directory, containing php-scripts,
cache - common directory, where scripts of all projects must be able to
create temporary files.
I want my projects not to be able to read scripts of each other, BUT use
common dirs.
open_base_dir in each directory of docs, tm, tts seems to be be a good
idea. BUT, in this case projects scripts won't be able to use cache and lib.
Other way - I can turn on safe_mode and include www/lib in
safe_mode_include_dir. In this case projects will be able to include
scripts from lib, BUT won't be able to create files in cache because
scripts and cache have different owners.
So, can you tell me some decision to solve my problem?

--
Andrew




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

I am trying to configure one snap shot of PHP5 in IIS 6.0 to test some
stuff, but somehow i can't make it work correctly.

This is what i get:
--------------------------------------------------------
CGI Error
The specified CGI application misbehaved by not returning a complete set of
HTTP headers.
--------------------------------------------------------

I dont know what it is...

I have configured PHP4.3.2 and it works correcly...



The installation procedure i followed to install PHP5 is... assume C:\phpx\
as the php root folder.

1. Copy php4ts.dll to C:\WINDOWS\SYSTEM32\  (DLL version 5.0.0)

2. Add extension to IIS6 as .phpx with the following cgi-handler:
    "C:\phpx\php.exe"-c php.ini

3. Set IIS6 to allow "All Uknown CGI extensions" in the Web Service
Extension

4. Edit C:\phpx\php.ini
                    cgi.force_redirect = 0;
                    fastcgi.impersonate = 1;
                    cgi.rfc2616_headers = 1;
                    and no extensions loaded

5. Test it with...
    http://localhost/index.phpx
    where index.phpx has the following contents:
    <?php echo "Hello World"; ?>


I really dunno why it happens, if someone have already configured a snapshot
of PHP5 on a win2003 box please tell me how to do it.


Any help would be appreciated.

Roberto Ramírez


--- End Message ---
--- Begin Message ---
I have this script named test.php:

<?php
// Get a file into an array.  In this example we'll go through HTTP to get 
// the HTML source of a URL.
$lines = 
file('http://www.google.fr/search?q=beautiful&hl=fr&lr=&ie=UTF-8&oe=UTF-8&start=10&sa=N');

// Loop through our array, show html source as html source; and line numbers too.
foreach ($lines as $line_num => $line) {
    echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br>\n";
}
?>

This script dosen't work. I receive the following warning: 
Warning: 
file("http://www.google.fr/search?q=beautiful&hl=fr&lr=&ie=UTF-8&oe=UTF-8&start=10&sa=N";)
 - No such file or directory in test.php on line 4

With this script I want to get the HTML source of a search result on google. I tried 
with another search engines and it works, only with google dosen't work.

For examle I have the script:
<?php
// Get a file into an array.  In this example we'll go through HTTP to get 
// the HTML source of a URL.
$lines = file('http://search.yahoo.com/search?p=sexe&ei=UTF-8&b=1');

// Loop through our array, show html source as html source; and line numbers too.
foreach ($lines as $line_num => $line) {
    echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br>\n";
}
?>
and I have no problem with it.

Can you help me? Maybe you have a suggestion what shall I do to make it work?

This is pretty stragne because I tested the code at home and it works. I also tested 
it at one of my friends and it dosen't work, at my work also it dosen't work.

Thanks for your support!
Adina

P.S. I tried to change the user agent header and it dosen't work.

--- End Message ---
--- Begin Message ---
On Friday 20 June 2003 16:23, Adina wrote:
> I have this script named test.php:

[snip]

> This script dosen't work. I receive the following warning:
> Warning:
> file("http://www.google.fr/search?q=beautiful&hl=fr&lr=&ie=UTF-8&oe=UTF-8&s
>tart=10&sa=N") - No such file or directory in test.php on line 4
>
> With this script I want to get the HTML source of a search result on
> google. I tried with another search engines and it works, only with google
> dosen't work.

You're not supposed to use Google like that. Use their API.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
A prisoner of war is a man who tries to kill you and fails, and then
asks you not to kill him.
                -- Sir Winston Churchill, 1952
*/


--- End Message ---
--- Begin Message ---
I'm using LDAP to authenticate my users. login.php and
any script that requires authentication start off with
the following code:
--
session_start();
if (session_is_registered("valid_user")) {
header( "Location: admin.php" );
--

The ldap binds as such:
ldap_bind($ds,
"uid=$uid,ou=people,dc=server,dc=domain,dc=dom",
$passw);

What I want is to be able to display AND use the $uid
throughout the other scripts.
How can I do this?

thanks,

Jay

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

--- End Message ---

Reply via email to