php-general Digest 8 Feb 2003 15:01:27 -0000 Issue 1871

Topics (messages 134845 through 134872):

Re: delete query doesnt work
        134845 by: Hardik Doshi

Re: strip slashes from variable content
        134846 by: Hardik Doshi

Re: mail() vs sockets
        134847 by: Jason Wong
        134852 by: Jeff Busby

PHP 4.3.0 safe_mode
        134848 by: Devin

Re: delete query doesnt work (fixed)
        134849 by: Chris Shiflett

Array sorting
        134850 by: Zydox
        134856 by: Philip Hallstrom

Re: Strings and regular expression?
        134851 by: John W. Holmes

Re: ImageJPEG?
        134853 by: Jason Wong

Permenant Page Generation
        134854 by: Mecca
        134855 by: Mecca
        134857 by: John W. Holmes

Re: Need To Find A php Person
        134858 by: Jean-Christian Imbeault

Re: mysql auto increment question
        134859 by: Justin Garrett

Re: GD Chinese support - php4.3
        134860 by: Eddy-Das

Re: Dynamic input fields in Form
        134861 by: Frank Keessen

Re: Multi-User phpMyAdmin
        134862 by: MIKE YRABEDRA

Re: Vars in URL
        134863 by: Justin French

How to remove only the last character?
        134864 by: Douglas Douglas
        134865 by: Ian Packer
        134867 by: nicos.php.net
        134869 by: Douglas Douglas

config.ini question
        134866 by: RoyW

Globals off and passing data
        134868 by: Paul
        134871 by: Jason Wong
        134872 by: Paul

