php-general Digest 3 Mar 2001 19:12:55 -0000 Issue 545

Topics (messages 42429 through 42464):

Re: [PHP-DB] How do I keep the selected showing...
        42429 by: andreas \(.work\)

Re: last inserted record
        42430 by: Christian Reiniger

Re: Netscape problems with PHP
        42431 by: Dennis Gearon

Extract() with 2D array
        42432 by: CC Zona

Hide Include-Files from the Web
        42433 by: mailing_list.gmx.at
        42442 by: Michael Hall
        42463 by: mailing_list.gmx.at

Re: Cash Offer!!
        42434 by: hollyjacobsemail77.excelonline.com
        42435 by: jannetfreebish67.juno.com

Help w/ sprintf
        42436 by: Anthony Rodriguez
        42439 by: mailing_list.gmx.at
        42459 by: Philip Olson

PHP web based mailing list administrator
        42437 by: Peter Van Dijck
        42443 by: Michael Hall

passing variables
        42438 by: george
        42440 by: Michael Hall
        42445 by: george
        42447 by: Ernest E Vogelsinger
        42448 by: Ben Weinberger
        42449 by: george
        42450 by: Ben Weinberger
        42451 by: Michael Hall
        42452 by: george
        42462 by: Terry Romine

any way to count subscribers to PHP lists?
        42441 by: Ned Lilly

length limit of URL?
        42444 by: Michael Hall
        42446 by: Ernest E Vogelsinger

Converting String to Variable
        42453 by: Randy Johnson
        42455 by: Ernest E Vogelsinger
        42456 by: Randy Johnson
        42457 by: John Meyer

Re: Netscape 4.75 problems
        42454 by: Dennis Gearon

Re: Nesting 'foreach ()'
        42458 by: Daniel Grace

Inane ereg_replace question
        42460 by: rm

Re:Fw: can't start apache
        42461 by: John Hinsley

Complicated Form Handling
        42464 by: Fred

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]


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


hi dave,


i usually do this from entries in a database

but it should also work this way with an array




// first make an array holding all the cities
$myTowns = array("London","New York","HongKong","Johannesburg");
$ArrayElements = 4;


this is now creating the dropdown-box:

<select name="town">
<?
for ($i=0;$i<$ArrayElements;$i++) {
     $selma="";
     $tacco = $myTowns[$i];
     if ($tacco == $town) { $selma = "selected";}
     $item="<option value=\"$tacco\" ".$selma.">".$tacco."</option>";
     echo $item;
}
?>
</select>



greetinx

andre
viva technologies


----- Original Message -----
From: "Dave Carrera" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 03, 2001 8:29 AM
Subject: [PHP-DB] How do I keep the selected showing...


> Hi All
> I have a fully functional db site which uses 2 sqls and 1 page to give our
> visitors info they need.
>
> That works fine, but some users have remarked that it would be nice that
the
> selected item from our drop down list stays shown when the page gives the
> info instead of going back to the top of the list.
>
> http://www.angelettes.co.uk/dates/index.php3 is the url in action and
> choosing different towns will show you what I mean.
>
> Its not the end of the world, as our visitors have said, but would be
nice.
>
> Any help is full appreciated.
>
> Dave C
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





On Saturday 03 March 2001 05:16, you wrote:

> i'm having a little bit of problems with a little mysql table i'm
> using. the table has no primary key nor index nor nothing.
>
> i was wondering if it's possible to select the last inserted record of
> a table with this characteristics.

Add a primary key. now. Accesses without that will be painfully slow.

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"These are the people who proudly call themselves "hackers" --
not as the term is now abused by journalists to mean a computer
criminal, but in its true and original sense of an enthusiast,
an artist, a tinkerer, a problem solver, an expert."

- ESR




I've got a weird problem with 4.75 as well. 

If you guys would go to http://64.177.230.204/FlowInputTable.php
and just reload it several times, you'll see that it's fine, but
enter any six numbers into the 1st 6 blocks and submit it,
when it comes back to itself and does the final redraw, 
NS4.75 says the post variables are already expired. The page
refers to itself, and checks for the existence of a variable
to see if it's the first time loaded.

I've also noticed that it acts really wired when I am doing
multiple reloads of a file I am editing. It remembers the OLD
pull down menus, even after I've changed them, AND it's received
the new code and the <view source> shows the new code. This is 
on MS95.

