php-general Digest 27 Nov 2002 11:17:23 -0000 Issue 1729

Topics (messages 126201 through 126259):

Re: & in Query String
        126201 by: Ernest E Vogelsinger
        126209 by: Chris Shiflett
        126247 by: . Edwin

session problems
        126202 by: Jason Romero
        126207 by: John W. Holmes
        126233 by: conbud
        126236 by: conbud

Re: Problems with a simple While-If condition
        126203 by: Bret L Conard
        126205 by: Jason Romero

Re: URL hiding
        126204 by: Marco Tabini
        126211 by: Kris
        126213 by: Marco Tabini
        126219 by: Bob Irwin
        126224 by: John Nichel

Re: deleting a record.
        126206 by: Peter Houchin

Re: Problems with a simple While-If condition With the statement
        126208 by: Rodrigo de Oliveira

PHP zipcode distance class
        126210 by: UberGoober

Re: Multiple page form
        126212 by: Verdon Vaillancourt
        126226 by: . Nilaab

Re: Need email solution
        126214 by: Bryan Koschmann - GKT

displaying record number in a cell in a table
        126215 by: Peter Houchin
        126217 by: Van Andel, Robert
        126220 by: Peter Houchin

testing for empty array
        126216 by: poliva.cox.net
        126218 by: Van Andel, Robert
        126221 by: Kyle Gibson
        126222 by: Morgan Hughes

php/mysql report builder
        126223 by: Michael P. Carel
        126225 by: John W. Holmes
        126227 by: Miles Thompson
        126250 by: DL Neil

php bugs (Chinese word display problem)-help
        126228 by: samuel.3give.com
        126229 by: Tom Culpepper
        126234 by: samuel.3give.com
        126246 by: . Edwin

How do i provide Download facility ??
        126230 by: Venkatesh Hosur
        126232 by: Chris Shiflett
        126235 by: Justin French

Re: Linux Question
        126231 by: Justin French

Re: php version of majordomo?
        126237 by: Jason Wong

Invalid Charactors in a string.
        126238 by: Philip J. Newman
        126239 by: Tom Culpepper
        126243 by: Justin French
        126248 by: DL Neil

My first XML!
        126240 by: Boris Kolev
        126245 by: olinux

Changing SERVER's IP ADDRESS
        126241 by: Adharsh Praveen R
        126244 by: Jason Wong
        126249 by: Adharsh Praveen R

array manipulations
        126242 by: Mattia Wow

Re: spawing new PHP process
        126251 by: Geranium

Newbie : How work with parameters?
        126252 by: Stéphane Génin
        126253 by: Ernest E Vogelsinger
        126254 by: Scott Houseman
        126255 by: Rich Gray

XSLT support for RH8
        126256 by: Dan Kuykendall

Re: Decrypt Password
        126257 by: Joakim Andersson

Re: Confirm message box
        126258 by: Keith Sauvant
        126259 by: Marek Kilimajer

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
At 00:00 27.11.2002, Jonathan Rosenberg \(Tabby's Place\) said:
--------------------[snip]--------------------
>Ok ... I take back what I said about & not working in a query string.
>It works just fine.
--------------------[snip]-------------------- 

Ahhh - and I just created a test page for all to check out... nevertheless,
here it is:
http://www.vogelsinger.at/test.php

Simply provides a link using query parameters encoded with &, to check
with different browsers. Maybe someone will check this outwith his browser
anyway.


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


--- End Message ---
--- Begin Message ---
--- "Jonathan Rosenberg" <[EMAIL PROTECTED]> wrote:

> I tried it & it fails.  The browser sends the query
> string with the &amp; & the $_GET access fails.
> 
> I am using IE 6.  I can't imagine that it would be
> buggy in this regard.

I just tried this in IE 6, and it worked fine for me. My test code
follows:

<?
if (isset($_GET["foo"]))
{
     echo "<pre>";
     print_r($_GET);
     echo "</pre>";
}
else
{
?>
<a href="./test.php?foo=bar&amp;blah=blah">Click Here</a>
<?
}
?>

This should display:

Array
(
    [foo] => bar
    [blah] => blah
)

Does it not work for you?

Chris
--- End Message ---
--- Begin Message ---
Hello,

"Chris Shiflett" <[EMAIL PROTECTED]> wrote:

[snip]
> Does it not work for you?
[/snip]

It does, just like I said earlier :)

Anyway, I just wanted to add that not only in IE6 but even in NN4 or N7
(also in linux) it works perfectly fine.

- E

--- End Message ---
--- Begin Message ---
when using session registered variables
i can only get them to save as session variables for one page
then on the next page they are gone
far as i can tell the variables are not getting written over or unset
and the session is not gettting destroyed
any other ideas what it might be?

Jason


--- End Message ---
--- Begin Message ---
> when using session registered variables
> i can only get them to save as session variables for one page
> then on the next page they are gone
> far as i can tell the variables are not getting written over or unset
> and the session is not gettting destroyed
> any other ideas what it might be?

Do you have session_start() on the second page?

---John Holmes...


--- End Message ---
--- Begin Message ---
Hey
Also in your php.ini do you have
session.use_cookies = 1
if its set to 0 then you will need to pass  the variables through the URL.

- Lee

"Jason Romero" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> when using session registered variables
> i can only get them to save as session variables for one page
> then on the next page they are gone
> far as i can tell the variables are not getting written over or unset
> and the session is not gettting destroyed
> any other ideas what it might be?
>
> Jason
>
>


--- End Message ---
--- Begin Message ---
Hey again.
In the php.ini if
register_globals = Off  - which is the default setting
then you will need to use $_SESSION['variable']

- Lee

"Jason Romero" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> when using session registered variables
> i can only get them to save as session variables for one page
> then on the next page they are gone
> far as i can tell the variables are not getting written over or unset
> and the session is not gettting destroyed
> any other ideas what it might be?
>
> Jason
>
>


--- End Message ---
--- Begin Message ---
There does not seem to be an 'IF' statement?????

Bret


Register your Domain for as little as $8.95 yr.
At pgaws.com
Find a contractor or find a contract at Tech-Temp.com

----- Original Message -----
From: "Rodrigo de Oliveira" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 26, 2002 6:47 PM
Subject: [PHP] Problems with a simple While-If condition


This is the fact:

I'm building a homepage that can access a mysql database, and display the
records within a certain condition. Following this it is verified if the sql
result was empty then  it should write a certain frase, if not it should
write the records. I've got the worst part ok, the while that display the
results, but the if isn't being verified, it writes the frase anyway.
Please help, the code is right under the file name:


indicador.php

<?
include "db_dados.php";
?>
<?  $sql = "SELECT * FROM tb_tao WHERE area='$area'and status=1";
    $res = @mysql_query($sql,$id)
?>

<?
echo "<table width='100%' height='100%' border='0' align='center'>"
?>