pg_connect $B$,;H$($J$$(B
        134870 by: $BNS(B $B7C72(B

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

I think you are facing problem with variable delete.
Make sure your Php.ini settings for global off. Check
value of variable is coming on the form or not.

In case of your update, i think you forget to put
where part. For example: 

mysql_query("update table_name set
varible_name='$variable_name' WHERE key_name =
'$key_variable') or die(mysql_error());

May be it will help u

Hardik
--- Sunfire <[EMAIL PROTECTED]> wrote:
> i have a delete query:
> mysql_query("delete from members where
> company='$delete');
> 
> it doesnt work should i change it to :
> mysql_query("delete from members where company like
> '$delete'");??
> 
> the first one worked in mysql client but it doesnt
> work in php script for
> some reason...
> 
> 
> also having problems with update... if nothing on
> the form changes and it
> gets submitted anyways all the records in the db
> gets changed to the same
> thing that one record  has in it...
> 
> 
> 
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system
> (http://www.grisoft.com).
> Version: 6.0.443 / Virus Database: 248 - Release
> Date: 1/10/2003
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--- End Message ---
--- Begin Message ---
Ok i got your problem.

First of all check php.ini settings for
magic_gpc_quotes. If it is on then turn it off. I
guess that the only problem you have. If you want to
make it turn it on then you have to use stripslashes
function.

thanks

Hardik
--- Jason Wong <[EMAIL PROTECTED]> wrote:
> On Saturday 08 February 2003 09:51, Sunfire wrote:
> > hi..
> > i have a hidden variable and when its submitted to
> another script it has
> > the value of "\\\... anybody know how to get the \
> out of it?
> 
> Search www.php.net for "strip slash".
> 
> -- 
> 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
> ------------------------------------------
> /*
> "The first rule of magic is simple.  Don't waste
> your time waving your
> hands and hoping when a rock or a club will do."
>               -- McCloctnik the Lucid
> */
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--- End Message ---
--- Begin Message ---
On Saturday 08 February 2003 06:39, Jeff Busby wrote:
> Sorry, every time I posted I got an auto reply saying it had an attatchment
> and it wasn't sent...and I had to post again.  The only way it worked was
> for me to reply to another post and change the subject and message.  Didn't
> mean to annoy anyone with multiple posts.

1) Don't attach attachments, most mailing lists strip them out.
2) Don't start a new post by replying to an old one.
3) Search archives for "mass mailing" (or similar) to see past discussions on 
this subject.

-- 
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
------------------------------------------
/*
Everything you read in newspapers is absolutely true, except for that
rare story of which you happen to have first-hand knowledge.
                -- Erwin Knoll
*/

--- End Message ---
--- Begin Message ---
Thanks, but I know how  it works.

I'm on the Pear general list and the php db list.  I just join the php
general list...replied to the confirm email then posted my question. There
was no attatchments, it was a brand new email.  I did it 3 times and
received the same auto responder.  So the last time I replied to someone
elses email but changed the subject and body and I didn't receive the auto
responed.

I've been all over the net looking for advice on the subject I posted, and I
didn't want to waste any more time...thats y I posted to the list....so mr.
wong.....if you don't want to help me....don't...but don't lecture me about
proper form on the news group plz.

----- Original Message -----
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 07, 2003 9:38 PM
Subject: Re: [PHP] mail() vs sockets


> On Saturday 08 February 2003 06:39, Jeff Busby wrote:
> > Sorry, every time I posted I got an auto reply saying it had an
attatchment
> > and it wasn't sent...and I had to post again.  The only way it worked
was
> > for me to reply to another post and change the subject and message.
Didn't
> > mean to annoy anyone with multiple posts.
>
> 1) Don't attach attachments, most mailing lists strip them out.
> 2) Don't start a new post by replying to an old one.
> 3) Search archives for "mass mailing" (or similar) to see past discussions
on
> this subject.
>
> --
> 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
> ------------------------------------------
> /*
> Everything you read in newspapers is absolutely true, except for that
> rare story of which you happen to have first-hand knowledge.
> -- Erwin Knoll
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
I am running Apache 1.3.27 with PHP loaded as a module
and I have several sites on the server running. I want
to enable safe_mode so that PHP can be more secure on
the server so one user can't read another users files.
However I notice that with safe_mode enabled it denies
readfile function, but the include and require functions
are allowed to read the file. Is there a way to get it
so that any include or require statements will have the
UID checked like readfile does? Any help would greatly
be appreciated.

Thanks
Devin Atencio
--- End Message ---
--- Begin Message ---
--- Sunfire <[EMAIL PROTECTED]> wrote:
> in the form that submits the $delete var add this:
> <input type="hidden" name="flag_delete" value="$delete">
> now in query change $delete to $flag_delete... and poof
> it magically works

It's not magic, and John Holmes already explained it to
you.

If you do not pass a variable via GET, POST, or as a
cookie, and you also do not store it as a session variable,
why would you expect it to exist on another page? This
demonstrates a very fundamental misunderstanding.

You might want to start with the basics and learn a bit
about how the Web works - how data is passed, etc.

Chris
--- End Message ---
--- Begin Message ---
My question is if anyone have any idé on how to sort this array so that the
names and ages are sorted after Close Friend, Friend, Wife and last
Family...

$A[] = array ("Nils", "23", "Friend");
$A[] = array ("Emma", "21", "Friend");
$A[] = array ("Cassie", "21", "Wife");
$A[] = array ("Zydox", "23", "Friend");
$A[] = array ("Patrick", "24", "Close Friend");
$A[] = array ("Kalle", "40", "Family");
$A[] = array ("John", "10", "Close Friend");
$A[] = array ("Anna", "12", "Friend");


--- End Message ---
--- Begin Message ---
never done it, but check out:

http://www.php.net/manual/en/function.array-multisort.php

On Sat, 8 Feb 2003, Zydox wrote:

> My question is if anyone have any idé on how to sort this array so that the
> names and ages are sorted after Close Friend, Friend, Wife and last
> Family...
>
> $A[] = array ("Nils", "23", "Friend");
> $A[] = array ("Emma", "21", "Friend");
> $A[] = array ("Cassie", "21", "Wife");
> $A[] = array ("Zydox", "23", "Friend");
> $A[] = array ("Patrick", "24", "Close Friend");
> $A[] = array ("Kalle", "40", "Family");
> $A[] = array ("John", "10", "Close Friend");
> $A[] = array ("Anna", "12", "Friend");
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
> > Very true, I agree. For your solution, though, wouldn't it correctly
> match a
> > string such as '2,3,11,12' even though there is no entry that's just
> one?
> 
> Ok, why not something like this..
> There is almost always a better solution than regex
> 
> <?php
> 
> $string = '98,244,9,243,2,6,36,3,111,';
> 
> if(catchOne($string) == 'TRUE'){
>         echo 'Found a One';
>         }else{
>         echo 'No match found';
>         }
> 
> function catchOne($string){
> 
>   $arr = explode(',', $string);
> 
>   // check if the 1 is in the array
>   if(in_array('1', $arr)){
>         return TRUE;
>         }else{
>         return FALSE;
>         }
> }

I love it when questions like this come up. Honestly, you can use any
solution you want and it's not going to make that much of a difference.
But... it's always fun to benchmark them all and see which one wins. 

Here's the code I tried (which uses PEAR Benchmark)

$str = '1,2,3,4,5,6,7,8,9,0';

$timer->start();
if(preg_match('/(^|,)1(,|$)/',$str)) {}
$timer->setMarker('Preg');
if(in_array('1',explode(',',$str))) {}
$timer->setMarker('Explode');
if(strstr($str,',1,') || substr($str,0,2)=='1,' ||
substr($str,-2)==',1') {}
$timer->setMarker('Strstr');
$timer->stop();
$timer->display();

and, the results...

Method  Elapsed Time
------------------------
Preg            0.000080
Explode         0.000065
Strstr  0.000065

Make your own conclusions... 

Since the last solution actually uses three tests, it is even faster
overall when the first condition comes out true and then gets slower if
it has to check the second and then third condition. So, putting
whatever condition is true the majority of the time will make that
solution more efficient. 

---John Holmes...


--- End Message ---
--- Begin Message ---
On Saturday 08 February 2003 05:24, John Wards wrote:
> Quickie....
>
> I want to save a modified jpeg to a file. I can out put it by doing this:
>
> Header("Content-type: image/jpeg");
>
> imagejpeg($image_thum);
>
> imagedestroy($image_thum);
>
> I want to save it to this location:
>
> /images/1000/
>
> with its original filename but with a t_ attached to the begining.
>
> I tried this:
> $uploadpath = "/images/1000/";
> $temp = "t_".$imagefilename;
> $imagefilename = $temp;
> $dest = $uploadpath.$imagefilename;
> ImageJPEG($image_thum,$dest);
>
> but that did nothing.

No errors? 

What does $dest contain? 

Is it a valid path and writeable by the webserver?

-- 
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
------------------------------------------
/*
Q:      "What is the burning question on the mind of every dyslexic
        existentialist?"
A:      "Is there a dog?"
*/

