Re: [PHP] Re: Handling checkboxes that aren't checked!!!

2003-11-04 Thread Daniel Clark
>> I have a page with a Form and a Checkbox.
>>
>> I have a second page which wants to do something depending on if the
>> checkbox is selected or not.
>> If its selected there is no problem.  But if I tryand do anything if
>> it isn't selected then it says the variable is 'undefined'.  How can I
>> test


For checkbox's I like to have a HIDDEN checkbox.







With the hidden name and value, I'll always have at least a blank form
variable passed.

Daniel

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



Re: [PHP] text input truncated

2003-11-04 Thread Daniel Clark
> $xyz = "Hello World";
>
> echo "";
>
> ?>
>
> The text box shows up with "Hello" NOT "Hello World". How do I get the
> entire variable?


I would try single quotes here.

$xyz = 'Hello World';

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



Re: [PHP] unexpected $ in ... WTF?

2004-04-14 Thread Daniel Clark
What about line 148 the "{" ... supposed to be there?


> Brian V Bonini wrote:
>> Parse error: parse error, unexpected $ in /foo/bar/foo.php4 on line 150
>>
>> 146: 
>> 147: > 148: }
>> 149: include "foobar.inc.php4";
>> 150: ?>

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



Re: [PHP] transformation to htm file when downloaded

2004-04-15 Thread Daniel Clark
The PHP code is processed on the web server and removed.   Only the HTML
and images are sent back to the clients browser.


> I'm just starting to get PHP, and I'm wondering about the security of the
> code I write. It _seems_ that when I try to download the PHP file directly
> (like using Save Target As...) it will download only as an HTML file and
> my
> PHP code is gone. I've tried this on a few other people's sites, and this
> seems to be the common behavior. Is there a way someone can extract my php
> file without this transformation? What are some good security issues I
> should know?
>
> One of the things I'm starting with is a simple blog/guestbook. I have a
> couple form fields and I strip_tags ... what else should I be doing? I
> want
> to leave the guestbook pretty open, so I don't want a sign-in and
> confirmation thingie. I don't even mind anonymity, cuz I can edit the
> comments later if I want.
>
> Thanks for your time.
>
> Gabino

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



Re: [PHP] alternating row color--newbie help

2004-04-15 Thread Daniel Clark
Are you sure there is data in "name, phonenumber, age" ??