"Robert Fischler, Ph.D. ABD" <[EMAIL PROTECTED]> wrote:

>Hello all (first post for me!):
>
>I've been running into problems when testing PHP scripts on Netscape (when
>MSIE works fine).
>
>First problem (SOLVED) was that Netscape does something funny with the
>$PHP_SELF environmental variable, so I've learned to circumvent the problem
>by just hard-coding the page name instead of relying on the $PHP_SELF
>trick.
>
>Second problem (UNSOLVED, SO FAR) is that Netscape (...and I'm talking
>about
>Communicator 4.75 for the Mac, at least) doesn't carry my session variables
>over from page to page.  Has anyone else ran into this problem and found a
>solution?
>
>Thanks!!!
>P.S.   Things seem to work fine in the new Netscape 6, but most Mac users
>are still at 4.75.


________________________________________________________________
Sites by friends of mine: http://www.myhiddentreasures.com/
________________________________________________________________
WARNING personal propaganda signature
TAKE WHAT YOU LIKE AND LEAVE THE REST

SINCE OUR GOVERNMENT WON'T PRESERVE OUR CLIMATE, IT'S UP TO US!
Imagine ** yourself ** and your kids now an endangered species
<1>Inflate automobile tires to near maximum in summer, -2psi in winter
<2>add insulation to house and hot water heater, and refrigerator,
<3>combine trips in cars, make less of them <4>buy cars, sports
vehicles and recreational vehicles with good if not best mileage
<4>put awnings over windows is summer, remove in winter. <5> add
solar hot water heating. <6>Push for energy recycling clothes
dryers <7> walk more, play outside with your kids! <8> let your
grass grow to 3-4 inches, chokes weeds, saves water and energy,
keeps house cooler <9> Put WHITE or REFLECTIVE materials on
roofs to send energy back into space. <10> Vote for burial of
logging slash onsite in logging areas for better watersheds
and less burned vegetation. <11> compost your leaves and grass,
bury in flower beds, lawns, gardens, or give away. <12> VOTE
for energy and CO2 ratings on ALL products and foods. KNOW how
much damage your purchases do to the climate. <13> Give your kids 
less stuff and more of you. <14> recycle everything you can <15>
limit your children to an average 1 per adult between all your 
marriages. (Only REPLACE yourself, not expand the population)




Does extract() work on multidimensional arrays?  IOW, I have an array 
like...

array($elem1=>array($val1,$val2),$elem2=>$val3)

...from which I'd like to extract $elem1 and $elem2.  Should this be 
possible with extract()?  The docs just say the function takes an array as 
a parameter, but don't specify whether or not the array can have more than 
one dimension.  Since I'm having trouble making this work, I have a feeling 
the answer is no, but wanted to double-check in case it's actually my code 
that's at fault.

TIA!

-- 
CC




Hi!

I want my include-files not be seen from outside AND not be executed!!!
I don't have access to a directory outside DOCUMENT_ROOT and I don't have
.htaccess!!!

I think about something like:
1.
name: <file>.inc.php
2.
add code: 
if ($PHP_SELF==MY_NAME) exit;
as first line in the inluded script.
so, if the script is being included from another script, the code will be
executed - but if the file will be called directly, no code is executed!
BUT - how do I get the include-file's name?

or is it safe enough, to use something like
if (substr($SCRIPT_URL,-8)==".inc.php") exit;

thanks
michi

-- 
Sent through GMX FreeMail - http://www.gmx.net






Include files do not have to end with '.inc', which is purely a convention
of dubious value. If you use '.php' as the extension for included files,
they will have to be parsed by PHP and can't be read as plain text from
outside.

Mick

On Sat, 3 Mar 2001 [EMAIL PROTECTED] wrote:

> Hi!
> 
> I want my include-files not be seen from outside AND not be executed!!!
> I don't have access to a directory outside DOCUMENT_ROOT and I don't have
> .htaccess!!!
> 
> I think about something like:
> 1.
> name: <file>.inc.php
> 2.
> add code: 
> if ($PHP_SELF==MY_NAME) exit;
> as first line in the inluded script.
> so, if the script is being included from another script, the code will be
> executed - but if the file will be called directly, no code is executed!
> BUT - how do I get the include-file's name?
> 
> or is it safe enough, to use something like
> if (substr($SCRIPT_URL,-8)==".inc.php") exit;
> 
> thanks
> michi
> 
> -- 
> Sent through GMX FreeMail - http://www.gmx.net
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 