--- End Message ---
--- Begin Message ---
I would like to create two pages: 

One form page to enter information. I've done that and used the same format as a 
typical html page. method="post" action="submit.php"> 

I want the second page to show the information was submitted and have the information 
create a permenant html page named after one of the text areas on the page. 

I guess this will lead to three pages because i will have a template set up for the 
created page to look like the pages that have already been created by static html. 

In effect...the user will physically upload a file to an intranet server. Next go to 
the form page and add the information on the file they just submitted to the server. 
Once that information is added and the submit button is pressed, it will trigger a 
html page to be created with the info submitted. Help!
--- End Message ---
--- Begin Message ---
I would like to create two pages: 

One form page to enter information. I've done that and used the same format as a 
typical html page. method="post" action="submit.php"> 

I want the second page to show the information was submitted and have the information 
create a permenant html page named after one of the text areas on the page. 

I guess this will lead to three pages because i will have a template set up for the 
created page to look like the pages that have already been created by static html. 

In effect...the user will physically upload a file to an intranet server. Next go to 
the form page and add the information on the file they just submitted to the server. 
Once that information is added and the submit button is pressed, it will trigger a 
html page to be created with the info submitted. Help!
--- End Message ---
--- Begin Message ---
> I would like to create two pages:
> 
> One form page to enter information. I've done that and used the same
> format as a typical html page. method="post" action="submit.php">
> 
> I want the second page to show the information was submitted and have
the
> information create a permenant html page named after one of the text
areas
> on the page.


You use fopen() to create a file and fwrite() to write to it...
hopefully you can handle it from there...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


--- End Message ---
--- Begin Message --- I might be able to help you with support/customization of your application depending on what kind of PHP application it is. I have a great deal of experience programming with PHP and developing large application.

Could you let me know what kind of application you have?