<?
echo "<tr><td><div align='center'>Nenhum profissional
cadastrado.</div></td></tr>";
?>
<?
while ($row = mysql_fetch_array($res)) {
?>
<?
echo"<tr><td>ID Profissional</td>";
echo"<td>".$row['id']."</td></tr>";

echo"<tr><td>Nome</td>";
echo"<td>".$row['nome']."</td></tr>";

echo"<tr><td>Profissão</td>";
echo"<td>".$row['area']."</td></tr>";

echo"<tr><td>Bairro</td>";
echo"<td>".$row['bairro']."</td></tr>";

echo"<tr><td>Telefone</td>";
echo"<td>".$row['telefone']."</td></tr>";

echo"<tr><td>E-mail</td>";
echo"<td>".$row['email']."</td></tr>";

echo"<tr><td>Telefone Celular</td>";
echo"<td>".$row['celular']."</td></tr>";

echo"<tr><td>Registro Profissional</td>";
echo"<td>".$row['regprof']."</td></tr>";

echo"<tr><td>Endereço</td>";
echo"<td>".$row['endereco']."</td></tr>";

echo"<tr><td>&nbsp;</td>";
echo"<td>&nbsp;</td></tr>";


?>
<?
 }
?>
<?
echo"</table>";
?>


db_dados.php