Hi!

as I wrote in my mail:
1.
I won't name them ".inc" but ".inc.php" (so *I* know, it's an include file)
2.
I don't even want them to be executable!!!

and therefore my question was, if this (on top of every include-file) would
be safe enough:
>> if (substr($SCRIPT_URL,-8)==".inc.php") exit;
$PHP_SELF better than $SCRIPT_URL in line above???

thanks
michi

> Include files do not have to end with '.inc', which is purely a convention
> of dubious value. If you use '.php' as the extension for included files,
> they will have to be parsed by PHP and can't be read as plain text from
> outside.
> 
> > Hi!
> > 
> > I want my include-files not be seen from outside AND not be executed!!!
> > I don't have access to a directory outside DOCUMENT_ROOT and I don't
> have
> > .htaccess!!!
> > 
> > I think about something like:
> > 1.
> > name: <file>.inc.php
> > 2.
> > add code: 
> > if ($PHP_SELF==MY_NAME) exit;
> > as first line in the inluded script.
> > so, if the script is being included from another script, the code will
> be
> > executed - but if the file will be called directly, no code is executed!
> > BUT - how do I get the include-file's name?
> > 
> > or is it safe enough, to use something like
> > if (substr($SCRIPT_URL,-8)==".inc.php") exit;

-- 
Sent through GMX FreeMail - http://www.gmx.net





hi there,
please take a moment to check out the newest cash offer.
cash is waiting for you!  Click Below 
Or copy the link and paste it in your browser

http://www.geocities.com/omega777799/





Hey...Janet Here... We Haven't Talked In So Long!!  
How Have You Been?  Thought I would Forward you this email!

I usually delete these but I opened this one, like what I saw, 
and thought you would like to see this.

http://www.geocities.com/rush009900/

IF THE LINK IS NOT HIGHLIGHTED OR YOU CANNOT CLICK ON IT.
COPY AND PASTE IT IN YOUR BROWSER.













What are the directives for the sprintf function to format an integer with 
commas (e.g.: 1,250,560)?

Thanks!





> What are the directives for the sprintf function to format an integer with
> 
> commas (e.g.: 1,250,560)?
 
you don't mean commas but thousands' grouping???

if you want thousands'  grouping it depends on your locale setting!

--cut--
For some numeric conversion a  radic  character  (`decimal
point')  or  thousands'  grouping  character  is used. The
actual character used depends on the  LC_NUMERIC  part  of
the  locale. The POSIX locale uses `.' as radix character,
and does not have a grouping character.  Thus,
       printf("%'.2f", 1234567.89);
results  in  `1234567.89'  in   the   POSIX   locale,   in
`1234567,89' in the nl_NL locale, and in `1.234.567,89' in
the da_DK locale.
--cut--

michael

-- 
Sent through GMX FreeMail - http://www.gmx.net




consider using number_format, for example :

  $formatted_number = number_format(1250560, 2); // 1,250,560.00

  $formatted_number = number_format(1250560);    // 1,250,560


regards,


Philip Olson
http://www.cornado.com/

On Sat, 3 Mar 2001, Anthony Rodriguez wrote:

> What are the directives for the sprintf function to format an integer with 
> commas (e.g.: 1,250,560)?
> 
> Thanks!
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





Hi,
does there exist a web based mailing list administrator in PHP (Tying in 
with some open source mailing list software)?
Ideally, something like egroups (now groups.yahoo.com). I just want to be 
able to easily administrate (or have other people administrate) mailing 
lists. I have access to my own server (linux, php4, ...)
thanks!
Peter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://liga1.com: building multiple language/culture websites






Yes, they are about. Try hotscripts.com.

Mick

On Sat, 3 Mar 2001, Peter Van Dijck wrote:

> Hi,
> does there exist a web based mailing list administrator in PHP (Tying in 
> with some open source mailing list software)?
> Ideally, something like egroups (now groups.yahoo.com). I just want to be 
> able to easily administrate (or have other people administrate) mailing 
> lists. I have access to my own server (linux, php4, ...)
> thanks!
> Peter
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> http://liga1.com: building multiple language/culture websites
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 





I have a page which pulls contact information out of a database name, email
message, and displays it on a page using
mysql_fetch_array  so my question is how is it possible to delete one of the
emails, the only way i can think of is to use a checkbox and a hidden field
giving the id and then place it inside a form so all ticked so that if you
tick the email and submit the form it deletes the ticked emails.
  However there must be a better way, perhaps using cookies

TIA

george







One way:

Pull as much info as you need out of the db, including the email id, then
have a select box or check box if you want which sends the id of the email
you want to delete back to a 'DELETE FROM' sql statement.

No need for cookies that I can see.

Mick 

On Sat, 3 Mar 2001, george wrote:

> I have a page which pulls contact information out of a database name, email
> message, and displays it on a page using
> mysql_fetch_array  so my question is how is it possible to delete one of the
> emails, the only way i can think of is to use a checkbox and a hidden field
> giving the id and then place it inside a form so all ticked so that if you
> tick the email and submit the form it deletes the ticked emails.
>   However there must be a better way, perhaps using cookies
> 
> TIA
> 
> george
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 






Thanks Michael,

            but what I plan on doing is pulling the name,subject and email
address out of the db, then giving the option to view the full message, but
i have had to do this using a form so my code looks like

<tr><form metod=post action=view_enq.php><input type=hidden name=id
value=$row[id]><td bgcolor=#ffffcc>$row[title] $row[name]</td><td
bgcolor=#ffffcc>$row[subject]</td
>";

echo
"<td  bgcolor=#ffffcc>$row[email]</td><td align=center
bgcolor=#ffffcc><input type=submit name=submit value=view></td></form></
tr>";
}
echo "</table></td></tr></table></td></tr></table>";

 I plan to add hidden fields for all the information pulled out the db my
