Re: [PHP] my paging task with PHP does not work. It uses cookie.

2007-09-19 Thread Patrik Hasibuan
Dear mike,

your thread solved my problem.

I really appreciate your help.

Thank you very much.

On Thu, 13 Sep 2007 14:49:29 -0700
mike <[EMAIL PROTECTED]> wrote:

> warning: this is VERY UGLY CODE. i wrote it 3-4 years ago now i think
> and it just keeps working.
> 
> you call it this way:
> 
> # pagination.
> if(isset($_GET['pg'])) {
> $page = intval($_GET['pg']);
> } else {
> $page = 1;
> }
> $page = sprintf("%02d",$page);
> 
> $query = Array(
> 'query' => "SELECT foo FROM bar",
> 'itemsperpage'  => 50,
> 'maxdisplay'=> 20,
> 'linkprefix'=> "$_SERVER[PHP_SELF]?f=$forum_id&pg="
> );
> list($pages,$numpages,$items,$threads) = paginate_sql($page,$query);
> 
> $pages is the html formatted links
> $numpages is the total number of pages
> i dont actually use $items much but i think it just tells you how many
> items (which is the same as itemsperpage... i believe)
> $threads is the mysql rows resource (you can use mysql_fetch_rows on it)
> 
> 
> 
> function paginate_sql(&$thispage,$options) {
> $offset = $options['itemsperpage'] * ($thispage - 1);
> if(isset($options['server'])) {
> $results = db_query(eregi_replace("^SELECT","SELECT
> SQL_CALC_FOUND_ROWS",$options['query'])."LIMIT
> $offset,$options[itemsperpage]",$options['server']);
> $rows = db_query("SELECT FOUND_ROWS()",$options['server']);
> } else {
> $results = db_query(eregi_replace("^SELECT","SELECT
> SQL_CALC_FOUND_ROWS",$options['query'])."LIMIT
> $offset,$options[itemsperpage]");
> $rows = db_query("SELECT FOUND_ROWS()");
> }
> list($totalitems) = db_rows($rows);
> db_free($rows);
> $html = "";
> $numpages = ceil($totalitems / $options['itemsperpage']);
> if(isset($options['maxpages']) && $numpages >
> $options['maxpages']) { $numpages = $options['maxpages']; }
> if($thispage < 1 || $totalitems < $options['itemsperpage']) {
> $thispage = sprintf("%02d",1); }
> if($thispage > $numpages && $numpages > 0) {
> header(sprintf("Location: %s01",
> str_replace("&","&",$options['linkprefix'])));
> exit();
> }
> $start = (ceil($thispage / $options['maxdisplay'])-1) *
> $options['maxdisplay'] + 1;
> if($start == 1) {
> $html .= "«";
> } else {
> $html .= sprintf("«",
> $options['linkprefix'], $start-1);
> }
> if(isset($options['maxdisplay']) && $options['maxdisplay'] !=
> 0 && $numpages > $options['maxdisplay']) {
> $numlist = $options['maxdisplay'] + $start - 1;
> } else {
> $numlist = $numpages + $start - 1;
> }
> if($numlist > $numpages) { $numlist = $numpages; }
> for($x=$start; $x<=$numlist; $x++) {
> if($x == $thispage) {
> $html .= sprintf(" %02d", $x);
> } else {
> $html .= sprintf("  href=\"%s%02d\">%02d", $options['linkprefix'], $x, $x);
> }
> }
> if($numlist == $numpages) {
> $html .= " »";
> } else {
> $html .= sprintf(" »",
> $options['linkprefix'], $numlist+1);
> }
> if($totalitems <= $options['itemsperpage']) { $html = ""; }
> return Array($html,sprintf("%02d",$numpages),$totalitems,$results);
> }
> 
> On 9/13/07, Patrik Hasibuan <[EMAIL PROTECTED]> wrote:
> > Hi Mike,
> >
> > I am intrested for the solution you gave me. But I am confused of the way 
> > in implementing "select FOUND_ROWS()".
> >
> > I wrote another very simple codes as the first step for understanding this 
> > threat:
> >  > $konek=mysql_connect("127.0.0.1","root","mypassword");
> > if ($konek){
> >for ($i=0;$i<2;$i++){
> >$sqlku="select SQL_CALC_FOUND_ROWS id_iklan from lowongan limit 5;";
> >$sqlkupage="select FOUND_ROWS()";
> >$mybd=mysql_select_db("headhunter",$konek);
> >$kueri=mysql_query($sqlku,$konek) or die('MYSQL QUERY ERROR 
> > ['.mysql_errno($konek).'] '.mysql_error($konek));
> >$kueri=mysql_query($sqlkupage,$konek) or die('MYSQL QUERY ERROR 
> > ['.mysql_errno($konek).'] '.mysql_error($konek));
> >while($brs=mysql_fetch_row($kueri)){
> >list($idiklan)=$brs;
> >echo "FirstItem  > href=\"showit.php?id=$idiklan\">$idiklan";
> >}
> >}
> > }else{
> >echo "I can't talk to the server";
> >exit();
> > }
> > ?>
> >
> > I've put nine records into the table of "lowongan", idiklan 1 to 9.
> > Look I get of course only one record, namely the: '9'.
> >
> > This is the output of my codes in my internet browser.
> > ===
> > FirstItem 9
> > FirstItem 9
> > ===
> > The output what I am expecting suppose to be:
> > on the $i=0
> > "
> > FirstItem 1
> > FirstItem 2
> > FirstItem 3
> > FirstItem 4
> > F

Re: [PHP] my paging task with PHP does not work. It uses cookie.

2007-09-19 Thread Patrik Hasibuan
Dear Brian,

My problem is solved. thank you very much for your help.
===
On Wed, 12 Sep 2007 14:04:11 -0400
brian <[EMAIL PROTECTED]> wrote:

> Patrik Hasibuan wrote:
> > Dear my friends...
> > 
> > I am trying to display the content of a table. Each page must content
> > only 5 records maximum. Each page has "Previous" and "Next" buttons
> > (made from anchor).
> > 
> > I dump the primary of the working table and keep it in a cookie. So
> > than the paging task work with the index of cookie array. But the
> > $curguruescomidiklan stays "0" each time I click "Next" button.
> > 
> 
> Patrick, i can't say what the problem is, but i recommend using the PEAR 
> Pager package for this if you have PEAR available. It takes care of a 
> lot of the heavy lifting and is very configurable.
> 
> http://pear.php.net/package/Pager
> 
> This does not require setting any cookies.
> 
> brian
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


-- 
Patrik Hasibuan <[EMAIL PROTECTED]>
Junior Programmer

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



Re: [PHP] my paging task with PHP does not work. It uses cookie.

2007-09-19 Thread Patrik Hasibuan
Hi Arvid,

thank you very much for your remark. It is useful for me.
===
On Fri, 14 Sep 2007 12:01:40 +0300
"Arvids Godjuks" <[EMAIL PROTECTED]> wrote:

> Don't use SQL_CALC_FOUND ROWS on simple queries, when you have to run a
> simple query on one or two (with join) tables with a simple WHERE. Especialy
> if tables are big. I found out that single SELECT COUNT(id) FROM table is
> far more faster when query has simple WHERE conditions. I use
> SQL_CALC_FOUND_ROWS only with a rather complex queries - that
> SQL_CALC_FOUND_ROWS doesn't affect query execution at all (well, it affects
> ofcourse, but affect is so small, you can't see it).
> 


-- 
Patrik Hasibuan <[EMAIL PROTECTED]>
Junior Programmer

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



Re: [PHP] my paging task with PHP does not work. It uses cookie.

2007-09-14 Thread Zoltán Németh
2007. 09. 14, péntek keltezéssel 10.50-kor mike ezt írta:
> except i think innodb does not have a full row count stored.

of course not, but SQL_CALC_FOUND_ROWS does not use that. it is working
like it selects the rows and counts them. and in the case of complex
queries (where you use more than one table) you could not make use of
that stored value anyway.

greets
Zoltán Németh

> 
> anyway the design was meant for a simple one function call. it's
> worked great for small and data loads.
> 
> On 9/14/07, Arvids Godjuks <[EMAIL PROTECTED]> wrote:
> > Don't use SQL_CALC_FOUND ROWS on simple queries, when you have to run a
> > simple query on one or two (with join) tables with a simple WHERE. Especialy
> > if tables are big. I found out that single SELECT COUNT(id) FROM table is
> > far more faster when query has simple WHERE conditions. I use
> > SQL_CALC_FOUND_ROWS only with a rather complex queries - that
> > SQL_CALC_FOUND_ROWS doesn't affect query execution at all (well, it affects
> > ofcourse, but affect is so small, you can't see it).
> 

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



Re: [PHP] my paging task with PHP does not work. It uses cookie.

2007-09-14 Thread mike
except i think innodb does not have a full row count stored.

anyway the design was meant for a simple one function call. it's
worked great for small and data loads.

On 9/14/07, Arvids Godjuks <[EMAIL PROTECTED]> wrote:
> Don't use SQL_CALC_FOUND ROWS on simple queries, when you have to run a
> simple query on one or two (with join) tables with a simple WHERE. Especialy
> if tables are big. I found out that single SELECT COUNT(id) FROM table is
> far more faster when query has simple WHERE conditions. I use
> SQL_CALC_FOUND_ROWS only with a rather complex queries - that
> SQL_CALC_FOUND_ROWS doesn't affect query execution at all (well, it affects
> ofcourse, but affect is so small, you can't see it).

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



Re: [PHP] my paging task with PHP does not work. It uses cookie.

2007-09-14 Thread Arvids Godjuks
Don't use SQL_CALC_FOUND ROWS on simple queries, when you have to run a
simple query on one or two (with join) tables with a simple WHERE. Especialy
if tables are big. I found out that single SELECT COUNT(id) FROM table is
far more faster when query has simple WHERE conditions. I use
SQL_CALC_FOUND_ROWS only with a rather complex queries - that
SQL_CALC_FOUND_ROWS doesn't affect query execution at all (well, it affects
ofcourse, but affect is so small, you can't see it).


Re: [PHP] my paging task with PHP does not work. It uses cookie.

2007-09-13 Thread mike
warning: this is VERY UGLY CODE. i wrote it 3-4 years ago now i think
and it just keeps working.

you call it this way:

# pagination.
if(isset($_GET['pg'])) {
$page = intval($_GET['pg']);
} else {
$page = 1;
}
$page = sprintf("%02d",$page);

$query = Array(
'query' => "SELECT foo FROM bar",
'itemsperpage'  => 50,
'maxdisplay'=> 20,
'linkprefix'=> "$_SERVER[PHP_SELF]?f=$forum_id&pg="
);
list($pages,$numpages,$items,$threads) = paginate_sql($page,$query);

$pages is the html formatted links
$numpages is the total number of pages
i dont actually use $items much but i think it just tells you how many
items (which is the same as itemsperpage... i believe)
$threads is the mysql rows resource (you can use mysql_fetch_rows on it)



function paginate_sql(&$thispage,$options) {
$offset = $options['itemsperpage'] * ($thispage - 1);
if(isset($options['server'])) {
$results = db_query(eregi_replace("^SELECT","SELECT
SQL_CALC_FOUND_ROWS",$options['query'])."LIMIT
$offset,$options[itemsperpage]",$options['server']);
$rows = db_query("SELECT FOUND_ROWS()",$options['server']);
} else {
$results = db_query(eregi_replace("^SELECT","SELECT
SQL_CALC_FOUND_ROWS",$options['query'])."LIMIT
$offset,$options[itemsperpage]");
$rows = db_query("SELECT FOUND_ROWS()");
}
list($totalitems) = db_rows($rows);
db_free($rows);
$html = "";
$numpages = ceil($totalitems / $options['itemsperpage']);
if(isset($options['maxpages']) && $numpages >
$options['maxpages']) { $numpages = $options['maxpages']; }
if($thispage < 1 || $totalitems < $options['itemsperpage']) {
$thispage = sprintf("%02d",1); }
if($thispage > $numpages && $numpages > 0) {
header(sprintf("Location: %s01",
str_replace("&","&",$options['linkprefix'])));
exit();
}
$start = (ceil($thispage / $options['maxdisplay'])-1) *
$options['maxdisplay'] + 1;
if($start == 1) {
$html .= "«";
} else {
$html .= sprintf("«",
$options['linkprefix'], $start-1);
}
if(isset($options['maxdisplay']) && $options['maxdisplay'] !=
0 && $numpages > $options['maxdisplay']) {
$numlist = $options['maxdisplay'] + $start - 1;
} else {
$numlist = $numpages + $start - 1;
}
if($numlist > $numpages) { $numlist = $numpages; }
for($x=$start; $x<=$numlist; $x++) {
if($x == $thispage) {
$html .= sprintf(" %02d", $x);
} else {
$html .= sprintf(" %02d", $options['linkprefix'], $x, $x);
}
}
if($numlist == $numpages) {
$html .= " »";
} else {
$html .= sprintf(" »",
$options['linkprefix'], $numlist+1);
}
if($totalitems <= $options['itemsperpage']) { $html = ""; }
return Array($html,sprintf("%02d",$numpages),$totalitems,$results);
}

On 9/13/07, Patrik Hasibuan <[EMAIL PROTECTED]> wrote:
> Hi Mike,
>
> I am intrested for the solution you gave me. But I am confused of the way in 
> implementing "select FOUND_ROWS()".
>
> I wrote another very simple codes as the first step for understanding this 
> threat:
>  $konek=mysql_connect("127.0.0.1","root","mypassword");
> if ($konek){
>for ($i=0;$i<2;$i++){
>$sqlku="select SQL_CALC_FOUND_ROWS id_iklan from lowongan limit 5;";
>$sqlkupage="select FOUND_ROWS()";
>$mybd=mysql_select_db("headhunter",$konek);
>$kueri=mysql_query($sqlku,$konek) or die('MYSQL QUERY ERROR 
> ['.mysql_errno($konek).'] '.mysql_error($konek));
>$kueri=mysql_query($sqlkupage,$konek) or die('MYSQL QUERY ERROR 
> ['.mysql_errno($konek).'] '.mysql_error($konek));
>while($brs=mysql_fetch_row($kueri)){
>list($idiklan)=$brs;
>echo "FirstItem  href=\"showit.php?id=$idiklan\">$idiklan";
>}
>}
> }else{
>echo "I can't talk to the server";
>exit();
> }
> ?>
>
> I've put nine records into the table of "lowongan", idiklan 1 to 9.
> Look I get of course only one record, namely the: '9'.
>
> This is the output of my codes in my internet browser.
> ===
> FirstItem 9
> FirstItem 9
> ===
> The output what I am expecting suppose to be:
> on the $i=0
> "
> FirstItem 1
> FirstItem 2
> FirstItem 3
> FirstItem 4
> FirstItem 5
> "
> and on the $i=1
> "
> FirstItem 6
> FirstItem 7
> FirstItem 8
> FirstItem 9
> FirstItem 9
> "
>
> I read on the documentation of MySQL but I couldn't find any code of sample 
> also in the php.net.
>
> Would be so kind to give me a very simple code of sample?
>
> Thank you very much in advance.
> On Wed, 12 Sep 2007 11:58:04 -0700
> mike <[EMAIL PROTECTED]> wrote:
>
> > On 9/12/07, Patrik Hasibuan <[EMAIL PROTECTED]> wrote:
> > > 

Re: [PHP] my paging task with PHP does not work. It uses cookie.

2007-09-13 Thread Patrik Hasibuan
Hi Mike,

I am intrested for the solution you gave me. But I am confused of the way in 
implementing "select FOUND_ROWS()".

I wrote another very simple codes as the first step for understanding this 
threat:
$idiklan";
}
}
}else{
echo "I can't talk to the server";
exit();
}
?>

I've put nine records into the table of "lowongan", idiklan 1 to 9.
Look I get of course only one record, namely the: '9'.

This is the output of my codes in my internet browser.
===
FirstItem 9
FirstItem 9
===
The output what I am expecting suppose to be:
on the $i=0
"
FirstItem 1
FirstItem 2
FirstItem 3
FirstItem 4
FirstItem 5
"
and on the $i=1
"
FirstItem 6
FirstItem 7
FirstItem 8
FirstItem 9
FirstItem 9
"

I read on the documentation of MySQL but I couldn't find any code of sample 
also in the php.net.

Would be so kind to give me a very simple code of sample?

Thank you very much in advance.
On Wed, 12 Sep 2007 11:58:04 -0700
mike <[EMAIL PROTECTED]> wrote:

> On 9/12/07, Patrik Hasibuan <[EMAIL PROTECTED]> wrote:
> > Dear my friends...
> >
> > I am trying to display the content of a table. Each page must content only 
> > 5 records maximum. Each page has "Previous" and "Next" buttons (made from 
> > anchor).
> >
> > I dump the primary of the working table and keep it in a cookie. So than 
> > the paging task work with the index of cookie array. But the 
> > $curguruescomidiklan stays "0" each time I click "Next" button.
> 
> yeah there is no reason to be using cookies for this.
> 
> just using query string parameters should work. for pagination you need to 
> know:
> 
> total number of items
> number of items per page
> 
> after that you know how many pages (numitems / itemsperpage) and work
> out the links appropriately (i.e. page1 has no previous, $maxpage has
> no next) and you can put the number of pages down how you want (if you
> want to do prev 3 4 5 next, or next 1 2 3 4 5 6 7 8 9 prev, there's a
> ton of strategies to print out what pages to show, and next, previous,
> jump to end, jump to beginning, etc)
> 
> i've never used the PEAR class or anything else, i made a function a
> long time ago that actually works in conjunction with mysql's SELECT
> FOUND_ROWS() and uses a LIMIT offset,number to save the overhead of
> fetching every row from the database to only show the ones for that
> page. it's actually worked well for 4 years now without a single
> change...
> 
> at some point perhaps i'll clean it up and post it somewhere, and
> someone might be able to make it even better.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


-- 
Patrik Hasibuan <[EMAIL PROTECTED]>
Junior Programmer

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



Re: [PHP] my paging task with PHP does not work. It uses cookie.

2007-09-12 Thread mike
On 9/12/07, Patrik Hasibuan <[EMAIL PROTECTED]> wrote:
> Dear my friends...
>
> I am trying to display the content of a table. Each page must content only 5 
> records maximum. Each page has "Previous" and "Next" buttons (made from 
> anchor).
>
> I dump the primary of the working table and keep it in a cookie. So than the 
> paging task work with the index of cookie array. But the $curguruescomidiklan 
> stays "0" each time I click "Next" button.

yeah there is no reason to be using cookies for this.

just using query string parameters should work. for pagination you need to know:

total number of items
number of items per page

after that you know how many pages (numitems / itemsperpage) and work
out the links appropriately (i.e. page1 has no previous, $maxpage has
no next) and you can put the number of pages down how you want (if you
want to do prev 3 4 5 next, or next 1 2 3 4 5 6 7 8 9 prev, there's a
ton of strategies to print out what pages to show, and next, previous,
jump to end, jump to beginning, etc)

i've never used the PEAR class or anything else, i made a function a
long time ago that actually works in conjunction with mysql's SELECT
FOUND_ROWS() and uses a LIMIT offset,number to save the overhead of
fetching every row from the database to only show the ones for that
page. it's actually worked well for 4 years now without a single
change...

at some point perhaps i'll clean it up and post it somewhere, and
someone might be able to make it even better.

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



Re: [PHP] my paging task with PHP does not work. It uses cookie.

2007-09-12 Thread brian

Patrik Hasibuan wrote:

Dear my friends...

I am trying to display the content of a table. Each page must content
only 5 records maximum. Each page has "Previous" and "Next" buttons
(made from anchor).

I dump the primary of the working table and keep it in a cookie. So
than the paging task work with the index of cookie array. But the
$curguruescomidiklan stays "0" each time I click "Next" button.



Patrick, i can't say what the problem is, but i recommend using the PEAR 
Pager package for this if you have PEAR available. It takes care of a 
lot of the heavy lifting and is very configurable.


http://pear.php.net/package/Pager

This does not require setting any cookies.

brian

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



[PHP] my paging task with PHP does not work. It uses cookie.

2007-09-12 Thread Patrik Hasibuan
Dear my friends...

I am trying to display the content of a table. Each page must content only 5 
records maximum. Each page has "Previous" and "Next" buttons (made from anchor).

I dump the primary of the working table and keep it in a cookie. So than the 
paging task work with the index of cookie array. But the $curguruescomidiklan 
stays "0" each time I click "Next" button.

The main part of doing the paging task is this lines:
"
for ($it=$curguruescomidiklan;$it<$itot;$it++){
$idad=$guruescomidiklan[$it];
echo "idad= $idad";
echo "it: $it";
bukaiklan($idad);
}
".

Please tell me why PHP does not work as I expect.

Thank you very much in advance.
=











0){ echo "Previous"; }
?>






1 or $curguruescomidiklan==0){ 
echo "Next"; 
}
?>





Lowongan Kerja";
include_once "koneksi.php";
$sqlnya="
select l.id_iklan 
from perusahaan as p right join lowongan as l on 
l.id_account=p.id_account 
where l.lama_tayang >= (current_date-l.mulai_tayang) 
order by bid desc
";
$kelas=new koneksi();
$klas=$kelas->getkoneksi("headhunter",$sqlnya);
$jmli=mysql_num_rows($klas);
if ( $jmli > 0 ) {
$i=0;
while(list($idiklan)=mysql_fetch_row($klas)) {
//  echo "ID Iklannya: $idiklan";
setcookie("guruescomidiklan[$i]","$idiklan");
$i++;
}
} else {
echo "No Ad of job vacancy currently in our database";
}
if (empty($curguruescomidiklan)){
$curguruescomidiklan=0;
}
//echo "pa: $pageamount";
if (isset($p)){ $nt=$_GET['p']; }
//I meant this part should direct the page content to be the next array contents
if ($jmli>=$pageamount){
echo "curguruescomidiklan -->$curguruescomidiklan";
if ($nt=='t'){
$itot=$_COOKIE['curguruescomidiklan']-$pageamount;
}else{
$itot=$_COOKIE['curguruescomidiklan']+$pageamount;
echo "lewat sini $curguruescomidiklan $pageamount";
}
echo "itot 1 -->$itot";
}else{
$itot=$jmltot;
echo "itot 2 -->$itot";
}
for ($it=$curguruescomidiklan;$it<$itot;$it++){
$idad=$guruescomidiklan[$it];
echo "idad= $idad";
echo "it: $it";
bukaiklan($idad);
}
$itot=$itot+$pageamount;
setcookie("curguruescomidiklan","$itot");
echo "curguruescomidiklan--> $curguruescomidiklan";

function bukaiklan($myid){
//echo "myid=$myid";
$sqlnya="
select p.company_fullname, p.company_address, p.city, p.country, 
p.postcode, p.phone, p.fax, p.url, p.company_description, l.iklan, l.id_iklan 
from perusahaan as p right join lowongan as l on 
l.id_account=p.id_account 
where l.lama_tayang >= (current_date-l.mulai_tayang) and 
l.id_iklan='$myid'
order by bid desc
";
$kelassqlbukaiklan=new koneksi();
$klassqlbukaiklan=$kelassqlbukaiklan->getkoneksi("headhunter",$sqlnya);
if ( mysql_num_rows($klassqlbukaiklan) > 0 ) {
while(list($namaprsh, $alamat, $kota, $negara, $kodepos, $telfon, $faks, $url, 
$comdesc, $iklan, $idiklan)=mysql_fetch_row($klassqlbukaiklan)) {
echo "Employer:$namaprsh";
echo "Address:$alamat";
echo "City:$kota";
echo "Country:$negara";
echo "Postcode:$kodepos";
echo "Fax:$faks";
echo "Website:$url";
echo "Business Field:$comdesc";
echo "$iklan";
echo "";
}
} else {
echo "No Ad of job vacancy currently in our database, possibly 
ads-id wrong.";
}
}

?>

















-- 
Patrik Hasibuan <[EMAIL PROTECTED]>
Junior Programmer

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



Re: [PHP] Does not work

2002-07-15 Thread Alberto Serra

ðÒÉ×ÅÔ!

Saci wrote:
> Who cares about privacy on my own company Intranet ?

Anyone not willing to show where they has been surfing on the net to any 
unexperienced bycomer. Youu may read the history, but you just have *no* 
warranty that it will not be cleared at runtime.

Since you have control on the machines (which you should have said at 
the beginning to have people help you) you'd be better off by having 
them configured to actually give the HTTP_referer string to Apache. It 
would be much more solid.

Besides, there *are* international laws concerning privacy at work, so I 
am not sure a determined employee could not getting your company into 
trouble because of your watching what he is doing.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Does not work

2002-07-14 Thread Justin French

This works for me, PHP 4.1.1

Upon first loading the page, I get nothing, but when I click on "go", I get
both referrer address' echoed.

refer.php:
---


go

Page refered by
';
echo $_SERVER['HTTP_REFERER'].'';
?>


---



It's already been said but:


1. are you sure php is working (with other files, and with simple echo
"hello world!"; type stuff)?


2. use this file (phpinfo.php) to test for the existence of HTTP_REFERER:

refer.php:
---


go

Page refered by
';
echo $_SERVER['HTTP_REFERER'].'';
?>


---

Upon first loading, it will not be set, but when you click go, you have a
referer, and it is set.  For me, it's listed under the Apache Environment
heading.


If you still can't get a referrer var after all that, then there's an issue
with your server (are you using apache) or perhaps the client (browser).

because it *should* be simple.


Justin French


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




Re: [PHP] Does not work

2002-07-14 Thread Saci

I agree, I made a mistake on my last reply , and I apologize for that.

Thank you also for you for your coments, but my main question still open
without any related reply.




>
> > To say the minumum yor reply does not help in nothing.
> >
> > Who cares about privacy on my own company Intranet ?
>
> 1. I don't believe you specified this was a company intranet, but you may
> have.
>
> 2. Generally it's a good idea to get things right the first time, rather
> than assuming that something will always remain in it's current state.  I
> tend to copy-and-paste a lot of code from one project to another, or
> assemble libraries of code.  It might be okay for you to say "this code
> works for a limited environment, and i'm happy with that", but will you
> remember this when:
>
> a) you copy it across to another project
> b) the status of the project changes or is extended
> c) the project is no longer in your control
>
> If you insist on sticking with this limitation, do yourself and your
> co-workers a favour, and ensure you:
>
> a) comment your code well, pointing out the limitation
> b) do some minimal (at least) error handling to deal with the fact that it
> may not be there
>
> 3. The reply WAS helpful, raised some important issues, and IMHO you
should
> have thanked the poster for being kind enough to point out issues you may
> not have thought of.  You could have easily replied with "thanks for those
> pointers, but I'm less concerned with privacy, since this is a corporate
> intranet".
>
>
> I'm not sure I'd ever help you again, if I'd received a reply such as
yours.
>
>
> Justin French
>



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




Re: [PHP] Does not work

2002-07-14 Thread Justin French

on 15/07/02 12:51 PM, Saci ([EMAIL PROTECTED]) wrote:

> To say the minumum yor reply does not help in nothing.
> 
> Who cares about privacy on my own company Intranet ?

1. I don't believe you specified this was a company intranet, but you may
have.

2. Generally it's a good idea to get things right the first time, rather
than assuming that something will always remain in it's current state.  I
tend to copy-and-paste a lot of code from one project to another, or
assemble libraries of code.  It might be okay for you to say "this code
works for a limited environment, and i'm happy with that", but will you
remember this when:

a) you copy it across to another project
b) the status of the project changes or is extended
c) the project is no longer in your control

