OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 10 Jun 2003 16:36:56 -0000 Issue 2109

php-general-digest-helplists.php.net
Date: Tue Jun 10 2003 - 11:36:56 CDT


php-general Digest 10 Jun 2003 16:36:56 -0000 Issue 2109

Topics (messages 150847 through 150940):

Re: php and flash chat program
        150847 by: Richard Baskett
        150908 by: Russell P Jones
        150909 by: Awlad Hussain

Printing Issue
        150848 by: birdto
        150849 by: Jean-Christian Imbeault

Re: Is It Possible to Tell PHP To Output x Decimal Places Per Float?
        150850 by: Jaap van Ganswijk

if ($xxxxx) { function not working?
        150851 by: Ben Houlton
        150854 by: Larry_Li.amat.com
        150855 by: Jean-Christian Imbeault
        150866 by: Ben Houlton
        150868 by: Thomas Seifert
        150870 by: Ben Houlton
        150873 by: Ben Houlton
        150874 by: Cristian MARIN
        150878 by: Ben Houlton
        150933 by: Philip Olson

Re: HTML and PHP
        150852 by: Jaap van Ganswijk
        150857 by: Jean-Christian Imbeault

Documents on Images.
        150853 by: Philip J. Newman
        150858 by: Dan Anderson

How to use objects, variables in an eval() func ?
        150856 by: LPA
        150896 by: Shawn McKenzie

add groups to linux with apache + php
        150859 by: josemaria
        150860 by: Dan Anderson

Re: PHP vs. jsp, advice please
        150861 by: SLanger.spirit21.de
        150880 by: Joel Rees
        150885 by: Jay Blanchard
        150887 by: CPT John W. Holmes

Automatically update other sections of page
        150862 by: Michael Benbow

Read website with <script src>
        150863 by: Johannes Reichardt

Loading an image file as a PHP file.
        150864 by: Philip J. Newman
        150872 by: Cristian MARIN
        150886 by: Jay Blanchard
        150889 by: Cristian MARIN

Re: Sessions problem
        150865 by: Cristian MARIN

Re: How can I change the timezone?
        150867 by: Cristian MARIN

PHP in VS.Net
        150869 by: Ulrik

how to make php working with asp?
        150871 by: yanxizhen
        150907 by: Dan Joseph

Re: sessions, IE and pop-up windows
        150875 by: Ford, Mike [LSS]

Re: Want to move M$Access frontend to PHP/MYSQL. Need suggestions...
        150876 by: electroteque
        150936 by: Apollo (Carmel Entertainment)

Re: solved Re: [PHP] sessions, IE and pop-up windows
        150877 by: Ford, Mike [LSS]
        150903 by: Emma Jane Hogbin

Re: PHP/Javascript Help
        150879 by: Ford, Mike [LSS]

Safe mode Problem
        150881 by: Cristian MARIN

preg_match ;)
        150882 by: Johannes Reichardt
        150901 by: Boaz Yahav

Please help
        150883 by: Ben Houlton
        150898 by: Wendell Brown

Warning Spammer
        150884 by: myphp
        150888 by: Lars Torben Wilson
        150893 by: Randum Ian
        150910 by: Ben Houlton
        150920 by: myphp
        150924 by: Mike Brum
        150931 by: Richard Baskett

can't figure out why
        150890 by: David McGlone

Table issue
        150891 by: Steve Marquez
        150894 by: Jay Blanchard
        150897 by: Steve Marquez
        150940 by: Mark

XML-RPC problem
        150892 by: Evandro Sestrem

Re: PHP using Linter...
        150895 by: Scott Fletcher
        150922 by: Ralph
        150927 by: Scott Fletcher

Php get vcard info?
        150899 by: MIKE YRABEDRA

Re: reading a file into variable for using in a javascript
        150900 by: David Robley

How to show BLOB ?
        150902 by: Roman Duriancik
        150905 by: CPT John W. Holmes

Array[array]
        150904 by: Erich Kolb
        150930 by: Joaco
        150934 by: Philip Olson

using % and £ in strings
        150906 by: bob pilly
        150926 by: Marek Kilimajer

PHP Hosting Sites
        150911 by: Martin, Stanley G
        150912 by: Mike Brum
        150914 by: Edward Peloke
        150915 by: Chris Hayes
        150917 by: Russell P Jones

What does this do?
        150913 by: Stephen Goddard
        150939 by: Steve Keller

Re: use print
        150916 by: Stephen Goddard

check is pop address
        150918 by: Philip S
        150919 by: R'twick Niceorgaw

Mail() "problem"
        150921 by: Maikel Verheijen

spawning new window with PHP
        150923 by: Amanda McComb
        150925 by: Henrik Hudson
        150928 by: Marek Kilimajer

Mail Username
        150929 by: Josh Thomas
        150932 by: John S. Huggins

Re: Bitwise flagging in mysql database
        150935 by: Jason Wong

MSSQL - Previous/Next Paging Results
        150937 by: Craig
        150938 by: Dan Joseph

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

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

attached mail follows:


Well there really is no way of knowing if they left their computer or not,
or just shutdown their computer. The only way that I know of would be to
use java, but that's not what you are using.

Good luck!

Rick

A wise women once said: " No one can help everybody, but everybody can help
somebody." - Unknown

> From: "Matt Palermo" <mpalermovt.edu>
> Date: Mon, 9 Jun 2003 21:37:20 -0400
> To: "'Richard Baskett'" <phpbaskettcase.com>, "'PHP General'"
> <php-generallists.php.net>
> Subject: RE: [PHP] php and flash chat program
>
> I realize that this can be done, but I would like to make it as instant
> as possible. I don't want to wait very long for the user to be removed
> from the online users list. Got any other ideas? Thanks.
>
> Matt
>
> -----Original Message-----
> From: Richard Baskett [mailto:phpbaskettcase.com]
> Sent: Monday, June 09, 2003 6:15 PM
> To: Matt Palermo; PHP General
> Subject: Re: [PHP] php and flash chat program
>
> What I normally do in these situations is have two fields separated by
> tabs
> or commas or whatever you want. The first field is the username and the
> second field is a timestamp.
>
> The timestamp can be updated every time the user writes a message, since
> Im
> sure you are logging also.. or after, say an hour, have their name
> removed
> from the list, although this might make them have to log back in :)
>
> Every time someone logs into the chat go through the list getting rid of
> any
> usernames older than an hour or any other time. And everytime someone
> logs
> off do the same thing.. or if you get a lot of activity, just go through
> the
> list when people logoff.
>
> Cheers!
>
> Rick
>
> "If you're going to be able to look back on something and laugh about
> it,
> you might as well laugh about it now." - Marie Osmond
>
>> From: "Matt Palermo" <mpalermovt.edu>
>> Date: Mon, 9 Jun 2003 17:19:31 -0400
>> To: <php-generallists.php.net>
>> Subject: [PHP] php and flash chat program
>>
>> Hey, I need some advice if anyone is willing to offer it. I have a
> chat
>> program I am working on. The interface is built in flash, and it uses
>> PHP also. There is a main chat area where the users type their
> messages
>> back and forth, and there is also a smaller area which displays all of
>> the currently logged-in users. When a user logs into the chat room,
> it
>> adds their nickname to a users.txt file, which creates a list of all
> the
>> online users and is then displayed in the chat page. I also have a
>> logoff button that will search for the users nickname in the users.txt
>> file and remove it, so that it won't be displayed in the chat window
>> anymore. The only problem I am having is that if a user doesn't click
>> on the logoff button and instead just closes the internet window or
>> shuts off their computer, then their nickname will still appear in the
>> list of users, since it wouldn't get a chance to be removed by the
>> logoff button. I'm not sure how to accomplish this, I would
> appreciate
>> any help you can offer me. Thanks a lot.
>>
>> Matt
>>
>
>
>