question is this how do you pass variables into the next page without using
a form.
can it be done say instead of a form there was a link next to each message
which said view, clicking on this takes you to a page where you read the
full mail, then there are another 2 links on for reply and one for
delete.How could that be done

Thanks in advance

george






At 15:41 03.03.2001, george said:
--------------------[snip]--------------------
> I plan to add hidden fields for all the information pulled out the db my
>question is this how do you pass variables into the next page without using
>a form.
>can it be done say instead of a form there was a link next to each message
>which said view, clicking on this takes you to a page where you read the
>full mail, then there are another 2 links on for reply and one for
>delete.How could that be done
--------------------[snip]-------------------- 

Whatever you want to remember - if you start a session and register the
data to be remembered with the session, it will be available when the
browser comes back again (and presents the appropriate PHPSESSID value, of
course).



     ...ebird

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





You could still use a form, but just have a very small one... something like:
<form method=post action="yourpage.html">
<input type=IMG name=REPLY value=submit><img src="ImageForReplies">
<input type=IMG name=DELETE value=submit><img src="ImageForDeletions">
</FORM>

This would then pass any variables you wanted to the next page...

-Ben

At 03:49 PM 3/3/2001 +0100, Ernest E Vogelsinger wrote:
>At 15:41 03.03.2001, george said:
>--------------------[snip]--------------------
> > I plan to add hidden fields for all the information pulled out the db my
> >question is this how do you pass variables into the next page without using
> >a form.
> >can it be done say instead of a form there was a link next to each message
> >which said view, clicking on this takes you to a page where you read the
> >full mail, then there are another 2 links on for reply and one for
> >delete.How could that be done
>--------------------[snip]--------------------






  Yes but it still goes to the same page,
if i give the option to delete or reply would it not need to go to different
pages one with the DELETE and the other to reply.
However I am still very much a newbie so of anyone knows better(which is a
certainy) then I would be delighted to listen..

Thanks again

george






You could make them on the same page with a PHP statement something like:

if ($Reply) {

//put your reply script here
}

elseif ($Delete) {

//put your delete script here
}

Just make sure the name and value of the input tags on the previous page 
are called Reply and Delete.

Best,
-Ben

At 03:02 PM 3/3/2001 +0000, george wrote:

>   Yes but it still goes to the same page,
>if i give the option to delete or reply would it not need to go to different
>pages one with the DELETE and the other to reply.
>However I am still very much a newbie so of anyone knows better(which is a
>certainy) then I would be delighted to listen..
>
>Thanks again
>
>george
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]






OK, sorry, I read your post in a hurry.
Something like this should work:

        <A HREF="the_next_page.php?id=$row[id]">Do Something</A>

On the next page you'd have:

        $sql = "Do Something WHERE id = '$id'";

