php-general Digest 13 Dec 2004 11:44:43 -0000 Issue 3167

Topics (messages 204122 through 204152):

Re: sharing info between websites with XML?
        204122 by: John Holmes

PHP &Apache Upload file Permission denied
        204123 by: Michael Leung
        204125 by: Raditha Dissanayake
        204126 by: Andre Dubuc
        204127 by: Michael Leung
        204129 by: Travis Conway
        204132 by: Michael Leung
        204133 by: Raditha Dissanayake
        204134 by: Travis Conway

Re: Classes and Functions
        204124 by: Rory Browne

Automaticly Play Sound when MySql Reach some Number
        204128 by: Sejati Opreker

Re: Question: Repopulating form parameters
        204130 by: David Robley
        204144 by: Stuart Felenstein
        204148 by: Jason Wong
        204150 by: Stuart Felenstein

Re: Infinity and nested categories
        204131 by: David Robley

still have the same problem
        204135 by: Mecnun
        204138 by: Marek Kilimajer
        204139 by: David Robley

Re: empty() problem
        204136 by: yangshiqi

Re: LDAP and referrals
        204137 by: List User

remote permissions on MySQL
        204140 by: Alessandro Rosa
        204141 by: Jason Wong

STUMPED: path/style vars in Windows with IIS
        204142 by: Ck
        204146 by: M. Sokolewicz
        204149 by: Ck

How can I fix that
        204143 by: Aalee
        204145 by: M. Sokolewicz
        204151 by: Robinson, Matthew

Re: File upload problems using Apache 1.3 on Debian stable
        204147 by: coding.digital-data.co.uk

sql syntax problem
        204152 by: Merlin

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 ---
> From: p80 <[EMAIL PROTECTED]>
 
> >> I have several website that use mysql as a database and I would like them
> >>to access each other DB. The problem is that I can't connect to each other
> >>mysql
> >> DB so I'm looking for a way to do so.
> 
> >Why aren't you able to connect to the other databases?
> cause hosters forbid it.

Then get another host or somewhere else to host your databases. Not a PHP 
issue, though. 

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

--- End Message ---
--- Begin Message ---
Hi all,
   I have faced the upload file permission denied for weeks. I can't
write a new file/create a directory. I did a test in PHP standalone
(Linux shell).  The operation is very normal.
But in web environment, I got this error message:

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
move '/tmp/phpjsLZfC' to '/var/www/htm/test/icons.zip' in
/var/www/html/simple_upload.php on line 76.

I think this is a problem bewteen Apache and PHP. The safe mode of PHP
is off and test directory is changed to 777.

yours,
Michael

--- End Message ---
--- Begin Message ---
Michael Leung wrote:

Hi all,
  I have faced the upload file permission denied for weeks. I can't
write a new file/create a directory. I did a test in PHP standalone
(Linux shell).  The operation is very normal.
But in web environment, I got this error message:



Something that just occurred to me?
do you have SELinux installed?

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
move '/tmp/phpjsLZfC' to '/var/www/htm/test/icons.zip' in
/var/www/html/simple_upload.php on line 76.

I think this is a problem bewteen Apache and PHP. The safe mode of PHP
is off and test directory is changed to 777.

yours,
Michael





--
Raditha Dissanayake.
------------------------------------------------------------------
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/ | Drag and Drop Upload

--- End Message ---
--- Begin Message ---
Dear Michael,

I spent the better part of today trying to get a file upload script to work 
too. Same sort of problem: local linux works ok, but web - nope.

Looking at your error message, it might be the renaming of the temp file that 
is barfing.

if (($_FILES["pix"]["size"] > 0)&&($_FILES["pix"]["size"] < 75000)){

        if ($_FILES["pix"]["type"] == "image/jpeg")
        {
                $pix_file = $_FILES["pix"]["name"];
                $pix_temp_file = $_FILES["pix"]["tmp_name"];

                $new_pix_file = "1111-5.jpg";

                if(is_uploaded_file($pix_temp_file)){
                        move_uploaded_file($pix_temp_file, "pix/$new_pix_file");
                }
        }
}
else {

print "<br><br><br><br><big><b>Picture Upload 
Error<b></big><br><br><h5>Filesize is greater than maximum 75k!<br><br> 
Please resize your picture to below 75k, and try again!</h5><br>";
}