If you insist on sticking with this limitation, do yourself and your
co-workers a favour, and ensure you:

a) comment your code well, pointing out the limitation
b) do some minimal (at least) error handling to deal with the fact that it
may not be there

3. The reply WAS helpful, raised some important issues, and IMHO you should
have thanked the poster for being kind enough to point out issues you may
not have thought of.  You could have easily replied with "thanks for those
pointers, but I'm less concerned with privacy, since this is a corporate
intranet".


I'm not sure I'd ever help you again, if I'd received a reply such as yours.


Justin French


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




RE: [PHP] Does not work

2002-07-14 Thread Peter



> -Original Message-
> From: Saci [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 15 July 2002 12:51 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Does not work
> 
> 
> To say the minumum yor reply does not help in nothing.
> 
> Who cares about privacy on my own company Intranet ?
> 
> 
u the bosses.. the employees tring to hide where they been from the bosses... the 
network admin... the list goes on and on and on and on and on and on and on ...


Re: [PHP] Does not work

2002-07-14 Thread Saci

To say the minumum yor reply does not help in nothing.

Who cares about privacy on my own company Intranet ?



"Alberto Serra" <[EMAIL PROTECTED]> escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> ðÒÉ×ÅÔ!
>
> Saci wrote:
> > // HTTP_REFERER as a feature. In  short, it cannot really be trusted.
> >
> > Anybody know how to do that using JAva history with PHP together , or
any
> > other methode that works and can be trusted.
>
> Thank god no method can be trusted :) History even less the the
> referrer. Just think of the frequency at which people in their offices
> clear it to avoid bosses seeing where they surfed while they were
> supposed to work...
>
> You'll never get a secure method, and if you do I'll personally report
> you to the authority for protection of privacy :) Marketing dotcoms
> would just love to do it, but fortunately it cannot be done :) Relax,
> you can live without knowing where some of the guys came from. Most
> won't mind telling you. But I just cleared my history immediately after
> reading your msg :) Pavlovian reaction ;)
>
> ÐÏËÁ
> áÌØÂÅÒÔÏ
> ëÉÅ×
>
>
> @-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@
>
> LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
> lOrD i'M sHiNiNg...
> YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
> tHe TeSt, YeS iT iS
> ThE tEsT, yEs It Is
> tHe TeSt, YeS iT iS
> ThE tEsT, yEs It Is...
>



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