By the way, you don't necessarily have to go to a different page in the
sense of a different file ... all your 'pages' can be part of the one php
script divided up like this:

        if ($action == 'delete') { do delete stuff }
        elseif ($action == 'full') { do full display }
        else { just do the default }

In that case, the line above would be more like:

        <A HREF="the_same_page.php?action=delete&id=$row[id]">Do
Something</A>

Hope this is helpful.

Mick


On Sat, 3 Mar 2001, george wrote:

> 
> Thanks Michael,
> 
>             but what I plan on doing is pulling the name,subject and email
> address out of the db, then giving the option to view the full message, but
> i have had to do this using a form so my code looks like
> 
> <tr><form metod=post action=view_enq.php><input type=hidden name=id
> value=$row[id]><td bgcolor=#ffffcc>$row[title] $row[name]</td><td
> bgcolor=#ffffcc>$row[subject]</td
> >";
> 
> echo
> "<td  bgcolor=#ffffcc>$row[email]</td><td align=center
> bgcolor=#ffffcc><input type=submit name=submit value=view></td></form></
> tr>";
> }
> echo "</table></td></tr></table></td></tr></table>";
> 
>  I plan to add hidden fields for all the information pulled out the db my
> question is this how do you pass variables into the next page without using
> a form.
> can it be done say instead of a form there was a link next to each message
> which said view, clicking on this takes you to a page where you read the
> full mail, then there are another 2 links on for reply and one for
> delete.How could that be done
> 
> Thanks in advance
> 
> george
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 








  Thanks Ben,
                       and a quick answer as well.
  that means I can give them an option on the main page to delete or view
the email, which is even better.

Thanks

George






I do this kind of thing all the time.

Consider using hidden for the various values you are passing, and name the
buttons "doAction" and set the values to "Add", "Delete", "View" ...

Then the php file can do:

switch($doAction) {
    case "Add":
        // your code
        break;
    case "Delete":
        // your code
        break;
    case "View":
        // your code
        break;
}

> From: Ben Weinberger <[EMAIL PROTECTED]>
> Date: Sat, 03 Mar 2001 08:57:30 -0600
> To: "george" <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] passing variables
> 
> You could still use a form, but just have a very small one... something like:
> <form method=post action="yourpage.html">
> <input type=IMG name=REPLY value=submit><img src="ImageForReplies">
> <input type=IMG name=DELETE value=submit><img src="ImageForDeletions">
> </FORM>
> 
> This would then pass any variables you wanted to the next page...
> 
> -Ben
> 
> At 03:49 PM 3/3/2001 +0100, Ernest E Vogelsinger wrote:
>> At 15:41 03.03.2001, george said:
>> --------------------[snip]--------------------
>>> I plan to add hidden fields for all the information pulled out the db my
>>> question is this how do you pass variables into the next page without using
>>> a form.
>>> can it be done say instead of a form there was a link next to each message
>>> which said view, clicking on this takes you to a page where you read the
>>> full mail, then there are another 2 links on for reply and one for
>>> delete.How could that be done
>> --------------------[snip]--------------------





Hi, I'm wondering if there's an ezmlm equivalent of the "lists-full"
command for majordomo.   That command returns data like the
following (from the PostgreSQL list):

---
pgsql-general           (no description)
                           Subscribers: 1217
                           Posts:       1589 in the last 30 days
                           Archive URL:    ?
                           Digests:
                             daily:  Daily Digest
---

actually, the lists-full command returns that data for every list
hosted at postgresql.org.  I'm building some general open source
advocacy statistics, and would love to have the same data on PHP
lists...

Thanks, and best regards,
Ned Lilly





Does anyone know the practical limit to the length of a URL? Some of mine
are now 100 characters long with heaps of variables packed in, so I'm
wondering what the limits are?

Thanks

Mick





At 14:02 03.03.2001, Michael Hall said:
--------------------[snip]--------------------
>Does anyone know the practical limit to the length of a URL? Some of mine
>are now 100 characters long with heaps of variables packed in, so I'm
>wondering what the limits are?
--------------------[snip]-------------------- 

