php-general Digest 22 Sep 2007 13:31:49 -0000 Issue 5032

Topics (messages 262353 through 262366):

Access name of variable in $_POST array
        262353 by: Eric Lommatsch
        262354 by: Stut
        262355 by: Stut
        262357 by: Daniel Brown

Re: back-button question
        262356 by: Πρεκατές Αλέξανδρος

Re: Page Numbering
        262358 by: tedd

Re: Page Numbering (To The Unsubscribe Guy)
        262359 by: Instruct ICC
        262361 by: Jim Lucas

Re: Working with sessions
        262360 by: tedd

str_replace oddity
        262362 by: Kevin Waterson
        262363 by: Jim Lucas

Re: php personal project
        262364 by: Crayon Shin Chan
        262366 by: tedd

Re: Limiting connection to mysql using old mysql module (not mysqli)
        262365 by: Per Jessen

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 ---
Hello,
 
I am writing a PHP script that is going to accept variables that are passed
from a PDF form and should write both the name of the variable and its value
to a text file. 
 
 
I can get the value that I want to retrieve with out problem. However, even
though I have searched through the PHP.net site and googled this as well I
have not yet been able to find the syntax that I need to get the names of the
variables in the $_Post array.
 
Can someone point me to the place in the PHP manual where I can find the
syntax to get the name of a variable in the $_POST array? 
 
Thank you
 
Eric H. Lommatsch
Programmer
360 Business 
2087 South Grant Street
Denver, CO 80210
Tel 303-777-8939
Fax 303-778-0378
 
[EMAIL PROTECTED]
 

--- End Message ---
--- Begin Message ---
Eric Lommatsch wrote:
I am writing a PHP script that is going to accept variables that are passed
from a PDF form and should write both the name of the variable and its value
to a text file. I can get the value that I want to retrieve with out problem. However, even
though I have searched through the PHP.net site and googled this as well I
have not yet been able to find the syntax that I need to get the names of the
variables in the $_Post array.
Can someone point me to the place in the PHP manual where I can find the syntax to get the name of a variable in the $_POST array?

http://php.net/array_keys

As in...

$varnames = array_keys($_POST);

-Stut

--
http://stut.net/

--- End Message ---
--- Begin Message ---
Please include the list when replying.