attached mail follows:


The best way I can see to answer this would be to use the <body
onUnload="function()" in javascript and just have that function run what
you need. You could have php put the screen name into some variable in the
javascript and then onUnload (the user either closes the browser or
changes the page) run the function that tells whatever your delete
username program is to remove that user from the list

attached mail follows:


How about using session???

----- Original Message -----
From: "Russell P Jones" <rjonesemail.unc.edu>
To: "Matt Palermo" <mpalermovt.edu>
Cc: "'PHP General'" <php-generallists.php.net>
Sent: Tuesday, June 10, 2003 3:11 PM
Subject: RE: [PHP] php and flash chat program

> The best way I can see to answer this would be to use the <body
> onUnload="function()" in javascript and just have that function run what
> you need. You could have php put the screen name into some variable in the
> javascript and then onUnload (the user either closes the browser or
> changes the page) run the function that tells whatever your delete
> username program is to remove that user from the list
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Hi All,

I have a problem in printing database. I have drawn some data from the MySQL
and print to A4 paper. When the data are more than 1 page, it has to print
on other A4 paper. The problem is, I need the program to print the same
heading in every page. How can I do this?

Regards,
Berthold

attached mail follows:


Birdto wrote:
> Hi All,
>
> I have a problem in printing database. I have drawn some data from the MySQL
> and print to A4 paper. When the data are more than 1 page, it has to print
> on other A4 paper. The problem is, I need the program to print the same
> heading in every page. How can I do this?

Are you displaying the data in a web browser and then using the web
browser's print function?

If so then this problem cannot be solved using PHP. You'd need to figure
out how many lines you can print on a sheet of A4 and add a header after
that many lines of data.

Unfortunately PHP has no way of knowing what font the browser is using
to display the data, hence you cannot know how many lines you can print.

PHP cannot help you in this case. I might be wrong but I doubt it.

Jean-Christian Imbeault

attached mail follows:


At 2003-06-09 18:22 -0400, Dan Anderson wrote:
>Is it possible to tell PHP when converting a number to a string (i.e. in
>an echo or print command) to use x decimal places?
>
>Specifically, if I
>
><?php
> echo '$' . $some_price;
>?>
>
>And some_price is $1.50, it outputs:
>
>$1.5

This should work:

printf("$%.2f",1.50);

and print:

$1.50

See:
http://www.php.net/manual/en/function.printf.php
http://www.php.net/manual/en/function.sprintf.php

Greetings,
Jaap

attached mail follows:


When I use the if ($xxx) fuction to use the web addresses function to call
up a command it desnt work! All it does is come up with the command line
with:
 }else {
      if (!id && !edit) {
        echo "blah blah blah";
       }
}
 I'm using PWS and localhost//HPPAV server.
Please help!

attached mail follows:


 if (!id && !edit) - something wrong here.

Normally id>0. if so, id=true. !id=false.

(false && anything) is false.

echo "blah blah blah" will never be executed.

           -----------------------------------------------------------------------------------------------------------------------
                                                                                                                                   
                                               To: php-generallists.php.net
                                               cc:
           "Ben Houlton" Subject: [PHP] if ($xxxxx) { function not working?
           <kaoru_cuthotmail.com>
           06/10/03 02:12 PM
                                                                                                                                   
                                                                                                                                   

When I use the if ($xxx) fuction to use the web addresses function to call
up a command it desnt work! All it does is come up with the command line
with:
 }else {
      if (!id && !edit) {
        echo "blah blah blah";
       }
}
 I'm using PWS and localhost//HPPAV server.
Please help!

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

attached mail follows:


Please post the whole code. If I understand what you are attempting to
say you are probable just missing braces in the right place or php start
-end tags.

Jean-Christian Imbeault

attached mail follows:


<HTML>
<BODY>

<?php

$db = mysql_connect("localhost","root");

mysql_select_db("main",$db);

if ($submit) {

  if ($id) {

    $sql = "UPDATE edit SET sub='$sub',msg='$msg',name='$name',email='$email',newday='$newday' WHERE id=$id";
  } else {

    $sql = "INSERT INTO edit (sub,msg,name,email,date,time,newday) VALUES ('$sub','$msg','$name','$email','$date','$time','$newday')";
  }

  $result = mysql_query($sql);

  echo "Record updated/edited!<p>Return to <A href=\"index2.php?page=edit\">$sub</a>.";

} elseif ($delete==areyousure) {

    $sql = "SELECT * FROM edit WHERE id=$id";

    $result = mysql_query($sql);

    echo "Are you sure you want to delete $sub?<p><a href=$PHP_SELF?page=edit&id=$id&delete=true>Yes</a> | <a href=$PHP_SELF?page=edit>No</a>";

} elseif ($delete==true) {

    $sql = "DELETE FROM edit WHERE id=$id";

    $result = mysql_query($sql);

    echo "$sub Record deleted!<p><a href=index2.php?page=edit>Return</a>";

} else {

  if (!$id && !$edit) {

    $result = mysql_query("SELECT * FROM edit ORDER BY time ASC",$db);

    while ($myrow = mysql_fetch_array($result)) {

    $newday = false ;

    $newday = $myrow['newday'] ;

      if ($newday) {

         printf("<TABLE border=0 cellpadding=0 cellspacing=2 width=%s><TR><TD align=right class=newsdate width=%s><P style=text-align: right><b>%s</b></TD></TD></TABLE>", $myrow["width"], $myrow["width"], $myrow["date"]);

      }

      printf("<font class=newstitle><b><a href=\"%s?page=edit&edit=yes&id=%s\">%s</a></b></font><font class=newsnfo> - <a href=mailto:%s>%s</A> %s AEST</font><br>", $PHP_SELF, $myrow["id"], $myrow["sub"], $myrow["email"], $myrow["name"], $myrow["time"]);

      printf("%s<br><br>", $myrow["msg"]);

      printf("<a href=\"index2.php?page=edit&id=%s&delete=areyousure\">(DELETE)</a><br>", $myrow["id"]);

    }

          echo "<P><a href=index2.php?page=edit&edit=yes>ADD A RECORD</a><P>";

  }

}

?>

<?php