Re: [PHP] Does not work

2002-07-14 Thread Justin French

Pffft you can't trust Java, JavaScript or anything on the server side at
all.  Since it's set by the browser (client) itself, the best you can do is
test for it, and provide a fall back option.

For the bulk of users, this will be okay, because they're on IE.  What you
need to be carefull of is what effect your fall back has on the unknown
browsers.

Or design/program without the need to know what they're using :D


Justin French


on 15/07/02 5:34 AM, Saci ([EMAIL PROTECTED]) wrote:

> // HTTP_REFERER as a feature. In  short, it cannot really be trusted.
> 
> Anybody know how to do that using JAva history with PHP together , or any
> other methode that works and can be trusted.
> 
> 


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




Re: [PHP] Does not work

2002-07-14 Thread Alberto Serra

ðÒÉ×ÅÔ!

Saci wrote:
> // HTTP_REFERER as a feature. In  short, it cannot really be trusted.
> 
> Anybody know how to do that using JAva history with PHP together , or any
> other methode that works and can be trusted.

Thank god no method can be trusted :) History even less the the 
referrer. Just think of the frequency at which people in their offices 
clear it to avoid bosses seeing where they surfed while they were 
supposed to work...

You'll never get a secure method, and if you do I'll personally report 
you to the authority for protection of privacy :) Marketing dotcoms 
would just love to do it, but fortunately it cannot be done :) Relax, 
you can live without knowing where some of the guys came from. Most 
won't mind telling you. But I just cleared my history immediately after 
reading your msg :) Pavlovian reaction ;)

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Does not work