Eric Lommatsch wrote:
-----Original Message-----
From: Stut [mailto:[EMAIL PROTECTED] Sent: Friday, September 21, 2007 3:09 PM
To: Eric Lommatsch
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Access name of variable in $_POST array

Eric Lommatsch wrote:
I am writing a PHP script that is going to accept variables that are passed from a PDF form and should write both the name of the variable and its value to a text file. I can get the value that I want to retrieve with out problem. However, even though I have searched through the PHP.net site and googled this as well I have not yet been able to find the syntax that I need to get the names of the variables in the $_Post array. Can someone point me to the place in the PHP manual where I can find the syntax to get the name of a variable in the $_POST array?

http://php.net/array_keys

As in...

$varnames = array_keys($_POST);

-Stut

--
http://stut.net/

Hello Stut,

That is not exactly what I am looking for. If I try using that in My PHP
script what I get as a result of that is repeatedly the Phrase "Post Array"
when I check the values there. The PDF form that is posting to the PHP script
is passing variable names like "Employer_name" or "Employee_Name". I am
hoping to get those variable names.

Put this line at the top of the script that the form posts to...

print '<pre>'.print_r($_POST, true).'</pre>'; exit;

That will display the contents of the $_POST array and you should be able to figure out where everything is.

By the sounds of it the posted values are actually in $_POST['Post Array'] but use the above line to be sure.

-Stut

--
http://stut.net/

--- End Message ---
--- Begin Message ---
On 9/21/07, Stut <[EMAIL PROTECTED]> wrote:
> Please include the list when replying.
>
> Eric Lommatsch wrote:
> > -----Original Message-----
> > From: Stut [mailto:[EMAIL PROTECTED]
> > Sent: Friday, September 21, 2007 3:09 PM
> > To: Eric Lommatsch
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Access name of variable in $_POST array
> >
> > Eric Lommatsch wrote:
> >> I am writing a PHP script that is going to accept variables that are
> >> passed from a PDF form and should write both the name of the variable
> >> and its value to a text file.
> >>
> >>
> >> I can get the value that I want to retrieve with out problem. However,
> >> even though I have searched through the PHP.net site and googled this
> >> as well I have not yet been able to find the syntax that I need to get
> >> the names of the variables in the $_Post array.
> >>
> >> Can someone point me to the place in the PHP manual where I can find
> >> the syntax to get the name of a variable in the $_POST array?
> >
> > http://php.net/array_keys
> >
> > As in...
> >
> > $varnames = array_keys($_POST);
> >
> > -Stut
> >
> > --
> > http://stut.net/
> >
> > Hello Stut,
> >
> > That is not exactly what I am looking for. If I try using that in My PHP
> > script what I get as a result of that is repeatedly the Phrase "Post Array"
> > when I check the values there. The PDF form that is posting to the PHP 
> > script
> > is passing variable names like "Employer_name" or "Employee_Name". I am
> > hoping to get those variable names.
>
> Put this line at the top of the script that the form posts to...
>
> print '<pre>'.print_r($_POST, true).'</pre>'; exit;
>
> That will display the contents of the $_POST array and you should be
> able to figure out where everything is.
>
> By the sounds of it the posted values are actually in $_POST['Post
> Array'] but use the above line to be sure.
>
> -Stut
>
> --
> http://stut.net/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

    Maybe this will get you started and give you some ideas.

<?
foreach($_POST as $p => $v) {
    $$p = $v;
    echo $p." = ".$v."\n";
}
?>


-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

Give a man a fish, he'll eat for a day.  Then you'll find out he was
allergic and is hospitalized.  See?  No good deed goes unpunished....

--- End Message ---
--- Begin Message ---
Στις 17-09-2007, ημέρα Δευ, και ώρα 23:33 -0400, ο/η Eric Butera έγραψε:
> On 9/17/07, Πρεκατές Αλέξανδρος <[EMAIL PROTECTED]> wrote:
> > I'a writing first time so sorry if i reapeat but
> > i wanted to say this in my own words and angle.
> >
> > My question is :
> >
> > Lets assume that we'r going throught  php/html files
> >
> > a-----> b ------> c
> >         |<--------|
> >   .
> >   .
> >
> >
> 
> Browsers will not store a page that contains a header redirect in the
> history.  In fact what you're talking about even has a name for it:
> http://en.wikipedia.org/wiki/Post/Redirect/Get

Thanks very much for your responses. The above link was very helpfull
and the advice of Al. I have started studying PRG , model-view-control
and web application frameworks, areas that i didnt know they exist!!  


Alexandros Prekates.
Trikala Greece

--- End Message ---
--- Begin Message ---
At 9:15 AM +1000 9/20/07, Andrew Wilson wrote:
What do I have to do to get off this list. Murder someone?
Please take me off the list as I have already tried to unsubscribe several
times.

Andrew:

Just for my own amusement, who do you think you are talking to?

Figuring out how to unsubscribe shouldn't be much harder than subscribing, which you did by all by yourself. So, figure it out -- other's have without problems.

Cheers,

tedd


--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
Just for grins, tell us the steps you took to unsubscribe.

There is a link at the bottom of every email inviting you to unsubscribe.  So 
I'm sure you began there.

Tell us where it failed.
_________________________________________________________________
Kick back and relax with hot games and cool activities at the Messenger Café.
http://www.cafemessenger.com?ocid=TXT_TAGLM_SeptWLtagline

--- End Message ---
--- Begin Message ---
Instruct ICC wrote:
Just for grins, tell us the steps you took to unsubscribe.

There is a link at the bottom of every email inviting you to unsubscribe.  So 
I'm sure you began there.

Tell us where it failed.
_________________________________________________________________
Kick back and relax with hot games and cool activities at the Messenger Café.
http://www.cafemessenger.com?ocid=TXT_TAGLM_SeptWLtagline

honestly, if he responded to either of the two un-subscribe submissions that I submitted for him, he is probably off the list already.

--
Jim Lucas


    "Perseverance is not a long race;
        it is many short races one after the other"

Walter Elliot



    "Some men are born to greatness, some achieve greatness,
        and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare

--- End Message ---
--- Begin Message ---
At 2:35 PM -0400 9/21/07, Jason Pruim wrote:
errrr... Never mind. Soon as I sent the e-mail I tried moving the $_SESSION['search'] = $_GET['search']; to the top just below the includes and it worked just fine! :)

Ahh, the old sequence bug. Funny how variables have to be set before they contain the values you want -- been there a few times.

Cheers,

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
I am using str_replace to strip double quotes.

$string = 'This string has "quotes" in it';

$string = str_replace('"', '', $string);

this seems to work, yet when I put the $string into mysql,
it uses backslashes to escape where the quotes were. The
double-quotes are gone, yet it still escapes the 'ghost'
where they were.

I even tried 
str_replace(array("\x8c", "\x9c", "'", '"'), '', $string)
but the ghost remains and mysql continues to escape them.

I check the charsets, and the db is Latin-1 and the sting is ISO-8859-1

Any thoughts on this would be most graciously accepted.
Kind regards
kevin


-- 
"Democracy is two wolves and a lamb voting on what to have for lunch. 
Liberty is a well-armed lamb contesting the vote."
-- 
"Democracy is two wolves and a lamb voting on what to have for lunch. 
Liberty is a well-armed lamb contesting the vote."

--- End Message ---
--- Begin Message ---
Kevin Waterson wrote:
I am using str_replace to strip double quotes.

$string = 'This string has "quotes" in it';

$string = str_replace('"', '', $string);

this seems to work, yet when I put the $string into mysql,
it uses backslashes to escape where the quotes were. The
double-quotes are gone, yet it still escapes the 'ghost'
where they were.

I even tried str_replace(array("\x8c", "\x9c", "'", '"'), '', $string)
but the ghost remains and mysql continues to escape them.

I check the charsets, and the db is Latin-1 and the sting is ISO-8859-1

Any thoughts on this would be most graciously accepted.
Kind regards
kevin


is $string honestly something that you are getting via a form submit?

if so, your system might have magic quotes enabled.

This would automatically escape quotes with the attempt to make the values safer, and then you go and run your str_replace command and remove the double quotes, you end up leaving the '\' that the system automatically put in the value for you.

read up on magic quote gpc

hope this helps.

Jim

--
Jim Lucas


    "Perseverance is not a long race;
        it is many short races one after the other"

Walter Elliot



    "Some men are born to greatness, some achieve greatness,
        and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare

--- End Message ---
--- Begin Message ---
On Friday 21 September 2007, Karl james wrote:

> I am in need of some help.
> I would love to get some assistance on this.
> I need to start creating a database for my website.
> This will be for a fantasy football league website.
> To store stats on the database for archive purposes,
> And be able to pull them out on html reports.

You've been working on this "fantasy football league" thing for *years*. 
You mean you still haven't gotten it off the ground yet?

-- 
Crayon

--- End Message ---
--- Begin Message ---
At 3:33 PM +0800 9/22/07, Crayon Shin Chan wrote:
On Friday 21 September 2007, Karl james wrote:

 I am in need of some help.
 I would love to get some assistance on this.
 I need to start creating a database for my website.
 This will be for a fantasy football league website.
 To store stats on the database for archive purposes,
 And be able to pull them out on html reports.

You've been working on this "fantasy football league" thing for *years*.
You mean you still haven't gotten it off the ground yet?

I think the big problem here is that the words "fantasy" and "football" really don't go together.

Like in the old Rocky and Bullwinkle show when a government agent identified himself to Rocky as "Military Intelligence" and Rocky replied "Sounds like a contradiction in terms."

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
Stut wrote:

> Stefano Esposito wrote:
>> i'm in need to limit the numbers of conection to the database,
>> whithout loose of functionality. There is a general strategy to
>> achieve this?
> 
> 1) Caching
> 2) Caching
> 3) Caching
> 
> And if all that fails...
> 
> 4) Caching

And mysqls query cache does that pretty well. 

http://dev.mysql.com/doc/refman/5.0/en/query-cache.html


/Per Jessen, Zürich

--- End Message ---

Reply via email to