if ($edit) {

?>

  <form method="post" action="index2.php?page=edit">

  <?php

  if ($page && $id) {

    $sql = "SELECT * FROM edit WHERE id=$id";

    $result = mysql_query($sql);

    $myrow = mysql_fetch_array($result);

    $id = $myrow["id"];

    $name = $myrow["name"];

    $email = $myrow["email"];

    $sub = $myrow["sub"];

    $msg = $myrow["msg"];

    $newday = $myrow["newday"];

    $width = $myrow["width"];

    ?>

    <input type=hidden name="id" value="<?php echo $id ?>">
    <?php

  }

  ?>
    <input type=hidden name="date" value="<?php echo date("l, F, jS Y"); ?>">
    <input type=hidden name="time" value="<?php echo date("H:i:s"); ?>">
    <input type=hidden name="width" value="100%">

  Name:<input type="Text" name="name" value="<?php echo $name ?>"><br>

  E-Mail:<input type="Text" name="email" value="<?php echo $email ?>"><br>

  Subject:<input type="Text" name="sub" width=50 value="<?php echo $sub ?>">New Day?<input type="radio" name="newday" value="1">Yes<input type="radio" name="newday" value="0">No<br>

  Message:<textarea name="msg" rows="7" cols="80" wrap="virtual"><?php echo $msg ?></TEXTAREA><br>

  <input type="Submit" name="submit" value="Enter information">

  </form>

<?php

}

?>

</BODY>
</HTML>

attached mail follows:


do you even have register_globals enabled?
otherwise $submit, $id and so on will not be set.

Thomas

On Tue, 10 Jun 2003 19:11:21 +1000 kaoru_cuthotmail.com (Ben Houlton) wrote:

> <HTML>
> <BODY>
>
> <?php
>
> $db = mysql_connect("localhost","root");
>
> mysql_select_db("main",$db);
>
> if ($submit) {
>
> if ($id) {
>
> $sql = "UPDATE edit SET sub='$sub',msg='$msg',name='$name',email='$email',newday='$newday' WHERE id=$id";
> } else {
>
> $sql = "INSERT INTO edit (sub,msg,name,email,date,time,newday) VALUES ('$sub','$msg','$name','$email','$date','$time','$newday')";
> }
>
> $result = mysql_query($sql);
>
> echo "Record updated/edited!<p>Return to <A href=\"index2.php?page=edit\">$sub</a>.";
>
> } elseif ($delete==areyousure) {
>
> $sql = "SELECT * FROM edit WHERE id=$id";
>
> $result = mysql_query($sql);
>
> echo "Are you sure you want to delete $sub?<p><a href=$PHP_SELF?page=edit&id=$id&delete=true>Yes</a> | <a href=$PHP_SELF?page=edit>No</a>";
>
> } elseif ($delete==true) {
>
> $sql = "DELETE FROM edit WHERE id=$id";
>
> $result = mysql_query($sql);
>
> echo "$sub Record deleted!<p><a href=index2.php?page=edit>Return</a>";
>
> } else {
>
>
> if (!$id && !$edit) {
>
> $result = mysql_query("SELECT * FROM edit ORDER BY time ASC",$db);
>
> while ($myrow = mysql_fetch_array($result)) {
>
> $newday = false ;
>
> $newday = $myrow['newday'] ;
>
> if ($newday) {
>
> printf("<TABLE border=0 cellpadding=0 cellspacing=2 width=%s><TR><TD align=right class=newsdate width=%s><P style=text-align: right><b>%s</b></TD></TD></TABLE>", $myrow["width"], $myrow["width"], $myrow["date"]);
>
> }
>
> printf("<font class=newstitle><b><a href=\"%s?page=edit&edit=yes&id=%s\">%s</a></b></font><font class=newsnfo> - <a href=mailto:%s>%s</A> %s AEST</font><br>", $PHP_SELF, $myrow["id"], $myrow["sub"], $myrow["email"], $myrow["name"], $myrow["time"]);
>
> printf("%s<br><br>", $myrow["msg"]);
>
> printf("<a href=\"index2.php?page=edit&id=%s&delete=areyousure\">(DELETE)</a><br>", $myrow["id"]);
>
> }
>
> echo "<P><a href=index2.php?page=edit&edit=yes>ADD A RECORD</a><P>";
>
> }
>
> }
>
> ?>
>
> <?php
>
> if ($edit) {
>
>
> ?>
>
> <form method="post" action="index2.php?page=edit">
>
> <?php
>
>
>
> if ($page && $id) {
>
> $sql = "SELECT * FROM edit WHERE id=$id";
>
> $result = mysql_query($sql);
>
> $myrow = mysql_fetch_array($result);
>
> $id = $myrow["id"];
>
> $name = $myrow["name"];
>
> $email = $myrow["email"];
>
> $sub = $myrow["sub"];
>
> $msg = $myrow["msg"];
>
> $newday = $myrow["newday"];
>
> $width = $myrow["width"];
>
>
> ?>
>
> <input type=hidden name="id" value="<?php echo $id ?>">
> <?php
>
> }
>
> ?>
> <input type=hidden name="date" value="<?php echo date("l, F, jS Y"); ?>">
> <input type=hidden name="time" value="<?php echo date("H:i:s"); ?>">
> <input type=hidden name="width" value="100%">
>
> Name:<input type="Text" name="name" value="<?php echo $name ?>"><br>
>
> E-Mail:<input type="Text" name="email" value="<?php echo $email ?>"><br>
>
> Subject:<input type="Text" name="sub" width=50 value="<?php echo $sub ?>">New Day?<input type="radio" name="newday" value="1">Yes<input type="radio" name="newday" value="0">No<br>
>
> Message:<textarea name="msg" rows="7" cols="80" wrap="virtual"><?php echo $msg ?></TEXTAREA><br>
>
> <input type="Submit" name="submit" value="Enter information">
>
> </form>
>
>
>
> <?php
>
> }
>
> ?>
>
> </BODY>
> </HTML>

attached mail follows:


But the $id is ment to be a number sorting out each record. Not an on/off
function.
If I'm reading your message wrong sorry.

attached mail follows:


I thought it was the gobal command i tried global $submit; (etc..) earlier
today but It didn't work so could you give me an exampe of how it works
please?
Thanks.

attached mail follows:


Why don't you use the traditional way ?
    
    if ( id<0 && !edit){
        echo "aa";
    }

It always work.

--
-------------------------------------------------
Cristian MARIN
InterAKT Online (www.interakt.ro)
+4021 411 2610
cristicinterakt.ro

  "Larry Li" <Larry_Liamat.com> wrote in message news:OFCBDF22EB.102C7976-ON48256D41.0026EF12LocalDomain...

   if (!id && !edit) - something wrong here.

  Normally id>0. if so, id=true. !id=false.

  (false && anything) is false.

  echo "blah blah blah" will never be executed.

             -----------------------------------------------------------------------------------------------------------------------
                                                                                                                                     
                                                 To: php-generallists.php.net
                                                 cc:
             "Ben Houlton" Subject: [PHP] if ($xxxxx) { function not working?
             <kaoru_cuthotmail.com>
             06/10/03 02:12 PM
                                                                                                                                     
                                                                                                                                     

  When I use the if ($xxx) fuction to use the web addresses function to call
  up a command it desnt work! All it does is come up with the command line
  with:
   }else {
        if (!id && !edit) {
          echo "blah blah blah";
         }
  }
   I'm using PWS and localhost//HPPAV server.
  Please help!

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