> Well, I've hit all the forums and tried it a few different ways, but I
> still
> can't get this code to work.  At this point it just shows me an empty
> table
> with column headings.  I am new and still experimenting, but can someone
> tell me what is wrong here?  This is pretty much straight from a tutorial,
> with just a few mods for my purposes.  Here's what it looks like online:
>
> http://www.enfieldrollerhockey.com/EDH/html/testing/alt_rows3.php
> 
>
> and the code:
>
>  $db = mysql_connect("*","","*") or
> die("Problem
> connecting");
> mysql_select_db("hockeystats") or die("Problem selecting database");
> $query = "SELECT * FROM mon_roll_de ORDER BY sid";
> $result = mysql_query($query) or die ("Query failed");
> //let's get the number of rows in our result so we can use it in a for
> loop
> $numofrows = mysql_num_rows($result);
> ?>
>
>  echo "\n";
> echo " bgcolor=\"lightblue\">sidleagueday\n";
> for($i = 0; $i < $numofrows; $i++) {
> $row = mysql_fetch_array($result); //get a row from our result set
> if($i % 2) { //this means if there is a remainder
> echo "\n";
> } else { //if there isn't a remainder we will do the else
> echo "\n";
> }
> echo
> "".$row['name']."".$row['phonenumber']."".$row['age'].
> "\n";
> echo "\n";
> }
> //now let's close the table and be done with it
> echo "\n";
> ?>
>
> I'd appreciate any hints on this...
>
> Thanks
>
> Dan
>
>

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



Re: [PHP] http header

2004-04-17 Thread Daniel Clark
Yes, that works.

>>Is the following code the best way to redirect someone to a different 
>>page using PHP?
>>
>>>header("Location: http://www.yahoo.com";);
>>?>
>>
>>I looked for a "redirect" function of some kind and didn't come up with 
>>anything.  Just curious what the consensus is...




Re: [PHP] why doesn't this work ?

2004-04-17 Thread Daniel Clark
The browser doesn't know what to do with PHP code.


>>If I put the following script in a .php file it would work but if I put it
>>in an .html file doesn't work, why? script tag is only used in .html file.
>>
>>
>>echo "
    "; >>if ($handle = opendir('.')) { >> while (false !== ($file = readdir($handle))) { >> if ($file != "." && $file != ".." && eregi('\.html$', $file)) { >> echo "
  • $file> >>font>

  • "; >> } >> } >> closedir($handle); >>} >> >>echo "
"; >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] why doesn't this work ?

I should have also said:

Because it's missing the  tags, the web server isn't going to run the 
code, but pass it back to the client browser.


>>If I put the following script in a .php file it would work but if I put it
>>in an .html file doesn't work, why? script tag is only used in .html file.
>>
>>

Re: [PHP] Array Problem

How about count()

>>That's how you could do it ...
>>
>>$ar = array();
>>
>>$len = strlen($a);
>>for ($i = 0; $i < $len; ++$i) {
>>$ar[] = $a{$i};
>>}
>>
>>HTH
>>
>>Richard

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



Re: [PHP] Rporting tool - CVS?

Beyond Compare is a pretty cool diff program. www.scootersoftware.com

They have a demo version.

>>Scenario :
>>Im working on several large projects, all which have several users.
>>Each user has a personal innstallation.
>>
>>Each of my projects are in constant development, and often the updates
>>from version to version are only in a few files.
>>
>>Is there a tool out there who can compare two folders, and generate
>>a report on what files are new, removed and updated?
>>
>>Usually I just upload all the project files all over, since all settings are
>>in the database or settings file. But when projects have over 500 files,
>>and you have 50 customers it would be nice to just upload the files
>>which are updated.
>>
>>I have a feeling CVS would maby be the trick here, but im not sure.
>>Still I could manually do this, it isnt that hard, but you know - maby
>>there already is such a system out there and in that case it would fit
>>me perfectly.
>>
>>-- 
>>-- 
>>Kim Steinhaug
>>--
>>There are 10 types of people when it comes to binary numbers:
>>those who understand them, and those who don't.
>>--
>>www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
>>--
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>




Re: [PHP] why doesn't this work ?

Can you post the code and error.


>>I took out the scrip tags and put in   at the
>>end, but it returns this:
>>
>>$file
>>"; } } closedir($handle); } echo "
>>"; ?>

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



Re: [PHP] Removing line breaks...

str_replace( $line, '\n', '')

http://us2.php.net/manual/en/function.str-replace.php

>>How do i turn this...
>>
>>[br]
>>  [b]My Title [/b]
>>[br]
>>
>>into
>>
>>[br][b]My Title[/b][br]
>>
>>
>>--- I just need to have line breaks removed basically...
>>
>>any ideas?

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



Re: [PHP] why doesn't this work ?

You have this as a xxx.php file right?

It has to have a .php extension for it to work.

>>I put this in the body of an html file:
>>
>>>if ($handle = opendir('.')) {
>>   while (false !== ($file = readdir($handle))) {
>>   if ($file != "." && $file != ".." && eregi('\.html$', $file)) {
>>   echo "$file>
>>font>";
>>   }
>>   }
>>   closedir($handle);
>>}
>>
>>echo "";
>>?>
>>
>>the output page contains :
>>
>>$file
>>"; } } closedir($handle); } echo "
>>"; ?>
>>
>>I don't understand why.

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



Re: [PHP] why doesn't this work ?

The web server is set up to see the .php file extension and pass the entire page to 
the PHP engine for processing.   Then the web server passes the 
results back to the client's browser  ( HTML, text, and images).


>>Yes, the server supports php, and I don't want to make it into a php file
>>because its a big html file and I just need this little script on it. Why
>>cannot I embed php in html files?

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



Re: [PHP] session var problems

Do yo have have start_session() on every page to before you can read session variables?

>>Dear list,
>>I am trying to set a simple session variable on PageA.
>>
>>$_SESSION['CategoryID'] = intval($Data['ID']);
>>
>>if I print after setting the value on PageA, I will
>>get the expected ID number.
>>
>>go on to PageB and $_SESSION['CategoryID'] is '0'.
>>
>>If I hard code in a value for $_SESSION['CategoryID']
>>on PageA, it prints correctly on PageB.  
>>
>>If I set $Test = 462 and then 
>>$_SESSION['CategoryID'] = intval($Test);
>>on PageA, it prints correctly on PageB.
>>
>>Does anyone have any ideas?
>>
>>Kathleen

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



Re: [PHP] PHP Web Hosting

I'm using www.phpwebhosting.com


> On Mon, 2004-04-19 at 15:14, Martin, Stanley G [Contractor for Sprint]
> wrote:
>> Some time ago I put up a web site on Domehost.com.  Everything has been
>> working great and I had a couple questions for their Tech Support but
>> haven't received any feedback from them, they don't answer their phones.
>> Also, it is stated on their site that a company called Wintek Computing
>> took them over last year.  I can't contact them either.  Does anyone
>> know anything that may have happened here?  I suspect I need to find
>> another web hosting company before my site just goes away.
>>
>> Stanley G. Martin
>> System Administrator
>> Sprint - EAS Business Intelligence
>> [EMAIL PROTECTED]
> --

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



Re: [PHP] session variables

hum.  Try $_SESSION['test'] on page 2.

> I have two test files running on a server, which is giving me a headache,
> due to the fact the session variables are not been maintained across the
> two
> pages.
>
> The server is running ...
>
> PHP Version  = 4.0.5
> register_globals = ON
> Session Support = Enabled
> session.auto_start = Off
> session.cache_expire =  180
> session.cache_limiter = nocache
> session.cookie_domain = inweb.net.uk
> session.cookie_lifetime = 600
> session.cookie_path =  /
> session.cookie_secure = Off
> session.entropy_file = no value
> session.entropy_length = 0
> session.gc_maxlifetime = 1440
> session.gc_probability = 1
> session.name = PHPSESSID
> session.referer_check = no value
> session.save_handler = files
> session.save_path = /tmp
> session.serialize_handler php
> session.use_cookies = On
>
> The two script files are as follows: -
>
> Page #1:
>
>   session_start();
>  session_register("test");
>  $test = "Hullo World";
>  print $test; // prints "test"
> ?>
>
> Page # 2
>
>   session_start();
>  print $test;// prints nothing, zip!
> ?>
>
> Can anyone tell me where I'm going wrong, works fine of test servers,
> etc.,
> only screwed up when site was lauched.

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



Re: [PHP] session variables

Does page1 call page2?
Or do you open another browser window and open page2?

My understanding is some browsers to NOT transfer the same session info to
another borwser window.

> Tried that as well as $HTTP_SERVER_VARS, $_SESSION, etc., still cannot get
> the damn thing working.
>
> Regards,
> Charlie.
>
> "Vincent Dupont" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> I would do
> script 1 :
> $_SESSION['test'] = "hello world";
>
> and in script2 :
> print($_SESSION['test']);
>
>
> vincent
>
> -Original Message-
> From: Charles Collins [mailto:[EMAIL PROTECTED]
> Sent: mardi 20 avril 2004 17:44
> To: [EMAIL PROTECTED]
> Subject: [PHP] session variables
>
>
> I have two test files running on a server, which is giving me a headache,
> due to the fact the session variables are not been maintained across the
> two
> pages.
>
> The server is running ...
>
> PHP Version  = 4.0.5
> register_globals = ON
> Session Support = Enabled
> session.auto_start = Off
> session.cache_expire =  180
> session.cache_limiter = nocache
> session.cookie_domain = inweb.net.uk
> session.cookie_lifetime = 600
> session.cookie_path =  /
> session.cookie_secure = Off
> session.entropy_file = no value
> session.entropy_length = 0
> session.gc_maxlifetime = 1440
> session.gc_probability = 1
> session.name = PHPSESSID
> session.referer_check = no value
> session.save_handler = files
> session.save_path = /tmp
> session.serialize_handler php
> session.use_cookies = On
>
> The two script files are as follows: -
>
> Page #1:
>
>   session_start();
>  session_register("test");
>  $test = "Hullo World";
>  print $test; // prints "test"
> ?>
>
> Page # 2
>
>   session_start();
>  print $test;// prints nothing, zip!
> ?>
>
> Can anyone tell me where I'm going wrong, works fine of test servers,
> etc.,
> only screwed up when site was lauched.

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



Re: [PHP] Re: Form Data Transfer b/w Pages

I agree.   $_GET[] would expose the username and password on the URL.

> For ease of use, i would create a session and handle it that way or you
> could pass it through $_GET[]
> Query string.
> Would recommend $_SESSION though.
> Cheers
>
> "Sobajo" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Two forms (form1 and form2 submit to the same controller.php file. The
>> controller redirects the page depending on the value of hidden value
>> 'page'. I want form data 'username' and 'password' to be available on
>> both redirected pages (staff.php and customer.php). How do I accomplish
>> this?
>>
>> 
>> 
>>
>>
>>
>>
>> 
>>
>> 
>> 
>>
>>
>>
>>
>> 
>>
>> >   //controller.php
>>   header("Location: http://"; . $_SERVER['HTTP_HOST']
>>  . dirname($_SERVER['PHP_SELF'])
>>  . "/"
>>  . $_POST["page"]);
>> ?>
>>
>> >   //user.php
>>   echo "Staff Name = " . $_POST["username"];
>>   echo "Staff Password = " . $_POST["password"];
>> ?>
>>
>>
>> >   //customer.php
>>   echo "Customer Name = " . $_POST["username"];
>>   echo "Customer Password = " . $_POST["password"];
>> ?>
>

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



Re: [PHP] What's wrong with this IF statement?

What about removing the quotes around the numbers.

 if ($cat_id != 53 || $cat_id != 54 || $cat_id != 55 etc...


> My IF statement should be picking up on the numbers, and if the number
> matches not be displaying out the information, however I look at the
> outputted page and the information is still there, what have I got wrong
> on the code?
>
> 
> //Show categories first
> $get_cats = "select id_num, id_name, description, cat_code from
> categories order by id_name";
> $get_cats_res = mysql_query($get_cats) or die(mysql_error());
>
> if (mysql_num_rows($get_cats_res) < 1)
> {
>  $display_block = "Sorry, no categories to browse.";
> }
> else
> {
>  while ($cats = mysql_fetch_array($get_cats_res))
>  {
>   $cat_id = $cats[id_num];
>   if ($cat_id != "53" || $cat_id != "54" || $cat_id != "55" || $cat_id
> != "117" || $cat_id != "118" || $cat_id != "74")
>   {
>   $cat_title = strtoupper(stripslashes($cats[id_name]));
>   $cat_desc = stripslashes($cats[description]);
>   $display_block .= " href=$_SERVER[PHP_SELF]?cat_id=$cat_id>$cat_title
> $cat_desc\n";
>   while ($items = mysql_fetch_array($get_items_res))
>{
> $item_id = $items[id];
> $item_num = $items[item_num];
> $item_desc = stripslashes($items[description]);
> if ($item_num != "ABC-R37" || $item_num !=  "ABC-R42" || $item_num
> != "HB-99100" || $item_num != "RO-PUMPS" || $item_num != "ML-HDGALJUG"
> || $item_num != "PFS-CAC21" || $item_num != "PFS-CO2")
> {
> $item_num = ltrim($item_num);
> $item_num = rtrim($item_num);
> $display_block .= " href=\"catalog/$item_id.html\">$item_num -
> $item_desc\n";
> }
>}
> 
>
> My assumption is that BOTH IF statements are not working correctly since
> the logic is that if they are built the same they would react the same.
> HELP!
>
> TIA!
> Robert
>
> --
> 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



Re: [PHP] calling php function

Because the Javascript onclick event runs in the client browser, you could call a php 
file that has and runs a particular php function.  

>> Is it possible to call php function in the onclick event ?
>>
>>REgards,
>>Uma

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



Re: [PHP] OK SQL experts...

I think you want to remove the single quotes around the field names.

SELECT * FROM my_table WHERE (field_1 LIKE '%$keyword%' OR 
field_2 LIKE '%$keyword%' OR field_3 LIKE '%$keyword%') AND 
status = 'active';


>>I STFW and RTFM and I still can't figure out why this returns a 1064 
>>parse error:
>>
>>SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 
>>'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 
>>'status' = 'active';
>>
>>Anyone? TIA!
>>
>>- B1ff Lamer

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



Re: [PHP] OK SQL experts...

The parenthesis are OK.   The query might take a long time to run with 3 LIKE 
statements.


>>Backticks, single quotes, or nothing at all makes no difference. I 
>>believe the parsing error is due to my parentheses or AND/OR structure. 
>>Any thoughts on that?
>>
>>
>>
>>On Apr 23, 2004, at 8:32 AM, John W. Holmes wrote:
>>
>>> From: "Brian Dunning" <[EMAIL PROTECTED]>
>>>
 I STFW and RTFM and I still can't figure out why this returns a 1064
 parse error:

 SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR
 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND
 'status' = 'active';




Re: [PHP] PHP Sessions on Windows

Sounds right.

Do you have a C:\temp directory?

>>How does one get sessions working on Windows? I have modified my php.ini
>>file so that session.save_path = C:\Temp, restarted and Apache. Still I get
>>this error message:
>>
>>Warning: session_start(): open(/tmp\sess_26310affee160329c9e50f27663f8971,
>>O_RDWR) failed: No such file or directory (2) in
>>c:\apache\htdocs\dbmdata\admin\61646d696e.php on line 2
>>
>>This is the code that is triggering the error. It seems very straightforward
>>to me:
>>
>>session_start();
>>  echo $_SESSION['user'];
>>

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



RE: [PHP] PHP Sessions on Windows

I think you need to restart PHP to pickup the new php.ini changes.

My php.ini is in the windows directory (I believe).

>> -Original Message-
>> From: David Mitchell [mailto:[EMAIL PROTECTED]
>> Sent: 12 May 2004 13:21
>>
>> OK, I managed to get it working.
>>
>> I first attempted to edit the php.ini so that the session
>> save path was C:\Temp. No matter what I did, the save path
>> always showed up in phpinfo() as /tmp. So I created folder on
>> the root of C: called tmp and everything worked.
>
> This still looks like PHP is not looking for the php.ini file where you
> think it is.  I strongly suggest you follow the previous advice to work
> out
> where PHP is actually expecting your php.ini to be, before you have a need
> to change another initialization parameter.
>
> Cheers!
>
> Mike

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



Re: [PHP] Why would a socket be unavailable?

I just read something about sock warnings this morning.   It said
sometimes they drop off, and to ignore the warnings, but capture the
errors.

> I get this output:
>
> PHP Warning:  socket_read() unable to read from socket [35]: Resource
> temporarily unavailable in /Users/rene/Sites/gpspolice/titan/cr.php on
> line 63
>
>  From this code:
>
> do {
>   socket_set_block($socket);
>   socket_set_option($socket,SOL_SOCKET,SO_RCVTIMEO,$timeout);
>   while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) {
>
>   [...]
>
> And it's failing at "while". Any ideas?
>
> ...Rene
>
> --
> 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



Re: [PHP] Why would a socket be unavailable?

http://www.php.net/manual/en/ref.sockets.ph

> I just read something about sock warnings this morning.   It said
> sometimes they drop off, and to ignore the warnings, but capture the
> errors.
>
>> I get this output:
>>
>> PHP Warning:  socket_read() unable to read from socket [35]: Resource
>> temporarily unavailable in /Users/rene/Sites/gpspolice/titan/cr.php on
>> line 63
>>
>>  From this code:
>>
>> do {
>>  socket_set_block($socket);
>>  socket_set_option($socket,SOL_SOCKET,SO_RCVTIMEO,$timeout);
>>  while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) {
>>
>>  [...]
>>
>> And it's failing at "while". Any ideas?
>>
>> ...Rene

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



Re: [PHP] Why would a socket be unavailable?

Guess it really is "experiemental" :-)

>> http://www.php.net/manual/en/ref.sockets.ph
>
> Yes, I've read that page... many times. It has not helped me. That is
> why I am posting my problem here, in that hopes that someone can help.
>
> (I don't mean to be completely helpless, but I just don't yet
> understand blocking/non-blocking sockets, and the parameters
> associated, since they are not well-documented. Someone said I
> shouldn't complain about this?and I'm not?since the functions are
> marked  "Experimental". But this is precisely why I'm posting the
> question here.)
>
> ...Rene

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



Re: [PHP] Dropdown menu

Hi Bill.

Put something like:


##your form selections here##



Then on your read_form.php page:

$what_they_selected = $_POST['name1']


>>A question about forms and PHP. I have a dropdown list which gets the lines
>>in the list from DB. Like this(col1 is used only for sorting the data):
>>
>>echo "choose one:";
>>$sql="SELECT col1, col2 FROM table_04 ORDER BY col1";
>>$result=mysql_query($sql);
>>$num = mysql_num_rows($result);
>>$counter = 1;
>>while ($num >= $counter) {
>>$row = mysql_fetch_array($result);
>>$col2 = $row["col2"];
>>echo "$col2";
>>$counter++;
>>}
>>
>>This obviously leaves the value of $col2 to what ever is in the last row in
>>database. How do I set the script to change the value when user selects
>>another name from the list? I need to do more stuff based on the users
>>selection. How do I get the selection from the list to a variable? I haven't
>>really done forms and PHP before ;-)
>>
>>Thanks
>>Bill

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



Re: [PHP] Uploaden files to the server

Does the img directory have writes permission?

>>Please,
>>
>>Can anybody help me with my problem !! I'm getting crazy.
>>
>>I am trying the upload a file to the server where my website is.
>>I get always the same fault when I want the try this code:
>>"Warning: Unable to create 'test.jpg': Permission denied in
>>/lvdata/www/tennis/Contact.php on line 147"
>> Line 147 is the one with:  "copy($_FILES['file']['tmp_name'],"imgs/" .
>>$newFileName)";
>>
>>Where is my fault. Has this something to do with the password which you use
>>to drop files on the particle server or...   ?
>>
>>
>>
>> THIS IS MY CODE:
>>
>>
>> if (!$_POST['submit'])
>>{
>>   ?>
>>
>>   >method="post">
>>   Description:
>>   
>>   
>>   File:
>>   
>>   
>>   
>>
>> >   }
>>   else
>>{
>> $titel = addslashes($_POST['titel']);
>> $desc = addslashes($_POST['desc']);
>>
>>// validate form data
>> if ($_FILES['file']['size'] == 0)
>>   {
>>die("Bad upload!");
>>   }
>>if ($_FILES['file']['type'] != "image/gif" && $_FILES['file']['type'] !=
>>"image/jpeg" && $_FILES['file']['type'] != "image/pjpeg")
>>   {
>>die("Invalid file format!");
>>   }
>>if (!$_POST['desc'])
>>   {
>>die("No description!");
>>   }
>>// get file type and rename file to recordID.ext
>> if ($_FILES['file']['type'] == "image/gif")
>>   {
>>$ext = ".gif";
>>   }
>> if ($_FILES['file']['type'] == "image/jpeg")
>>   {
>>$ext = ".jpg";
>> }
>> if ($_FILES['file']['type'] == "image/pjpeg")
>>   {
>>$ext = ".jpg";
>> }
>>
>>$newFileName = 'test'. $ext;
>>
>>copy($_FILES['file']['tmp_name'],"imgs/" . $newFileName);
>>
>>  }

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



Re: [PHP] session names

You need to name your session variables, but no name for session_start().

>>It is necessary to always name your sessions?or is session_start()
>>sufficient?
>>
>>
>>
>>Thanks,
>>Eddie

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



Re: [PHP] php calender

It could be a HTML table with links on the properties to view more details.

> I am currently working on a site for a vacation rental company.   They
> want
> the ability to show users the availability of certain properties.  The
> availability will be held in a mysql db so I assume I will have to
> dynamically build a small javascript menu or somethingI am just
> looking
> for some good suggestions and examples from other's who have done this.
>
> I am not a fan of generating javascript from php.
>
> Thanks,
> Eddie

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



Re: [PHP] include (or require) doesn't seem to work

Think you want something like this.

require("/tristan/library.php");

> Hi,
>
>  I'm almost ashamed to ask this question as surely enough the
> problem is something very basic but, nonetheless, I can't put my finger on
> it. I'm trying to implement the concept of a library (library.php) on PHP
> where I define (once) all auxiliary functions and then use them in a file
> (for instance index.php) via the 'require' or 'include' constructs. Here's
> a
> reduced version of what I'm doing:
>
>
>
> index.php:
>
>  $lang = (isset($_REQUEST['lang']) ? $_REQUEST['lang'] : "es");
> echo "index.php: include_path is " . (ini_get('include_path'))."";
> require("http://tristan/library.php?lang=$lang";);
> my_function("en");
> ?>
>

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



Re: [PHP] rounding average to one decimal point

How about round()

echo round(1.95583, 2);  // 1.96
echo round(1241757, -3); // 1242000

http://www.phpbuilder.com/manual/function.round.php


> Hi, I have a randon group of numbers I need the average of.  When I add
> them up and divide by how many there are and print the result, I get a
> lot of decimal places.  The number comes out to look like 29.3529411765,
> but I don't need that many decimal places.  rounding to one decimal place
> will be fine.  anyway to trim off the excess decimal values?

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



Re: [PHP] How to find path for PHP script

What about:

$_SERER['PATH_TRANSLATED']


http://www.phpbuilder.com/manual/reserved.variables.php#reserved.variables.server


> Does anyone know a quick way to find the full path on a shared hosting
> plan
> to use in an include file?
> Thanks,
> Tom
>

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



Re: [PHP] How to find path for PHP script

oops.   $_SERVER[]

> What about:
>
> $_SERER['PATH_TRANSLATED']
>
>
> http://www.phpbuilder.com/manual/reserved.variables.php#reserved.variables.server

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



Re: [PHP] How to find path for PHP script

Thanks John.

> From: "Daniel Clark" <[EMAIL PROTECTED]>
>
>> > Does anyone know a quick way to find the full path on a shared hosting
>> > plan to use in an include file?
>>
>> What about:
>>
>> $_SERER['PATH_TRANSLATED']
>
> If you note my message from yesterday, I was having some trouble with this
> variable on certain configurations. You may want to use
> $_SERVER['SCRIPT_FILENAME'] which will have the same value and seems to be
> present in more cases (or just test for both).
>
> ---John Holmes...

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



Re: [PHP] Re: protecting web page

I agree.  Once the screen, text, or picture is on the clients machine they have a 
copy of it.

>>Petr U. wrote:
>>> On Sat, 08 May 2004 21:00:43 -0500
>>> Anguz <[EMAIL PROTECTED]> wrote:
>>> 
>>>  > > Do you know any solution that can help me. I've find an application named
>>>  > > HTML guard but it only work for static html pages. I need more a class or
>>>  > > function to prevent for printing.
>>> 
>>> There is _no way_ to really hide/protect html page on client side.. If someone
>>> (some knowing) would like to show your source and it's important for him, then
>>> he spend some time to break this ugly protection.
>>
>>Just to strengthen/clarify this statement, look at it this way.  The user has 
>>downloaded the data to his machine.  You don't have any control over the data 
>>after that point.  Heck, the user can just print the screen they are looking 
>>at.  How you gonna stop that?
>>
>>If you're just looking to discourage casual copying, then carry on. :-)  If 
>>it's really important, you might be able to generate non-printable PDF files, 
>>or generate images containing the desired text, or stuff like that.  Just to 
>>make copying/printing harder.




Re: [PHP] Strange mails...

Yep.  I'm getting it too.

>>Each time I post a message on p.general, i receive two strange mails 
>>from ADVANCE CREDIT SUISSE BANK.
>>
>>What's this spam ? It looks like an auto-responder is subscribed on the 
>>newsgroup. Spammers really s*x !
>>
>>Greg

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



Re: [PHP] page_title

Think you want



>>I have write following code:
>>>$page_title = "Welcome";
>>?>
>>
>>But I can not see Welcome on top of the page.
>>Can someone tell me why I not can see it?
>>
>>Thanks
>>Erik Gjertsen
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>




Re: [PHP] Header() and POST data

No I don't think so.

> I need to go to another page and I use the
>
> header("location: " . $the_url_to_the_page);
>
> Is it possible to use this method with POST so that the info does not
> show in the URL?
>
> Todd

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



Re: [PHP] Header() and POST data

You could create a new  with hidden variable. And have an automatic
submit onload, going to the next location.


> I need to go to another page and I use the
>
> header("location: " . $the_url_to_the_page);
>
> Is it possible to use this method with POST so that the info does not
> show in the URL?
>
> Todd

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



Re: [PHP] Header() and POST data

Yes I agree, SESSION variables would be a pretty good way to pass info to
the next page.

> Daniel -
>
> What is the best way to "go to another page"?
>
> header("location: . $new_page);  
>
> Todd
>
> Daniel Clark wrote:
>
>> No I don't think so.
>>
>>
>>>I need to go to another page and I use the
>>>
>>>header("location: " . $the_url_to_the_page);
>>>
>>>Is it possible to use this method with POST so that the info does not
>>>show in the URL?

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



Re: [PHP] Register globals off, still not secure?

Yes.  My understanding turning globals off stops using $PHP_AUTH_PW directly.

> Hi, Even with register globals off isn't it possible to have a webpage
> like this:
>
> 
> 
> 
>
> Hello, 
> I know your password is 
>
> 
> 
> 
>
>
> Is there a way to make sure apache doesn't set the $SERVER['PHP_AUTH_PW
> '] global?
>
> Thanks.
>
> --
> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
> Patrick Hutchinson  [EMAIL PROTECTED]
> Engineering Web Systems Administrator 408.527.0305 direct
> Cisco Systems, Inc. 408.527.2313 fax
>
> --
> 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



Re: [PHP] initializing HTML form using PHP

That is the way I've done it.

I hear that with PEAR, you can add elments to the HTML page.

> I have a large HTML form (~100 form elements) that I used a year ago to
> conduct a survey.  Now I would like to use this same form but rather than
> starting with an empty form I would like to populate the form with a
> user's
> survey response from last year.  I have the survey data in a mysql db and
> I
> know how to use PHP to retrieve a user's data.  However, the only way I
> know
> to insert a user's data into a form is to embed value=""
> statements for each form element (text, checkbox, drop-down, etc).  This
> is
> pretty messy, especially for drop-down lists.
>
> Is there a cleaner, easier way to do this?
>
> Denis
>
> --
> 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



Re: [PHP] Re: repeating data from one column until data from another column changes

Are you looping through the record set?

>> "SELECT * FROM NewsArchive WHERE YEAR(date) = '" . date('Y') . "' AND
>>   MONTH(date) ='" . date('m') . "' ORDER BY sort DESC";
>
> Well, still not working...but maybe closer?  Not getting an error message,
> just not returning any data.

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



Re: [PHP] Re: repeating data from one column until data from another column changes

Are you getting any output?


> 
>  mysql_select_db($database_jpike, $jpike);
> $query_rsENews = 'SELECT * FROM NewsArchive WHERE YEAR(date) = ' .
> date('Y')
> . ' AND MONTH(date) = ' . date('m') . ' ORDER BY sort DESC';
> $rsENews = mysql_query($query_rsENews, $jpike) or die(mysql_error());
> $row_rsENews = mysql_fetch_assoc($rsENews);
> $totalRows_rsENews = mysql_num_rows($rsENews);
> ?>
>
> end top code
>
> start code in body of document:
>
> 
>   
> //this is  where I would like to list the titles of the articles for
> the
> current month
> 
>   
>   
> ?>
>   
>   
> 
>  E-News$theYear = substr($row_rsLatestDate['date'], 0, 4);
>   $theMonth = substr($row_rsLatestDate['date'], 5, 2);
>   $theDay = substr($row_rsLatestDate['date'], 8, 2);
>   $timestamp = mktime(0, 0, 0, $theMonth, $theDay, $theYear);
>   echo date('F j, Y', $timestamp);
>
>?>
>  //this is where i want the list to be title and article
> for
> the current month
> 
> 
>   
>   ?>
> top
> 
> 

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



Re: [PHP] Re: repeating data from one column until data from another column changes

Netscape browser?
In your browser have you checked View Source to see it table data is there?

> no.
>
> - Original Message -
> From: "Daniel Clark" <[EMAIL PROTECTED]>
>
>
>> Are you getting any output?

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



Re: [PHP] Re: repeating data from one column until data from another column changes

Just for right now, go ahead a make the date change, or elimate the date
 range to get SOMETHING to come out.


>> Just change the . date('m')  to the actualy month you want if not the
>> current month.
>
>
> except if I have to specify the specific month I want, then every month I
> have to go in and change the codeI would rather be able to have the
> code
> "know" that it just needs to look for the most recent date in the
> table...whatever that may becan that be done?
>
> --
> 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



Re: [PHP] Re: repeating data from one column until data from another column changes

Good :-)

You are narrowing the error down :-)

Sounds like it's in the date section then.

> when i take out the WHERE clause, I get ALL 192 titles in the upper right
> side and ALL 192 titles and descriptions in the main body..which is
> almost what i want...minus about 180 titles and articles....
>
> "Daniel Clark" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Just for right now, go ahead a make the date change, or elimate the date
>>  range to get SOMETHING to come out.
>>
>>
>> >> Just change the . date('m')  to the actualy month you want if not the
>> >> current month.
>> >
>> >
>> > except if I have to specify the specific month I want, then every
>> month
> I
>> > have to go in and change the codeI would rather be able to have
>> the
>> > code
>> > "know" that it just needs to look for the most recent date in the
>> > table...whatever that may becan that be done?

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



Re: [PHP] tweeking WHERE clause

Hey Melissa.

Will your articles always had a certain number (for each section) each
month?   If so a ORDER BY and LIMIT would work.

Daniel



> I am trying to query a table that consists of e-news artilces.  in the
> table
> are the following fields: ID, sortBy, datePublished, title, description.
> You can see a fake sample of this at:  www.aiaky.org/articles.htm
>
> I have the following $query on the actual e-news page:
>
> $query_rsENews = 'SELECT * FROM NewsArchive WHERE datePublished >=
> DATE_FORMAT(NOW(), "%Y-%m-01") ORDER BY sortBy ASC';
>
> what this is doing is returning only those records whose 'datePublished' =
> the current mont.
>
> it works great...butthere's always a butt..
>
> i really need it to return those records of the most recent date, as the
> most recent date might be last month and there may be no records for this
> month...leaving my page blank.  Is there a way to do this?
>
> so many of you have already gotten me to this point...thanks!!
>
> --
> 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



Re: [PHP] HTTP_REFERER ... ?

I found this in the manual:

HTTP_REFERER'

The address of the page (if any) which referred the user agent to the
current page. This is set by the user agent. Not all user agents will set
this, and some provide the ability to modify HTTP_REFERER as a feature. In
short, it cannot really be trusted.

> if ($_SERVER['HTTP_REFERER'] == 'http://www.mysite.com/') {
> // Stuff
> }
>
> Now why does this not work?
> I wanna asign varibales based on certain referers...
> but this is not working?
>
> Any ideas why?

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



Re: [PHP] tweeking WHERE clause

OK how about.

Do a count of this monthes articles, if NONE, then run another query to
select the previous months articles.  Note, this would only "publish" this
or last monthes records.



> there are a different number of articles each month...:(
>
> "Daniel Clark" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Hey Melissa.
>>
>> Will your articles always had a certain number (for each section) each
>> month?   If so a ORDER BY and LIMIT would work.
>>
>> Daniel
>
> --
> 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



Re: [PHP] Carrying Variables

I uses  variables and method="post" to sent them to the next page.
On your 2nd page it's inserting into the database, so past that page, if I want to 
retain the variables I either read them again from the database OR 
store those variables as $_SESSION variables.


>>How would I carry a variable from one page to another
>>
>>Here is what I mean
>>
>>I have a send.php page and this is sent to
>>insert_into_database.php where the values of the previous page are inserted
>>into the database.
>>I then use a meta=refresh to go to another page and evaluate the variable.
>>The problem is that I do remember how to carry the variable.  I believed
>>that I used the meta before to carry it, but unsure.  Any help would be
>>appreciated!

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



Re: [PHP] Re: Carrying Variables

On the URL, use ? to separate the file name from the variables, and & to separate each 
additional variable.

. &logdate=

URL=check.php?Event_Type=&logdate=">

>>How would you carry two variables?
>>
>>

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



Re: [PHP] elseif carry

I think you want double quotes around the entire line and \" for the internal double 
quotes.

echo "';

>>I have tried both of these statements and neither one works  Trying to get
>>the Date and Time to be carried in the URL.  Any Help please.
>>
>> print '';
>>
>>or
>>
>> echo '';

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



Re: [PHP] elseif carry

Oops. Try this.

echo "" ;


>>I did a cut asnd paste to your code and this is the error that I receive
>>
>>Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
>>T_STRING or T_VARIABLE or T_NUM_STRING in c:\inetpub\wwwroot\check.php on
>>line 9
>>
>>
>>
>>"Daniel Clark" <[EMAIL PROTECTED]> wrote in message
>>news:[EMAIL PROTECTED]
>>> I think you want double quotes around the entire line and \" for the
>>internal double quotes.
>>>
>>> echo ">> URL=./Conference_Calls.php?Date_and_Time=$_POST['Date_and_Time']">';
>>>
>>> >>I have tried both of these statements and neither one works  Trying to
>>get
>>> >>the Date and Time to be carried in the URL.  Any Help please.
>>> >>
>>> >> print '';
>>> >>
>>> >>or
>>> >>
>>> >> echo '';
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>




Re: [PHP] GET and POST variables name

http://www.php.net/manual/en/control-structures.foreach.php

Try this.

echo "GET:";
foreach($_GET as $key => $value)
{
 echo "$key = $value ";
}


>>i know it could be a stupid problem, but i need a help and i hope u could be 
>>generous with me :).
>>this is my code, it writes the list of POST and GET variables. 
>>
>>>echo "GET:";
>>foreach($_GET as $parole)
>>{
>> echo "Parola = $parole ";
>>}
>>
>>echo "POST:";
>>foreach($_POST as $parole)
>>{
>> echo "Parola = $parole ";
>>}
>>?>
>>
>>i want to write also the name of the variable, for example:
>>if i call my page so --->  index.php?id=2&a=4
>>it writes
>>
>>GET:
>>Parola = 2 
>>Parola = 4 
>>
>>
>>POST:
>>
>>I want it to write:
>>
>>GET:
>>id = 2 
>>a = 4 
>>
>>
>>POST:
>>
>>how can I do it?
>>thx for any help.

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



Re: [PHP] elseif carry

Ah.

Must have a POST variable in that page called Date_and_Time.


>>Tried it and this is the error that  I get
>>
>>
>>Notice: Undefined index: Date_and_Time in c:\inetpub\wwwroot\check.php on
>>line 9
>>http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Reposting elseif carry

 echo "";

>>I have tried both of these statements and neither one works  Trying to get
>>the Date_and_Time to be carried in the URL.  Any Help please.
>>
>> print '';
>>
>>or
>>
>> echo '';

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



Re: [PHP] $_post and array question

I've done a couple things. One is to use isset() and check first.
The other is to add a hidden input field, that way something is always sent.









> Best readers,
>
> //PHP version: 4.3.6
>
> I have question concerning the following issue:
>
> I have a HTML input element of the type check.
>
> 
>
> let assum this checkbox is unchecked. The checkbox is part of a form.
> Now we gonna submit this form (post) and gonna catch the POST variable
> test_arr like this:
>
> $arr_test = $_POST["test_arr"];
>
> This will result in a novice error "Undefined index: "
> Of course because test_arr does not exist. It's unchecked.
>
> Now we gonna do the following:
> We immediately put the $_POST["test_arr"] into a function and then we
> assign
> $_POST["test_arr"] to $arr_test like this:
>
> functionX($_POST["test_arr"])
> $arr_test = $_POST["test_arr"];
>
> Knowing that $_POST["test_arr"]) does not exist.. this code will not
> result
> in a error.
>
> Is this a bug,error,etc? Should this not also produce a novice error?
>
> Thanks for reading,
> Amon

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



Re: [PHP] How to make program execution go to another file?

This works providing there has NOT been any header (HTML) info outputed.

 if (1==a)
header("Location:  thisotherfile.php");



> Hi,
>I want program execution to go to one of several other files
> based on a decision.
> For Example.
>
> if (1==a)
>go to this .php file
>
> if (1==b)
>go to that .php file
>
> if (1==c)
>go to the other .php file
>
>
> Thank you for your time.
>
>Michael

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



Re: [PHP] Sessions still do not persist

Try a session_start() at the top of pages, see if that works.
Maybe the auto_start does not work.

>
> I've posted several times mentioning that I am completely unable
> to cause sessions to persist.  Over the intervening time, I have
> replicated this problem to a different machine, with the same
> results.  Here's a recap of the problem.
>
> I am not using cookies.  Sessions are automatically created (and
> changing that makes no difference)  The relevant session variables
> (copied from phpinfo) are:
>Session Support  enabled
>session.auto_start   On<- hence no session_start
>session.name   PHPSESSID
>session.use_cookies  Off   <- no cookies
>session.use_trans_sidOn
>
> Environment is FreeBSD4.8.  phpinfo for apache says:
>Apache/1.3.29 (Unix) mod_perl/1.28 PHP/4.3.4 mod_ssl/2.8.16
> OpenSSL/0.9.6d
>
>
> Here is a cut/paste of the borwser screen for the code below:
>
>Stage:0 SessionID: 04ace04b1fe0bc81d2cd678c9bab1619
>_ [Submit]
>Stage:1 SessionID: 04ace04b1fe0bc81d2cd678c9bab1619 Request: Array ( )
>
> So I type "foo" into the box and hit submit.  And the session variable
> is NOT preserved:
>
>Stage:0 SessionID: 55c70989b7279d6a18edfd81b28d67a6
>foo___ [Submit]
>Stage:1 SessionID: 55c70989b7279d6a18edfd81b28d67a6 Request: Array (
> [PHPSESSID] => 04ace04b1fe0bc81d2cd678c9bab1619 [field] => foo )
>
> The session directory IS writable and I see the expected information
> being written there:
>-rw---  1 nobody   wheel  10 May 21 13:35
> sess_04ace04b1fe0bc81d2cd678c9bab1619
>-rw---  1 nobody   wheel  10 May 21 13:38
> sess_55c70989b7279d6a18edfd81b28d67a6
>
> Apache runs as user "nobody" on this server.  Both session files contain:
>stage|i:1;
> but the files never seem to be being read back!
>
> Help!?
>
>
> Here's the entire php code I'm testing with:
>
>  if (!isset($_SESSION['stage'])) {
>$_SESSION['stage'] = 0;
>}
> if (!isset($_POST['field'])) { $_POST['field'] = ""; }
> ?>
> 
> PHP Test page
> 
>echo "Stage:"; echo $_SESSION['stage'];
>   echo " SessionID: "; echo session_id();
>   $_SESSION['stage'] = 1;
> ?>
>
>   
>   
>
>echo "Stage:"; echo $_SESSION['stage']; echo " ";
>   echo " SessionID: "; echo session_id(); echo " ";
>   echo " Request: "; print_r($_REQUEST);
> ?>
>  

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



Re: [PHP] Newbie error with cookies and headers already declared

Try putting your  below setting the cookie.

> I'm getting this error:
>
> Warning: Cannot add header information - headers already sent by (output
> started at /home/tiempodemaria/main.php:3) in /home/tiempodemaria/main.php
> on line 11
>
> With this code in "main.php":
>
> 
>   define(SECONDS_IN_THREE_MONTHS, 3600*24*90);
>  define(OFFSET_WITH_GMT, -3*3600);
>
>  $has_visited = isset($_COOKIE["TdM_visited"]);
>
>  if (!$has_visited) {
>   setcookie("TdM_visited",
>   (string) (time() + OFFSET_WITH_GMT),
>   time() + OFFSET_WITH_GMT + SECONDS_IN_THREE_MONTHS);
>
>   // the above (not blank) is line 11
>
>  } else {
>   $latestVisit = (int) $_COOKIE["TdM_visited"];
>   setcookie("TdM_visited",
>   (string) (time() + OFFSET_WITH_GMT),
>   time() + OFFSET_WITH_GMT + SECONDS_IN_THREE_MONTHS);
>  }
> ?>
> 
> 
>
> 
> .
>
> Does anybody knows what's going on? I don't understand which header is
> being
> sent before the setting of the cookie, and I don't understand the ":3" in
> the error description. This page is a frame, so I don't have any head tag,
> does that matter to php?
>
> Thanks in advance,
> Nicolas

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



Re: [PHP] Random Record Retrieval

How about rand() on your ID column.

http://www.php.net/manual/en/function.rand.php


>>How's that for alliteration in a subject line?
>>
>>Got a simple MySQL table that contains records which are made up of only
>>three fields - ID, quote and author. These are "inspirational" quotes that
>>I want to appear at the bottom of the pages of my website. I want them to
>>come up randomly with every page load. I've posted this on a MySQL board to
>>see if there's a MySQL command to make things simple. But, I thought about
>>building a random number generator in PHP that selects a random number out
>>of the total number of records in the table, saves it into a variable and
>>then have MySQL retrieve that ID. Is this the way to go or is there
>>something simpler. And, if this is the best way to go, unfortunately I
>>don't know how to write a random number generator in PHP so would
>>appreciate any help.
>>
>>Thanx in advance,
>>Robb
 

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



Re: [PHP] sessions

Should username have quote around it?   Wouldn't it try to make it a constant 
otherwise?

echo $_SESSION['username']

>>Hi,
>>
>>All my session_start() calls were working fine.
>>But since yesterday the vars i use does not keep there value
>>i use $_SESSION['varname']
>>
>>Nothing has been changed to the server normally, but on all my sites it does
>>work anymore
>>
>>i think the problem is that when i use session_start() and then for example
>>$_SESSION[username] = 'test';
>>
>>on at an other page:
>>
>>session_start()
>>then echo $_SESSION[username] gives blanco.
>>
>>How can this be?

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



RE: [PHP] Re: find out ip address [beginner]

LOL :-)

>>Jonesy 
>>on Monday, May 24, 2004 2:21 PM said:
>>
>>> WFM:
>>>|$ ping ibm.com
>>>|PING ibm.com (129.42.18.99) 56(84) bytes of data.
>>>:
>>
>>wow. that's the weirdest looking php i've ever seen. is that a beta or
>>something?
>>
>>
>>
>>chris.




Re: [PHP] Session variables not recognized?

Session handling was added in PHP 4.0. 

>>The first line of my file is session_start(); but whenever I try to set 
>>or reference $_SESSION['anything'] I get:
>>
>>  Undefined variable: _SESSION
>>
>>What's up with that???
>>
>>- Brian

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



Re: [PHP] Re: test

I think it's someone else on the list getting the email lists, and spaming. 

>>Signed up litterally 1 minute ago and I'm already getting spam. From
>>"Advance Credit Suisse Bank"
>>
>>Great. Thanks php.net.
>>
>>Guess you can't even trust the well known sites not to slam you with spam.

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



Re: [PHP] interesting

What does the { } around the array mean?

>>From: "Bob Lockie" <[EMAIL PROTECTED]>
>>
>>> echo "\"" . $search_for_list[$i][0] . "\"" works but
>>> echo "\"$search_for_list[$i][0]\"" prints "Array[0].
>>
>>$search_for_list[$i] is an 'Array' which is followed by the string '[0]' ...
>>how is PHP supposed to know you mean
>>$search_for_list[$i][0]?
>>
>>echo "\"{$search_for_list[$i][0]}\""; will work, btw.
>>
>>---John Holmes...




Re: [PHP] interesting

Thank you John, and Michal :-)

>>From: Daniel Clark
>>
>>>>echo "\"{$search_for_list[$i][0]}\""; will work, btw.
>>>
>>> What does the {}around the array mean?
>>
>>It delimits your variable so PHP knows what to interpret as a variable and
>>what to interpret as a string.
>>
>>$ar[1] = 'foo';
>>echo "Value is {$ar[1]}"; // Value is foo
>>
>>$ar = 'foo';
>>echo "Value is {$ar}[1]"; //Value is foo[1]
>>echo "Value is {$ar[1]}"; //Value is f
>>
>>echo "Hello {$name}, you are {$age} years old";
>>
>>etc...
>>
>>---John Holmes...
>>

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



Re: [PHP] interesting

Good point Justin !

>>John W. Holmes wrote:
>>
>>> From: Daniel Clark
>>> 
>>> 
>>>>>echo "\"{$search_for_list[$i][0]}\""; will work, btw.
>>>>
>>>>What does the {}around the array mean?
>>> 
>>> 
>>> It delimits your variable so PHP knows what to interpret as a variable and
>>> what to interpret as a string.
>>> 
>>> $ar[1] = 'foo';
>>> echo "Value is {$ar[1]}"; // Value is foo
>>> 
>>> $ar = 'foo';
>>> echo "Value is {$ar}[1]"; //Value is foo[1]
>>> echo "Value is {$ar[1]}"; //Value is f
>>> 
>>> echo "Hello {$name}, you are {$age} years old";
>>> 
>>> etc...
>>> 
>>> ---John Holmes...
>>
>>IMHO it's just better to use concatenation and single quotes for your 
>>string. PHP doesn't have to parse your strings for variables that way 
>>and it makes it obvious what parts are variables.
>>
>>-- 
>>paperCrane 

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



Re: [PHP] interesting

Ok, print or echo :-)

>>From: "Justin Patrin" <[EMAIL PROTECTED]>
>>
>>> IMHO it's just better to use concatenation and single quotes for your
>>> string. PHP doesn't have to parse your strings for variables that way
>>> and it makes it obvious what parts are variables.
>>
>>To each his own. Shall we discuss the merits of print vs. echo next? Or
>>maybe template systems!?!?
>>
>>;)
>>
>>---John Holmes...
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>




Re: [PHP] dynamic table

Very slick Richard.

>>$i = 0;
>>while ($myrow = mysql_fetch_array($sql)) {
>>  if (++$i % 5 == 0) echo '';
>>  ...
>>
>>  
>>Note: if used repeatedly do not increment the $i again in the loop.
>>
>>HTH
>>Richard

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



Re: [PHP] How to check for a $_GET without throwing a Notice?

if (isset( $_GET['id']))

>>How do I check for the presence of an optional $_GET param without 
>>throwing a "Notice: Undefined index" when the param is not present?
>>
>>Tried all three of these, they all produce the Notice when the param is 
>>not passed:
>>
>>if ($_GET['id'])
>>if ($_GET['id'] != "")
>>if (isset $_GET['id'])
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>




Re: [PHP] how to redirect with post method

I don't believe you can sent those post variables on the URL.

Either as GET variables on the URL.
Set Session variables and read on the next page.

Or setup a  with hidden post variables populated with the $post
variables, and JavaScript to auot submit onload.

> Hello,
> I have a webpage that I'm redirecting to other page with header command,
> for instance:
> header("location:information.php?cod1=$cod1&cod2=$cod2&...codn=$codn");
>
> I need send all vars (cod1, cod2, ..codn) on POST method, How Can I do
> this? thanks.

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



Re: [PHP] datetime formatting problem

Isn't "date" a reserved word?

> hi all -
>
> this is probably straight forward, but i'm learning and would appreciate
> any insight.
>
> i'm using the datetime type in mysql and have been able to successsfully
> pull the data records's date, but it's failing out and giving me the
> current time [as in what it says on my system's clock]
>
> basically i'm just spitting out all the rows to an html table and would
> like to have the date AND time formatted as is in the date(...) function
> at the top of the code demo.
>
> thanks!
> matt
>
> / begin code demo
>
>
> function formatDate($val)
> {
> $arr = explode("-", $val);
> return date("M d, Y g:i A", mktime(0,0,0, $arr[1], $arr[2], $arr[0]));
> }
>
>
> // open database connection
> $connection = mysql_connect($host, $user, $pass) or die ("Unable to
> connect!");
>
> // select database
> mysql_select_db($db) or die ("Unable to select database!");
>
> // generate and execute query
> $query = "SELECT * FROM outdoor ORDER BY id ASC";
> $result = mysql_query($query) or die ("Error in query: $query. " .
> mysql_error());
>
>
> // if records present
> if (mysql_num_rows($result) > 0)
> {
>   // iterate through resultset
>   // print title with links to edit and delete scripts
>   while($row = mysql_fetch_object($result))
>   {
>   ?>
>   
>   id; ?>
>   name; ?>
>$row->email; ?>
>   zip ?>
>   date); ?>
>   club_member ?>
>   driver ?>
>   
>
>src="notepad.gif" alt="" width="16" height="16" border="0">  
>  alt="" width="16" height="16" border="0">
>   
>  }
> }
>
> --
> 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



Re: [PHP] ColdFusion / SQL > PHP / mySQL HELP!

I've used Cold Fusion for years.  However one week at 100 hours might not
be enough time to covert everything to PHP and mySQL.


> Hi everyone,
>
> Ok, I need serious help. I have been handed a project by my boss to
> convert
> an existing site that was built using ColdFusion / SQL into a site that
> will
> use PHP / mySQL. The site relies heavily on calls to the database for
> everything from site content, to an admin area where you can edit that
> content, to a news ticker, to the actual navigation of the site.
>
> What's the problem? I have one week to do this. Oh, and did I mention that
> I
> know VERY little about PHP / mySQL. I know NOTHING about ColdFusion or
> MSSQL. And to top it off, the site in question contains over 300 .cfm
> files!
>
> Does anyone have any idea how I could pull this off?
>
> Even if I had a working knowledge of ColdFusion, MSSQL, PHP, mySQL...still
> one week isn't enough time to retool a site of this proportion. Especially
> considering that I don't understand any of the code that I'm staring at.
>
> I've been a web designer for about five years now. Notice I said
> "designer"
> not "developer". I want to learn PHP / mySQL but in order to complete this
> project I also need to understand ColdFusion in order to replicate the
> site
> functionality. Any advice on what I should do?
>
> Thanks in advance for your help,
> Chris

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



Re: [PHP] ColdFusion / SQL > PHP / mySQL HELP!

That's funny Travis !

>>Here's what you do.   Assume 10-hour work days.  Obviously, you want to start 
>>with the schema.  That's pretty darn important, so allow yourself a whole day 
>>for that.
>>
>>You have four days left.  Oh wait -- you will probably have to work the weekend 
>>for this one.  So you have six days left.  That's 60 hours, or 3600 minutes. 
>>You have 300 files, so you can't spend more than 12 minutes per file.  Wait, 
>>you said OVER 300, so try to keep it to 10 minutes per file.  To play it safe, 
>>spend no more than 8 minutes per file -- that way, you have a little extra time 
>>in case something unexpected comes up.
>>
>>It might be easier to buy a CFM-to-PHP converter.  You can get those at most 
>>Kmart stores.  They're usually next to the bacon stretchers and smoke-shifters.
>>
>>Hope this helps!
>>
>>cheers,
>>
>>Travis

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



Re: [PHP] Preg_match question

Great quote Jeroen.

>>Always code as if the guy who ends up maintaining your code will be a violent 
>>psychopath who knows where you live.
>>  -- Martin Golding

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



Re: [PHP] cookies malfunctioning moving from windows to linux

Apache must have read and write privs on the tmp directory.

>>Hi, I developed a Poll system that uses cookies. It works fine under Windows
>>(Apache and MySQL), but it does not work properly under Linux. - I
>>transitioned my site from my windows based server to a linux machine.
>>
>>Cookies does not work properly when I use the system under Linux (Apache and
>>MySQL).
>>
>>I already checked php.ini and can't seem to find what is wrong.  The only
>>difference is the "session.save_path = /tmp" on the Linux box and on the
>>windows box it was "session.save_path = c:/windows/temp" 
>>
>>Could you help me ?
>>
>>Thank you!
>>Ryan
>>
>>

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



Re: [PHP] Text file wont' have newlines?

Needs a new line and return.

fwrite($fp, ($credit . "\n\r") );

>>Hi everybody,
>>
>>I have this script in a file that allows users to upload files, and I want 
>>to know who submitted what so I write $userfile_name and $credit1(their 
>>name) to CREDIT.txt in the same directory like so :
>>
>>$credit = $userfile_name.': '.$credit1."\n";
>>$fp = fopen('CREDIT.txt','a');
>>fwrite($fp, $credit);
>>fclose($fp);
>>
>>But every new submission ends up on the same line, there is never a line 
>>break in the text. Any suggestions?
>>
>>Thanks,
>>AMP
>>
>>_
>>FREE pop-up blocking with the new MSN Toolbar  get it now! 
>>http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>




Re: [PHP] Query Query

Can you send more of the code?   I looks good so far.

>>This may be better suited to the MySQL lists, but I'd appreciate it if 
>>someone could help. I'm probably just missing something stupid here but 
>>have been coding non-stop for a week and need another set of eyes.
>>
>>Here's the line of code giving me an issue. I can print all the 
>>variables in the script to screen and know that they're ok. It returns 
>>successfully, but fails to update the database. I'm sure I'm about to 
>>feel pretty stupid, so fire away... just please fire the answer too.
>>
>>$query="UPDATE $table_name SET company_name='$company', 
>>first_name='$first_name', last_name='$last_name', address='$address', 
>>city='$city', state_province='$state', postal_code='$postal', 
>>office_phone='$office', fax_phone='$fax', email='$email' WHERE 
>>company_name='$mod_dataset'";

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



Re: [PHP] hyperlink to the mysql data

Can you post some of the code?

--Original Message Text---
From: CurlyBraces Technologies ( Pvt ) Ltd
Date: Mon, 31 May 2004 01:49:17 +0600

hi ,  
 
i have retrived  some perticular data from mysql , and them show in the web browser.( 
It is very few data ) 
When clicking on one of that that perticular data ,  i want to show the whole 
information with related to the above mentioned part.  
So , can some body help me to add like this hyper link to the mysql data ? 
 
thanx in advance 
curlys  
 





Re: [PHP] installing php4 in windows 2000

Is your php.ini in the windows or winnt directory?

>>i have configured apache 2.0.49 in my system and included the following lines of 
>>code in my http:conf file
>>
>>LoadModule php4_module "c:/php/sapi/php4apache2.dll"
>>AddType application/x-httpd-php .php
>>
>>i have also configured the  php.ini file and created a test 
>>script(phpinfo.php,placed it in my htdocs directory) to check whether php has been 
properly installed or not
>>but when i run the testscript by entering the follwoing line in the address bar of 
>>internet explorer
>>
>>localhost/phpinfo.php
>>
>>i get the following error message
>>
>>HTTP 404 - File not found
>>Internet Explorer 
>>
>>can somebody please help me to know where am i going wrong

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



Re: [PHP] multiple checkbox help

Change $_REQUEST to $_POST (a little more secure).

foreach( $deleteID as $key => $value) {
 
echo 'deleting ' . $value . '' ;
}


>>I tried this HTML:
>>
>>
>>
>>$_REQUEST['deleteID'] === the last box checked.
>>so I did a google search and changed my HTML to:
>>
>>
>>
>>
>>Now the code:
>>for ($i = 0; $i < count($_REQUEST['deleteID']); $i++){
>> echo "deleting '" . $value . "'";
>>}
>>has the right count but how do I get the values out?
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>




Re: [PHP] duplicating a row


INSERT INTO new_table (column1, column2, ...)
SELECT column1, column2, ...
FROM original_table

>>I want to duplicate a row (back it up - copy to a table with the same 
>>schema) regardless of the table schema.
>>This in MySQL but I need a solution that can be made easily portable to 
>>other databases.

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



Re: [PHP] Re: Re: drop down menu populated from a directory

With the SELECT drop down, you'd need a submit button, and then the value of $file 
would be passed to the next page and read.  There you 
could open that file.

>>So I made my code:
>>
>>>if ($handle = opendir('../../../mov')) {
>>while (false !== ($file = readdir($handle)))
>>
>>if ($file != '.' && $file != '..')
>>
>>$fileName = str_replace('.mov', '', $file);
>>echo '' . $fileName . 
>>'';
>>closedir($handle);
>>}
>>?>
>>
>>And it does display the name in the menu... so that is a good start, 
>>but the link doesn't work when selected. So I am assuming hte code does 
>>need those brackets, and I rather need to open the opening one...
>>
>>d

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



Re: [PHP] update mysql using radio button

I think you need Values for the radio buttons.

club_member
 ='N'){echo 'CHECKED';}?>>

>
> hello all -
>
> i'm having a problem getting an UPDATE to work with radio buttons and
> i'm not sure where it's gone wrong. the initial values are being grabbed
> properly, but unfortunately they don't want to get updated. the regular
> text form values update just fine. would appreciate some help.
>
> the html:
>
> 
>
> club member?
> No: club_member
> ='N'){echo 'CHECKED';}?>>
> Yes: club_member
> == 'Y'){echo 'CHECKED';}?>>
>
>
> the query to update:
>
> $query = "UPDATE outdoor SET name='$name', email='$email', zip='$zip',
> club_member='$club_member' WHERE id='$id'";
> $result = mysql_query($query) or die ("Error in query: $query. " .
> mysql_error());
>
>
>
> [trying to keep the code paste to what i think is important, let me know
> if more is needed for info.]
>
>
> thanks!
> m.
>
> --
> 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