Jc

Michael McGlaughlin wrote:
Hello,

I am looking for someone well versed and established who understands the php language and who can support a product that I have that I cannot receive support from by the original developer.
What would be the best way for me to go about finding someone? We paid the developer by making a donation to him for his script, then paid him for some further customizations, which he completed, but now he does not appear interested in additional cusomization work on our system and I am left in a bit of a lurch.
Any help you can give would be greatly appreciated.
Sincerely,
Michael


_____________________________________________________________
Get your FREE email address
http://www.hootingowl.com
"The Wise Way To Search"

_____________________________________________________________
Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=tag

--- End Message ---
--- Begin Message ---
http://www.php.net/manual/en/function.mysql-insert-id.php

Justin Garrett

"Van Andel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
m...
I have an application that updates two MySQL database tables.  One table has
an auto_increment id field.  I need to use this id to link to an entry in
the other table.  Is there an easy way to find out what the auto_incremented
number is so I can use it to update the other table?

Robbert van Andel




--- End Message ---
--- Begin Message ---
but even i tried the hong kong local chinese font, it still display the same
thing!

--


- Eddy Wong
__________________________
inframatrix internet solutions
http://www.inframatrix.com/


       ¥¿¤KEddy
Regular Octa-Eddy
¡@¢¨¡½¢ª¡½¢©¡@
¢¨¢«¡@¡@¡½¢ª¢©
¡½¡@¡@¡@¡½¡@¡½
¡½¡½¡½¡@¡½¡@¡½
¡½¡@¡@¡@¡½¡@¡½
¢ª¢©¡@¡@¡½¢¨¢«
¡@¢ª¡½¢¨¡½¢«¡@
"Tom Rogers" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> Saturday, February 8, 2003, 3:30:11 AM, you wrote:
> ED> any one know how display Chinese Characters (tradition or simplified)
in
> ED> GD.....?
> ED> is that something deal with multibyte functions...?
>
> ED> i have installed the bundled GD and Libjpeg
> ED> they all worked perfectly with english words
>
> ED> but when i generate a Chinese character, it just display two symbols
> ED> i've already set the encoding (of php) to BIG5
> ED> and even i use mb_detect_encoding() it can show "BIG-5"
>
> ED> but when i use ImageTTFtext(blah blah blah ,
mb_convert_encoding("[Chinese
> ED> word here]","BIG-5")
> ED> it pops out 2 symbol
>
> ED> the ttf font i loaded is the one distributed by Microsoft (HKSCS)
>
> ED> any php experts know how to solve this problem?
>
> ED> Thank you all :)
>
> ED> Regards,
>
>
> ED> Eddy @ Hong Kong
> ED> [EMAIL PROTECTED]
>
> You will probably find the microsoft font is unicode not Big5
>
> --
> regards,
> Tom
>


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

Thanks guys for helping me out!

Regards,

Frank
---- Original Message -----
From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>; "Jon Haworth"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, February 07, 2003 9:23 PM
Subject: Re: [PHP] Dynamic input fields in Form


> > Thanks for the answer; but there is nobody who can show me an example in
> > code???
>
> You mean do the work for you? Do you want the PHP or Javascript solution?
> Only one can be posted on this list...
>
No you don't have to do the coding for me!!!!

> The PHP one is simple. Assuming $_POST['num'] is the number from your drop
> down...
>
> for($x=0;$x<$_POST['num'];$x++)
> { echo '<input type="text">'; }
>
> That's it.
>
> ---John Holmes...
>
> > > > I have a form where the user selects for example; how many cars
> > > > you have:  4. Then it most dynamicly create 4 input fields
> > > [...]
> > >
> > > Using only PHP, you'll have to make this a two-step process where page
1
> > > collects the number of cars and posts to page 2, which generates the
> form
> > > accordingly.
> > >
> > > If is has to be done on the same page, you'll need to call a
Javascript
> > > function every time the number of cars changes. That function will
have
> to
> > > add or remove <input>s from the form depending on the number  of cars
> > > entered, and of course the whole page will break completely for anyone
> > > without Javascript.
> > >
> > > I'd make it a two-step process myself, it's considerably more robust
and
> > > offers considerably less room for problems (what happens if I claim I
> have
> > > five cars, fill out their details, and then change it to three cars?
> which
> > > details do you get rid of?)
> > >
> > > Cheers
> > > Jon
> > >
> > > --
> > > 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 ---
on 2/7/03 3:35 PM, Stephen at [EMAIL PROTECTED] wrote:

> Can anyone tell me a tutorial on how to setup a multi-user phpmyadmin
> installation? I would like to just have one central copy, then have other
> users able to access their corresponding database in phpMyAdmin. How can I
> do this?


It is on the phpmyadmin documentation page and it looks something like
this...

--snip--

This example assumes you want to use pma as the controluser and pmapass as
the controlpass, but this is only an example: use something else in your
file:
       GRANT USAGE ON mysql.* TO 'pma'@'localhost' IDENTIFIED BY 'pmapass';
GRANT SELECT (Host, User, Select_priv, Insert_priv, Update_priv,
Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv,
Process_priv, File_priv, Grant_priv, References_priv, Index_priv,
Alter_priv) ON mysql.user TO 'pma'@'localhost';
GRANT SELECT ON mysql.db TO 'pma'@'localhost';
GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv) ON
mysql.tables_priv TO 'pma'@'localhost';
... and if you want to use the many new relation and bookmark features:
       GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db> TO
'pma'@'localhost'; (this of course requires you to have a special DB for
phpMyAdmin, the contents will be explained later)

*    Then each of the true users should be granted of a set of privileges on
a set of particular databases but shouldn't have any global privileges. For
example, to grant the user real_user with all privileges on the database
user_base:
   GRANT ALL PRIVILEGES ON user_base.* TO 'real_user'@localhost IDENTIFIED
BY 'real_password';

--snip--


-- 
Mike Yrabedra
President