attached mail follows:


Now I get a blank page and all the code... that I can think of is the same...
Look here:
<HTML>

<BODY>

<?php

$db = mysql_connect("localhost","root");

mysql_select_db("kangaroo",$db);

if ($submit) {

if ($id) {

$sql = "UPDATE edit SET sub='$sub',msg='$msg',name='$name',email='$email',newday='$newday' WHERE id=$id";

} else {

$sql = "INSERT INTO edit (sub,msg,name,email,date,time,newday) VALUES ('$sub','$msg','$name','$email','$date','$time','$newday')";

}

$result = mysql_query($sql);

echo "Record updated/edited!<p>Return to <A href=\"edit.php?\">$sub</a>.";

} elseif ($delete==areyousure) {

$sql = "SELECT * FROM edit WHERE id=$id";

$result = mysql_query($sql);

echo "Are you sure you want to delete $sub?<p><a href=$PHP_SELF?id=$id&delete=true>Yes</a> | <a href=$PHP_SELF>No</a>";

} elseif ($delete==true) {

$sql = "DELETE FROM edit WHERE id=$id";

$result = mysql_query($sql);

echo "$sub Record deleted!<p><a href=edit.php>Return</a>";

} else {

if (!$id && !$edit) {

$result = mysql_query("SELECT * FROM edit ORDER BY time ASC",$db);

while ($myrow = mysql_fetch_array($result)) {

$newday = $myrow['newday'];

if ($newday) {

printf("<TABLE border=0 cellpadding=0 cellspacing=2 width=%s><TR><TD align=right class=newsdate width=%s><P style=text-align: right><b>%s</b></TD></TD></TABLE>", $myrow["width"], $myrow["width"], $myrow["date"]);

}

printf("<font class=newstitle><b><a href=\"%s?edit=yes&id=%s\">%s</a></b></font><font class=newsnfo> - <a href=mailto:%s>%s</A> %s AEST</font><br>", $PHP_SELF, $myrow["id"], $myrow["sub"], $myrow["email"], $myrow["name"], $myrow["time"]);

printf("%s<br><br>", $myrow["msg"]);

printf("<a href=\"edit.php?id=%s&delete=areyousure\">(DELETE)</a><br>", $myrow["id"]);

}

echo "<P><a href=edit.php?edit=yes>ADD A RECORD</a><P>";

}

}

?>

<?php

if ($edit) {

?>

<form method="post" action="edit.php?">

<?php

if ($id) {

$sql = "SELECT * FROM edit WHERE id=$id";

$result = mysql_query($sql);

$myrow = mysql_fetch_array($result);

$id = $myrow["id"];

$name = $myrow["name"];

$email = $myrow["email"];

$sub = $myrow["sub"];

$msg = $myrow["msg"];

$newday = $myrow["newday"];

$width = $myrow["width"];

?>

<input type=hidden name="id" value="<?php echo $id ?>">

<input type=hidden name="date" value="<?php echo date("l, F, jS Y"); ?>">

<input type=hidden name="time" value="<?php echo date("H:i:s"); ?>">

<input type=hidden name="width" value="100%">

<?php

}

?>

Name:<input type="Text" name="name" value="<?php echo $name ?>"><br>

E-Mail:<input type="Text" name="email" value="<?php echo $email ?>"><br>

Subject:<input type="Text" name="sub" width=50 value="<?php echo $sub ?>">New Day?<input type="radio" name="newday" value="1">Yes<input type="radio" name="newday" value="0">No<br>

Message:<textarea name="msg" rows="7" cols="80" wrap="virtual"><?php echo $msg ?></TEXTAREA><br>

<input type="Submit" name="submit" value="Enter information">

</form>

<?php

}

?>

</BODY>

</HTML>

attached mail follows:


On Tue, 10 Jun 2003, Ben Houlton wrote:

> Now I get a blank page and all the code... that I can think of is the same...
> Look here:
> <HTML>
>
> <BODY>
>
> <?php
>
> $db = mysql_connect("localhost","root");
>
> mysql_select_db("kangaroo",$db);
>
> if ($submit) {
>
> if ($id) {
[snip]

Do this, to help us and you know your settings:

$info = array('rg' => ini_get('register_globals'),
              'er' => ini_get('error_reporting'),
              'de' => ini_get('display_errors'),
              'id' => $id,
              'id2' => $_REQUEST['id'],
              'sub' => $submit,
              'sub2' => $_REQUEST['submit']);

var_dump($info);

And now, read this entire page:

  http://www.php.net/variables.external

As you are not yet understanding what register_globals is and
btw it has nothing to do with the global keyword. I am guessing
the above will show register_globals off and the variables you
assume exist do not really exist. Read that manual page
for why, it should explain all of this to you.

Regards,
Philip

attached mail follows:


At 2003-06-04 15:59 -0400, Edward Peloke wrote:
>you would have to use echo or print statements...

Yes.

After a while I stopped mixing PHP and HTML parts
and started writing everything in PHP using echo
and print statements. That way the code is much
more regular and flexible.

Greetings,
Jaap

attached mail follows:


Christian Ista wrote:
>
> Look the code below. Is it an obligation to multiply the number of <?php ?>.
> There is no other way ? not possible to use only an open php tag (<?php) and
> a clode php tag (?>) ?

Sure, instead of using <?php ?> use echo or print.

switch($constant_lastupdate[$i][3]){
   case '1' :
   echo "<img src='design/logo_windows.gif' alt='' width='12' height='10'
  border='0'>";
     break;

And so on ...

Jean-Christian Imbeault

attached mail follows:


Can someone point me to some documents about pulling images from out side the doc root?

thanks

/ Phil

attached mail follows:


> Can someone point me to some documents about pulling images from out side the doc root?
>

Go to php.net and search for the following functions:

file()
fopen()
fget()

These functions should have listings to other functions. In case you
knew about these functions but didn't know, you can use web addresses.
So, you could:

<?php
  // excuse the pseudocode
  $some_var = file("http://www.yahoo.com");
  do_something($some_var);
?>

-Dan

attached mail follows:


Hi,

I have an eval which evaluate a block of code before echo the result on the screen.. Here is the func :

function t_eval($texte) {
 ob_start();
  eval("?>".$texte);
  $retval = ob_get_contents();
 ob_end_clean();
 return $retval;
}

But I use some objects for databases, ... and when i trying to execute this code i have this text.
Fatal error: Call to a member function on a non-object in k:\program files\easyphp\www\dhea\include\php\functions_conversion.inc.php(23) : eval()'d code on line 9

What to do ?

Thanx

Laurent

attached mail follows:


Maybe: global $yourobject;

-Shawn

"Lpa" <lpassebnumericable.fr> wrote in message
news:001701c32f21$183b6dc0$f9a6dc51lpa...
Hi,

I have an eval which evaluate a block of code before echo the result on the
screen.. Here is the func :

function t_eval($texte) {
 ob_start();
  eval("?>".$texte);
  $retval = ob_get_contents();
 ob_end_clean();
 return $retval;
}

But I use some objects for databases, ... and when i trying to execute this
code i have this text.
Fatal error: Call to a member function on a non-object in k:\program
files\easyphp\www\dhea\include\php\functions_conversion.inc.php(23) :
eval()'d code on line 9

What to do ?

Thanx

Laurent

attached mail follows:


Hi everybody,

Maybe this is not the exact place for this post, as is more a problem with
permissions and linux, but I have been searching all around and I cannot
find an answer to my problem, so if somebody can lend a hand it will be
greatly appreciated.

My problem is that i have written a script that only adds a group to linux
with function groupadd and with a name that i give in a php page. If I
execute the script from console, it works fine, as I am root user on my
machine, but when I try to execute from web page, it makes nothing, as the
user is apache.

If I want to make su at the beginning of the script, is it possible to send
also the password so it prompts for nothing? is there a better way to do
that?

I'm using RH9, Apache 2 and php 4.2.3.

Thx in advance.

attached mail follows:


a) $man su for more info
b) because suing and passing in arbitrary commands is a hackers dreams
you may have some problems with safe mode and the like

-Dan

On Tue, 2003-06-10 at 03:45, josemaria wrote:
> Hi everybody,
>
> Maybe this is not the exact place for this post, as is more a problem with
> permissions and linux, but I have been searching all around and I cannot
> find an answer to my problem, so if somebody can lend a hand it will be
> greatly appreciated.
>
> My problem is that i have written a script that only adds a group to linux
> with function groupadd and with a name that i give in a php page. If I
> execute the script from console, it works fine, as I am root user on my
> machine, but when I try to execute from web page, it makes nothing, as the
> user is apache.
>
> If I want to make su at the beginning of the script, is it possible to send
> also the password so it prompts for nothing? is there a better way to do
> that?
>
> I'm using RH9, Apache 2 and php 4.2.3.
>
> Thx in advance.
>
>

attached mail follows:


Hello

Well here is my opinion on the two.
I think it is a lot easier to get an app ready and running with PHP
(especially database driven) than it is with JSP. The memory footprint of
PHP is a lot lower than with JSP. Alone the JVM that needs to be loaded
requires lots of resources. Also installing a Servletcontainer can be a
pain in the ____ but I don't think this is really a matter of choosing
between the two.
In PHP it is quite easy to programm fast and dirty but I find it hard to
programm clean easy to maintain code (mostly due to the typless nature of
the system, the inclusion of php code in HTML and the "per request
parsing"). This is supported with the lack of true object oriented
programming in PHP (at least IMHO) - this might be different with PHP 5 -
(NO FLAMES ON THIS!!!). JSP tends to force you to use a cleaner design
since you have to declare all your interfaces before hand. This does not
mean you can't programm dirty in JSP. Do to the memory model used in JSP
it is also easier to maintain session and request state since you have the
abitlity to access the different scopes (Application, Session, Request)
through a clean interface. Struts supports you in this by separating your
view from your logic in a clean managable fashion. If used in conjuction
with a generating tool struts is fairly easy and fast to use. ( I
recommend eclipse and a struts plugin like easy struts but this is just my
opinion) On the other hand the learning curve for JSP and Struts is a lot
higher than using PHP.
If you are using EJB in the backend (or other JAVA technologies) I think
it is easier if you go with JSP since you are staying in the same
programming paradigm although webservices should make it fairly easy to
connect PHP to an EJB.
Also i18n tends to be easier with Java than with PHP due to the builtin
UNICODE support.
One last thing in JSP you have the namespace advantage. In PHP large
applications tend to clutterup the global namespace and great care must be
taken to prevent variable redeclarations. But this is mainly a coding /
team issue. (Pear and their codingguidelnes might be a good resolution to
this problem)
JSP does add the threading issue which is not too apparent but can be a
real pain. But if you follow some guidlines it should not become an issue.

The fazit:
 Can't really tell you this or that is better since I think you can built
largescale application in both. Depends on your preferences which one is
easier to use. All I can say OO is much better in JAVA than in PHP.
If you are using PHP I recommend using smarty as a templating engine and
building your own custom functions to have a clean separation of logic
and view.

Hope that helps a little

Stefan Langer

attached mail follows:


> > You might want to look around the jakarta projects and ask questions on
> > some of those mailing lists.
>
> Thanks for the advice. I'll try that. But I *would* like to hear the
> opinions of PHP'ers too. I'm worried that by asking people on that list
> Ill get one-sided views.

Of COURSE you'll get one-sided opinions over there. No, actually,
they're mostly pretty open-minded.

I think I recall a thread or two on one or both of the lists I mentioned
comparing JSP with tomcat and maybe struts to php. You should be able to
find it on marc or one of the other places that archives the jakarta
lists.

Hmm. "php" seems to get a lot of unrelated hits for some reason, but I
notice that some people seem to have apache, tomcat, and php all running
together.

> What do PHP people who've tried jsp or struts think?
>
> > (tomcat is an open source java server that can be used with or without
> > apache, and struts is an application framework.)
>
> The jsp'ers that I talked with could not stop praising struts ... which
> is what got me interested in finding out more and maybe even switching.

Yeah, and the guys who developed struts are already working on something
even better ...

> I just hope that if I do decide that struts are worth the switch the
> learning curve isn't too steep. Or the installation curve also since I'm
> the lone sysadmin too ...

Well, it was pretty steep for me because I was trying to pick up Java
and objects at the same time. I think you'll have less trouble if you
already are comfortable with Java.

--
Joel Rees <joelalpsgiken.gr.jp>

attached mail follows:


[snip]
I'm worried that PHP won't scale well. And by scaling I don't mean under
heavy load, I mean maintenance wise :) I
can't imagine having to do a feature upgrade on a PHP project with more
than 100 files ... (this file requires that file which requires that one
and so on ...)
[/snip]

This is really a planning issue. PHP scales extremely well maintenance
wise if you plan the application well. IMHO a lot of PHP developers
operate fast and loose because the language allows it, therefore
planning is glossed over and maintenance issues get out of hand.
Conversely there are many well planned large scale PHP projects that do
not suffer from the maintenance problems you describe. I have seen this
problem in other apps using other languages...so I think that this is a
moot point.

Jay

attached mail follows:


Agree 100%. Don't assume that just because you use JSP, or any other
language, your program is going to instantly "scale well" and be easy to
maintain. You can write crappy, inefficient code in any language. You can
also write good programs in most any language if you put the proper planning
into it before hand.

It all comes down to using the language you know well enough to make your
program efficient. If you decide to use JSP, great, I wish you all the best.
If you decide to use PHP, great, I wish you all the best and we'll be here
on the mailing list to help.

---John Holmes...

PS: Sorry for the top-post, OE sucks!

----- Original Message -----
From: "Jay Blanchard" <jay.blanchardniicommunications.com>
To: "Jean-Christian Imbeault" <jcmega-bucks.co.jp>;
<php-generallists.php.net>
Sent: Tuesday, June 10, 2003 7:46 AM
Subject: RE: [PHP] PHP vs. jsp, advice please

[snip]
I'm worried that PHP won't scale well. And by scaling I don't mean under
heavy load, I mean maintenance wise :) I
can't imagine having to do a feature upgrade on a PHP project with more
than 100 files ... (this file requires that file which requires that one
and so on ...)
[/snip]