Re: [PHP] Strtotime() weirdness

http://us3.php.net/manual/en/function.strtotime.php

Note: The valid range of a timestamp is typically from Fri, 13 Dec 1901
20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that
correspond to the minimum and maximum values for a 32-bit signed integer.)
Additionally, not all platforms support negative timestamps, therefore
your date range may be limited to no earlier than the Unix epoch. This
means that e.g. dates prior to Jan 1, 1970 will not work on Windows, some
Linux distributions, and a few other operating systems.


> Does anybody know of any peculiarities in the strtotime() function?
>
> If I enter any date before 1 Jan 1970 I get a -1 returned.
>
> alex hogan

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



Re: [PHP] update mysql using radio button

Right.  (oops)

> From: "Daniel Clark" <[EMAIL PROTECTED]>
>
>>  if($row->club_member
>>  ='N'){echo 'CHECKED';}?>>
>
> =='N', you mean. :)
>
> ---John Holmes...

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



Re: [PHP] Finding the sizeof a variable....

There is memory_get_usage()  but it returns the amount of memory allocated
to PHP.

http://us3.php.net/manual/en/function.memory-get-usage.php

> I'm wondering if there's something similar to the C sizeof operator in
> PHP?  I would like to find out how much space in memory a variable is
> actually using (and possibly adjust the max memory per script
> accordingly).
>
> No, sizeof() http://us3.php.net/sizeof is not what I want :-(
>
> Thanks!
>
> Matt

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