323 Enterprises 
Home of The MacDock and The MacSurfshop
[http://macdock.com] : [http://macsurfshop.com]
VOICE: 770.382.1195
iChat/AIM: ichatmacdock
_______________________________________________________________________
"in all your ways acknowledge Him and He will direct your paths."
Proverbs 3:6 NIV
<{{{><
--


--- End Message ---
--- Begin Message ---
on 06/02/03 10:03 AM, Shawn McKenzie ([EMAIL PROTECTED]) wrote:

> I am trying to do something simple to sell items with paypal.  One of the
> options paypal has is a return url, so that after the buyer pays via the
> paypal website they are forwarded to the return url (my site) so they can
> access some info..
> 
> The problem is that the form on my site that collects info and posts to
> paypal has the hidden return url vars in it.  So a simple view source in the
> browser reveals the return url.
> 
> So what I did is made a form that submits to a php script on my site that
> then adds the appropriate paypal vars and submits to the paypal site.  I
> used header(Location:"), but this shows the return url var in the url
> address bar.  I want to pass vars to paypal without them being shown in the
> url address bar.

Not a chance really -- you can't use cookies (essentially the third way to
do pass vars around), because cookies are tied to a specific domain.

I say if the rest of society can deal with POST and GET vars for Paypal etc,
then so can you :)


Justin

--- End Message ---
--- Begin Message ---
Good day.

Is there any PHP function that removes only the last
character of a string and returns the new string?

I'm looking in the manual and I can't find anything.

Until now I'm doing this:

$var=substr($var,0,strlen($var)-1)

Is this the most efficient way?

Thanks.

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--- End Message ---
--- Begin Message ---
Hiya,

Try this, *probably* more efficient but I don't know for sure.

<?

$string = 'testing 1 2 3 testing';

echo $string . "\n";

$string[strlen($string)-1] = "\0";

echo $string . "\n";

?>

Regards,

Ian Packer


----- Original Message ----- 
From: "Douglas Douglas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 08, 2003 1:21 PM
Subject: [PHP] How to remove only the last character?


> Good day.
> 
> Is there any PHP function that removes only the last
> character of a string and returns the new string?
> 
> I'm looking in the manual and I can't find anything.
> 
> Until now I'm doing this:
> 
> $var=substr($var,0,strlen($var)-1)
> 
> Is this the most efficient way?
> 
> Thanks.
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
--- End Message ---
--- Begin Message ---
www.php.net/substr


--
Regards.
M.CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com Hébergement de sites internets.

"Douglas Douglas" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Good day.
>
> Is there any PHP function that removes only the last
> character of a string and returns the new string?
>
> I'm looking in the manual and I can't find anything.
>
> Until now I'm doing this:
>
> $var=substr($var,0,strlen($var)-1)
>
> Is this the most efficient way?
>
> Thanks.
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com


--- End Message ---
--- Begin Message ---
I want to thank you Ian, Zydox and Nicos.

After Zydox response I checked the manual again and
read this part in the substr function:

"If length is given and is negative, then that many
characters will be omitted from the end of string
(after the start position has been calculated when a
start is negative)...."

Sorry to bother you guys, and thanks again.

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--- End Message ---
--- Begin Message ---
Virtual Directory Support is set to "disabled"

where in the config file do I set this to "enabled"?

Thanks!

--- End Message ---
--- Begin Message ---
I'm working in a multitiered envoronment in development. I'd like to turn globals off, 
but I can't figure out how to pass data back and forth between machines. I'm sending 
data to a database machine using POST, and I can use the data once it gets there, but 
I can't seem to get anything back. At the moment I'm using a meta refresh statement to 
get back to the next page on the web server on the originating machine (would like 
something more elegant than this to go to the next page, but just getting some data 
back is first on my list). Does such a thing as a tutorial exist for this?

TIA,
Paul
--- End Message ---
--- Begin Message ---
On Sunday 09 February 2003 06:32, Paul wrote:
> I'm working in a multitiered envoronment in development. I'd like to turn
> globals off, but I can't figure out how to pass data back and forth between
> machines. I'm sending data to a database machine using POST, and I can use
> the data once it gets there, but I can't seem to get anything back. At the
> moment I'm using a meta refresh statement to get back to the next page on
> the web server on the originating machine (would like something more
> elegant than this to go to the next page, but just getting some data back
> is first on my list). Does such a thing as a tutorial exist for this?

Perhaps you could elaborate on what your setup is and what you're doing. For 
example, what do you mean by "sending data to a database machine using POST"? 
The usual method of accessing a remote database does not involve the use of 
"POST".

-- 
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
------------------------------------------
/*
What this country needs is a good five dollar plasma weapon.
*/

--- End Message ---
--- Begin Message ---
I'm opening a socket to the remote machine and using post to send the data. But please 
enlighten me, what is the usual method of accessing a remote database?

Jason Wong wrote:
On Sunday 09 February 2003 06:32, Paul wrote:

>> I'm working in a multitiered envoronment in development. I'd like to turn globals 
>off, but I can't figure out how to pass data back and forth between machines. I'm 
>sending data to a database machine using POST, and I can use>> the data once it gets 
>there, but I can't seem to get anything back. At the moment I'm using a meta refresh 
>statement to get back to the next page on the web server on the originating machine 
>(would like something more elegant than this to go to the next page, but just getting 
>some data back>> is first on my list). Does such a thing as a tutorial exist for this?


Perhaps you could elaborate on what your setup is and what you're doing. For example, 
what do you mean by "sending data to a database machine using POST"? The usual method 
of accessing a remote database does not involve the use of "POST".
--- End Message ---
--- Begin Message ---
$B;O$a$^$7$F!#(Blin $B$H?=$7$^$9!#(B
(B
(Bphp$B$N(Bpg_connect$B$G(BpostgreSQL $B$K@\B3$r;n$_$^$7$?$,!"4X?t$,(B
$B8+$D$+$j$^$;$s$H%(%i!<$,=P$F$7$^$$$^$7$?!#F1MM$J8=>]$,Ax(B
$B6x$7$?J}$,$$$?$h$&$G$9$,!"4N?4$J2r7hJ}K!$O8+$D$+$j$^$;$s(B
$B$G$7$?!#$I$J$?$+$,2r7hJ}K!$r$4B8CN$G$7$?$i!"CN7C$r$*B_$7(B
$B$/$@$5$$!#(B
(B
(B
(B
(B
(B__________________________________________________
(BDo You Yahoo!?
(BYahoo! BB is Broadband by Yahoo!
(Bhttp://bb.yahoo.co.jp/
--- End Message ---

Reply via email to