This works for me -- might want to modify it and see if it clicks on yours. My 
pix directory is 777, uploaded files go in as apache:apache 755. (also, if 
you try to upload greater than limit set in apache, nothing will show up in 
'/var/www/htm/test/icons.zip'.
              ^^^^^

Btw, is that a typo: 'htm' or did you want 'html'??

Hth,
Andre

On Sunday 12 December 2004 07:46 pm, Michael Leung wrote:
> Hi all,
>    I have faced the upload file permission denied for weeks. I can't
> write a new file/create a directory. I did a test in PHP standalone
> (Linux shell).  The operation is very normal.
> But in web environment, I got this error message:
>
> Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
> move '/tmp/phpjsLZfC' to '/var/www/htm/test/icons.zip' in
> /var/www/html/simple_upload.php on line 76.
>
> I think this is a problem bewteen Apache and PHP. The safe mode of PHP
> is off and test directory is changed to 777.
>
> yours,
> Michael

--- End Message ---
--- Begin Message ---
Hi Andre,
  thank you, I have hided my html path in the message. I have replace 
my real path with '/var/www/html/'.  the error message should be like
this.
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
> > move '/tmp/phpjsLZfC' to '/var/www/html/test/icons.zip' in
> > /var/www/html/simple_upload.php on line 76.
Pervious error message , I have some typing mistakes in there.

Yes, this kind of script is working in my pervious old server. But
after I have upgraded the OS to Fedora 3 with PHP 5.0.2 and Apache 2.
The script does not work any more. I am thinking may be I need to
modify some configure in Apache 2 to allow the upload file function.

yours,
Michael

--- End Message ---
--- Begin Message ---
Ha!

Sorry for that.... Fedora 3 is causing all kinds of havoc. I would stay away for a while.

Trav

----- Original Message ----- From: "Michael Leung" <[EMAIL PROTECTED]>
To: "Andre Dubuc" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, December 12, 2004 7:25 PM
Subject: Re: [PHP] PHP &Apache Upload file Permission denied



Hi Andre,
 thank you, I have hided my html path in the message. I have replace
my real path with '/var/www/html/'.  the error message should be like
this.
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
> move '/tmp/phpjsLZfC' to '/var/www/html/test/icons.zip' in
> /var/www/html/simple_upload.php on line 76.
Pervious error message , I have some typing mistakes in there.

Yes, this kind of script is working in my pervious old server. But
after I have upgraded the OS to Fedora 3 with PHP 5.0.2 and Apache 2.
The script does not work any more. I am thinking may be I need to
modify some configure in Apache 2 to allow the upload file function.

yours,
Michael

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

--- End Message ---
--- Begin Message ---
Hi all,
  I am more believing this is a kind of apache configure problem. If
that's Fedora 3 problem, I can't do this kind in command line.
Therefore, if I bypassed Apache, my problem is solved. Moreover, my
system is highly OOP , I can't fall back into PHP 4.


yours,
Michael

--- End Message ---
--- Begin Message ---
Yes, this kind of script is working in my pervious old server. But
after I have upgraded the OS to Fedora 3 with PHP 5.0.2 and Apache 2.


Then as I mentioned in my previous mail SELinux is to blame. Uninstall it or disable it. (pass selinux=0 when you boot).






--
Raditha Dissanayake.
------------------------------------------------------------------
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/ | Drag and Drop Upload

--- End Message ---
--- Begin Message ---
What user did you run your command line as?

Trav
----- Original Message ----- From: "Michael Leung" <[EMAIL PROTECTED]>
To: "Travis Conway" <[EMAIL PROTECTED]>
Cc: "Andre Dubuc" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, December 12, 2004 8:01 PM
Subject: Re: [PHP] PHP &Apache Upload file Permission denied



Hi all,
 I am more believing this is a kind of apache configure problem. If
that's Fedora 3 problem, I can't do this kind in command line.
Therefore, if I bypassed Apache, my problem is solved. Moreover, my
system is highly OOP , I can't fall back into PHP 4.


yours, Michael

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

--- End Message ---
--- Begin Message ---
your question is hard to answer. The difference between classes and
functions is like the difference between a toolbox, and a spanner. A
class is a container, that contains functions, and variables, or as
they are called in Object-Oriented-Speak(methods, and properties).

A method is a function that exists in a class, although in php they
are still declared as functions.

function do_something(){
  echo "Im doing something this is a function";
}

class class_thing{
  function method_of_thing(){
     echo "I am a method(function) that exists inside of class class_thing";
  } 
}


Hope this helps, but from what I'm reading, you really need to learn
some basics before you even think about classes. Worry about functions
for now. Read the PHP manual(you don't get better docs, than the php
ones). It explains things like that in a easy to use manner.

I also don't know of a better programming tutorial than the PHP manual.

Good luck
Rory


On Sat, 11 Dec 2004 10:23:12 -0800, Robby Russell <[EMAIL PROTECTED]> wrote:
> On Sat, 2004-12-11 at 13:03 -0500, R. Van Tassel wrote:
> 
> 
> > Can someone give me a distinction between the two and when to use / not use
> > them?
> >
> >
> >
> > I want to thank everyone who replied about my"For" loop question. All the
> > answers were VERY helpful! Thanks very much.
> 
> You might want to pick up a book on programming to read up on this.
> 
> In a nutshell, a function should do something specific. It's good to use
> functions when you do the same thing in different places in your code so
> that you don't need to copy/paste your code over and over.
> 
> function foo()
> {
>     $x = 1;
>     $y = 2;
>     return $x + $y;
> }
> 
> $bar = foo();
> 
> print $bar;
> -----
> OUTPUT:
> 3
> 
> A class/object is a collection of functions and variables that are
> contained within their own scope. (vague description)
> 
> class foobar
> {
>   var $x = 10;
> 
>   var $y = NULL;
> 
>   function foobar($y)
>   {
>      $this->y = $y;
>   }
> 
>   function add()
>   {
>     return $this->x + $this->y;
>   }
> 
>   function subtract()
>   {
>     return $this->x - $this->y;
>   }
> 
> }
> 
> $object =& new foobar(4);
> 
> print $object->add() . "\n";
> print $object->subtract() . "\n";
> 
> # set y to a new number
> $object->y = 2;
> 
> print $object->add() . "\n";
> print $object->subtract() . "\n";
> 
> --------
> OUTPUT:
> > 14
> > 6
> > 12
> > 8
> 
> As it sounds like you're still new to this, I would pick up a book or
> read some material online that will better show you when to use either
> and play around with them both.
> 
> Have fun
> 
> -Robby
> 
> --
> /***************************************
> * Robby Russell | Owner.Developer.Geek
> * PLANET ARGON  | www.planetargon.com
> * Portland, OR  | [EMAIL PROTECTED]
> * 503.351.4730  | blog.planetargon.com
> * PHP/PostgreSQL Hosting & Development
> *    --- Now supporting PHP5 ---
> ****************************************/
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

--- End Message ---
--- Begin Message ---
How do I make automaticly PHP playing a sound (Ogg, or
MP3 format file) when MySql (in Table, or Coulom)
reach a number (for example 5)


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--- End Message ---
--- Begin Message ---
On Mon, 13 Dec 2004 00:56, Stuart Felenstein wrote:

> 
> --- Jason Wong <[EMAIL PROTECTED]> wrote:
> 
>> 
>> If in doubt, print it out (TM)
>> 
>>   echo '$Ind<br>', "$Ind<br>", $Ind;
>> 
> $Ind
> '1','2','3','4'
> '1','2','3','4'
> 
> Funny, they are both the same.

I think you are missing the point Jason was trying to make, which is the
difference between '$Ind' and "$Ind". If you look again, you will see that
those are handled differently.

http://www.php.net/manual/en/language.types.string.php will tell you more
about the difference in handling of single quoted and double quoted
strings.

-- 
David Robley

This isn't right. This isn't even wrong.

--- End Message ---
--- Begin Message ---
--- David Robley <[EMAIL PROTECTED]> wrote:

> On Mon, 13 Dec 2004 00:56, Stuart Felenstein wrote:
> 
> > 
> > --- Jason Wong <[EMAIL PROTECTED]> wrote:
> > 
> >> 
> >> If in doubt, print it out (TM)
> >> 
> >>   echo '$Ind<br>', "$Ind<br>", $Ind;
> >> 
> > $Ind
> > '1','2','3','4'
> > '1','2','3','4'
> > 
> > Funny, they are both the same.
> 
> I think you are missing the point Jason was trying
> to make, which is the
> difference between '$Ind' and "$Ind". If you look
> again, you will see that
> those are handled differently.
> 
If you read the post Jason suggested I print out using
both single and double quotes.
Regardless that has very little to do with my
question.

Here is just another variation of my multiple select
list. 
<option value="<?php echo
$rsinds->Fields('CareerIDs')?>"<?php if
($rsinds->Fields('CareerIDs')== 5) {echo "SELECTED";}
?>><?php echo
$rsinds->Fields('CareerCategories')?></option>

Here I was just testing with a specific value.
the line == 5 will set the value "SELECTED" correctly.
 If I put in 5, 6, or '5,','6', etc, I get an error. 
However, I don't believe that line works for multiple
values. What works is still a mystery to me.

Stuart    

--- End Message ---
--- Begin Message ---
On Monday 13 December 2004 18:29, Stuart Felenstein wrote:

> > I think you are missing the point Jason was trying
> > to make, which is the
> > difference between '$Ind' and "$Ind". If you look
> > again, you will see that
> > those are handled differently.
>
> If you read the post Jason suggested I print out using
> both single and double quotes.

Yes, I really do suggest that you re-read what was said in this thread.

> Regardless that has very little to do with my
> question.

I believe that in the code you posted previously you was using '$Ind' in 
strcmp(), in which case it is extremely relevant, that is why I brought it 
up.

> Here is just another variation of my multiple select
> list.
> <option value="<?php echo
> $rsinds->Fields('CareerIDs')?>"<?php if
> ($rsinds->Fields('CareerIDs')== 5) {echo "SELECTED";}
> ?>><?php echo
> $rsinds->Fields('CareerCategories')?></option>
>
> Here I was just testing with a specific value.
> the line == 5 will set the value "SELECTED" correctly.
>  If I put in 5, 6, or '5,','6', etc, I get an error.
> However, I don't believe that line works for multiple
> values. What works is still a mystery to me.

For heaven's sake, do you even know what the HTML *should* look like? Did you 
construct an example to look at? If you're unable to construct your own 
example just look at someone else's, go find a site that has multi-select 
listboxes with pre-selected values and examine the HTML source.

Once you know what the HTML should look like it would be straightforward to 
recreate it using PHP.

-- 
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
------------------------------------------
/*
If you can count your money, you don't have a billion dollars.
  -- J. Paul Getty
*/

--- End Message ---
--- Begin Message ---
--- Jason Wong <[EMAIL PROTECTED]> wrote:

> > Here is just another variation of my multiple
> select
> > list.
> > <option value="<?php echo
> > $rsinds->Fields('CareerIDs')?>"<?php if
> > ($rsinds->Fields('CareerIDs')== 5) {echo
> "SELECTED";}
> > ?>><?php echo
> > $rsinds->Fields('CareerCategories')?></option>
> >
> > Here I was just testing with a specific value.
> > the line == 5 will set the value "SELECTED"
> correctly.
> >  If I put in 5, 6, or '5,','6', etc, I get an
> error.
> > However, I don't believe that line works for
> multiple
> > values. What works is still a mystery to me.
> 
> For heaven's sake, do you even know what the HTML
> *should* look like? Did you 
> construct an example to look at? If you're unable to
> construct your own 
> example just look at someone else's, go find a site
> that has multi-select 
> listboxes with pre-selected values and examine the
> HTML source.
> 
heaven's sake ? bit over dramatic. The code above is
my created html. I've created a number of them, both
from a table and just listing out some options. To
repeat they all work . Yet all seem to have little in
common when the values are dynamic and from an array. 


Stuart

--- End Message ---
--- Begin Message ---
On Sun, 12 Dec 2004 23:50, Bruno b b magalh�es wrote:

> Hi again everybody,
> 
> well, I've asked it before, but I couldn't work on this at all.
> 
> As some knows I have a system witch has a category system. The generic
> part of the site is handled by a generic module called contents...
> generic like products, services, company, etc. Where the content layout
> and structure is quite the same.
> 
> Well suppose that I have this:
> http://www.the_company.com/site/products/product_one/requirements/
> requirements.html
> 
> Where:
> site/ <---- the controller
> products/  <----- alias module for content module
> product_one/   <----- top category
> requirements/    <----- nested category
>              <---------- as many nested categories as needed
> requirements.html <----- article is called searching using it without
> the .html, witch is used to know that it is an article and not a
> category. ('WHERE article_path='requirements' AND category_id='022')
> 
> My problem is that how can I handle those categories!!!!!!!!!!!!! and
> build a three of it.
> 
> I am using PHP5 and MySQL 4.1

You may find this article on storing hierarchical data useful.

http://www.sitepoint.com/print/hierarchical-data-database

-- 
David Robley

On the other hand, you also have 5 fingers.

--- End Message ---
--- Begin Message ---
I have a form and a php file. I enter some values from the form and click to 
submit button. The values that I enter can't be seen on the output. I'm using 
Php php-4.0.5 and my register_global is set to Off.
 
HTML file:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>9.2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="listing9.3.php" method="POST">
Name: <br>
<input type = "text" name="user">
<br>
Address:<br>
<textarea name="address" rows="5" cols="40"></textarea>
<br>
<input type="submit" value="Send">  
</form>
</body>
</html>
 
PHP File:
 
<?php
print "Welcome <b> $_POST[user] </b> <P>\n\n";
print "Your address is:<P>\n\n <b> $_POST[address] </b>";
?>
 
 
 
 
The output dont show the user value or address value. 
 
Thanks,

Selim

                
---------------------------------
Do you Yahoo!?
 Send holiday email and support a worthy cause. Do good.

--- End Message ---
--- Begin Message --- Mecnun wrote:
I have a form and a php file. I enter some values from the form and click to submit button. The values that I enter can't be seen on the output. I'm using Php php-4.0.5 and my register_global is set to Off.
HTML file:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>9.2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="listing9.3.php" method="POST">
Name: <br>
<input type = "text" name="user">
<br>
Address:<br>
<textarea name="address" rows="5" cols="40"></textarea>
<br>
<input type="submit" value="Send"> </form>
</body>
</html>
PHP File:
<?php
print "Welcome <b> $_POST[user] </b> <P>\n\n";
print "Your address is:<P>\n\n <b> $_POST[address] </b>";
?>
The output dont show the user value or address value. Thanks,


Selim

$_POST, $_GET, $_REQUEST, $_SERVER and $_FILES superglobals are available since php-4.1


http://www.php.net/variables.predefined
--- End Message ---
--- Begin Message ---
On Mon, 13 Dec 2004 16:17, Mecnun wrote:

> I have a form and a php file. I enter some values from the form and click
> to submit button. The values that I enter can't be seen on the output. I'm
> using Php php-4.0.5 and my register_global is set to Off.
>  
> HTML file:
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <title>9.2</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> </head>
> <body>
> <form action="listing9.3.php" method="POST">
> Name: <br>
> <input type = "text" name="user">
> <br>
> Address:<br>
> <textarea name="address" rows="5" cols="40"></textarea>
> <br>
> <input type="submit" value="Send">
> </form>
> </body>
> </html>
>  
> PHP File:
>  
> <?php
> print "Welcome <b> $_POST[user] </b> <P>\n\n";
> print "Your address is:<P>\n\n <b> $_POST[address] </b>";
> ?>
Try
<?php
print "Welcome <b> " . $_POST['user'] . " </b> <P>\n\n";
print "Your address is:<P>\n\n <b> " . $_POST['address'] . " </b>";
?>

> The output dont show the user value or address value.


-- 
David Robley

"I commanded a group of ships for a week," Tom said fleetingly.

--- End Message ---
--- Begin Message ---
Maybe this can help you.

If (empty((string)$Game_rating))
……

-----邮件原件-----
发件人: Ahmed Abdel-Aliem [mailto:[EMAIL PROTECTED] 
发送时间: 2004年12月12日 21:58
收件人: [EMAIL PROTECTED]
主题: [PHP] empty() problem

Hi Group Members
i have a problem with function empty() 
i use it to check if user entered the form fields and store it in array

for example : 

if (empty($Game_rating))
        $errors[] = "You didn't enter the Online Status for the Game.";

the problem when the user enters 0 in the form field
the empty function returns the error.

can i  use another function that doesn't return false when the 0 is passes ?

any help plz ?

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

--- End Message ---
--- Begin Message ---
Whoops.  For some reason I've attached the wrong file. Here's the correct one.

Cajus
#!/usr/bin/php4 -q
<?php

##################### T E S T - V A R I A B L E S ##################
$server= "localhost";
$filter= "(uid=*)";
$base  = "dc=example,dc=net";


######################## F U N C T I O N S #########################
function get_additional_error($res)
{
        $error= "";
        ldap_get_option ($res, LDAP_OPT_ERROR_STRING, $error);
        return ($error);
}

function get_error($res)
{
        $error= ldap_error($res);
        if ($error == 'Success'){
                return "success";
        } else {
                $adderror= get_additional_error($res);
                if ($adderror != ""){
                        $error= $error." (".get_additional_error($res).")";
                }
                return $error;
        }
}


function rebind($ldap, $referral)
{
        $server= preg_replace('!^(ldap://[^/]+)/.*$!', '\\1', $referral);
        if (!($ds= ldap_connect($server))){
                echo "reconnect failed - ";
                return ($ldap);
        }
        ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
        ldap_set_option($ds, LDAP_OPT_REFERRALS, 1);
        ldap_set_rebind_proc($lds, "rebind");
        if (!ldap_bind($ds)){
                echo "rebind failed - ";
                return ($ldap);
        }
        echo "rebind to $server - ";
        return ($ds);
}


####################################################################
#                             M A I N                              #
####################################################################
echo "Opening connection to $server - ";
$ds= @ldap_connect($server);

if ($ds) {
        echo "success\n";

        echo "Setting up link parameters - ";
        ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
        ldap_set_option($ds, LDAP_OPT_REFERRALS, 1);
        echo get_error($ds)."\n";

        echo "Setting rebind proc - ";
        ldap_set_rebind_proc($ds, "rebind");
        echo get_error($ds)."\n";

        echo "Binding - ";
        if (!($r= @ldap_bind($ds))){
                echo get_error($ds)."\n\n";
                exit (2);
        }
        echo "success\n";
} else {
        echo get_error($ds)."\n\n";
        exit (1);
}

echo "Performing search with base '$base' and filter '$filter'\n";
echo "* starting search - ";
$sr=   @ldap_search($ds, $base, $filter, array('uid', 'cn'), 0, 0, 0, 
LDAP_DEREF_ALWAYS);
echo get_error($ds)."\n";
if (!$sr){
        exit (3);
}

$info= ldap_get_entries($ds, $sr);
echo "* getting entries - ";
echo get_error($ds)."\n";
if (!$info){
        exit (4);
}
for ($n= 0; $n<=$info['count']; $n++){
        if (!isset($info[$n]['uid'][0])){
                continue;
        }
        echo "  ".$info[$n]['dn']."\n";
}


echo "Closing connection...\n";
ldap_close($ds);
?>

--- End Message ---
--- Begin Message ---
I'm a newbie on MySQL.

I just wanted to know whether there is the possibility
to create a new user/psw remotely onto a server.

That is, something related to command 'mysql_setpermissions',
but acting from a remote host.

Alessandro

--- End Message ---
--- Begin Message ---
On Monday 13 December 2004 16:48, Alessandro Rosa wrote:
> I'm a newbie on MySQL.

  www.mysql.com

-- 
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
------------------------------------------
/*
BOFH Excuse #410:

Electrical conduits in machine room are melting.
*/

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

I am trying to get path/style variables working in windows with IIS on
a hosted environment.  What I mean by path/style variables is the
following:  Say I have a script "test.php" that can be accessed via:

http://mydomain/controller.php

...I want to pass variables to it like:

http://mydomain/controller.php/article/10

...With IIS, I get a "404 Object Not Found" error when I append
anything after "controller.php".  In the past with Apache this has
always just simply worked, even as a cgi module.  What do I do to get
this working with IIS?

Thanks in advance,

Chris

--- End Message ---
--- Begin Message ---
Ck wrote:

Hello.

I am trying to get path/style variables working in windows with IIS on
a hosted environment.  What I mean by path/style variables is the
following:  Say I have a script "test.php" that can be accessed via:

http://mydomain/controller.php

...I want to pass variables to it like:

http://mydomain/controller.php/article/10

...With IIS, I get a "404 Object Not Found" error when I append
anything after "controller.php".  In the past with Apache this has
always just simply worked, even as a cgi module.  What do I do to get
this working with IIS?

Thanks in advance,

Chris
this is a "stupid IIS"-issue :) I'd suggest asking this on a mailinglist that specialises in IIS, and not in PHP (*only*).
--- End Message ---
--- Begin Message ---
"M. Sokolewicz" <[EMAIL PROTECTED]> wrote:
> Chris wrote:
> > I am trying to get path/style variables working in windows with IIS
> > on a hosted environment.
>
> this is a "stupid IIS"-issue :) I'd suggest asking this on a
> mailinglist 
> that specialises in IIS, and not in PHP (*only*).

I understand how obscure and lame the requests can sometimes be here. 
In turn, please understand that I have tried everything else I can
think of before asking this PHP-only list.  With all the php developers
out there, I am sure another has run into this issue.

Thanks,

Chris

--- End Message ---
--- Begin Message ---
Hi there everyone...

I did a form to add data to a database and it works fine. Once the data is
entered its gives a thankyou message. But the problem is, if I refresh this
thankyou page, the data is entered again into the database. Why is it doing
so. I couldnt think of a way to fix it. Help...

cheers

--- End Message ---
--- Begin Message --- Aalee wrote:
Hi there everyone...

I did a form to add data to a database and it works fine. Once the data is
entered its gives a thankyou message. But the problem is, if I refresh this
thankyou page, the data is entered again into the database. Why is it doing
so. I couldnt think of a way to fix it. Help...

cheers
refreshing a page means resending the last request to the server. If by any chance that were a GET (usually this one) or POST request, it will resend that. Your php script notices those vars were sent, and (re-)adds the info to the db.
--- End Message ---
--- Begin Message ---
 
I've just had this exact problem. The solution as far as I found is one
of the following:

1. Keep a $_SESSION going and set a flag, then on a re-post you can
check the flag to see if it's set and hopefully spot the re-post.

2. Check to see if what you're about to enter is already there, chances
are it's a repost - this only works for certain sorts of applications
though.

3. Divert the user to a different page using header() so that if they
hit refresh they only refresh the thankyou page and not the post - this
doesn't stop 'back' for screwing things though.

4. Use java to prevent the history, I've found this example (not tested
it)