This is really a planning issue. PHP scales extremely well maintenance
wise if you plan the application well. IMHO a lot of PHP developers
operate fast and loose because the language allows it, therefore
planning is glossed over and maintenance issues get out of hand.
Conversely there are many well planned large scale PHP projects that do
not suffer from the maintenance problems you describe. I have seen this
problem in other apps using other languages...so I think that this is a
moot point.

Jay

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

attached mail follows:


Hi,

I've created a very advanced web form which acts as an application and I am in desperate need of help.

The application works great, and it utilizes components such as combo boxes, checkboxes and radio buttons. It is split into sections using iframes, meaning that each section is scrollable to display the full repitoire of available information.

The problem I have is every time a piece of information is updated, whether it is a selection or an alteration, my application needs to reset a number of times to reflect the change from the top down. The refresh allows my application to show the most current scenario, but the problem is there is a cascading effect and one click can result in three or four refreshes so that all the iframes are up to date.

What I'm wanting to know is whether there is a way that this information could be updated without the need of the refresh? I'd need to update information above where the change took place, and some of the changes are simply text (ie an integer calculation could be different depending on which radio button is selected). Is this possible? I want to be able to click on a checkbox and the information related to that record is displayed below automatically without reloading or refreshing.

Please help!

Thanks,
Michael.

attached mail follows:


Hi All!

I have a small problem with reading a file via crontab. For better
performance i read a dynamic php page every hour, so the actual page
is static with better performance. Actually there is some <script src>
that is not being executed by fopen, that means the <script src..> is
just
taken - it would be even more better, if php would read the scripts
behind
script src - you know what i mean? that way i could prevent my site from
parsing external javascript files.

Any ideas?

Mit freundlichen Grüssen |*|
                           |*|
[Johannes Reichardt] |*|
************************ |*|
Webaddict +49172/3895500 |*|
gramba.net:typorized.com |*|

attached mail follows:


To Do:

I would like to call image /user/mysite/image_01.jpg using something like /user/mysite/public_html/loadimage.php?image=1

is this a simple procedure or hard ...

any suggestions or someone want to point me in the right direcion/ Phil

attached mail follows:


You should make the maping some how between the images name(+location) and the numbers.
I see two solutions:

1. Use a database table in which the image number is the id

    table images_img{
        id_img, - the number you are sending
        name_img - a name if you need this
        path_img - the path to this file
    }

    You can dinamically create a gallery after or you can hardcoded every id in the pages you needed. It's up to you what you need this for.

2. Create a file with an associative array between the id's and pathnames (it's a very bad ideea)

I hope this is the answer at your question, if not send me a mail.

--
-------------------------------------------------
Cristian MARIN
InterAKT Online (www.interakt.ro)
+4021 411 2610
cristicinterakt.ro

  "Philip J. Newman" <newmanpjphilipnz.com> wrote in message news:00c001c32f2c$ed904f30$0401a8c0philip...
  To Do:

  I would like to call image /user/mysite/image_01.jpg using something like /user/mysite/public_html/loadimage.php?image=1

  is this a simple procedure or hard ...

  any suggestions or someone want to point me in the right direcion/ Phil

attached mail follows:


[snip]
I would like to call image /user/mysite/image_01.jpg using something
like /user/mysite/public_html/loadimage.php?image=1

is this a simple procedure or hard ...
[/snip]

It is quite simple Newman. Create a PHP page that reacts to the passing
of a variable to determine which image to call. It will still be a jpg
when it arrives at the browser...is this what you are trying to prevent?
If so, why? If it is to "prevent" image theft it really will not permit
it.

HTH!

Jay

attached mail follows:


You can use the following code also:

for url www.yoursite.com/index.php?image=1

<?php

    if (isset($HTTP_GET_VARS['image']) && $HTTP_GET_VARS['image'] >0){
?>
        <img src="/user/mysite/image_<?php echo $HTTP_GET_VARS['image']?>.jpg">
<?php
    }
?>

and the /user/mysite/image_1.jpg will be loaded for image=1 or image_2.jpg for image=2 ... and so on

--
-------------------------------------------------
Cristian MARIN
InterAKT Online (www.interakt.ro)
+4021 411 2610
cristicinterakt.ro

  "Philip J. Newman" <newmanpjphilipnz.com> wrote in message news:00c001c32f2c$ed904f30$0401a8c0philip...
  To Do:

  I would like to call image /user/mysite/image_01.jpg using something like /user/mysite/public_html/loadimage.php?image=1

  is this a simple procedure or hard ...

  any suggestions or someone want to point me in the right direcion/ Phil

attached mail follows:


It's a bit large the concept "not working". The code seems OK but I can't tested or help you because I can't see what it should do. If I register the my_email by hand it will enter to the do_session_crap() ... if not I don't get anything. When you are registering the my_email and how do you get the datas ... I need more to help you .

--
-------------------------------------------------
Cristian MARIN
InterAKT Online (www.interakt.ro)
+4021 411 2610
cristicinterakt.ro

  "Ryan A" <ryanjumac.com> wrote in message news:000701c32d31$59cfbda0$1701400al2zcaxu7emppqh...
  Hi,
  Heres the code (very simple stuff) but not working:

  if(session_is_registered('my_email')){}
   else{
     do_session_crap();
   }

   function do_session_crap()
    {
     if(isset($id[0]))
     {$p1=$id[0];
     echo $p1;
     $_SESSION['p1'] = $p1;
     
     }
     if(isset($id[1]))
     {$p2=$id[1];
     echo $p2;
     $_SESSION['p2'] = $p2;
     }
     if(isset($id[2]))
     {$p3=$id[2];
     $_SESSION['p3'] = $p3;
     }
     if(isset($id[3]))
     {$p4=$id[3];
     $_SESSION['p4'] = $p4;
     }
     if(isset($id[4]))
     {$p5=$id[4];
     $_SESSION['p5'] = $p5;
     }
     else {echo "not working";}
  // header("Location: my.login.php");
     exit;
    }

  it always gives me "not working"
  Any idea why?

  -Ryan

attached mail follows:


You should use the putenv() to set temporarly another timezone.
Read the notes in the php manual: http://www.php.net/manual/en/function.putenv.php

--
-------------------------------------------------
Cristian MARIN
InterAKT Online (www.interakt.ro)
+4021 411 2610
cristicinterakt.ro

  "Erick" <webmasterpczonehk.com> wrote in message news:20030528124725.71784.qmailpb1.pair.com...
  I am in Hong Kong and the server is in US.
  I can't change the server setting.

attached mail follows:


Hello,
 
I while back somebody on this list posted me a link to a registry update
which enabled syntax highlighting of PHP file in Visual Studio .Net. Due
to some tragid data loss, I am now back with a unpatched Visual Studio
.Net and I can't find the mentioned registry hack on google. If anybody
knows what I am talking about it would be great if he or she could post
the link again!
 
Thanx in advance
 