2002-07-14 Thread Saci

// HTTP_REFERER as a feature. In  short, it cannot really be trusted.

Anybody know how to do that using JAva history with PHP together , or any
other methode that works and can be trusted.



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




RE: [PHP] Does not work

2002-07-14 Thread Michael Geier

from PHP documentation:
http://www.php.net/manual/en/reserved.variables.php

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

> -Original Message-
> From: Saci [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 14, 2002 2:11 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Does not work
>
>
> I tried this simple code
>
> 
> 
> Page refered by
>  echo $HTTP_REFERER.'';
> echo $_SERVER['HTTP_REFERER'].'';
> ?>
> 
> 
>
> and I receive blank reply even if referenced from a link from other site.
>
> What am i doing wrong ? Or perhaps my server does not have
> referer enabled?
>
>
>
>
>
> --
> 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




[PHP] Does not work

2002-07-14 Thread Saci

I tried this simple code



Page refered by
';
echo $_SERVER['HTTP_REFERER'].'';
?>



and I receive blank reply even if referenced from a link from other site.

What am i doing wrong ? Or perhaps my server does not have referer enabled?





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




Re: [PHP] Re: PHP does not work??

2002-07-02 Thread Richard Lynch

>I forgot to point out another disadvantage of turning on register_globals
>apart from that of security is that when you are sending a page with a
>form to the same page, e.g:
>
>
>
>there is a tendency to lose info..  E.g.
>If you are sending text separated by spaces you only manage to
>send the first word this can be overcome by using the
>htmlspecialchars('value') method to evaluate value...
>
>turning on globals is to make the coding easier but has a
>good deal of disadvantages...

register_globals on or off is completely irrelevant to using urlencode (GET)
or htmlentities (POST) to send properly formatted strings to the browser.

If you want to delude yourself the register_globals off significantly
increases security, go ahead, but don't claim that it somehow "fixes"
badly-encoded HTML.  It doesn't.

-- 
Like Music?  http://l-i-e.com/artists.htm


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




Re: [PHP] Re: PHP does not work??

2002-06-28 Thread Scott Fletcher

Not a problem!  I can make some adjustment to the $user_detail['']
(session_id()) to make it work as $_SESSION[''].

Scott
"Erik Price" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> On Wednesday, June 26, 2002, at 02:37  PM, Scott Fletcher wrote:
>
> > I didn't know that.  Thanks for the info.  I think it would be best
> > that I
> > not use php.ini.
>
> On the contrary, I think it would be best if you read through it and
> read about it at http://www.php.net/manual/en/configuration.php .
> Putting it off will only cause you trouble in the long run.
>
> > I can write the script to register the variable.  What would be a demo
> > script that would work?  I'm having a little trouble understanding that
> > on
> > the php.net website.  Most of the script that use global variables came
> > from
> > hyperlinks.  I have no form method like "post" or "get".
>
> If it doesn't have "post" or "get", then your data is probably in the
> $_GET array.  But you should always use the "method" attribute of the
> "form" tag.
>
> > I have one website that use session.  Like session_start(),
> > session_register(), etc.  How would this be affected and what is the
> > work
> > around to this one.
>
> You now refer to a session variable as $_SESSION['variablename'].
>
>
> Erik
>
>
>
>
> 
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
>



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




Re: [PHP] Re: PHP does not work??

2002-06-28 Thread Scott Fletcher

Not a problem, I can make some code modification.  Sometime it is better to
do it now and not have so much headache later on when more features are
being added.

Scott
"Kondwani Spike Mkandawire" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I forgot to point out another disadvantage of turning on register_globals
> apart from that of security is that when you are sending a page with a
> form to the same page, e.g:
>
> 
>
> there is a tendency to lose info..  E.g.
> If you are sending text separated by spaces you only manage to
> send the first word this can be overcome by using the
> htmlspecialchars('value') method to evaluate value...
>
> turning on globals is to make the coding easier but has a
> good deal of disadvantages...
>
> Spike...
> "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Um, alright, I'll just leave the code in the hyperlink the way it is.
It
> is
> > not possible to use the "" or post of some sort for the hyperlink.
> > "" will work with the submit button where we can use post or
hidden.
> > Hyperlink meant words or sentences that have underline underneath it,
when
> > clicked will go to a different webpage.
> >
> > Thanks,
> >  Scott
> >
> > "Erik Price" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > >
> > > On Wednesday, June 26, 2002, at 02:56  PM, Scott Fletcher wrote:
> > >
> > > > I tried that and it worked.  I have
> > > > one question, what about the hyperlink?  People will see the option
in
> > > > the
> > > > hyperlink.  You know.  Is there a way around it to hid that in the
> > > > hyperlink?
> > >
> > > If by "hyperlink" you mean the URL in the URL bar of their browser,
> > > correct -- people will see it.  That GET data is part of the URL, sort
> > > of.
> > >
> > > Most browsers will not display POST data to their users (easily) but
> > > it's never truly "hidden" from view.  Any data that your users are
> > > sending to you, whether it's GET, POST, or COOKIE, is data that they
can
> > > see.
> > >
> > >
> > > Erik
> > >
> > >
> > >
> > > 
> > >
> > > Erik Price
> > > Web Developer Temp
> > > Media Lab, H.H. Brown
> > > [EMAIL PROTECTED]
> > >
> >
> >
>
>



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




Re: [PHP] Re: PHP does not work??

2002-06-27 Thread Kondwani Spike Mkandawire

I forgot to point out another disadvantage of turning on register_globals
apart from that of security is that when you are sending a page with a
form to the same page, e.g:



there is a tendency to lose info..  E.g.
If you are sending text separated by spaces you only manage to
send the first word this can be overcome by using the
htmlspecialchars('value') method to evaluate value...

turning on globals is to make the coding easier but has a
good deal of disadvantages...

Spike...
"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Um, alright, I'll just leave the code in the hyperlink the way it is.  It
is
> not possible to use the "" or post of some sort for the hyperlink.
> "" will work with the submit button where we can use post or hidden.
> Hyperlink meant words or sentences that have underline underneath it, when
> clicked will go to a different webpage.
>
> Thanks,
>  Scott
>
> "Erik Price" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > On Wednesday, June 26, 2002, at 02:56  PM, Scott Fletcher wrote:
> >
> > > I tried that and it worked.  I have
> > > one question, what about the hyperlink?  People will see the option in
> > > the
> > > hyperlink.  You know.  Is there a way around it to hid that in the
> > > hyperlink?
> >
> > If by "hyperlink" you mean the URL in the URL bar of their browser,
> > correct -- people will see it.  That GET data is part of the URL, sort
> > of.
> >
> > Most browsers will not display POST data to their users (easily) but
> > it's never truly "hidden" from view.  Any data that your users are
> > sending to you, whether it's GET, POST, or COOKIE, is data that they can
> > see.
> >
> >
> > Erik
> >
> >
> >
> > 
> >
> > Erik Price
> > Web Developer Temp
> > Media Lab, H.H. Brown
> > [EMAIL PROTECTED]
> >
>
>



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




Re: [PHP] Re: PHP does not work??

2002-06-26 Thread Scott Fletcher

Um, alright, I'll just leave the code in the hyperlink the way it is.  It is
not possible to use the "" or post of some sort for the hyperlink.
"" will work with the submit button where we can use post or hidden.
Hyperlink meant words or sentences that have underline underneath it, when
clicked will go to a different webpage.

Thanks,
 Scott

"Erik Price" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> On Wednesday, June 26, 2002, at 02:56  PM, Scott Fletcher wrote:
>
> > I tried that and it worked.  I have
> > one question, what about the hyperlink?  People will see the option in
> > the
> > hyperlink.  You know.  Is there a way around it to hid that in the
> > hyperlink?
>
> If by "hyperlink" you mean the URL in the URL bar of their browser,
> correct -- people will see it.  That GET data is part of the URL, sort
> of.
>
> Most browsers will not display POST data to their users (easily) but
> it's never truly "hidden" from view.  Any data that your users are
> sending to you, whether it's GET, POST, or COOKIE, is data that they can
> see.
>
>
> Erik
>
>
>
> 
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
>



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




Re: [PHP] Re: PHP does not work??

2002-06-26 Thread Erik Price


On Wednesday, June 26, 2002, at 02:37  PM, Scott Fletcher wrote:

> I didn't know that.  Thanks for the info.  I think it would be best 
> that I
> not use php.ini.

On the contrary, I think it would be best if you read through it and 
read about it at http://www.php.net/manual/en/configuration.php .  
Putting it off will only cause you trouble in the long run.

> I can write the script to register the variable.  What would be a demo
> script that would work?  I'm having a little trouble understanding that 
> on
> the php.net website.  Most of the script that use global variables came 
> from
> hyperlinks.  I have no form method like "post" or "get".

If it doesn't have "post" or "get", then your data is probably in the 
$_GET array.  But you should always use the "method" attribute of the 
"form" tag.

> I have one website that use session.  Like session_start(),
> session_register(), etc.  How would this be affected and what is the 
> work
> around to this one.

You now refer to a session variable as $_SESSION['variablename'].


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Re: PHP does not work??

2002-06-26 Thread Erik Price


On Wednesday, June 26, 2002, at 02:56  PM, Scott Fletcher wrote:

> I tried that and it worked.  I have
> one question, what about the hyperlink?  People will see the option in 
> the
> hyperlink.  You know.  Is there a way around it to hid that in the
> hyperlink?

If by "hyperlink" you mean the URL in the URL bar of their browser, 
correct -- people will see it.  That GET data is part of the URL, sort 
of.

Most browsers will not display POST data to their users (easily) but 
it's never truly "hidden" from view.  Any data that your users are 
sending to you, whether it's GET, POST, or COOKIE, is data that they can 
see.


Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Re: PHP does not work??

2002-06-26 Thread Scott Hurring

There is no feasable way to "hide" data being submitted to your
website.  Anything that a user's browser can send, the user can
telnet to port 80 of your server and "spoof".

You can try POSTing data, which will not appear in the URL,
but dont even waste time trying to "hide" submitted data,
rather, build a stronger backend.

--
Scott Hurring
Systems Programmer
EAC Corporation
scott (*) eac.com
--
"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Erik!
>
> This is my 2nd posting, not sure what happened to my first one.  Sorry about
> not seeing your previous posting before.  Windows crashed on me.  My fault.
> I didn't know we can use php.ini in UNIX or Linux.  Cool!  Haven't been
> using it on UNIX for a long time.  I think I can leave it out for now and
> make some changes to the scripts instead.  When I saw the php.ini on
> Windows, I couldn't believe of so many configuration.  So, I think it will
> be helpful to make some changes to teh website and keep it simple for
> someone who will take my place as webmaster.
>
> Saw your comments about "_GET['data']".  I tried that and it worked.  I have
> one question, what about the hyperlink?  People will see the option in the
> hyperlink.  You know.  Is there a way around it to hid that in the
> hyperlink?  Just curious.
>
> Thanks,
>  Scott
>
> "Erik Price" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > On Wednesday, June 26, 2002, at 02:13  PM, Scott Fletcher wrote:
> >
> > > I'm using UNIX, not windows, so there is no php.ini in UNIX.
> >
> > Sorry, don't take offense if I ask if you've been living under a rock --
> > I only use Linux, and there is definitely a php.ini file that you use.
> > I put mine in /usr/local/lib/ .  If you follow the source install
> > instructions, you will see that the last step is:
> >
> > $ cp php.ini-dist /usr/local/lib/php.ini
> >
> > Yep, that means you're supposed to copy php.ini-dist to a dir on your
> > server.  This is your configuration file, where register_globals and a
> > million other configuration directives are decided...
> >
> >
> > ?
> >
> >
> >
> > Erik
> >
> >
> >
> >
> > 
> >
> > Erik Price
> > Web Developer Temp
> > Media Lab, H.H. Brown
> > [EMAIL PROTECTED]
> >
>
>



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




Re: [PHP] Re: PHP does not work??

2002-06-26 Thread Scott Fletcher

Hi Erik!

This is my 2nd posting, not sure what happened to my first one.  Sorry about
not seeing your previous posting before.  Windows crashed on me.  My fault.
I didn't know we can use php.ini in UNIX or Linux.  Cool!  Haven't been
using it on UNIX for a long time.  I think I can leave it out for now and
make some changes to the scripts instead.  When I saw the php.ini on
Windows, I couldn't believe of so many configuration.  So, I think it will
be helpful to make some changes to teh website and keep it simple for
someone who will take my place as webmaster.

Saw your comments about "_GET['data']".  I tried that and it worked.  I have
one question, what about the hyperlink?  People will see the option in the
hyperlink.  You know.  Is there a way around it to hid that in the
hyperlink?  Just curious.

Thanks,
 Scott

"Erik Price" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> On Wednesday, June 26, 2002, at 02:13  PM, Scott Fletcher wrote:
>
> > I'm using UNIX, not windows, so there is no php.ini in UNIX.
>
> Sorry, don't take offense if I ask if you've been living under a rock --
> I only use Linux, and there is definitely a php.ini file that you use.
> I put mine in /usr/local/lib/ .  If you follow the source install
> instructions, you will see that the last step is:
>
> $ cp php.ini-dist /usr/local/lib/php.ini
>
> Yep, that means you're supposed to copy php.ini-dist to a dir on your
> server.  This is your configuration file, where register_globals and a
> million other configuration directives are decided...
>
>
> ?
>
>
>
> Erik
>
>
>
>
> 
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
>



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




Re: [PHP] Re: PHP does not work??

2002-06-26 Thread Scott Fletcher

I didn't know that.  Thanks for the info.  I think it would be best that I
not use php.ini.

I can write the script to register the variable.  What would be a demo
script that would work?  I'm having a little trouble understanding that on
the php.net website.  Most of the script that use global variables came from
hyperlinks.  I have no form method like "post" or "get".

I have one website that use session.  Like session_start(),
session_register(), etc.  How would this be affected and what is the work
around to this one.

Thanks,
 Scott

"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
002901c21d3e$0bba45d0$8102a8c0@niigziuo4ohhdt">news:002901c21d3e$0bba45d0$8102a8c0@niigziuo4ohhdt...
> [snip]
> I'm using UNIX, not windows, so there is no php.ini in UNIX.
> [/snip]
>
> Look here /etc/apache/php.ini-dist or /etc/apache/php.ini. There is an ini
> file for PHP, and you may have to rename php.ini-dist to php.ini. Once
done,
> look for
>
> ; You should do your best to write your scripts so that they do not
require
> ; register_globals to be on;  Using form variables as globals can easily
> lead
> ; to possible security problems, if the code is not very well thought of.
> register_globals = Off
>
> Setting Off to On will let your scripts continue to work, once you have
> restarted your server of course. You really should, due to security
> considerations leave this set of Off and reconfigure your variables as
> stated in other e-mails. Since this will probably take some time you can
> leave register_globals on until you're finished with that project.
>
> HTH!
>
> Jay
>
>



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




Re: [PHP] Re: PHP does not work??

2002-06-26 Thread Erik Price


On Wednesday, June 26, 2002, at 02:13  PM, Scott Fletcher wrote:

> I'm using UNIX, not windows, so there is no php.ini in UNIX.

Sorry, don't take offense if I ask if you've been living under a rock -- 
I only use Linux, and there is definitely a php.ini file that you use.  
I put mine in /usr/local/lib/ .  If you follow the source install 
instructions, you will see that the last step is:

$ cp php.ini-dist /usr/local/lib/php.ini

Yep, that means you're supposed to copy php.ini-dist to a dir on your 
server.  This is your configuration file, where register_globals and a 
million other configuration directives are decided...


?



Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




RE: [PHP] Re: PHP does not work??

2002-06-26 Thread Jay Blanchard

[snip]
I'm using UNIX, not windows, so there is no php.ini in UNIX.
[/snip]

Look here /etc/apache/php.ini-dist or /etc/apache/php.ini. There is an ini
file for PHP, and you may have to rename php.ini-dist to php.ini. Once done,
look for

; You should do your best to write your scripts so that they do not require
; register_globals to be on;  Using form variables as globals can easily
lead
; to possible security problems, if the code is not very well thought of.
register_globals = Off

Setting Off to On will let your scripts continue to work, once you have
restarted your server of course. You really should, due to security
considerations leave this set of Off and reconfigure your variables as
stated in other e-mails. Since this will probably take some time you can
leave register_globals on until you're finished with that project.

HTH!

Jay



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




[PHP] Re: PHP does not work??

2002-06-26 Thread Scott Fletcher

I'm using UNIX, not windows, so there is no php.ini in UNIX.

I only use the "./configure" command which is 

-- snip --
./configure
--with-apache=../apache_1.3.26
--with-ibm-db2=/usr/lpp/db2_06_01
--with-openssl=../openssl-0.9.6d
--with-mcrypt=../../lib
--without-mysql
--with-config-file-path=/etc
--enable-track-vars
--with-curl=../../lib
--with-xml
--snip--

Then I went on to compile the PHP, then Apache, etc.

Since from recent post, there was some talk about register_globals.  I'm not
familiar with that so I will find out what that is, and what that is use
for.  If anyone know, can anyone tell me what it does?  Thanks.  Scott
"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi!  I downloaded the newer version of PHP and compiled it.  The php is
> working great!  But there is one problem.
>
> When I use the hyperlink, "test.php?data=yes" and I go to this page,
> test.php but there is no data in this variable, $data.  So, the web page I
> have, most of them are all thrown off becuase of this.  I use PHP version
> 4.2.1.  Is there a bug in this PHP version???  Or some changes in PHP that
> I'm not aware of?  Let me know!
>
> Thanks,
>  Scott
>
>



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




RE: [PHP] PHP does not work??

2002-06-26 Thread Jay Blanchard

[snip]
When I use the hyperlink, "test.php?data=yes" and I go to this page,
test.php but there is no data in this variable, $data.  So, the web page I
have, most of them are all thrown off becuase of this.  I use PHP version
4.2.1.  Is there a bug in this PHP version???  Or some changes in PHP that
I'm not aware of?  Let me know!
[/snip]

Did you RTF release notes? Did you search the list archives?
Did you check to make sure that register_globals is 'ON'?

Accck ;-(



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




Re: [PHP] PHP does not work??

2002-06-26 Thread Erik Price


On Wednesday, June 26, 2002, at 01:20  PM, Scott Fletcher wrote:

> When I use the hyperlink, "test.php?data=yes" and I go to this page,
> test.php but there is no data in this variable, $data.  So, the web 
> page I
> have, most of them are all thrown off becuase of this.  I use PHP 
> version
> 4.2.1.  Is there a bug in this PHP version???  Or some changes in PHP 
> that
> I'm not aware of?  Let me know!

Use $_GET['data'], not $data.  Or turn register_globals = on in your 
php.ini.

Get to know your php.ini, and read the release notes for any software 
you upgrade -- this is mentioned in the PHP 4.1.x release notes if you 
want to read them for yourself.


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] PHP does not work??

2002-06-26 Thread Scott Fletcher

Hi!  I downloaded the newer version of PHP and compiled it.  The php is
working great!  But there is one problem.

When I use the hyperlink, "test.php?data=yes" and I go to this page,
test.php but there is no data in this variable, $data.  So, the web page I
have, most of them are all thrown off becuase of this.  I use PHP version
4.2.1.  Is there a bug in this PHP version???  Or some changes in PHP that
I'm not aware of?  Let me know!

Thanks,
 Scott



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