<script language="php">
  history.forward();
</script> 

Hope this helps

Matthew

-----Original Message-----
From: Aalee [mailto:[EMAIL PROTECTED] 
Sent: 13 December 2004 09:50
To: [EMAIL PROTECTED]
Subject: [PHP] How can I fix that

Hi there everyone...

I did a form to add data to a database and it works fine. Once the data
is entered its gives a thankyou message. But the problem is, if I
refresh this thankyou page, the data is entered again into the database.
Why is it doing so. I couldnt think of a way to fix it. Help...

cheers

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


________________________________________________________________________
This message has been checked for all known viruses by the 
CitC Virus Scanning Service powered by SkyLabs. For further information
visit
http://www.citc.it

___

________________________________________________________________________
This message has been checked for all known viruses by the 
CitC Virus Scanning Service powered by SkyLabs. For further information visit
http://www.citc.it

___

--- End Message ---
--- Begin Message --- Hi,
I do indeed have the file upload code inside a class function. it's one of those little things about PHP hadn't fully realised yet. Thanks for the pointer! If I pass the relevant _FILE entry to that function and work off that it solves the problem right?


Cheers,
Tom

Richard Lynch wrote:

[EMAIL PROTECTED] wrote:


Hi,
   I have been having problems trying to get file uploads working with
PHP in a Debian Linux enviroment. I have ensured that both the temporary
directory PHP uploads use has the appropriate permissions set, as well
as the folder I am attempting to copy the images into.

When I called phpinfo() from the page that the upload script is on it
shows the contents of the _FILE array as containing the appropriate
details, however when I try and access them from within my actual code,
the variables appear to be unset, and no files appear in either the
temporary folder or the folder I am trying to copy the file to.

Anyone have any suggestions?



Did you wrap your code up in a nice function?

Perhaps you need:
global $_FILES;
inside that function.

Or not.  Still haven't worked out which $_XXX are super-global or not in
which versions.

Maybe someday.




-- Working on webhosting Tel:01388 777711 MTA handling, PHP Web:www.digital-data.co.uk scripting, and wireless Email:[EMAIL PROTECTED] networking, just for a change.

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

I am trying to create a sql query with php and I do have a syntax problem with the mysql query.
One row is called "plz" and I would like to search for a value inside that with a like statement. Problem is, the system takes the u.plz as a character not as a table element:


LIKE  "%u.plz%"

Has anybody an idea how the correct sytnax is? I am lost here.

Thank you in advance,

Merlin

PS: This is the complete statement:
SELECT c.name AS city
FROM geo_de.geodb_locations AS c, fix.user AS u
WHERE u.user_id =4 AND c.plz
LIKE  "%u.plz%";

--- End Message ---

Reply via email to