Re: [PHP] php installation verification

Save to your root directory as test.php (or something ending in php).



> I am new to php and was tasked with installing php v.4.3.6.  I installed
> it on redhat with apache v2.0.48.
> I read in the doc that you can create a test file called test.php with
> some php tags such as .
> Could someone post a test.php file as an example?
> Thanks for the help.

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



RE: [PHP] php installation verification

Have you stopped and restarted the web server?

> OK - I tried that and what came up on the browser was the content of the
> test.php file.
>
> I checked in my httpd.conf file I do have the following:
>
> AddType application/x-httpd-php .php
> AddType application/x-http-php-source .phps
>
> LoadModule php4_module libexec/libphp4.so
>
> Any thoughts?
>
> thank you.

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



RE: [PHP] php installation verification

And you test.php file has? (note starting with 

> Yes.
>

> Have you stopped and restarted the web server?
>
>> OK - I tried that and what came up on the browser was the content of the
>> test.php file.
>>
>> I checked in my httpd.conf file I do have the following:
>>
>> AddType application/x-httpd-php .php
>> AddType application/x-http-php-source .phps
>>
>> LoadModule php4_module libexec/libphp4.so
>>
>> Any thoughts?
>>
>> thank you.

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



RE: [PHP] php installation verification

Running Apache?  Windows?

> I get the source display on the browser as:
>
>  phpinfo();
> ?>

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



RE: [PHP] php installation verification

Seems to me there was a problem with Apache 2 and PHP (some version).

> The content of my test.php file has:
>
>  phpinfo();
> ?>

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



Re: [PHP] Best way to sort?

SELECT DISTINCT person_name, count(*)
FROM table_name
GROUP BY person_name
ORDER BY 2 DESC

> I'm not sure if this is a complex SQL query or a PHP array sorting
> thing, but what's the best way to take this data:
>
>Tom
>Greg
>Brian
>Tom
>Brian
>Tom
>
> And return the following results, sorted by number of records:
>
>Tom - 3
>Brian - 2
>Greg - 1
>
> Any thoughts?
>
> --
> 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



Re: [PHP] Asuming query without the ?

I think it's in the Apache config file.

> Where and how do I set this? I'm to Unix and PHP.
>
> "Marek Kilimajer" <[EMAIL PROTECTED]> escribió en el mensaje
> news:[EMAIL PROTECTED]
>> Robert Winter wrote:
>> > Is it possible to configure PHP/.htAccess/etc. for assuming a query
>> when
> the
>> > users enters a path like this:
>> >
>> > www.myserver.com/path/154--> assumes
>> > www.myserver.com/path/index.php?code=154
>> >
>> > The only thing I could do is avoid writing index.php but I still have
>> to
>> > write the ?: www.myserver.com/path/?154
>> >
>> > Any idea?
>> > Thanks.
>> > Gus
>> >
>>
>> RewriteRule ^/path/([0-9]+)$/path/index.php?code=$1

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



RE: [PHP] Best way to sort?

Order by the 2nd column

>>what is the 2? in the order by statement mean?
>>thanks
>>
>>-Original Message-
>>From: Raúl Castro [mailto:[EMAIL PROTECTED]
>>Sent: Thursday, June 03, 2004 6:20 PM
>>To: [EMAIL PROTECTED]
>>Subject: Re: [PHP] Best way to sort?
>>
>>
>>The best way is:
>>
>>SELECT person_name, count(*)
>>FROM table_name
>>GROUP BY person_name
>>ORDER BY 2 DESC




  1   2   >