Ulrik
 
 
 
 
 

attached mail follows:


Hi!
I want to using asp in a php file,how to do it?
thanks!

attached mail follows:


Hi,

> -----Original Message-----
> I want to using asp in a php file,how to do it?
> thanks!

        As far as I know, that is not possible. ASP and PHP are two different
languages. It would be like someone programming an application in both C++
and Java at the same time. If there is no reason for you to have to use
ASP, then just use PHP by itself. If you must use ASP, you'll just have to
use that.

-Dan Joseph

attached mail follows:


> -----Original Message-----
> From: Jason k Larson [mailto:jlarsoncandlefire.org]
> Sent: 09 June 2003 22:23
>
> Try adding the SessionID to the URL.
>
> openEdit("add=event&amp;cellid=10&amp;<?PHP echo Session_Name
> ().'='.Session_ID();?>");
>
> or a little better:
> $thisSession = Session_Name().'='.Session_ID();
> openEdit("add=event&amp;cellid=10&amp;<?PHP echo $thisSession;?>");

Sigh! I've already mentioned tow or three times in the past week that this
is exactly what the predefined constant SID is for -- so even better would
be:

   openEdit("add=event&amp;cellid=10&amp;<?PHP echo SID ?>");

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


i cant help much seeing that u already are using mysql why an access
frontend ? i'm currently doing a access to mysql intergration , i moved the
db over using sqlyog's odbc import , then i basically had to build the forms
from scratch is there a problem with that ?? if u are moving over u may
aswell do the whole thing in one go

-----Original Message-----
From: Apollo (Carmel Entertainment) [mailto:listscarmelme.com]
Sent: Tuesday, June 10, 2003 9:05 AM
To: php-generallists.php.net
Subject: [PHP] Want to move M$Access frontend to PHP/MYSQL. Need
suggestions...

I want to move my Microsoft Access based front end (back end is already on
MySQL/Linux) to PHP. MSAccess does have some forms that have VBscript in
the,
but I think I can figure other ways to do that.I am not a wizard with PHP,
so I
would interested in finding some open source apps, or something like that to
help me convert my front end to PHP/Apache/Mysql. GUI is what I am looking
for.
Any advice? Anyone done this before?

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

attached mail follows:


Why an MS Access front end? Old school talent booking agents, they do not want
to see any changes, so you have to do everything in the background. Only my Dir
of Ops. understands what I am talking about, since she benefits every time I
move my finger.
Person who originaly wrote the Access database did so much VBA in it, that I
have to now re-do everything if I choose to change the front end. And I suck in
Javascript, PHP came to me only from looking at examples. I am not a programmer,
I am operations person.
Anyway...
ANy other suggestions?

Quoting electroteque <danielelectroteque.org>:

> i cant help much seeing that u already are using mysql why an access
> frontend ? i'm currently doing a access to mysql intergration , i moved the
> db over using sqlyog's odbc import , then i basically had to build the forms
> from scratch is there a problem with that ?? if u are moving over u may
> aswell do the whole thing in one go
>
> -----Original Message-----
> From: Apollo (Carmel Entertainment) [mailto:listscarmelme.com]
> Sent: Tuesday, June 10, 2003 9:05 AM
> To: php-generallists.php.net
> Subject: [PHP] Want to move M$Access frontend to PHP/MYSQL. Need
> suggestions...
>
>
> I want to move my Microsoft Access based front end (back end is already on
> MySQL/Linux) to PHP. MSAccess does have some forms that have VBscript in
> the,
> but I think I can figure other ways to do that.I am not a wizard with PHP,
> so I
> would interested in finding some open source apps, or something like that to
> help me convert my front end to PHP/Apache/Mysql. GUI is what I am looking
> for.
> Any advice? Anyone done this before?
>

Apolinaras "Apollo" Sinkevicius
Carmel Music & Entertainment, LLC
 web-site: http://carmelme.com
________________________________
Having an event in Chicago, or would you like to bring Chicago entertainment
to your event? Give Carmel Music & Entertainment a call for the finest
entertainment available in Chicago.

attached mail follows:


> -----Original Message-----
> From: Kevin Stone [mailto:kevinhelpelf.com]
> Sent: 09 June 2003 23:54
>
> ----- Original Message -----
> From: "Emma Jane Hogbin" <emmajanextrinsic.com>
> To: <php-generallists.php.net>
>
> > What ended up working was passing the session ID to the
> pop-up window
> > "manually" by including it in the function (and thus the URL).
>
> I just don't see how this could have solved your problem
> except to do the
> same thing that output buffering would have done and that is to
> (essentially) queue the execution of the two scripts. Anyone care to
> explain this?

Well, first of all the fact that this solution works means it has nothing to do with the output buffering setting, nor whether there's a session_write_close() in the calling script (although that's good practice in this situation, and I'd probably recommend doing it a bit earlier in the script -- certainly before emitting the </body>).

From the fact that this does solve the problem, we can assume that (i) the session ID is being passed in the URL and not via a cookie, and (ii) the session.use_trans_sid URL rewriter isn't rewriting the URLs in the JavaScript call. This would mean that the script called in the popup is seeing the session ID neither in the URL nor in a cookie -- i.e. not at all -- and hence the need to add the SID information manually.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


On Tue, Jun 10, 2003 at 10:47:58AM +0100, Ford, Mike [LSS] wrote:
> Well, first of all the fact that this solution works means it has nothing to do with the output buffering setting, nor whether there's a session_write_close() in the calling script (although that's good practice in this situation, and I'd probably recommend doing it a bit earlier in the script -- certainly before emitting the </body>).

Because of the way the templates are set up this is the best place for me
to put it, I think. At the bottom of the page I'm still including footers
which have logout options.

> >From the fact that this does solve the problem, we can assume that (i) the session ID is being passed in the URL and not via a cookie, and (ii) the session.use_trans_sid URL rewriter isn't rewriting the URLs in the JavaScript call. This would mean that the script called in the popup is seeing the session ID neither in the URL nor in a cookie -- i.e. not at all -- and hence the need to add the SID information manually.

Ahh!! Yes, I'm using an external .js file to create the pop-up window.

emma

--
Emma Jane Hogbin
[[ 416 417 2868 ][ www.xtrinsic.com ]]

attached mail follows:


> -----Original Message-----
> From: Stephen [mailto:webmastermelchior.us]
> Sent: 06 June 2003 15:48
>
>
> Thanks for your reply. I had actually made a mistake in the
> code. It looks
> like this now:
>
>
>
> How could I still use the id thing on this?

Well, the addition of the stripslashes() call doesn't really change the
basic idea, so:

   print "<a href=\"#\" onClick=\"window.opener.document.order['" .
stripslashes($HTTP_GET_VARS['name']) . "].value='$y-$m-$d';\">$d</a>";

> I now use ' in
> the brakets as
> well, if that helps any...

I'm not sure I quite understand this, but if you're saying that the value of
$HTTP_GET_VARS['name'] may itself include ' characters, then I think the
answer to that is *not* to stripslashes() it -- JavaScript will understand
the backslashed notations and convert them to the correct result. If that's
not what you were getting at, please try explaining it again in a bit more
detail (adding an example might help).

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


How can I disable the Safe Mode for a php 4.3.2 compiled on linux with --enable-safe-mode.

The problem is I can't touch the machine so I can't test if I change the setting in the php.ini it just ignore the flag and I don't have the posibility to reproduce this on my server.

Even a link to where I can find docs about the options for compiling Php will be good.

--
-------------------------------------------------
Cristian MARIN
InterAKT Online (www.interakt.ro)
+4021 411 2610
cristicinterakt.ro

attached mail follows:


Hi there!

Sorry for annoying you with stupid questions, but actually i am fooling
around with this problem since hours:

3:<br><b>foo &middot;

what i need is (what else?) foo.

i followed the http referer example on php.net but i simply failed - i
never get foo if i try to match it somewhat like this:

preg_match("/(:<br><b>)?([^&]+)/i", $value, $matches);

i tried many variations of this version, but all failed

someone who could enligthen me?

Mit freundlichen Grüssen |*|
                           |*|
[Johannes Reichardt] |*|
************************ |*|
Webaddict +49172/3895500 |*|
gramba.net:typorized.com |*|

attached mail follows:


Try this :

<?
$str="3:<br><b>foo &middot;";
preg_match('/3:<br><b>(.*?)&middot;/i',$str,$result);
Echo $result[1];
?>

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.

-----Original Message-----
From: Johannes Reichardt [mailto:mailboxgramba.net]
Sent: Tuesday, June 10, 2003 1:05 PM
To: php-generallists.php.net
Subject: [PHP] preg_match ;)