<?
$id = mysql_connect("localhost","rodrigo","g3mston3")or die ('I cannot
connect to the database.');
$con = mysql_select_db("db_tao");
?>


--- End Message ---
--- Begin Message ---
try using the extract command instead of the array reference
ie:
<?
while ($row = mysql_fetch_array($res)) {
extract($row);

echo"<tr><td>ID Profissional</td>";
echo"<td>$id</td></tr>";
?>

instead of :
while ($row = mysql_fetch_array($res)) {
?>
<?
echo"<tr><td>ID Profissional</td>";
echo"<td>".$row['id']."</td></tr>";


Jason



"Rodrigo De Oliveira" <[EMAIL PROTECTED]> wrote in message
002501c295a6$3e048ab0$6ed4a5c8@soho">news:002501c295a6$3e048ab0$6ed4a5c8@soho...
This is the fact:

I'm building a homepage that can access a mysql database, and display the
records within a certain condition. Following this it is verified if the sql
result was empty then  it should write a certain frase, if not it should
write the records. I've got the worst part ok, the while that display the
results, but the if isn't being verified, it writes the frase anyway.
Please help, the code is right under the file name:


indicador.php

<?
include "db_dados.php";
?>
<?  $sql = "SELECT * FROM tb_tao WHERE area='$area'and status=1";
    $res = @mysql_query($sql,$id)
?>

<?
echo "<table width='100%' height='100%' border='0' align='center'>"
?>

<?
echo "<tr><td><div align='center'>Nenhum profissional
cadastrado.</div></td></tr>";
?>
<?
while ($row = mysql_fetch_array($res)) {
?>
<?
echo"<tr><td>ID Profissional</td>";
echo"<td>".$row['id']."</td></tr>";

echo"<tr><td>Nome</td>";
echo"<td>".$row['nome']."</td></tr>";

echo"<tr><td>Profissão</td>";
echo"<td>".$row['area']."</td></tr>";

echo"<tr><td>Bairro</td>";
echo"<td>".$row['bairro']."</td></tr>";

echo"<tr><td>Telefone</td>";
echo"<td>".$row['telefone']."</td></tr>";

echo"<tr><td>E-mail</td>";
echo"<td>".$row['email']."</td></tr>";

echo"<tr><td>Telefone Celular</td>";
echo"<td>".$row['celular']."</td></tr>";

echo"<tr><td>Registro Profissional</td>";
echo"<td>".$row['regprof']."</td></tr>";

echo"<tr><td>Endereço</td>";
echo"<td>".$row['endereco']."</td></tr>";

echo"<tr><td>&nbsp;</td>";
echo"<td>&nbsp;</td></tr>";


?>
<?
 }
?>
<?
echo"</table>";
?>


db_dados.php

<?
$id = mysql_connect("localhost","rodrigo","g3mston3")or die ('I cannot
connect to the database.');
$con = mysql_select_db("db_tao");
?>



--- End Message ---
--- Begin Message ---
If index.php is the index page of your website, then you do not need to
specify it at all.

i.e. www.whatever.com/index.php?uName=Kris

is functionally equivalent to www.whatever.com?uName=Kris

A way to get rid of the variables passed in the query string is to use
POST instead of GET as the method of your HTML form.


Hope this helps,


Marco
-- 
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers

Come visit us at http://www.phparch.com!
--- Begin Message ---
Hi

When I pass variables to a new page in the address bare of the browser it looks like

www.whatever.com/index.php?uName=Kris&passWd=1234

How can I hide this so it's just

www.whatever.com/index.php or even better just

www.whatever.com

thanks

Kris

--- End Message ---
--- End Message ---
--- Begin Message ---
I already use POST as the form method.
I know
www.whatever.com/index.php?uName=Kris can be the same as
www.whatever.com?uName=Kris

I just want to get rid of the ?uName=Kris part on the end
I still need the variables to be passed I just don't want the user to be
able to see them.

Thanks for your help

Kris

----- Original Message -----
From: "Marco Tabini" <[EMAIL PROTECTED]>
To: "Kris" <[EMAIL PROTECTED]>
Cc: "PHP-General" <[EMAIL PROTECTED]>
Sent: Wednesday, November 27, 2002 9:12 AM
Subject: Re: [PHP] URL hiding


> If index.php is the index page of your website, then you do not need to
> specify it at all.
>
> i.e. www.whatever.com/index.php?uName=Kris
>
> is functionally equivalent to www.whatever.com?uName=Kris
>
> A way to get rid of the variables passed in the query string is to use
> POST instead of GET as the method of your HTML form.
>
>
> Hope this helps,
>
>
> Marco
> --
> ------------
> php|architect - The magazine for PHP Professionals
> The first monthly worldwide magazine dedicated to PHP programmers
>
> Come visit us at http://www.phparch.com!
>


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


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

--- End Message ---
--- Begin Message ---
Then the only solution I can think of is to make them part of the POST
variables somehow--ie. through a hidden field, which you can even fill
dynamically with Javascript. AFAIK that's the only way.

Cheers,


Marco
-- 
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers

Come visit us at http://www.phparch.com!
--- Begin Message ---
I already use POST as the form method.
I know
www.whatever.com/index.php?uName=Kris can be the same as
www.whatever.com?uName=Kris

I just want to get rid of the ?uName=Kris part on the end
I still need the variables to be passed I just don't want the user to be
able to see them.

Thanks for your help

Kris

----- Original Message -----
From: "Marco Tabini" <[EMAIL PROTECTED]>
To: "Kris" <[EMAIL PROTECTED]>
Cc: "PHP-General" <[EMAIL PROTECTED]>
Sent: Wednesday, November 27, 2002 9:12 AM
Subject: Re: [PHP] URL hiding


> If index.php is the index page of your website, then you do not need to
> specify it at all.
>
> i.e. www.whatever.com/index.php?uName=Kris
>
> is functionally equivalent to www.whatever.com?uName=Kris
>
> A way to get rid of the variables passed in the query string is to use
> POST instead of GET as the method of your HTML form.
>
>
> Hope this helps,
>
>
> Marco
> --
> ------------
> php|architect - The magazine for PHP Professionals
> The first monthly worldwide magazine dedicated to PHP programmers
>
> Come visit us at http://www.phparch.com!
>


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


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


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

--- End Message ---
--- End Message ---
--- Begin Message ---
There may be an easier way, but I usually use sessions when I want to pass
variables around that I want to remain hidden, but want to use links.

Best Regards
Bob Irwin
Server Admin & Web Programmer
Planet Netcom
----- Original Message -----
From: "Kris" <[EMAIL PROTECTED]>
Cc: "PHP-General" <[EMAIL PROTECTED]>
Sent: Wednesday, November 27, 2002 10:39 AM
Subject: Re: [PHP] URL hiding


> I already use POST as the form method.
> I know
> www.whatever.com/index.php?uName=Kris can be the same as
> www.whatever.com?uName=Kris
>
> I just want to get rid of the ?uName=Kris part on the end
> I still need the variables to be passed I just don't want the user to be
> able to see them.
>
> Thanks for your help
>
> Kris
>
> ----- Original Message -----
> From: "Marco Tabini" <[EMAIL PROTECTED]>
> To: "Kris" <[EMAIL PROTECTED]>
> Cc: "PHP-General" <[EMAIL PROTECTED]>
> Sent: Wednesday, November 27, 2002 9:12 AM
> Subject: Re: [PHP] URL hiding
>
>
> > If index.php is the index page of your website, then you do not need to
> > specify it at all.
> >
> > i.e. www.whatever.com/index.php?uName=Kris
> >
> > is functionally equivalent to www.whatever.com?uName=Kris
> >
> > A way to get rid of the variables passed in the query string is to use
> > POST instead of GET as the method of your HTML form.
> >
> >
> > Hope this helps,
> >
> >
> > Marco
> > --
> > ------------
> > php|architect - The magazine for PHP Professionals
> > The first monthly worldwide magazine dedicated to PHP programmers
> >
> > Come visit us at http://www.phparch.com!
> >
>
>
> --------------------------------------------------------------------------
--
> ----
>
>
> > --
> > 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
>
>
> Scanned by PeNiCillin http://safe-t-net.pnc.com.au/
>
> Scanned by PeNiCillin http://safe-t-net.pnc.com.au/
>

--- End Message ---
--- Begin Message --- Have you index.php page as a frameset, and load all pages into the frameset. No matter where the user is on your site, they'll just see http://www.whatever.com

Kris wrote:
Hi

When I pass variables to a new page in the address bare of the browser it looks like

www.whatever.com/index.php?uName=Kris&passWd=1234

How can I hide this so it's just

www.whatever.com/index.php or even better just

www.whatever.com

thanks

Kris



--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
Thanks Kyle, got it working like a treat :) for some reason it wasn't
selecting the DB but it is now :D

> -----Original Message-----
> From: Kyle Gibson [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 27 November 2002 10:05 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: deleting a record.
>
>
> > <?
> > // get the list of resellers from the db
> > $res = mysql_query("SELECT * FROM resellers ORDER BY id");
> >
> > // print all records in the DB
> > while ($myrow = mysql_fetch_array($res)){
> > echo "<tr><td><div align='center'><font
> > class=\"content\">".$myrow['id']."</font></div>
> </td><td>&nbsp;</td><td><div
> > align='justify'><font
> > class=\"content\">".$myrow['company']."</font></div></td>";
> >     printf("<td><font class='content'><a
> >
> href=\"%s?op=resellers&id=%s&delete=yes\">(DELETE)</a></font></td></tr>",
> > $PHP_SELF, $myrow["id"]);
> > }?>
>
> There's an easier way to display this. It should make your life
> easier...made mine.
>
> Take a look:
>
> <?
> // get the list of resellers from the db
> $res = mysql_query("SELECT * FROM resellers ORDER BY id");
>
> // print all records in the DB
> while ($myrow = mysql_fetch_array($res)): ?>
> <tr><td><div align='center'>
> <font class="content"><?=$myrow['id']?></font>
> </div></td><td>&nbsp;</td><td>
> <div align='justify'><font class="content">
> <?=$myrow['company']?></font></div></td><td><font class="content">
> <a href="<?=$PHP_SELF?>?op=resellers&id=<?=$myrow['id']?>&delete=yes">
> (DELETE)</a></font></td></tr>
> <? endwhile; ?>
>
>
> > now when I click on delete it just reloads the page and doesn't
> delete the
> > record. I have this code before anything else on the page to handle the
> > delete...
> >
> > if($delete){
> > $res= mysql_query("DELETE FROM resellers WHERE id=$id");
> > header("Location: admin2.php?op=resellers");
> > }
>
> What you should do here is check to see if $res is failing, simply by
> doing the following:
>
> if(!$res) echo "error";
>
> Then, place an 'exit;' after the header(...) command to see if the
> $delete variable is actually being passed.
>
> --
> Kyle Gibson
> admin(at)frozenonline.com
> http://www.frozenonline.com/
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
<?
include "db_dados.php";
?>
<?  $sql = "SELECT * FROM tb_tao WHERE area='$area'and status=1";
    $res = @mysql_query($sql,$id)
?>

<?
echo "<table width='100%' height='100%' border='0' align='center'>"
?>

<?
$rodrigo=mysql_fetch_array($res);
if($rodrigo=false){
echo "<tr><td><div align='center'>Nenhum profissional cadastrado.</div></td></tr>";
}
?>
<?
while ($row = mysql_fetch_array($res)) {
?>
<?
echo"<tr><td>ID Profissional</td>";
echo"<td>".$row['id']."</td></tr>";

echo"<tr><td>Nome</td>";
echo"<td>".$row['nome']."</td></tr>";

echo"<tr><td>Profissão</td>";
echo"<td>".$row['area']."</td></tr>";

echo"<tr><td>Bairro</td>";
echo"<td>".$row['bairro']."</td></tr>";

echo"<tr><td>Telefone</td>";
echo"<td>".$row['telefone']."</td></tr>";

echo"<tr><td>E-mail</td>";
echo"<td>".$row['email']."</td></tr>";

echo"<tr><td>Telefone Celular</td>";
echo"<td>".$row['celular']."</td></tr>";

echo"<tr><td>Registro Profissional</td>";
echo"<td>".$row['regprof']."</td></tr>";

echo"<tr><td>Endereço</td>";
echo"<td>".$row['endereco']."</td></tr>";

echo"<tr><td>&nbsp;</td>";
echo"<td>&nbsp;</td></tr>";


?>
<?
 }
?>
<?
echo"</table>";
?>
--- End Message ---
--- Begin Message ---
Hello -
There were several discussions on how to do zip code location lookups,
distance checks, zipcode data, etc. Well, for everyone that was following
those threads, check this out:
http://www.sanisoft.com/ziploc/

Opensource (and free) php class to do everything you zipcode distances.
Downright handy to have.

Thanks -

--Brian


--- End Message ---
--- Begin Message ---
You might also want to look at this solution. It seems functional and
elegant, worked simply for me...

http://codewalkers.com/tutorials.php?show=28&page=1


> On 11/26/2002 01:42 PM, Shane McBride wrote:
>> It's been a while since I have done any PHP work. I am creating an online
>> employment application using multiple forms for a client. I was going to use
>> PHP. I don't remember if I need to pass variables along with the form for
>> each page, or can I just call them on the last page.
>> 
>> The application form is very long. Any ideas? There may be a script that
>> exists already?
> 
> Yes, you may want to try this class. It lets you compose and process
> multipage forms in two modes: sequential access (wizard like with
> buttons Next >>, << Back, Finish >> and cancel) and random access
> (tabbed pages like with edit or view only modes).
> 
> http://www.phpclasses.org/multipageforms
> 
> 
> http://www.phpclasses.org/browse.html/file/348/view/1/name/test_random_form_pa
> ge.html
> 
> http://www.phpclasses.org/browse.html/file/349/view/1/name/test_sequential_for
> m_page.html
> 
> -- 
> 
> Regards,
> Manuel Lemos


--- End Message ---
--- Begin Message ---
Oh, ok. That makes a lot more sense. Thanks for the info John   :)

- Nilaab

> -----Original Message-----
> From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 26, 2002 4:00 PM
> To: @ Nilaab; [EMAIL PROTECTED]
> Subject: Re: [PHP] Multiple page form
>
>
> > Is there an actual way to store the data in a temporary table as you go
> > through the multi-page form and then extract that data from the
> temporary
> > storage from the DB App and either process the data or store it in a
> > permanent place?
> >
> > I have never done this before, but maybe someone else has? Any
> tips on how
> > to do this, what "type(s)" of DB tables are required to do this and can
> you
> > give me an url to help me research it further?
> >
> > I think this would be a great alternative to the sessions
> solution because
> > it doesn't work really well with some PHP error handling that
> you need to
> do
> > for the forms. You have to register and unregister variables throughout
> the
> > form and it gets hard to keep track of when you have so many forms and
> field
> > variables to deal with. With a temporary DB table, I can just insert any
> > data that has been checked for errors and then not have to worry about
> > passing them back and forth until the end of the application when I
> actually
> > need to do something with them.
>
> So don't add it to the session until you've verified the data.
> It's the same
> as using a temp table but you don't have to worry about the
> overhead of the
> database and you don't have to worry about cleanup with sessions.
>
> Also, a true TEMPORARY table will only be there for the current
> connection,
> so on the next page request, the table will be gone.
>
> ---John Holmes...
>

--- End Message ---
--- Begin Message ---
You could try Sendmail, it comes with it's own version of Linux for free
:)

Just kidding, you sounded too serious.

        Bryan

On Tue, 26 Nov 2002, Manuel Ochoa wrote:

|
|I'm setting up a Windows 2000 server with Apache, PHP and MySQL. I also need to setup 
|email service for 1 domain name.
|
|I'm looking for any suggestions on SMTP software.
|

--- End Message ---
--- Begin Message ---
howdy,

I've had a look around and haven't been able to find what I'm after..

What I'm trying to do is display the number of each individual record with
in a table in a db WITH OUT relying on the records id, here what I've come
up with so far:

//get and count the number of records in the table
$result = mysql_query("SELECT count(*) AS num FROM resellers");
$num = mysql_result($result,0,"num");

//display the number of records
for ($i = 1; $i <= $num; $i++) {?>
<td><div align='center'>
<font class="content"><?//=$myrow['id']

    print $i;?>
</font>
</div></td>
<?}

now this all works except that it displays 12345etc in every cell of the
html table when i need it to display as

1
2
3
4
5
etc

with each number on a new row in the html table ..

TIA & I hope i've made what am after clear enough...

Cheers

Peter
"the only dumb question is the one that wasn't asked"


--- End Message ---
--- Begin Message ---
$result = mysql_query("select * from [database table]");

echo "<table>";

while($data = mysql_fetch_array($result))
{
        $count++;
        echo "<tr>";
        echo "<td>$count</td>";
        echo "<td>$data[0]</td>";
        echo "<td>$data[1]</td>";
        ...and so on....
        echo "</tr>";

}

echo "</table>";

This will give you a row number for each row.

Robbert van Andel 

-----Original Message-----
From: Peter Houchin [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 26, 2002 4:49 PM
To: php_gen
Subject: [PHP] displaying record number in a cell in a table


howdy,

I've had a look around and haven't been able to find what I'm after..

What I'm trying to do is display the number of each individual record with
in a table in a db WITH OUT relying on the records id, here what I've come
up with so far:

//get and count the number of records in the table
$result = mysql_query("SELECT count(*) AS num FROM resellers");
$num = mysql_result($result,0,"num");

//display the number of records
for ($i = 1; $i <= $num; $i++) {?>
<td><div align='center'>
<font class="content"><?//=$myrow['id']

    print $i;?>
</font>
</div></td>
<?}

now this all works except that it displays 12345etc in every cell of the
html table when i need it to display as

1
2
3
4
5
etc

with each number on a new row in the html table ..

TIA & I hope i've made what am after clear enough...

Cheers

Peter
"the only dumb question is the one that wasn't asked"



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

--- End Message ---
--- Begin Message ---
Thanks Robert

> -----Original Message-----
> From: Van Andel, Robert [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 27 November 2002 11:43 AM
> To: Peter Houchin; php_gen
> Subject: RE: [PHP] displaying record number in a cell in a table
>
>
> $result = mysql_query("select * from [database table]");
>
> echo "<table>";
>
> while($data = mysql_fetch_array($result))
> {
>       $count++;
>       echo "<tr>";
>       echo "<td>$count</td>";
>       echo "<td>$data[0]</td>";
>       echo "<td>$data[1]</td>";
>       ...and so on....
>       echo "</tr>";
>
> }
>
> echo "</table>";
>
> This will give you a row number for each row.
>
> Robbert van Andel
>
> -----Original Message-----
> From: Peter Houchin [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 26, 2002 4:49 PM
> To: php_gen
> Subject: [PHP] displaying record number in a cell in a table
>
>
> howdy,
>
> I've had a look around and haven't been able to find what I'm after..
>
> What I'm trying to do is display the number of each individual record with
> in a table in a db WITH OUT relying on the records id, here what I've come
> up with so far:
>
> //get and count the number of records in the table
> $result = mysql_query("SELECT count(*) AS num FROM resellers");
> $num = mysql_result($result,0,"num");
>
> //display the number of records
> for ($i = 1; $i <= $num; $i++) {?>
> <td><div align='center'>
> <font class="content"><?//=$myrow['id']
>
>     print $i;?>
> </font>
> </div></td>
> <?}
>
> now this all works except that it displays 12345etc in every cell of the
> html table when i need it to display as
>
> 1
> 2
> 3
> 4
> 5
> etc
>
> with each number on a new row in the html table ..
>
> TIA & I hope i've made what am after clear enough...
>
> Cheers
>
> Peter
> "the only dumb question is the one that wasn't asked"
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
I have an array $keywords, how do I test to see if it is empty?  $keywords == '' seems 
to throw out an error.

--- End Message ---
--- Begin Message ---
I believe if(empty($keywords)) or even if(!$keywords) will check if they are empty

Robbert van Andel 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 26, 2002 4:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] testing for empty array


I have an array $keywords, how do I test to see if it is empty?  $keywords == '' seems 
to throw out an error.


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

--- End Message ---
--- Begin Message ---
I have an array $keywords, how do I test to see if it is empty?  $keywords == '' seems to throw out an error.
Maybe...

if(count($keywords) <= 0)
{
	//...
}


--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/

--- End Message ---
--- Begin Message ---
On Tue, 26 Nov 2002, Kyle Gibson wrote:

> > I have an array $keywords, how do I test to see if it is empty?
> > $keywords == '' seems to throw out an error.
>
> Maybe...
>
> if(count($keywords) <= 0)
> {
>       //...
> }

  I use sizeof(), which apparently is an alias to count(), and it works
  fine, so count() should do the trick.

  if ( !sizeof($keywords) )
    print "keywords is empty";

-- 
   Morgan Hughes
   C programmer and highly caffeinated mammal.
   [EMAIL PROTECTED]
   ICQ: 79293356


--- End Message ---
--- Begin Message ---
hi to all;

sorry for posting this mysql question again. im searching for a report
builder for mysql specifically for creating reports for
invoice/receipt..etc.
just like crystal reports and oracle report builder. or  is there any
suggestion to do it  in PHP .

any idea? thanks in advance



Regards,

mike

--- End Message ---
--- Begin Message ---
> sorry for posting this mysql question again. im searching for a report
> builder for mysql specifically for creating reports for
> invoice/receipt..etc.
> just like crystal reports and oracle report builder. or  is there any
> suggestion to do it  in PHP .

Get any of the hundreds of PDF classes out there and create your reports
with those...

---John Holmes...


--- End Message ---
--- Begin Message --- It's not the same as simply generating a report in PDF. He's looking for a band-type of report writer with groupoing levels, automatic totals, subtotals, sub reports, drag anddrop fields, right click formatting options, etc. One of the great leaps backwards with PHP, or any of the scripting language, has been reversion to the hand-coding of reports.

On the other hand, the output device is a browser, so one cannot get too fancy - hence generate a PDF. After looking at the PDF library that's not a task I'd gladly undertake.

Cheers - Miles

At 09:08 PM 11/26/2002 -0500, John W. Holmes wrote:
> sorry for posting this mysql question again. im searching for a report
> builder for mysql specifically for creating reports for
> invoice/receipt..etc.
> just like crystal reports and oracle report builder. or  is there any
> suggestion to do it  in PHP .

Get any of the hundreds of PDF classes out there and create your reports
with those...

---John Holmes...



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

--- End Message ---
--- Begin Message ---
Hi Mike;

> sorry for posting this mysql question again. im searching for a report
> builder for mysql specifically for creating reports for
> invoice/receipt..etc.
> just like crystal reports and oracle report builder. or  is there any
> suggestion to do it  in PHP .


On my travels (FWIW) I have seen nothing as sophisticated as
Crystal/Oracle*Reports (and certainly not open/free) - however I have been
v.pleased not to be asked to provide such (well I was once, but he was such
an Excel 'expert', I gave him the data and let him while away many 'happy'
hours...)

You have reminded me that before I was dragged away onto another
project/product set, I had started to play with JaneBuilder
(www.seejanecode.com/). Which is really simple but seems to do a heap of
basic 'grunt work' of turning table schema into display/data-entry forms,
etc. May be a start!?

Please let us know your findings,
=dn

--- End Message ---
--- Begin Message ---
Hi, everyone:
    I am a Chinese, I am a programmer.
    I encounter a problem about php.
    Attachment is 1.php,
    when i open this file (this file is saved at linux server, apache and
php 4.2.3 are installed on this server) in Internet Explorer, error
displays:

     Parse error: parse error, expecting `','' or `';'' in
/usr/3give/test/1.php on line 5


    (If your computer is windows 2000, and Simplify Chinese and Traditional
chinese language are installed) you will read the Chinese word.

    I found that if the hex code for Chinese word ends with '5C', then the
error will exist.
    Anymore, if I input a Chinese word which hex code ends with '5C' in the
database field, then the display result will add a suffix '\', for example,
if i input "ÖÐß\", it will display "ÖÐß\\" at the browser (Internet
explorer).
    I don't know why this problem exist, can you solve this problem for us?

 Contact me by: [EMAIL PROTECTED]; (86)755-27232311->samuel

Best regards
Thanks.
Samuel







--- End Message ---
--- Begin Message --- I am not positive of the problem as I can not see your code, but if you want to display the words that end in '5C' the you can do them like so:
\(escape character) like this: \(95 5C 5C)

If you could sttach some code we might have a better idea.

-tom culpepper

[EMAIL PROTECTED] wrote:
Hi, everyone:
    I am a Chinese, I am a programmer.
    I encounter a problem about php.
    Attachment is 1.php,
    when i open this file (this file is saved at linux server, apache and
php 4.2.3 are installed on this server) in Internet Explorer, error
displays:

     Parse error: parse error, expecting `','' or `';'' in
/usr/3give/test/1.php on line 5


    (If your computer is windows 2000, and Simplify Chinese and Traditional
chinese language are installed) you will read the Chinese word.

    I found that if the hex code for Chinese word ends with '5C', then the
error will exist.
    Anymore, if I input a Chinese word which hex code ends with '5C' in the
database field, then the display result will add a suffix '\', for example,
if i input "ÖÐß\", it will display "ÖÐß\\" at the browser (Internet
explorer).
    I don't know why this problem exist, can you solve this problem for us?

 Contact me by: [EMAIL PROTECTED]; (86)755-27232311->samuel

Best regards
Thanks.
Samuel









--- End Message ---
--- Begin Message ---
Hi, everyone:
    I am a Chinese, I am a programmer.
    I encounter a problem about php.
    Attachment is 1.php,
    when i open this file (this file is saved at linux server, apache and
php 4.2.3 are installed on this server) in Internet Explorer, error
displays:

     Parse error: parse error, expecting `','' or `';'' in
/usr/3give/test/1.php on line 5


    (If your computer is windows 2000, and Simplify Chinese and Traditional
chinese language are installed) you will read the Chinese word.

    I found that if the hex code for Chinese word ends with '5C', then the
error will exist.
    Anymore, if I input a Chinese word which hex code ends with '5C' in the
database field, then the display result will add a suffix '\', for example,
if i input "ÖÐß\", it will display "ÖÐß\\" at the browser (Internet
explorer).
    I don't know why this problem exist, can you solve this problem for us?

 Contact me by: [EMAIL PROTECTED]; (86)755-27232311->samuel

Best regards
Thanks.
Samuel









begin 666 1.php
M/#\*"65C:&\@(G-T87)T:6YG(CL@"@EE8VAO("+?7" B.R *"65C:&\@(M]<
M(CL@"@EE8VAO("*Y^KQ<(CL*"65C:&\@(KGZO%P@(CL*"65C:&\@(F5N9&EN
(9R([( H_/@H`
`
end

--- End Message ---
--- Begin Message ---
Hello,

"Tom Culpepper" <[EMAIL PROTECTED]> wrote:

> I am not positive of the problem as I can not see your code, but if you
> want to display the words that end in '5C' the you can do them like so:
> \(escape character)  like this: \(95 5C 5C)

Putting a space (or some other character) after the character in question is
actually a good "workaround"--though not really a solution :(

Anyway, this kind of problem also exist with Chinese characters used in
Japanese (sjis encoding).

There could be various ways to handle this but here are some:
1. Try using a different encoding. Like utf-8 or some other Chinese
encoding. (In Japanese, you can use euc instead of sjis.)
2. Creating your own addslashes function for "escaping".

These are basically from the Japanese ML: (It's, of course, in Japanese.)

  http://ns1.php.gr.jp/pipermail/php-users/2001-August/001641.html

By the way Samuel,  there's a patched version of php that I've mention here:

  http://marc.theaimsgroup.com/?l=php-general&m=103781121614978&w=2

The patched version corrected some problems having to do with multi-byte
strings so it might just work for Chinese as well. There were also some
other info in the site I mentioned above but I'm afraid they're all in
Japanese so...

Anyway, I justed to post some ideas that might help.

Also, please make sure to check the manual about multibyte strings--

  http://www.php.net/manual/en/ref.mbstring.php

- E

--- End Message ---
--- Begin Message ---
Hello,
      I am a newbie in this PHP world.  I was just looking around for
information on Download of files using PHP.
I need to provide link/button, by clicking which a user can download a file
(Say a CSV file..). Does PHP provide any class or methods to achieve the
same...? Looking forward for your suggestions ...

Thanking in advance !!!
Venkatesh Hosur


--- End Message ---
--- Begin Message ---
--- Venkatesh Hosur <[EMAIL PROTECTED]> wrote:

> I was just looking around for information on Download
> of files using PHP. I need to provide link/button, by
> clicking which a user can download a file (Say a CSV
> file..)

The best solution, in my opinion, is just to use a straightforward
HTML link:

<a href="http://yourserver.org/foo.csv";>Download foo.csv</a>

The only caveat to this is that you must make the file available as a
URL, meaning it must be stored under document root.

If you instead want to have a PHP application decide whether the user
is allowed to download the file as a way to restrict access to it,
that's a different question. :-)

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

> I am a newbie in this PHP world.  I was just looking around for
> information on Download of files using PHP.
> I need to provide link/button, by clicking which a user can download a file
> (Say a CSV file..). Does PHP provide any class or methods to achieve the
> same...? Looking forward for your suggestions ...

Why do you need it to be anything to do with PHP?  You need to tell us more
information, because plain HTML like this works fine:

<a href="myfile.csv">Click here to download the CSV file</a>

...but I assume you want to restrict file downloads to only logged in users,
or you wish to count the number of downloads, or something else??


Justin French
--------------------
http://Indent.com.au
Web Development & 
Graphic Design
--------------------

--- End Message ---
--- Begin Message ---
Yes, we are way off topic.

You offered a solution, and it rang warning bells for me from an
accessibility P.O.V...  yes, I miss-quoted the spec, but yes, i'm right
about IE, and almost every developer using px should be very worried for
quite some time, until it gets addressed.

Cheers,

Justin

--- End Message ---
--- Begin Message ---
On Wednesday 27 November 2002 05:56, The Gabster wrote:
> Thanks Jason...
>
> I went through those but so far nothing in php... :-(

> > google -> mailing list manager software

<SIGH>

Try adding 'php' to the list of search terms above.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Of course it's possible to love a human being if you don't know them too well.
                -- Charles Bukowski
*/

--- End Message ---
--- Begin Message ---
Where should i start, tips wanted.

I would like to check a username string for valid charactors before the name
is processed.

Someone point me in the right direction please

---
Philip J. Newman.
Head Developer.
PhilipNZ.com New Zealand Ltd.
http://www.philipnz.com/
[EMAIL PROTECTED]

Mob: +64 (25) 6144012.
Tele: +64 (9) 5769491.

VitalKiwi Site:
Philip J. Newman
Internet Developer
http://www.newman.net.nz/
[EMAIL PROTECTED]

*****************************
  Friends are like Stars,
  You can't always see them,
  But you know they are there.

*****************************

ICQ#: 20482482
MSN ID: [EMAIL PROTECTED]
Yahoo: [EMAIL PROTECTED]
AIM: newmanpjkiwi


--- End Message ---
--- Begin Message ---
lookup ereg() and eregi()

-tom culpepper

Philip J. Newman wrote:
Where should i start, tips wanted.

I would like to check a username string for valid charactors before the name
is processed.

Someone point me in the right direction please

---
Philip J. Newman.
Head Developer.
PhilipNZ.com New Zealand Ltd.
http://www.philipnz.com/
[EMAIL PROTECTED]

Mob: +64 (25) 6144012.
Tele: +64 (9) 5769491.

VitalKiwi Site:
Philip J. Newman
Internet Developer
http://www.newman.net.nz/
[EMAIL PROTECTED]

*****************************
  Friends are like Stars,
  You can't always see them,
  But you know they are there.

*****************************

ICQ#: 20482482
MSN ID: [EMAIL PROTECTED]
Yahoo: [EMAIL PROTECTED]
AIM: newmanpjkiwi




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

if(!preg_match("/^[a-z0-9_]*$/", $username))
    {
    // the string contained a char other than a-z, 0-9 and _ (underscore)
    }

Season to taste :)

Justin




on 27/11/02 6:18 PM, Philip J. Newman ([EMAIL PROTECTED]) wrote:

> Where should i start, tips wanted.
> 
> I would like to check a username string for valid charactors before the name
> is processed.
> 
> Someone point me in the right direction please
> 
> ---
> Philip J. Newman.
> Head Developer.
> PhilipNZ.com New Zealand Ltd.
> http://www.philipnz.com/
> [EMAIL PROTECTED]
> 
> Mob: +64 (25) 6144012.
> Tele: +64 (9) 5769491.
> 
> VitalKiwi Site:
> Philip J. Newman
> Internet Developer
> http://www.newman.net.nz/
> [EMAIL PROTECTED]
> 
> *****************************
> Friends are like Stars,
> You can't always see them,
> But you know they are there.
> 
> *****************************
> 
> ICQ#: 20482482
> MSN ID: [EMAIL PROTECTED]
> Yahoo: [EMAIL PROTECTED]
> AIM: newmanpjkiwi
> 
> 

Justin French
--------------------
http://Indent.com.au
Web Development & 
Graphic Design
--------------------

--- End Message ---
--- Begin Message ---
Gidday Philip,

Full answer: http://www.oreilly.com/catalog/regex/

Short answer: PHPBuilder etc have articles introducing the use of RegExes
(Regular Expressions) for this sort of thing.
(but please not the Arthurian "how do I validate an email address"...)

Regards,
=dn



> Where should i start, tips wanted.
>
> I would like to check a username string for valid charactors before the
name
> is processed.
>
> Someone point me in the right direction please
>
> ---
> Philip J. Newman.
> Head Developer.
> PhilipNZ.com New Zealand Ltd.
> http://www.philipnz.com/
> [EMAIL PROTECTED]
>
> Mob: +64 (25) 6144012.
> Tele: +64 (9) 5769491.
>
> VitalKiwi Site:
> Philip J. Newman
> Internet Developer
> http://www.newman.net.nz/
> [EMAIL PROTECTED]
>
> *****************************
>   Friends are like Stars,
>   You can't always see them,
>   But you know they are there.
>
> *****************************
>
> ICQ#: 20482482
> MSN ID: [EMAIL PROTECTED]
> Yahoo: [EMAIL PROTECTED]
> AIM: newmanpjkiwi
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Hello php-general,

  Hi.
  I want to know how i can export tree structure from Mysql table to
  XML
  mysql table structure is:
  ID - Group Unique Id
  P_ID - Parent Id
  Name - Name of group

  I want to make XML whit tree structure. Can some body help me!
  

-- 
Best regards,
 Boris                          mailto:[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Here's a start for you

<?
/* Connect to database */

$sql = "SELECT * FROM categories ORDER BY
parent_id,cat_id  ASC";

$result = @mysql_query($sql) or die("Couldn't select
categories."); 

$menu = array();

while ($row = mysql_fetch_array($result)) {
        $id = $row['cat_id'];
        $category = $row['category'];
        $pid = $row['parent_id'];
        
        $menu[$pid][$id] = $category;
}

function show_cats ($parent="", $indent="") {
global $menu;

foreach($menu as $key1 => $value1) {

        if ($key1 == $parent) {// if it's a top category
print it
        
                foreach ($value1 as $key2 => $value2) { 
                $catname = $value2; // $value2 same as
$value1[$key2]
                $catID = $key2;
                echo str_repeat("&nbsp;&nbsp;", $indent);
                echo "<a
href=\"search/show_results.php?catID=$catID\">$catname</a><br>";
                
show_cats($catID, $indent+1);
                }
                        
        }
}

} // end show_cats function

show_cats();
?> 

--- Boris Kolev <[EMAIL PROTECTED]> wrote:
> Hello php-general,
> 
>   Hi.
>   I want to know how i can export tree structure
> from Mysql table to
>   XML
>   mysql table structure is:
>   ID - Group Unique Id
>   P_ID - Parent Id
>   Name - Name of group
> 
>   I want to make XML whit tree structure. Can some
> body help me!
>   
> 
> -- 
> Best regards,
>  Boris                         
> mailto:[EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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

I want to know how can I redirect the browser to contact to a new ip
address of the same server.

In Detail

I have a server say 192.168.1.10 (eth0) running apache.( Linux Machine
running Apache).

I contact the server through a client(Browser), through this client
I change the

IP address of the server, from 192.168.1.10 to 192.168.1.15.


(After entering IP Address in the text field and clicking on the button
save I call

a perl script which calls ifconfig to change the address,perl script is
called with exec()   ).


After few seconds I get "Page cannot be found" message as the browser
tries to contact

the old IP address.

How can I make the client point to the new IP address of the same
server?

I can show the code also.

regards,
adharsh.

--- End Message ---
--- Begin Message ---
On Wednesday 27 November 2002 15:52, Adharsh Praveen R wrote:
> hai php-general,
>
> I want to know how can I redirect the browser to contact to a new ip
> address of the same server.
>
> In Detail
>
> I have a server say 192.168.1.10 (eth0) running apache.( Linux Machine
> running Apache).
>
> I contact the server through a client(Browser), through this client
> I change the
>
> IP address of the server, from 192.168.1.10 to 192.168.1.15.
>
>
> (After entering IP Address in the text field and clicking on the button
> save I call

Presumably this is done in a form and submitted to a php page which then calls 
your perl script?

> a perl script which calls ifconfig to change the address,perl script is
> called with exec()   ).
>
>
> After few seconds I get "Page cannot be found" message as the browser
> tries to contact
>
> the old IP address.
>
> How can I make the client point to the new IP address of the same
> server?

Have your php output a meta refresh tag.

> I can show the code also.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Encyclopedia for sale by father.  Son knows everything.
*/

--- End Message ---
--- Begin Message ---
Hai Jason,

Thanks a lot for the reply.

you are right I call the perl script in form page.

How to output a meta refresh tag from PHP? and is it in form or in the main page?

In form page after I call the perl script which changes the IP address of the
server,

I have header("Location:https://$HTTP_HOST/mainpage.php";);    ( I use https)

which tries to redirect to main page.

Can you please explain me where should I output meta refresh tag.

Is the meta refresh tag is the same as the one I have in HTML.

<meta http-equiv="refresh" content ="15">

regards,
adharsh.




Jason Wong wrote:

> On Wednesday 27 November 2002 15:52, Adharsh Praveen R wrote:
> > hai php-general,
> >
> > I want to know how can I redirect the browser to contact to a new ip
> > address of the same server.
> >
> > In Detail
> >
> > I have a server say 192.168.1.10 (eth0) running apache.( Linux Machine
> > running Apache).
> >
> > I contact the server through a client(Browser), through this client
> > I change the
> >
> > IP address of the server, from 192.168.1.10 to 192.168.1.15.
> >
> >
> > (After entering IP Address in the text field and clicking on the button
> > save I call
>
> Presumably this is done in a form and submitted to a php page which then calls
> your perl script?
>
> > a perl script which calls ifconfig to change the address,perl script is
> > called with exec()   ).
> >
> >
> > After few seconds I get "Page cannot be found" message as the browser
> > tries to contact
> >
> > the old IP address.
> >
> > How can I make the client point to the new IP address of the same
> > server?
>
> Have your php output a meta refresh tag.
>
> > I can show the code also.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Encyclopedia for sale by father.  Son knows everything.
> */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Wow this was really elegant!! thank you!! :-)


> if (0 < strlen(implode('',$a))) {
>     // error
> }
> 
> Stas




---------------------------------
Per te Blu American Express è gratis
--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, Robert McPeak
<[EMAIL PROTECTED]> wrote:

> I have other situations where I would like to somehow "spawn" a new php
> process so that the page loads quickly and my user doesn't get frustrated or
> confused.

Hang on, there's lots of talking around the point here. This is not
hard. Look in the manual under pcntl_fork. This will let you create a
separate process that stays running all the time (not just when you're
running a web page) and you can send commands to either using
pcntl_signal (docs are out of date - also look up "ticks") or through
your database. You will need to have the CGI version of PHP installed,
as well as mod_php - and in 4.3 this happens very easily.

Having said all that, I've run into a separate probem further down the
road doing just what you're wanting to do. My back-end process runs
perfectly with no problems but after 5 mins or so starts generating
"chunk/page already free" errors, then crashes. Looks to be a bug in
there somewhere, but not sure where yet.
--- End Message ---
--- Begin Message ---
Hello,

I want to read the parameters in the URL, but I can't find the right way to
do that. I've tried several things :

my URL is:  http://localhost/test.php?id=abc

I tried to use the $id, but in this case, I have a notice with 'undefined
variable'.
I have the same problem if I try the variable $QUERY_STRING (still undefined
variable).

Do you know what is the best way to read this parameters?

Many thanks
Stéphane


--- End Message ---
--- Begin Message ---
At 09:58 27.11.2002, Stéphane Génin said:
--------------------[snip]--------------------
>I want to read the parameters in the URL, but I can't find the right way to
>do that. I've tried several things :
>
>my URL is:  http://localhost/test.php?id=abc

Check out the PHP manual at
http://www.php.net/manual/en/reserved.variables.php#reserved.variables.get

>I tried to use the $id, but in this case, I have a notice with 'undefined
>variable'.
>I have the same problem if I try the variable $QUERY_STRING (still undefined
>variable).
>
>Do you know what is the best way to read this parameters?

Most certainly, register_globals is OFF in your php.ini. This is the
default setting since PHP 4.2, for security reasons. Read
http://www.php.net/manual/en/security.registerglobals.php
on the security issues with register_globals = on.

To access parameters, generally use the superglobals arrays $_GET
(parameters passed in the URL), $_POST (passed in posted forms), $_REQUEST
(both get and post combined), and $_COOKIE (cookies passed to your script).

Hope this gets you started. You may always find it helpful to refer to the
_extremely_ well done online manual at http://www.php.net/manual/en/.

Regards,

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


--- End Message ---
--- Begin Message ---
Use the superglobal array $_GET

echo $_GET{'id'}; // should return abc

Cheers

Scott

Stéphane Génin wrote, On 11/27/2002 10:58 AM:
Hello,

I want to read the parameters in the URL, but I can't find the right way to
do that. I've tried several things :

my URL is:  http://localhost/test.php?id=abc

I tried to use the $id, but in this case, I have a notice with 'undefined
variable'.
I have the same problem if I try the variable $QUERY_STRING (still undefined
variable).

Do you know what is the best way to read this parameters?

Many thanks
Stéphane



--
Scott Houseman
Senior Software Developer
Junk Mail Publishing (Pty) Ltd
T + 27 12 342 3840 ext 2806 F +27 12 342 3876
E [EMAIL PROTECTED] | www.junkmail.co.za
A 1312 Pretorius Street, Hatfield, Pretoria
P O Box 6574, Pretoria, 0001, South Africa
+27 82 491 8021

--- End Message ---
--- Begin Message ---
Stephane

http://www.php.net/manual/en/security.registerglobals.php

http://www.php.net/manual/en/faq.php

Substitute 'fr' for 'en' if your prefer it en francais

Use: $_GET['id'] or $_REQUEST['id']

Ciao
Rich
-----Original Message-----
From: Stéphane Génin [mailto:[EMAIL PROTECTED]]
Sent: 27 November 2002 08:58
To: [EMAIL PROTECTED]
Subject: [PHP] Newbie : How work with parameters?


Hello,

I want to read the parameters in the URL, but I can't find the right way to
do that. I've tried several things :

my URL is:  http://localhost/test.php?id=abc

I tried to use the $id, but in this case, I have a notice with 'undefined
variable'.
I have the same problem if I try the variable $QUERY_STRING (still undefined
variable).

Do you know what is the best way to read this parameters?

Many thanks
Stéphane



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



--- End Message ---
--- Begin Message --- I cannot seem to get RH8 to to compile XSLT support. Has anyone else gotten this to work? Anyone with the resulting php-xslt rpm?

Dan

--- End Message ---
--- Begin Message ---
Stephen wrote:
That's what I'm going to do but how can I pull it from the database to
decrypt it, then send it?
You can't. Well that depends what method you used to create the passwords, but most likely you used a one-way encryption.

How to solve the problem then?

1. User klicks link 'Forgot my password'
2. Generate a one-time password for this user. Do not change the users
ordinary password yet.
3. Send mail to user with the one-time pw. This must be a verified
mailaddress.
4. Let the user enter his login/mailaddress and the one-time pw to
login.
5. Let the user enter a new pw. Then update the dB.

That's one way to do it with reasonable security.

Regards
Joakim

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

> And when the user hits the Delete link a pop up dialog box (javascript

> style) asks for confirmation.

Not a big deal. Your PHP script has to generate Links like:

<a href="myscript.php?del=xy" onClick="return confirm('really
delete?')">delete</a>

where xy is the id of your record. The link will be followed after a
positive conformation, "myscript.php" can delete the record.

Good luck
Keith

--- End Message ---
--- Begin Message --- I use this javascript code:

function confirmAction(question, uri) {
if(confirm(question)){
document.location=uri + '&confirm=1';
}
return false;
}

create link like this:
<a href="delete.php" onclick="return confirmAction('Do you really ...?','delete.php?')">delete</a>

If user has javascript enabled, on delete.php you will get $_GET['confirm']=1, and you know the action
has been confirmed and go straight to deleting. If user has no javascript, you won't receive $_GET['confirm'],
thus you know you need to confirm the action using php/html.

PS: even if you don't need parameters to your script, add at least ? for it to work.

Wilmar Perez wrote:

Hello guys

I have an script that just shows a list of names brought from a data base as this:

name 1
name 2
etc...

I want to have the following:

name 1 Delete
name 2 Delete
etc...

And when the user hits the Delete link a pop up dialog box (javascript style) asks for confirmation.

I guess this is a simple task but being my first time mixing php and javascript variables I'm a bit confused. It would be nice if someone could point me at an example or a tutorial that may help me (I already did some searching but couldn't find anything useful).

Thanks a lot

*******************************************************
Wilmar Pérez
Network Administrator
Library System
Tel: ++57(4)2105962
University of Antioquia
Medellín - Colombia
2002 *******************************************************



--- End Message ---

Reply via email to