Excerpt from RFC 2616 (http://www.ietf.org/rfc/rfc2616.txt), Page 18

The HTTP protocol does not place any a priori limit on the length of
a URI. Servers MUST be able to handle the URI of any resource they
serve, and SHOULD be able to handle URIs of unbounded length if they
provide GET-based forms that could generate such URIs. A server
SHOULD return 414 (Request-URI Too Long) status if a URI is longer
than the server can handle (see section 10.4.15).

   Note: Servers ought to be cautious about depending on URI lengths
   above 255 bytes, because some older client or proxy
   implementations might not properly support these lengths. 




     ...ebird

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





Is there anyway to convert a string to a variable

example

$str="monday"; 

I would like to then do this:

$monday="blah";

thanks

randy








At 17:09 03.03.2001, Randy Johnson said:
--------------------[snip]--------------------
>Is there anyway to convert a string to a variable
>
>example
>
>$str="monday"; 
>
>I would like to then do this:
>
>$monday="blah";
--------------------[snip]-------------------- 

RTFM ;->

$$str = "blah";
print $monday;



     ...ebird

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





it may look weird but that is the way it needs to be done. here is a better
example

$str=myfunct()  this returns monday

then i want the monday to turn into this

$monday

so i can do this

$monday="BlaH";

thanks

randy

-----Original Message-----
From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 03, 2001 11:35 AM
To: Randy Johnson
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Converting String to Variable


At 17:09 03.03.2001, Randy Johnson said:
--------------------[snip]--------------------
>Is there anyway to convert a string to a variable
>
>example
>
>$str="monday";
>
>I would like to then do this:
>
>$monday="blah";
--------------------[snip]--------------------

RTFM ;->

$$str = "blah";
print $monday;



     ...ebird

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






Here's my question: why do you want to do this, and is there a better way to
do this, say a hash list or something?


BTW, isn't monday defined as a constant that always equals "blah!"  It
always has for me.

-----Original Message-----
From: Randy Johnson [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 03, 2001 9:44 AM
To: Ernest E Vogelsinger; Randy Johnson
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Converting String to Variable


it may look weird but that is the way it needs to be done. here is a better
example

$str=myfunct()  this returns monday

then i want the monday to turn into this

$monday

so i can do this

$monday="BlaH";

thanks

randy





<BTW, Robert, your mailbox is too full to send this to>

I've got a weird problem with 4.75 as well. 

If you guys would go to http://64.177.230.204/FlowInputTable.php
and just reload it several times, you'll see that it's fine, but
enter any six numbers into the 1st 6 blocks and submit it,
when it comes back to itself and does the final redraw, 
NS4.75 says the post variables are already expired. The page
refers to itself, and checks for the existence of a variable
to see if it's the first time loaded.

I've also noticed that it acts really weird when I am doing
multiple reloads of a file I am editing. It remembers the OLD
pull down menus, even after I've changed them, AND it's received
the new code and the <view source> shows the new code. This is 
on MS95.

"Robert Fischler, Ph.D. ABD" <[EMAIL PROTECTED]> wrote:

>Hello all (first post for me!):
>
>I've been running into problems when testing PHP scripts on Netscape (when
>MSIE works fine).
>
>First problem (SOLVED) was that Netscape does something funny with the
>$PHP_SELF environmental variable, so I've learned to circumvent the
problem
>by just hard-coding the page name instead of relying on the $PHP_SELF
>trick.
>
>Second problem (UNSOLVED, SO FAR) is that Netscape (...and I'm talking
>about
>Communicator 4.75 for the Mac, at least) doesn't carry my session
variables
>over from page to page.  Has anyone else ran into this problem and found a
>solution?
>
>Thanks!!!
>P.S.   Things seem to work fine in the new Netscape 6, but most Mac users
>are still at 4.75.


-- 
________________________________________________________________
Sites by friends of mine: http://www.myhiddentreasures.com/
________________________________________________________________
WARNING personal propaganda signature
TAKE WHAT YOU LIKE AND LEAVE THE REST

SINCE OUR GOVERNMENT WON'T PRESERVE OUR CLIMATE, IT'S UP TO US!
Imagine ** yourself ** and your kids now an endangered species
<1>Inflate automobile tires to near maximum in summer, -2psi in winter
<2>add insulation to house and hot water heater, and refrigerator,
<3>combine trips in cars, make less of them <4>buy cars, sports
vehicles and recreational vehicles with good if not best mileage
<4>put awnings over windows is summer, remove in winter. <5> add
solar hot water heating. <6>Push for energy recycling clothes
dryers <7> walk more, play outside with your kids! <8> let your
grass grow to 3-4 inches, chokes weeds, saves water and energy,
keeps house cooler <9> Put WHITE or REFLECTIVE materials on
roofs to send energy back into space. <10> Vote for burial of
logging slash onsite in logging areas for better watersheds
and less burned vegetation. <11> compost your leaves and grass,
bury in flower beds, lawns, gardens, or give away. <12> VOTE
for energy and CO2 ratings on ALL products and foods. KNOW how
much damage your purchases do to the climate. <13> Give your kids 
less stuff and more of you. <14> recycle everything you can <15>
limit your children to an average 1 per adult between all your 
marriages. (Only REPLACE yourself, not expand the population)




"Tim Ward" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> is okay (but still doesn't work) although I have noticed that you seem to
> need to code-block single statements in if ... else constructs
> i.e
> if (1==1) echo("fred") else echo("bill"):
> should work but doesn't.
>

if (1==1) echo("fred"); else echo("bill"):
----------------------^

You need to have a semicolon before the else.

 - Daniel Grace <http://dewin.oldbattery.com/>
--
  "Space may be the final frontier but its made in a Hollywood basement."
    - Red Hot Chili Peppers - Californication







I have to get rid of any spaces on either side of the
: mark. Can anyone explain why

php 3.xx

$a="to be or not      :    to to be";

$b=ereg_replace(" *:",":",$b);
  $b=ereg_replace(": *",":",$b);

works and

$b=ereg_replace(" *:|: *",":",$b); 

does not work. I've had this problem before and ended
up using two or more statments rather than one.

rm




__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/




> 
> 
> 

Scott Wagner wrote:
> To: php 
> Sent: Thursday, March 01, 2001 11:55 PM
> Subject: can't start apache
> 
> 
> Hi
> I just installed mysql, apache and php4 on Linux Mandrake 7.0 from a cd I got with 
>the book "PHP Fast and Easy"
> After installing apache it seemed ok and started normally.  But after installing 
>PHP4 I get the following error message
> when I try to start apache:
> 
> Syntax error on line 207 of httpd. config: cannot load 
>/usr/apache_1.3.12/libexec/libphp4.so into server:
> /usr/loca/apache_1.3.12/libexec/libphp4.so: undefined symbol: mysql_init
> 
>  I used the following command to build php4:
> /configure --with-mysql=/usr/local/mysql-3.22.32-pc-linux-gnu-i686/ 
>--with-apxs=/usr/local/apache_1.3.12/bin/apxs
> 
> Including ./configure --activate-module=src/modules/modules/p in installation fails, 
>saying directories do not exist.
> Looking at previous output it appears that the modules have already been activated.
> 
> Any hints in a newbie-friendly format would be greatly appreciated.
> Thanks,
> SW

I tried installing the files of the CD too, and tied myself up in knots,
although I like the general style of the book. In the end, I adopted the
path of least resistance and simply installed the SuSE rpms (although I
wouldn't recommend this on RedHat or Mandy!) and everything worked out
of the crate. 

I'd advise you delete what you've installed and just grab the relevant
rpms from Mandrake or RedHat's site (or off the CD). The important thing
is not that they match the version numbers in the book correctly, but
that they are appropriate to your version of Mandrake. Be aware that the
RedHat rpm for MySQL was faulty (maybe they've fixed it now): you need
to either compile that with no dependencies (see man rpm for details) or
grab the rpm from the MySQL site.

Let us know how you get on.

-- 
******************************************************************************
Marx: "Why do Anarchists only drink herbal tea?"
Proudhon: "Because all proper tea is theft."
******************************************************************************




my table holds these fields: userid, pid, setting, status
the pk is the pid field,  and for each pid a user holds, there is a
different row to hold the user's pid's setting and status.
I am making a script t modify the setting of the user pid,
the script first generates a form, the form goes:

User has pid, (Radio Button) enable,(Radio Button) Disable, (Radio Button)
Open;  Setting is Active/Inactive

the form also passes the as a hidden input. and this is repeated for each
pid that the user has,
so in effect, when submitting the form, nothing changes but the setting, but
im racking my brains trying to figure how to associate the radio button
group with the hidden pid,
as to create a form that works as
pid1 <-- Setting
pid2 <-- Setting
pid3 <-- Setting
so that i could insert them into the datbase the same way,

~Fred




Reply via email to