Hi there!

Sorry for annoying you with stupid questions, but actually i am fooling around with this problem since hours:

3:<br><b>foo &middot;

what i need is (what else?) foo.

i followed the http referer example on php.net but i simply failed - i never get foo if i try to match it somewhat like this:

preg_match("/(:<br><b>)?([^&]+)/i", $value, $matches);

i tried many variations of this version, but all failed

someone who could enligthen me?

Mit freundlichen Grüssen |*|
                           |*|
[Johannes Reichardt] |*|
************************ |*|
Webaddict +49172/3895500 |*|
gramba.net:typorized.com |*|

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

attached mail follows:


I've tried this code on a web server and it worked, but on my localhost server it did not work. It just looped the "ADD RECORD" text (not including database infomation).
My code is below:
<HTML>

<BODY>

<?php

$register_globals;

$db = mysql_connect("localhost","root");

mysql_select_db("kangaroo",$db);

if ($submit) {

if ($id) {

$sql = "UPDATE edit SET sub='$sub',msg='$msg',name='$name',email='$email',newday='$newday' WHERE id=$id";

} else {

$sql = "INSERT INTO edit (sub,msg,name,email,date,time,newday) VALUES ('$sub','$msg','$name','$email','$date','$time','$newday')";

}

$result = mysql_query($sql);

echo "Record updated/edited!<p>Return to <A href=\"edit.php\">$sub</a>.";

} elseif ($delete==areyousure) {

$sql = "SELECT * FROM edit WHERE id=$id";

$result = mysql_query($sql);

echo "Are you sure you want to delete $sub?<p><a href=$PHP_SELF?id=$id&delete=true>Yes</a> | <a href=$PHP_SELF>No</a>";

} elseif ($delete==true) {

$sql = "DELETE FROM edit WHERE id=$id";

$result = mysql_query($sql);

echo "$sub Record deleted!<p><a href=edit.php>Return</a>";

} else {

if (!$edit) {

$result = mysql_query("SELECT * FROM edit",$db);

while ($myrow = mysql_fetch_array($result)) {

$newday = $myrow['newday'];

if ($newday) {

printf("<TABLE border=0 cellpadding=0 cellspacing=2 width=%s><TR><TD align=right class=newsdate width=%s><P style=text-align: right><b>%s</b></TD></TD></TABLE>", $myrow["width"], $myrow["width"], $myrow["date"]);

}

printf("<font class=newstitle><b><a href=\"%s?edit=yes&id=%s\">%s</a></b></font><font class=newsnfo> - <a href=mailto:%s>%s</A> %s AEST</font><br>", $PHP_SELF, $myrow["id"], $myrow["sub"], $myrow["email"], $myrow["name"], $myrow["time"]);

printf("%s<br><br>", $myrow["msg"]);

printf("<a href=\"edit.php?id=%s&delete=areyousure\">(DELETE)</a><br>", $myrow["id"]);

}

echo "<P><a href=edit.php?edit=yes>ADD A RECORD</a><P>";

}

}

?>

<?php

if ($edit) {

?>

<form method="post" action="edit.php">

<?php

if ($id) {

$sql = "SELECT * FROM edit WHERE id=$id";

$result = mysql_query($sql);

$myrow = mysql_fetch_array($result);

$id = $myrow["id"];

$name = $myrow["name"];

$email = $myrow["email"];

$sub = $myrow["sub"];

$msg = $myrow["msg"];

$newday = $myrow["newday"];

$width = $myrow["width"];

?>

<input type=hidden name="id" value="<?php echo $id ?>">

<?php

}

?>

<input type=hidden name="date" value="<?php echo date("l, F, jS Y"); ?>">

<input type=hidden name="time" value="<?php echo date("H:i:s"); ?>">

<input type=hidden name="width" value="100%">

Name:<input type="Text" name="name" value="<?php echo $name ?>"><br>

E-Mail:<input type="Text" name="email" value="<?php echo $email ?>"><br>

Subject:<input type="Text" name="sub" width=50 value="<?php echo $sub ?>">New Day?<input type="radio" name="newday" value="1">Yes<input type="radio" name="newday" value="0">No<br>

Message:<textarea name="msg" rows="7" cols="80" wrap="virtual"><?php echo $msg ?></TEXTAREA><br>

<input type="Submit" name="submit" value="Enter information">

</form>

<?php

}

?>

</BODY>

</HTML>

The !$id && !$edit are the cause but I don't know how to fix it.
I've tried id<0 and so, and they did not work.

So could somebody please help me out?
Thank you for you're time

-Ben

attached mail follows:


On Tue, 10 Jun 2003 21:14:52 +1000, Ben Houlton wrote:

>I've tried this code on a web server and it worked, but on my localhost server it did not work. It just looped the "ADD RECORD" text (not including database infomation).
>My code is below:
><HTML>
>
><BODY>
>
><?php
>
>$register_globals;

It sounds like you have register_globals turned on on the "web server"
but off on the "localhost server". The $register_globals line in your
code above does absolutely nothing. I would recommend searching this
list for solutions. To see for sure what the status of
register_globals is look at phpinfo() or simply cut and paste the code
below to phpinfo.php and run it.

-----phpinfo.php-----
<?php
phpinfo();
?>

attached mail follows:


The email address I use on this list is never used
anywhere else in the world so only a list member must
have used it to send me the message below. It did not
come through the php lists.
Can anyone translate it into english or dont bother its
probably spam.
If it is spam then could the moderators of this list
please advise what I should do.

BELOW IS TAKEN FROM EMAIL HEADERS:

[QUOTE]