|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 4 Jun 2003 01:31:53 -0000 Issue 2096
php-general-digest-help
lists.php.net
Date: Tue Jun 03 2003 - 20:31:53 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 4 Jun 2003 01:31:53 -0000 Issue 2096
Topics (messages 149954 through 150094):
Delete from Multidimensional Array?
149954 by: Mark D Hiatt
149959 by: CPT John W. Holmes
149962 by: Marek Kilimajer
Displaying 5 records only/displaying specific records
149955 by: Matt MacLeod
149956 by: Jay Blanchard
149958 by: CPT John W. Holmes
Re: Variables changes their values
149957 by: CPT John W. Holmes
149961 by: Jay Blanchard
149964 by: Svein Larsen
149966 by: Svein Larsen
149970 by: Jason Wong
149972 by: Marek Kilimajer
Re: convert seconds to hours, minutes, seconds
149960 by: Yves Daemen
file reading and regex
149963 by: Michael Allan
149968 by: Jay Blanchard
149971 by: Marek Kilimajer
149977 by: Michael Allan
Sending Layer2 frames with PHP
149965 by: Kai Poppe
149973 by: Marek Kilimajer
Re: Validating user input
149967 by: Manuel Lemos
150068 by: Lars Torben Wilson
sql question
149969 by: Diana Castillo
149974 by: Marek Kilimajer
149987 by: ?$EF;?
submitting to differient php scripts based on button -O T-
149975 by: Ryan A
149976 by: Jay Blanchard
150000 by: Steve Keller
Re: Link to a Site
149978 by: sven
This line does not execute...
149979 by: Todd Cary
149981 by: Alex Ciurea
149982 by: Alex Ciurea
149985 by: Todd Cary
149986 by: Marek Kilimajer
149988 by: Alex Ciurea
149990 by: Todd Cary
149993 by: Marek Kilimajer
150039 by: Todd Cary
Migration from register_globals=on to register_globals=off
149980 by: Øystein Håland
149991 by: ?$EF;?
149994 by: Øystein Håland
149995 by: Jonathan Wilkes
149997 by: Leif K-Brooks
149998 by: Jonathan Wilkes
149999 by: Leif K-Brooks
150001 by: ?$EF;?
150003 by: Justin French
150005 by: Øystein Håland
150007 by: Wouter van Vliet
150011 by: R'twick Niceorgaw
150017 by: R'twick Niceorgaw
150031 by: Wouter van Vliet
150036 by: CPT John W. Holmes
How do I grab the first X characters of a string?
149983 by: Erich Kolb
149984 by: Jay Blanchard
Re: Cookies and Sessions: What's the Best Recipe?
149989 by: Monty
Re: determine action of a form dynamically?
149992 by: Monty
150028 by: Yves Daemen
pagenting logic to cut short
149996 by: Ryan A
150002 by: CPT John W. Holmes
Automatically include global file ...
150004 by: Wouter van Vliet
150008 by: Wendell Brown
150022 by: esctoday.com | wouter van vliet
preg_replace help
150006 by: Jackson Miller
150010 by: Jim Lucas
150012 by: Jackson Miller
150014 by: Ernest E Vogelsinger
150016 by: Ernest E Vogelsinger
150024 by: Jackson Miller
150086 by: Ernest E Vogelsinger
Creating favorites
150009 by: Joaco
150019 by: Edward Peloke
150020 by: Joaco
150029 by: Yves Daemen
150032 by: Joaco
PHP and base32 encryption
150013 by: CDitty
150021 by: DvDmanDT
150072 by: Mark
PHP and MYSQL record locking
150015 by: Jason May
150018 by: CPT John W. Holmes
OK guys, thank you so far
150023 by: Øystein Håland
150026 by: Edward Peloke
150030 by: Wendell Brown
150046 by: Øystein Håland
150058 by: David Nicholson
150066 by: Lars Torben Wilson
John - > RE: pagenting logic to cut short
150025 by: Ryan A
150037 by: CPT John W. Holmes
problems?
150027 by: Dale
150033 by: Edward Peloke
150035 by: Ed Gorski
150043 by: Dale
150047 by: esctoday.com | wouter van vliet
Mcrypt functions
150034 by: Daniel Rychlik
150045 by: Jay Smith
150053 by: Daniel Rychlik
150055 by: Jay Smith
150063 by: Daniel Rychlik
setting up a cron job for a PHP script
150038 by: Tim Thorburn
150040 by: Wendell Brown
150041 by: Jay Blanchard
150042 by: CPT John W. Holmes
Multi Selection
150044 by: Frank Keessen
150048 by: esctoday.com | wouter van vliet
150061 by: Jim Lucas
150065 by: Frank Keessen
150067 by: Frank Keessen
150076 by: Jim Lucas
Interesting.... :/
150049 by: Chris Knipe
php and mcrypt on windows
150050 by: Gilberto Garcia Jr.
150051 by: ?$EF;?
150052 by: Leif K-Brooks
Cookies and Expirations
150054 by: Tom Ray [Lists]
150057 by: Leif K-Brooks
Re: php session not persisting
150056 by: Eric D.
150060 by: Johnson, Kirk
150069 by: Jason Wong
150074 by: Eric D.
150075 by: Eric D.
150083 by: Johnson, Kirk
150091 by: Eric D.
php session not persisting from page to page
150059 by: Eric D.
Re: foreach and mysql_fetch_array problem
150062 by: Lars Torben Wilson
mcrypt installation
150064 by: Tom Ray [Lists]
150094 by: Daniel Rychlik
selecting first character from a MySQL table
150070 by: Tim Thorburn
move_uploaded_file > 1MB
150071 by: Maurício Valente
150081 by: Yves Daemen
150085 by: electroteque
150088 by: Yves Daemen
Re: What Visual PHP Edit ?
150073 by: Bix
PHP runtime error with Apache 1.3.27 & Oracle 9.0.1.0
150077 by: Jonathan Cowherd
Sorting a merged array? how?
150078 by: A. Lyse
Change object state
150079 by: Info.Best-IT
150080 by: Lars Torben Wilson
CLI problems
150082 by: Brian Paulson
150084 by: Jackson Miller
PHP extension is not installed?
150087 by: David Busby
Administration packages
150089 by: christian calloway
Re: Shipping Rates
150090 by: Jaap van Ganswijk
Re: How to delete a line in a TXT-file
150092 by: poetbox
buildconf doesn't seem to be working for 4.3.2
150093 by: Robert Cummings
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
I think I've outsmarted myself, again. Can someone help me out of this,
please?
I've built a page that collects network card information, assigning each
element its place within a $Card array, and all of the cards to $NetCards.
As you enter your card information at the bottom, the previous card is
displayed above it, with a Delete checkbox option at the end of that row
($Delete[$Card]).
But I can't figure out how to actually delete that card from the "deck",
as it were. I've looked over the Arrays pages, but there's little there
about multi-dimensional arrays and I ended up more confused than ever.
Here's my print_r:
Array <=--- This is $NetCards
(
[0] => Array <=--- This one is just
$Card
(
[0] => 3Com <=--- Description
[1] => 12:34:45:78:90:AA <=--- MAC Address
[2] => 129.93.100.100 <=--- IP Address
)
[1] => Array
(
[0] => Intel 100b
[1] => 12:34:45:78:90:AB
[2] => 129.93.100.101
)
[2] => Array
(
[0] => ThinAire
[1] => 12:34:45:78:90:BB
[2] => 129.93.100.102
)
[3] => Array
(
[0] => 3Com
[1] => 12:34:45:78:90:BC
[2] => 129.93.100.103
)
)
How can I delete, say, the wireless card (ThinAire) which is third, here,
if someone clicks on that one's Delete box? Thanks!
Mark D Hiatt
"Better Documentation Through Science"
attached mail follows:
> I've built a page that collects network card information, assigning each
> element its place within a $Card array, and all of the cards to $NetCards.
> As you enter your card information at the bottom, the previous card is
> displayed above it, with a Delete checkbox option at the end of that row
> ($Delete[$Card]).
>
> But I can't figure out how to actually delete that card from the "deck",
> as it were. I've looked over the Arrays pages, but there's little there
> about multi-dimensional arrays and I ended up more confused than ever.
> Here's my print_r:
>
> Array <=--- This is $NetCards
> (
> [0] => Array <=--- This one is just
> $Card
> (
> [0] => 3Com <=--- Description
> [1] => 12:34:45:78:90:AA <=--- MAC Address
> [2] => 129.93.100.100 <=--- IP Address
> )
>
> [1] => Array
> (
> [0] => Intel 100b
> [1] => 12:34:45:78:90:AB
> [2] => 129.93.100.101
> )
>
> [2] => Array
> (
> [0] => ThinAire
> [1] => 12:34:45:78:90:BB
> [2] => 129.93.100.102
> )
>
> [3] => Array
> (
> [0] => 3Com
> [1] => 12:34:45:78:90:BC
> [2] => 129.93.100.103
> )
>
> )
>
> How can I delete, say, the wireless card (ThinAire) which is third, here,
> if someone clicks on that one's Delete box? Thanks!
Assuming you somehow already get the "2" value when the user checks the
checkbox, you'd simply call
unset($NetCards[2]);
to get rid of the "ThinAire" card. If you're also looking for help making
the checkboxes, let me know.
---John Holmes...
attached mail follows:
unset($NetCards[2]);
Mark D Hiatt wrote:
> I think I've outsmarted myself, again. Can someone help me out of this,
> please?
>
> I've built a page that collects network card information, assigning each
> element its place within a $Card array, and all of the cards to $NetCards.
> As you enter your card information at the bottom, the previous card is
> displayed above it, with a Delete checkbox option at the end of that row
> ($Delete[$Card]).
>
> But I can't figure out how to actually delete that card from the "deck",
> as it were. I've looked over the Arrays pages, but there's little there
> about multi-dimensional arrays and I ended up more confused than ever.
> Here's my print_r:
>
> Array <=--- This is $NetCards
> (
> [0] => Array <=--- This one is just
> $Card
> (
> [0] => 3Com <=--- Description
> [1] => 12:34:45:78:90:AA <=--- MAC Address
> [2] => 129.93.100.100 <=--- IP Address
> )
>
> [1] => Array
> (
> [0] => Intel 100b
> [1] => 12:34:45:78:90:AB
> [2] => 129.93.100.101
> )
>
> [2] => Array
> (
> [0] => ThinAire
> [1] => 12:34:45:78:90:BB
> [2] => 129.93.100.102
> )
>
> [3] => Array
> (
> [0] => 3Com
> [1] => 12:34:45:78:90:BC
> [2] => 129.93.100.103
> )
>
> )
>
> How can I delete, say, the wireless card (ThinAire) which is third, here,
> if someone clicks on that one's Delete box? Thanks!
>
> Mark D Hiatt
> "Better Documentation Through Science"
>
attached mail follows:
Hi,
I'm trying to build a news panel for my home page. Basically I want to
present the five most recent news articles in a recordset, but I'm not
sure how to cut off the recordset after 5.
Also I want to present a picture with my first headline.
My code will go something like this:
<?php
// Start News Wotsit.
// Create Recordset
$gubbins = "SELECT * FROM tblContent WHERE pageParent =
3 ORDER BY pageDate DESC";
$resGubbins = mysql_query($gubbins,$conn);
$rowsGubbins = mysql_fetch_assoc($resGubbins);
echo "<p> </p>\n";
echo "<table cellpadding=3 cellspacing=0
border=0><tr><td width=75>\n";
echo "<img src=\"/i/s/";
//echo pageImage
echo "\" width=\"75\"/>\n";
echo "</td><td width=\"225\">";
// echo pageTitle
// echo pageContent
echo "</td></tr>\n";
//Begin Loop articles 2-5
// Not sure how to make the loop start at the 2nd record
echo "<tr><td> </td>\n";
echo "<td><p><strong>";
//echo pageTitle
echo "</strong> ";
// echo pageContent
echo "<a href=\"/news/page.php?pageID=";
//echo page ID
echo "\">Read More...</a></p></td></tr>\n";
//end loop
}*/
echo "</table>\n";
}
?>
I can see in my head how this should work but I' don't really understand
how to do things like print the value of pageTitle for the nth record in
the set.
Any pointers would be gratefully received.
Matt
attached mail follows:
[snip]
I'm trying to build a news panel for my home page. Basically I want to
present the five most recent news articles in a recordset, but I'm not
sure how to cut off the recordset after 5.
[/snip]
use LIMIT 5 as the last bit of your query
Jay
attached mail follows:
> I'm trying to build a news panel for my home page. Basically I want to
> present the five most recent news articles in a recordset, but I'm not
> sure how to cut off the recordset after 5.
> Also I want to present a picture with my first headline.
>
> My code will go something like this:
>
> <?php
> // Start News Wotsit.
> // Create Recordset
> $gubbins = "SELECT * FROM tblContent WHERE pageParent =
> 3 ORDER BY pageDate DESC";
SELECT * FROM tblContent WHERE pageParent = 3 ORDER BY pageDate DESC LIMIT 5
Now your result only has 5 results returned. Loop through them with
mysql_fetch_assoc() and display accordingly.
---John Holmes...
attached mail follows:
> On Tuesday 03 June 2003 13:58, Jay Blanchard wrote:
> > [snip]
> > We would have to see some code....
> >
> > Jay
>
> I'm not able to reproduce this in a short code-snippet.
> But from the first echo to the last echo $lid change its value:
Either this is a bad cut and paste job or this script will never run because
it's full of errors. Either way, if $lid changes, it's because you're
changing it. Maybe you have an if($lid = 'value') instead of if($lid ==
'value') somewhere?
> if ($hostid==31) echo "lid1: $lid";
>
> # Paragraphs
> #
> if ($bodytype==1) {
> sql_query("UPDATE tblArticleParagraph SET sort=-1 WHERE
artid=$lid
> AND hostid=$session_hostid");
> $tmpbody = '';
> for ($i=0; $i<count($paragraphs); $i++) {
> $popt = 1;
> $popt = $popt | (($parhardoutline[$i]) ? 0x2 : 0);
> $parpicurl[$i] = preg_replace("/'/s",'"',$parpicurl[$i]);
> $parheadline[$i] = trim($parheadline[$i]);
> $parpictext[$i] = trim($parpictext[$i]);
> if ($hostoptions&0x80) { # STRICT FONT/STYLE STRIP
> $parparagraph[$i] = stripFontAndStyle($parparagraph[$i]);
> }
> sql_query("INSERT INTO tblArticleParagraph
> (hostid,artid,sort,options,headline,picurl,paragraph,pictext)
> VALUES
>
($session_hostid,$lid,$i,$popt,'$parheadline[$i]','$parpicurl[$i]','$parpara
graph[$i]','$parpictext[$i]')");
> $tmpbody .= $parheadline[$i];
> $tmpbody .= ' ';
> $tmpbody .= $parparagraph[$i];
> $tmpbody .= ' ';
> }
> sql_query("UPDATE tblArticle SET body='$tmpbody' WHERE id=$lid
AND
> hostid=hostid=$session_hostid");
> sql_query("DELETE FROM tblArticleParagraph WHERE artid=$lid AND
> sort=-1 AND hostid=$session_hostid");
> }
>
> if ($special && $formid) {
> # form based article publishing
> # arnt h, Feb 03
> list($tformid,$treplyid) = sql_queryandfetch("SELECT
formid,replyid
> FROM refArticleForm WHERE hostid=$session_hostid AND artid='$saveid'
You do not finish the above SQL statement
> if (!$tformid && !$treplyid) {
> sql_query("INSERT INTO refArticleForm
> (hostid,artid,formid,replyid) VALUES
($session_hostid,$saveid,$formid,0)");
> $tformid = $formid;
> }
> $surveyid = $tformid;
> $hostid = $session_hostid;
> $arntid = $id;
> $id = $saveid;
> $arntpublic_userid = $public_userid;
> $public_userid = 0;
> include 'include/surveysavereply.inc'; ## perform saving
> $public_userid = $arntpublic_userid;
> $id = $arntid;
> sql_query("UPDATE refArticleForm SET replyid=$thisreplyid WHERE
> artid=$saveid AND hostid=$session_hostid");
> $tmp = '';
> reset($surveykeyval);
> foreach ($surveykeyval as $key => $val) {
> for ($xxi=0; $xxi<count($val); $xxi++) {
> $tmpval = $val[$xxi];
> if (!$tmpval) continue;
> $tmpval = preg_replace('/\|\{.*?\}/','',$tmpval);
> $lbl = "fbq_".$key;
> $tmp .= "<$key lbl=\"".$$lbl."\">$tmpval</$key>\r\n";
> }
> }
> # $tmp = '<bodyxml>'.$tmp.'</bodyxml>';
> sql_query("UPDATE tblArticle SET body='$tmp' WHERE id=$saveid AND
> hostid=$session_hostid");
> }
>
> # Save tblArticleExtension
> #
> list($tmp) = sql_queryandfetch("SELECT id FROM tblArticleExtension
WHERE
> artid=$lid AND hostid=$session_hostid");
> if ($tmp) sql_query("UPDATE tblArticleExtension SET
>
custom1='$custom1',custom2='$custom2',custom3='$custom3',custom4='$custom4'
> WHERE ar
Same here...
> elseif ($custom1||$custom2||$custom3||$custom4) sql_query("INSERT
INTO
> tblArticleExtension (hostid,artid,custom1,custom2,custom3,custom4) V
and here...
Those alone will cause a ton of parse errors.
>
> if ($hostid==31) echo "<hr>lid2:$lid";
---John Holmes...
attached mail follows:
[snip]
I'm not able to reproduce this in a short code-snippet.
But from the first echo to the last echo $lid change its value:
if ($hostid==31) echo "lid1: $lid";
# Paragraphs
[/snip]
$lid is getting set the first time before the IF statement. From this IF
to the last $lid in what you posted I couldn't find anything re-setting
$lid. So you must be doing it outside of the code block. What is the
initial value of the variable, and what does it change to?
Jay
attached mail follows:
Thats the strange thing... there IS NO CODE that change the value...
And the cut/paste is bad... there is no parse errors and the code snip is only
a small part of a scriptfile.
- Svein
On Tuesday 03 June 2003 15:33, Jay Blanchard wrote:
> [snip]
> I'm not able to reproduce this in a short code-snippet.
> But from the first echo to the last echo $lid change its value:
>
> if ($hostid==31) echo "lid1: $lid";
>
> # Paragraphs
> [/snip]
>
> $lid is getting set the first time before the IF statement. From this IF
> to the last $lid in what you posted I couldn't find anything re-setting
> $lid. So you must be doing it outside of the code block. What is the
> initial value of the variable, and what does it change to?
>
> Jay
attached mail follows:
On Tuesday 03 June 2003 15:27, CPT John W. Holmes wrote:
> > On Tuesday 03 June 2003 13:58, Jay Blanchard wrote:
> > > [snip]
> > > We would have to see some code....
> > >
> > > Jay
> >
> > I'm not able to reproduce this in a short code-snippet.
> > But from the first echo to the last echo $lid change its value:
>
> Either this is a bad cut and paste job or this script will never run
> because it's full of errors. Either way, if $lid changes, it's because
> you're changing it. Maybe you have an if($lid = 'value') instead of if($lid
Yep, its a bad paste :) The script is error-free...
But there is no code that change the variable and it still get changed.
Eg. it change from 75497 to 6894
- Svein
attached mail follows:
> Yep, its a bad paste :) The script is error-free...
> But there is no code that change the variable and it still get changed.
> Eg. it change from 75497 to 6894
In order of increasing probability:
- you can attribute it to black magic
- you've hit upon a php bug
- there's something wrong with your code
Assume that there's something wrong with your code, you can do one of the
following:
- step through it with a debugger to see where $lid changes
- remove code from it until $lid doesn't change
- echo $lid after everything statement/line in your code
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
You may have heard that a dean is to faculty as a hydrant is to a dog.
-- Alfred Kahn
*/
attached mail follows:
Cut&paste the code, also file include/surveysavereply.inc.
Svein Larsen wrote:
> On Tuesday 03 June 2003 15:27, CPT John W. Holmes wrote:
>
>>>On Tuesday 03 June 2003 13:58, Jay Blanchard wrote:
>>>
>>>>[snip]
>>>>We would have to see some code....
>>>>
>>>>Jay
>>>
>>>I'm not able to reproduce this in a short code-snippet.
>>>But from the first echo to the last echo $lid change its value:
>>
>>Either this is a bad cut and paste job or this script will never run
>>because it's full of errors. Either way, if $lid changes, it's because
>>you're changing it. Maybe you have an if($lid = 'value') instead of if($lid
>
>
> Yep, its a bad paste :) The script is error-free...
> But there is no code that change the variable and it still get changed.
> Eg. it change from 75497 to 6894
>
> - Svein
>
>
attached mail follows:
It's just some mathematics:
assume $time is the value in seconds:
$secs = $time % 60;
$totalMinutes = ( $time - $secs ) / 60;
$minutes = $totalMinutes % 60;
$hours = ( $totalMinutes - $minutes ) / 60;
Now you can do like this:
echo "$time secondes is $hours hours, $minutes minutes and $seconds
seconds";
"Chinmoy Barua" <chinmoysubarna
yahoo.com> schreef in bericht
news:20030603123808.8213.qmail
web21109.mail.yahoo.com...
> Hello everybody,
> I have a value 178607, which is stored as seconds. I
> like to convert it (178607 Secs) to Hours, Minutes and
> Seconds appropiatly.
> Can anybody help me supplying the code?
> Thank You,
> - Chinmoy
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
attached mail follows:
New to the list, so I hope I'm in the right place.
I'm trying to write a small php function which checks a page filled
with a list of satellite images of earth, and loads the latest one to
have been taken at 4:25 in the morning, when the view is most complete
(full credit to be given to the original source, of course ... I'm not
pretending to be running a satellite here).
Here's what I've got so far:
<?php
$URLbase =
"http://rsd.gsfc.nasa.gov/goesg/earth/Weather/GMS-5/jpg/vis/4km/";
if (!($fp = fopen($URLbase, "r")))
{
echo "<p style=color:white>Could not open the url</p>";
exit;
}
$contents = fread($fp, 1000000);
fclose($fp);
$pattern = (^[[:digit:]]{6}0425\.jpg$);
if (eregi($pattern, $contents, $fullviews))
{
$latestfullview = end($fullviews);
echo "<img src=\"".$URLbase.$latestfullview."\" width=\"470\""
." alt=\"Earth from the GMS-5 satellite above the Timor strait\"
\\>";
}
else
{
echo "<p style=color:white>No image available</p>";
}
?>
The error I'm getting points to the fclose($fp) line, but whether or
not that's the culprit I don't know. (What little java I've written has
taught me that the effects of an error can be registered far from it's
source - perhaps the url isn't properly formed for the fopen()
function?)
I've tested the regex, and it returns true for a jpg file named with a
10 digit number ending in 0425 (eg. 0305110425.jpg) as it should, but
not for eg. <a href="0305110425.jpg">0305110425.jpg</a>, which is the
sort of code in which the file name is embedded in the page I'm asking
it to search, so I guess there's a problem here. Am I understanding the
caret and dollar signs correctly, as respectively indicating the start
and end of the search string? Or do they refer to the token being
searched?
I want to add more functionality to the script yet (load a default
image and email the webmaster when no image is found, date and time of
the image capture, etc.) but I need to get at least this much working
to start off with.
Any suggestions? I'm still new to this, so feel free to mention the
most obvious mistakes as well as any more subtle ones.
I'm working locally on Mac OS X if that makes any difference.
Many thanks,
Mike
attached mail follows:
[snip]
<?php
$URLbase =
"http://rsd.gsfc.nasa.gov/goesg/earth/Weather/GMS-5/jpg/vis/4km/";
if (!($fp = fopen($URLbase, "r")))
{
echo "<p style=color:white>Could not open the url</p>";
exit;
}
$contents = fread($fp, 1000000);
fclose($fp);
?>
[/snip]
Was that really a line break after $URLbase = ? (Probably not, but just
checking) ...
Try adding a 'b' to your fopen ...
fopen($URLbase, "rb")
... in the event that you're dealing with a Windows platform.
HTH!
Jay
attached mail follows:
Your pattern should look like:
$pattern = "([[:digit:]]{6}0425\.jpg)";
This will give you the image name, but remember that ereg works on
single lines and also the image might be taken at some time around 4:25.
So you need a while loop to read the html line by line, in the loop try
to match the pattern, and if the pattern succeeds (first few lines and
last 2 lines are just html junk), check if it is close enough to 4:25.
Then break the while loop and display the image.
Michael Allan wrote:
> New to the list, so I hope I'm in the right place.
>
> I'm trying to write a small php function which checks a page filled with
> a list of satellite images of earth, and loads the latest one to have
> been taken at 4:25 in the morning, when the view is most complete (full
> credit to be given to the original source, of course ... I'm not
> pretending to be running a satellite here).
>
> Here's what I've got so far:
>
> <?php
>
> $URLbase =
> "http://rsd.gsfc.nasa.gov/goesg/earth/Weather/GMS-5/jpg/vis/4km/";
>
> if (!($fp = fopen($URLbase, "r")))
> {
> echo "<p style=color:white>Could not open the url</p>";
> exit;
> }
> $contents = fread($fp, 1000000);
> fclose($fp);
>
> $pattern = (^[[:digit:]]{6}0425\.jpg$);
> if (eregi($pattern, $contents, $fullviews))
> {
> $latestfullview = end($fullviews);
> echo "<img src=\"".$URLbase.$latestfullview."\" width=\"470\""
> ." alt=\"Earth from the GMS-5 satellite above the Timor
> strait\" \\>";
> }
> else
> {
> echo "<p style=color:white>No image available</p>";
> }
> ?>
>
> The error I'm getting points to the fclose($fp) line, but whether or not
> that's the culprit I don't know. (What little java I've written has
> taught me that the effects of an error can be registered far from it's
> source - perhaps the url isn't properly formed for the fopen() function?)
>
> I've tested the regex, and it returns true for a jpg file named with a
> 10 digit number ending in 0425 (eg. 0305110425.jpg) as it should, but
> not for eg. <a href="0305110425.jpg">0305110425.jpg</a>, which is the
> sort of code in which the file name is embedded in the page I'm asking
> it to search, so I guess there's a problem here. Am I understanding the
> caret and dollar signs correctly, as respectively indicating the start
> and end of the search string? Or do they refer to the token being searched?
>
> I want to add more functionality to the script yet (load a default image
> and email the webmaster when no image is found, date and time of the
> image capture, etc.) but I need to get at least this much working to
> start off with.
>
> Any suggestions? I'm still new to this, so feel free to mention the most
> obvious mistakes as well as any more subtle ones.
> I'm working locally on Mac OS X if that makes any difference.
>
> Many thanks,
> Mike
>
>
attached mail follows:
Marek,
> Your pattern should look like:
> $pattern = "([[:digit:]]{6}0425\.jpg)";
BINGO!
> This will give you the image name, but remember that ereg works on
> single lines and also the image might be taken at some time around
> 4:25. So you need a while loop to read the html line by line, in the
> loop try to match the pattern, and if the pattern succeeds (first few
> lines and last 2 lines are just html junk), check if it is close
> enough to 4:25. Then break the while loop and display the image.
I'll look into this - 04:25 has been a constant for the months I've
been watching this, but I'll work out a routine to check if this
changes as you suggest. And thanks for the explanation of ereg() - that
will help.
And Jay,
> Was that really a line break after $URLbase = ? (Probably not, but just
> checking) ...
nah, just line wrapping in the email
> Try adding a 'b' to your fopen ...
>
> fopen($URLbase, "rb")
>
> ... in the event that you're dealing with a Windows platform.
I presume from the forward slashes in $URLbase that I'm dealing with
just such a platform, so I've added the b (and looked up what it
means). Good tip.
Thanks for such quick and effective help, guys! What a great resource.
Mike
> Michael Allan wrote:
>> New to the list, so I hope I'm in the right place.
>> I'm trying to write a small php function which checks a page filled
>> with a list of satellite images of earth, and loads the latest one to
>> have been taken at 4:25 in the morning, when the view is most
>> complete (full credit to be given to the original source, of course
>> ... I'm not pretending to be running a satellite here).
>> Here's what I've got so far:
>> <?php
>> $URLbase =
>> "http://rsd.gsfc.nasa.gov/goesg/earth/Weather/GMS-5/jpg/vis/4km/";
>> if (!($fp = fopen($URLbase, "r")))
>> {
>> echo "<p style=color:white>Could not open the url</p>";
>> exit;
>> }
>> $contents = fread($fp, 1000000);
>> fclose($fp);
>> $pattern = (^[[:digit:]]{6}0425\.jpg$);
>
>
>> if (eregi($pattern, $contents, $fullviews))
>> {
>> $latestfullview = end($fullviews);
>> echo "<img src=\"".$URLbase.$latestfullview."\"
>> width=\"470\""
>> ." alt=\"Earth from the GMS-5 satellite above the
>> Timor strait\" \\>";
>> }
>> else
>> {
>> echo "<p style=color:white>No image available</p>";
>> }
>> ?>
>> The error I'm getting points to the fclose($fp) line, but whether or
>> not that's the culprit I don't know. (What little java I've written
>> has taught me that the effects of an error can be registered far from
>> it's source - perhaps the url isn't properly formed for the fopen()
>> function?)
>> I've tested the regex, and it returns true for a jpg file named with
>> a 10 digit number ending in 0425 (eg. 0305110425.jpg) as it should,
>> but not for eg. <a href="0305110425.jpg">0305110425.jpg</a>, which is
>> the sort of code in which the file name is embedded in the page I'm
>> asking it to search, so I guess there's a problem here. Am I
>> understanding the caret and dollar signs correctly, as respectively
>> indicating the start and end of the search string? Or do they refer
>> to the token being searched?
>> I want to add more functionality to the script yet (load a default
>> image and email the webmaster when no image is found, date and time
>> of the image capture, etc.) but I need to get at least this much
>> working to start off with.
>> Any suggestions? I'm still new to this, so feel free to mention the
>> most obvious mistakes as well as any more subtle ones.
>> I'm working locally on Mac OS X if that makes any difference.
>> Many thanks,
>> Mike
>
attached mail follows:
Hi NG,
I am trying to implement the CDP (Cisco Discovery Protocol) into PHP. For
this task it is needed to send Layer2 frames to a specific MAC address. Is
there a possibility to do so ?
Please answer as fast as possible either to kmpoppe
tzi.de or to this NG.
Thanks !
Kai M Poppe
WLAN Infrastructure, University of Bremen
attached mail follows:
No, not with php. You can use some external program or write a php module.
Kai Poppe wrote:
> Hi NG,
>
> I am trying to implement the CDP (Cisco Discovery Protocol) into PHP. For
> this task it is needed to send Layer2 frames to a specific MAC address. Is
> there a possibility to do so ?
>
> Please answer as fast as possible either to kmpoppe
tzi.de or to this NG.
>
> Thanks !
>
> Kai M Poppe
> WLAN Infrastructure, University of Bremen
>
>
>
attached mail follows:
Hello,
On 06/03/2003 06:21 AM, Shaun wrote:
> I am creating a timesheet application, how can I make sure that a user has
> entered a number, and that the number is a whole number or a decimal up to 2
> places, and that the number is less than 24?
You may want to try this forms generation and validation class that can
either validate you form values in the client site with generated
Javascript or using the class itself on the server side:
http://www.phpclasses.org/formsgeneration
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
On Tue, 2003-06-03 at 02:46, Sichta Daniel wrote:
> Another way is to do it on client side (javascript)
>
> DS
Indeed, but then you have to be prepared for it not to work if
the user doesn't have js enabled.
Torben
> -----Original Message-----
> From: Shaun [mailto:shaun
mania.plus.com]
> Sent: Tuesday, June 03, 2003 11:21 AM
> To: php-general
lists.php.net
> Subject: [PHP] Validating user input
>
>
> Hi,
>
> I am creating a timesheet application, how can I make sure that a user has
> entered a number, and that the number is a whole number or a decimal up to 2
> places, and that the number is less than 24?
>
> Thanks for your help
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Torben Wilson <torben
php.net> +1.604.709.0506
http://www.thebuttlesschaps.com http://www.inflatableeye.com
http://www.hybrid17.com http://www.themainonmain.com
-----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----
attached mail follows:
If I have a date in unix format in a numeric field in my table (Mysql) and I
want to compare it to a date which is in unixformat also, will the query
work like this?
"SELECT from tarifs where unix_from_date<=".$dateinunixformat
attached mail follows:
What about trying it first?
Diana Castillo wrote:
> If I have a date in unix format in a numeric field in my table (Mysql) and I
> want to compare it to a date which is in unixformat also, will the query
> work like this?
>
> "SELECT from tarifs where unix_from_date<=".$dateinunixformat
>
>
>
>
attached mail follows:
That procedure it's call "validation" so i think you don't need compare, or
query to bd any. Just validate if a $variable is a valid date in UnixFormat,
i don't know how to do this, but google or someelse maybe know.
regards.
EF.
"Diana Castillo" <diana
interhotel.com> escribió en el mensaje
news:20030603141359.58434.qmail
pb1.pair.com...
> If I have a date in unix format in a numeric field in my table (Mysql) and
I
> want to compare it to a date which is in unixformat also, will the query
> work like this?
>
> "SELECT from tarifs where unix_from_date<=".$dateinunixformat
>
>
>
attached mail follows:
Hi,
This is more of a JS question than a PHP but have not found anything on
google
(http://www.google.com/search?q=javascript+onclick+button&sourceid=opera&num
=0&ie=utf-8&oe=utf-8) and cant remember how I did this last time
I simply want to submit my form to either one.php or two.php or thr.php
depending on which BUTTON is pressed (I am using html buttons <input
type='submit' value='blah'>) I have 3 buttons....how do i set it?
Sorry this is so O T but any help appreciated.
Thanks,
-Ryan
attached mail follows:
[snip]
I simply want to submit my form to either one.php or two.php or thr.php
depending on which BUTTON is pressed (I am using html buttons <input
type='submit' value='blah'>) I have 3 buttons....how do i set it?
[/snip]
Instead of 3 different .php why not use one.php with a SWITCH statement?
http://us3.php.net/manual/en/control-structures.switch.php
HTH!
Jay
attached mail follows:
At 6/3/2003 04:24 PM, Ryan A wrote:
> I simply want to submit my form to either one.php or two.php or thr.php
> depending on which BUTTON is pressed (I am using html buttons <input
> type='submit' value='blah'>) I have 3 buttons....how do i set it?
You can do this one of three ways:
1. Instead of actually submitting to a different php script, you submit to
one script that gives a header location based on which submit button you
use. So if I have three submit-type buttons, I'll just say
IF($_POST['submit1']) {
header("Location: script1.php");
}
ELSEIF($_POST['submit2']) {
header("Location: script2.php");
}
etc.
2. You submit to one script that includes the relevant functions depending
on which button is pushed.
IF($_POST['submit1']) {
include("script1.php"):
}
or
3. You do it with Javascript since what you actually want to do is on the
client, not the server.
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: skeller
healthtvchannel.org
Web: www.healthtvchannel.org
attached mail follows:
don't echo anything before the header. else there is automatically a header
generated by your server.
"Mishari" <esheager
yahoo.com> schrieb im Newsbeitrag
news:20030603124248.49950.qmail
web21413.mail.yahoo.com...
> Hi,
> I used it before, but I had a problem
>
> my code look like,
> if (------) {
> echo "-------";
> header(------);
> }
>
> I don't know what is it?
>
>
>
> --- Marek Kilimajer <kilimajer
webglobe.sk> wrote:
> > Discused few threads ago:
> > header('Refresh: 15; url=newurl.php' );
> >
> > 15 is in seconds.
> >
> > Mishari wrote:
> > > Hi all,
> > >
> > > I need help,
> > > actually I'm building a PHP site where my users
> > will
> > > wait for a few seconds reading a text then it will
> > > automatically link them to another site.
> > >
> > > I'm looking for the command which auto. link to
> > other
> > > sites.
> > >
> > >
> > > Kind Regards,
> > > esheager
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! Calendar - Free online calendar with sync
> > to Outlook(TM).
> > > http://calendar.yahoo.com
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
attached mail follows:
I am trying to get the Sample Barcode to run on my server, however the
following line does not execute:
echo "<table align='center'><tr><td><img src='./image.php?code=" .
$barcode . "&style=" . $style . "&type=" . $type . "&width=" . $width .
"&height=" . $height . "&xres=" . $xres . "&font=" . $font .
"'></td></tr></table>";
To see if it is executing, I have an "Echo" statement in the script.
The image.php file is in the same directory as the other script files.
What am I missing here?
Todd
--
attached mail follows:
did u made copy&paste with your code?
yes? then why don't you try to use the path='image.php?blahblahmoreblah'
????
no? then please give us more details about the error you're getting...
good luck,
Alex
----- Original Message -----
From: "Todd Cary" <todd
aristesoftware.com>
To: <php-general
lists.php.net>
Sent: Tuesday, June 03, 2003 6:03 PM
Subject: [PHP] This line does not execute...
> I am trying to get the Sample Barcode to run on my server, however the
> following line does not execute:
>
> echo "<table align='center'><tr><td><img src='./image.php?code=" .
> $barcode . "&style=" . $style . "&type=" . $type . "&width=" . $width .
> "&height=" . $height . "&xres=" . $xres . "&font=" . $font .
> "'></td></tr></table>";
>
> To see if it is executing, I have an "Echo" statement in the script.
>
> The image.php file is in the same directory as the other script files.
> What am I missing here?
>
> Todd
> --
>
attached mail follows:
oh I see, you want to execute that image.php script ?
----- Original Message -----
From: "Alex Ciurea" <alex
netonwave.com>
To: "php mailing" <php-general
lists.php.net>; "Todd Cary"
<todd
aristesoftware.com>
Sent: Tuesday, June 03, 2003 6:07 PM
Subject: Re: [PHP] This line does not execute...
> did u made copy&paste with your code?
>
> yes? then why don't you try to use the path='image.php?blahblahmoreblah'
> ????
>
> no? then please give us more details about the error you're getting...
>
> good luck,
> Alex
>
>
> ----- Original Message -----
> From: "Todd Cary" <todd
aristesoftware.com>
> To: <php-general
lists.php.net>
> Sent: Tuesday, June 03, 2003 6:03 PM
> Subject: [PHP] This line does not execute...
>
>
> > I am trying to get the Sample Barcode to run on my server, however the
> > following line does not execute:
> >
> > echo "<table align='center'><tr><td><img src='./image.php?code=" .
> > $barcode . "&style=" . $style . "&type=" . $type . "&width=" . $width .
> > "&height=" . $height . "&xres=" . $xres . "&font=" . $font .
> > "'></td></tr></table>";
> >
> > To see if it is executing, I have an "Echo" statement in the script.
> >
> > The image.php file is in the same directory as the other script files.
> > What am I missing here?
> >
> > Todd
> > --
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Alex -
The code I placed in the messsage is a copy and paste of the code from
the sample.php script provided by the author of the barcode class and it
agrees with the demo he has on his site.
The "error" is that nothing is happening which I interpret as the file,
image.php is not being accessed (I put an Echo statement inside it and
it does not execute). Here is the complete block of code:
if ($obj) {
if ($obj->DrawObject($xres)) {
echo "<table align='center'><tr><td><img
src='./image.php?code=" . $barcode . "&style=" . $style . "&type=" .
$type . "&width=" . $width . "&height=" . $height . "&xres=" . $xres .
"&font=" . $font . "'></td></tr></table>";
// My debug code - this line executes!
echo "<table align='center'><tr><td><font
color='#FF0000'>Success: Barcode = " . $barcode .
"</font></td></tr></table>";
} else {
echo "<table align='center'><tr><td><font color='#FF0000'>" .
($obj->GetError()) . "</font></td></tr></table>";
// My debug code
echo "<table align='center'><tr><td><font
color='#FF0000'>Problem; Barcode = " . $barcode .
"</font></td></tr></table>";
}
} else {
// My debug code
echo "<table align='center'><tr><td><font color='#FF0000'>Obj is
false; Barcode = " . $barcode . "</font></td></tr></table>";
}
Alex Ciurea wrote:
>did u made copy&paste with your code?
>
>yes? then why don't you try to use the path='image.php?blahblahmoreblah'
>????
>
>no? then please give us more details about the error you're getting...
>
>good luck,
>Alex
>
>
>----- Original Message -----
>From: "Todd Cary" <todd
aristesoftware.com>
>To: <php-general
lists.php.net>
>Sent: Tuesday, June 03, 2003 6:03 PM
>Subject: [PHP] This line does not execute...
>
>
>
>
>>I am trying to get the Sample Barcode to run on my server, however the
>>following line does not execute:
>>
>> echo "<table align='center'><tr><td><img src='./image.php?code=" .
>>$barcode . "&style=" . $style . "&type=" . $type . "&width=" . $width .
>>"&height=" . $height . "&xres=" . $xres . "&font=" . $font .
>>"'></td></tr></table>";
>>
>>To see if it is executing, I have an "Echo" statement in the script.
>>
>>The image.php file is in the same directory as the other script files.
>> What am I missing here?
>>
>>Todd
>>--
>>
>>
>>
>
>.
>
>
>
--
attached mail follows:
How do you know it is not being accessed? You should output an image,
and if it is not an image, broken image icon is displayed in IE or
nothing in Netscape/Mozilla (I see you use Netscape). Look at the html,
and if the <img> tag is there, I'm sure your browser tries to read the
image.
Todd Cary wrote:
> Alex -
>
> The code I placed in the messsage is a copy and paste of the code from
> the sample.php script provided by the author of the barcode class and it
> agrees with the demo he has on his site.
>
> The "error" is that nothing is happening which I interpret as the file,
> image.php is not being accessed (I put an Echo statement inside it and
> it does not execute). Here is the complete block of code:
>
> if ($obj) {
>
> if ($obj->DrawObject($xres)) {
> echo "<table align='center'><tr><td><img src='./image.php?code="
> . $barcode . "&style=" . $style . "&type=" . $type . "&width=" . $width
> . "&height=" . $height . "&xres=" . $xres . "&font=" . $font .
> "'></td></tr></table>";
>
> // My debug code - this line executes!
> echo "<table align='center'><tr><td><font
> color='#FF0000'>Success: Barcode = " . $barcode .
> "</font></td></tr></table>";
> } else {
> echo "<table align='center'><tr><td><font color='#FF0000'>" .
> ($obj->GetError()) . "</font></td></tr></table>";
>
> // My debug code
> echo "<table align='center'><tr><td><font
> color='#FF0000'>Problem; Barcode = " . $barcode .
> "</font></td></tr></table>";
> }
> } else {
> // My debug code
> echo "<table align='center'><tr><td><font color='#FF0000'>Obj is
> false; Barcode = " . $barcode . "</font></td></tr></table>";
> }
>
>
> Alex Ciurea wrote:
>
>> did u made copy&paste with your code?
>>
>> yes? then why don't you try to use the path='image.php?blahblahmoreblah'
>> ????
>>
>> no? then please give us more details about the error you're getting...
>>
>> good luck,
>> Alex
>>
>>
>> ----- Original Message -----
>> From: "Todd Cary" <todd
aristesoftware.com>
>> To: <php-general
lists.php.net>
>> Sent: Tuesday, June 03, 2003 6:03 PM
>> Subject: [PHP] This line does not execute...
>>
>>
>>
>>
>>> I am trying to get the Sample Barcode to run on my server, however the
>>> following line does not execute:
>>>
>>> echo "<table align='center'><tr><td><img src='./image.php?code=" .
>>> $barcode . "&style=" . $style . "&type=" . $type . "&width=" . $width .
>>> "&height=" . $height . "&xres=" . $xres . "&font=" . $font .
>>> "'></td></tr></table>";
>>>
>>> To see if it is executing, I have an "Echo" statement in the script.
>>>
>>> The image.php file is in the same directory as the other script files.
>>> What am I missing here?
>>>
>>> Todd
>>> --
>>>
>>>
>>
>>
>> .
>>
>>
>>
>
attached mail follows:
Ok Tod, this is what I understood so far:
1) image.php should generate for you a barcode;
2) you placed an echo statement inside image.php and nothing happens
Marek have good ideea: try to see the html source code, the code that is
interpreted by your browser.
the executable file ./image.php probably don't run.
try to see, from your shell (i think you use linux) if u can run a php
script. e.g.: ./myscript.php
----- Original Message -----
From: "Todd Cary" <todd
aristesoftware.com>
To: "Alex Ciurea" <alex
netonwave.com>
Cc: "php mailing" <php-general
lists.php.net>
Sent: Tuesday, June 03, 2003 6:22 PM
Subject: Re: [PHP] This line does not execute...
> Alex -
>
> The code I placed in the messsage is a copy and paste of the code from
> the sample.php script provided by the author of the barcode class and it
> agrees with the demo he has on his site.
>
> The "error" is that nothing is happening which I interpret as the file,
> image.php is not being accessed (I put an Echo statement inside it and
> it does not execute). Here is the complete block of code:
>
> if ($obj) {
>
> if ($obj->DrawObject($xres)) {
> echo "<table align='center'><tr><td><img
> src='./image.php?code=" . $barcode . "&style=" . $style . "&type=" .
> $type . "&width=" . $width . "&height=" . $height . "&xres=" . $xres .
> "&font=" . $font . "'></td></tr></table>";
>
> // My debug code - this line executes!
> echo "<table align='center'><tr><td><font
> color='#FF0000'>Success: Barcode = " . $barcode .
> "</font></td></tr></table>";
> } else {
> echo "<table align='center'><tr><td><font color='#FF0000'>" .
> ($obj->GetError()) . "</font></td></tr></table>";
>
> // My debug code
> echo "<table align='center'><tr><td><font
> color='#FF0000'>Problem; Barcode = " . $barcode .
> "</font></td></tr></table>";
> }
> } else {
> // My debug code
> echo "<table align='center'><tr><td><font color='#FF0000'>Obj is
> false; Barcode = " . $barcode . "</font></td></tr></table>";
> }
>
>
> Alex Ciurea wrote:
>
> >did u made copy&paste with your code?
> >
> >yes? then why don't you try to use the path='image.php?blahblahmoreblah'
> >????
> >
> >no? then please give us more details about the error you're getting...
> >
> >good luck,
> >Alex
> >
> >
> >----- Original Message -----
> >From: "Todd Cary" <todd
aristesoftware.com>
> >To: <php-general
lists.php.net>
> >Sent: Tuesday, June 03, 2003 6:03 PM
> >Subject: [PHP] This line does not execute...
> >
> >
> >
> >
> >>I am trying to get the Sample Barcode to run on my server, however the
> >>following line does not execute:
> >>
> >> echo "<table align='center'><tr><td><img src='./image.php?code=" .
> >>$barcode . "&style=" . $style . "&type=" . $type . "&width=" . $width .
> >>"&height=" . $height . "&xres=" . $xres . "&font=" . $font .
> >>"'></td></tr></table>";
> >>
> >>To see if it is executing, I have an "Echo" statement in the script.
> >>
> >>The image.php file is in the same directory as the other script files.
> >> What am I missing here?
> >>
> >>Todd
> >>--
> >>
> >>
> >>
> >
> >.
> >
> >
> >
>
> --
>
>
attached mail follows:
Marek -
Yes, the Img is being executed (Broken image icon in IE) as evidenced by
the HTML:
<table align='center'><tr><td><img
src='./image.php?code=0123456789&style=68&type=C39&width=460&height=120&xres=2&font=5'></td></tr></table><table
align='center'><tr><td><font color='#FF0000'>Success: Barcode =
0123456789</font></td></tr></table><br>
However, the image.php is apparently not being executed. I put an Echo
statement in the top of image.php:
// Debug
echo "Debug<br>";
Is there some setting in the php.ini file that would prevent image.php
from executing? I do have
register_globals = Off
However, I get the variables with $HTTP_POST_VARS[] statements.
Todd
Marek Kilimajer wrote:
> How do you know it is not being accessed? You should output an image,
> and if it is not an image, broken image icon is displayed in IE or
> nothing in Netscape/Mozilla (I see you use Netscape). Look at the
> html, and if the <img> tag is there, I'm sure your browser tries to
> read the image.
>
> Todd Cary wrote:
>
>> Alex -
>>
>> The code I placed in the messsage is a copy and paste of the code
>> from the sample.php script provided by the author of the barcode
>> class and it agrees with the demo he has on his site.
>>
>> The "error" is that nothing is happening which I interpret as the
>> file, image.php is not being accessed (I put an Echo statement inside
>> it and it does not execute). Here is the complete block of code:
>>
>> if ($obj) {
>>
>> if ($obj->DrawObject($xres)) {
>> echo "<table align='center'><tr><td><img
>> src='./image.php?code=" . $barcode . "&style=" . $style . "&type=" .
>> $type . "&width=" . $width . "&height=" . $height . "&xres=" . $xres
>> . "&font=" . $font . "'></td></tr></table>";
>>
>> // My debug code - this line executes!
>> echo "<table align='center'><tr><td><font
>> color='#FF0000'>Success: Barcode = " . $barcode .
>> "</font></td></tr></table>";
>> } else {
>> echo "<table align='center'><tr><td><font color='#FF0000'>" .
>> ($obj->GetError()) . "</font></td></tr></table>";
>>
>> // My debug code
>> echo "<table align='center'><tr><td><font
>> color='#FF0000'>Problem; Barcode = " . $barcode .
>> "</font></td></tr></table>";
>> }
>> } else {
>> // My debug code
>> echo "<table align='center'><tr><td><font color='#FF0000'>Obj is
>> false; Barcode = " . $barcode . "</font></td></tr></table>";
>> }
>>
>>
>> Alex Ciurea wrote:
>>
>>> did u made copy&paste with your code?
>>>
>>> yes? then why don't you try to use the
>>> path='image.php?blahblahmoreblah'
>>> ????
>>>
>>> no? then please give us more details about the error you're getting...
>>>
>>> good luck,
>>> Alex
>>>
>>>
>>> ----- Original Message -----
>>> From: "Todd Cary" <todd
aristesoftware.com>
>>> To: <php-general
lists.php.net>
>>> Sent: Tuesday, June 03, 2003 6:03 PM
>>> Subject: [PHP] This line does not execute...
>>>
>>>
>>>
>>>
>>>> I am trying to get the Sample Barcode to run on my server, however the
>>>> following line does not execute:
>>>>
>>>> echo "<table align='center'><tr><td><img src='./image.php?code=" .
>>>> $barcode . "&style=" . $style . "&type=" . $type . "&width=" .
>>>> $width .
>>>> "&height=" . $height . "&xres=" . $xres . "&font=" . $font .
>>>> "'></td></tr></table>";
>>>>
>>>> To see if it is executing, I have an "Echo" statement in the script.
>>>>
>>>> The image.php file is in the same directory as the other script files.
>>>> What am I missing here?
>>>>
>>>> Todd
>>>> --
>>>>
>>>>
>>>
>>>
>>>
>>> .
>>>
>>>
>>>
>>
>
>
--
attached mail follows:
<img> tag can only display images, even if you did put echo "Debug";,
this is not a valid image, so it is not displayed. Try Right Click ->
View Image, you should see your debug output.
Todd Cary wrote:
> Marek -
>
> Yes, the Img is being executed (Broken image icon in IE) as evidenced by the HTML:
>
> <table align='center'><tr><td><img
> src='./image.php?code=0123456789&style=68&type=C39&width=460&height=120&xres=2&font=5'></td></tr></table><table
> align='center'><tr><td><font color='#FF0000'>Success: Barcode =
> 0123456789</font></td></tr></table><br>
>
> However, the image.php is apparently not being executed. I put an Echo
> statement in the top of image.php:
>
> // Debug
> echo "Debug<br>";
>
> Is there some setting in the php.ini file that would prevent image.php from
> executing? I do have
>
> register_globals = Off
>
> However, I get the variables with $HTTP_POST_VARS[] statements.
>
> Todd
>
>
>
> Marek Kilimajer wrote:
>
>> How do you know it is not being accessed? You should output an image, and if
>> it is not an image, broken image icon is displayed in IE or nothing in
>> Netscape/Mozilla (I see you use Netscape). Look at the html, and if the <img>
>> tag is there, I'm sure your browser tries to read the image.
>>
>> Todd Cary wrote:
>>
>>> Alex -
>>>
>>> The code I placed in the messsage is a copy and paste of the code from the
>>> sample.php script provided by the author of the barcode class and it agrees
>>> with the demo he has on his site.
>>>
>>> The "error" is that nothing is happening which I interpret as the file,
>>> image.php is not being accessed (I put an Echo statement inside it and it
>>> does not execute). Here is the complete block of code:
>>>
>>> if ($obj) {
>>>
>>> if ($obj->DrawObject($xres)) {
>>> echo "<table align='center'><tr><td><img src='./image.php?code=" .
>>> $barcode . "&style=" . $style . "&type=" . $type . "&width=" . $width .
>>> "&height=" . $height . "&xres=" . $xres . "&font=" . $font .
>>> "'></td></tr></table>";
>>>
>>> // My debug code - this line executes!
>>> echo "<table align='center'><tr><td><font color='#FF0000'>Success:
>>> Barcode = " . $barcode . "</font></td></tr></table>";
>>> } else {
>>> echo "<table align='center'><tr><td><font color='#FF0000'>" .
>>> ($obj->GetError()) . "</font></td></tr></table>";
>>>
>>> // My debug code
>>> echo "<table align='center'><tr><td><font color='#FF0000'>Problem;
>>> Barcode = " . $barcode . "</font></td></tr></table>";
>>> }
>>> } else {
>>> // My debug code
>>> echo "<table align='center'><tr><td><font color='#FF0000'>Obj is false;
>>> Barcode = " . $barcode . "</font></td></tr></table>";
>>> }
>>>
>>>
>>> Alex Ciurea wrote:
>>>
>>>> did u made copy&paste with your code?
>>>>
>>>> yes? then why don't you try to use the path='image.php?blahblahmoreblah'
>>>> ????
>>>>
>>>> no? then please give us more details about the error you're getting...
>>>>
>>>> good luck,
>>>> Alex
>>>>
>>>>
>>>> ----- Original Message -----
>>>> From: "Todd Cary" <todd
aristesoftware.com>
>>>> To: <php-general
lists.php.net>
>>>> Sent: Tuesday, June 03, 2003 6:03 PM
>>>> Subject: [PHP] This line does not execute...
>>>>
>>>>
>>>>
>>>>
>>>>> I am trying to get the Sample Barcode to run on my server, however the
>>>>> following line does not execute:
>>>>>
>>>>> echo "<table align='center'><tr><td><img src='./image.php?code=" .
>>>>> $barcode . "&style=" . $style . "&type=" . $type . "&width=" . $width .
>>>>> "&height=" . $height . "&xres=" . $xres . "&font=" . $font .
>>>>> "'></td></tr></table>";
>>>>>
>>>>> To see if it is executing, I have an "Echo" statement in the script.
>>>>>
>>>>> The image.php file is in the same directory as the other script files.
>>>>> What am I missing here?
>>>>>
>>>>> Todd
>>>>> --
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> .
>>>>
>>>>
>>>>
>>>
>>
>>
>
> --
>
attached mail follows:
Alex -
The problem is/was that I run PHP with register_globals = Off. Knowing
that, I thought that I had put in all of the $HTTP_XXX_VARS statments,
but I did not. Setting register_globals = On temporarily fixed the
problem.
Now the question is what is the "usual" setting for register_globals :
on or off. As i stated, my preference is to have it "off".
Sorry for not setting register_globals = On right in the beginning...it
would have saved a lot of time :-)!!
Todd
Alex Ciurea wrote:
>Ok Tod, this is what I understood so far:
>
>1) image.php should generate for you a barcode;
>
>2) you placed an echo statement inside image.php and nothing happens
>
>Marek have good ideea: try to see the html source code, the code that is
>interpreted by your browser.
>
>the executable file ./image.php probably don't run.
>try to see, from your shell (i think you use linux) if u can run a php
>script. e.g.: ./myscript.php
>
>
>----- Original Message -----
>From: "Todd Cary" <todd
aristesoftware.com>
>To: "Alex Ciurea" <alex
netonwave.com>
>Cc: "php mailing" <php-general
lists.php.net>
>Sent: Tuesday, June 03, 2003 6:22 PM
>Subject: Re: [PHP] This line does not execute...
>
>
>
>
>>Alex -
>>
>>The code I placed in the messsage is a copy and paste of the code from
>>the sample.php script provided by the author of the barcode class and it
>>agrees with the demo he has on his site.
>>
>>The "error" is that nothing is happening which I interpret as the file,
>>image.php is not being accessed (I put an Echo statement inside it and
>>it does not execute). Here is the complete block of code:
>>
>> if ($obj) {
>>
>> if ($obj->DrawObject($xres)) {
>> echo "<table align='center'><tr><td><img
>>src='./image.php?code=" . $barcode . "&style=" . $style . "&type=" .
>>$type . "&width=" . $width . "&height=" . $height . "&xres=" . $xres .
>>"&font=" . $font . "'></td></tr></table>";
>>
>> // My debug code - this line executes!
>> echo "<table align='center'><tr><td><font
>>color='#FF0000'>Success: Barcode = " . $barcode .
>>"</font></td></tr></table>";
>> } else {
>> echo "<table align='center'><tr><td><font color='#FF0000'>" .
>>($obj->GetError()) . "</font></td></tr></table>";
>>
>> // My debug code
>> echo "<table align='center'><tr><td><font
>>color='#FF0000'>Problem; Barcode = " . $barcode .
>>"</font></td></tr></table>";
>> }
>> } else {
>> // My debug code
>> echo "<table align='center'><tr><td><font color='#FF0000'>Obj is
>>false; Barcode = " . $barcode . "</font></td></tr></table>";
>> }
>>
>>
>>Alex Ciurea wrote:
>>
>>
>>
>>>did u made copy&paste with your code?
>>>
>>>yes? then why don't you try to use the path='image.php?blahblahmoreblah'
>>>????
>>>
>>>no? then please give us more details about the error you're getting...
>>>
>>>good luck,
>>>Alex
>>>
>>>
>>>----- Original Message -----
>>>From: "Todd Cary" <todd
aristesoftware.com>
>>>To: <php-general
lists.php.net>
>>>Sent: Tuesday, June 03, 2003 6:03 PM
>>>Subject: [PHP] This line does not execute...
>>>
>>>
>>>
>>>
>>>
>>>
>>>>I am trying to get the Sample Barcode to run on my server, however the
>>>>following line does not execute:
>>>>
>>>>echo "<table align='center'><tr><td><img src='./image.php?code=" .
>>>>$barcode . "&style=" . $style . "&type=" . $type . "&width=" . $width .
>>>>"&height=" . $height . "&xres=" . $xres . "&font=" . $font .
>>>>"'></td></tr></table>";
>>>>
>>>>To see if it is executing, I have an "Echo" statement in the script.
>>>>
>>>>The image.php file is in the same directory as the other script files.
>>>>What am I missing here?
>>>>
>>>>Todd
>>>>--
>>>>
>>>>
>>>>
>>>>
>>>>
>>>.
>>>
>>>
>>>
>>>
>>>
>>--
>>
>>
>>
>>
>
>
>
>
--
attached mail follows:
None of my old scripts worx nowadays and the most common error message is
'undefined variable'. What is the best/simplest way to work around this
situation?
if !isset($myvar) {
do this
blah blah
}
?
attached mail follows:
When you recivied that error ?, in a form ?, if is in a Form just put in the
top of .php files this code
$HTTP_GET_VARS["variable2"];
$HTTP_GET_VARS["variable3"];
Of course if you send with other method (post) change the GET for POST
$HTTP_POS_VARS["variable2"];
$HTTP_POS_VARS["variable3"];
Regards.
Esteban.
"ØYstein HåLand" <ha
ematte.se> escribió en el mensaje
news:20030603150831.24991.qmail
pb1.pair.com...
> None of my old scripts worx nowadays and the most common error message is
> 'undefined variable'. What is the best/simplest way to work around this
> situation?
> if !isset($myvar) {
> do this
> blah blah
> }
> ?
>
>
attached mail follows:
I'm not sure what you mean. To give ONE example:
Earlier I could use this code on top of every page:
if ($printout != "yeah") { include("header.php"); }
This code gives an error today. The variable $printout is set if the visitor
choose to click on the 'print_page_image', otherwise the variable has no
value.
"Esteban FernáNdez" <efernandez
tecsol.cl> skrev i meddelandet
news:20030603154909.78521.qmail
pb1.pair.com...
> When you recivied that error ?, in a form ?, if is in a Form just put in
the
> top of .php files this code
>
> $HTTP_GET_VARS["variable2"];
> $HTTP_GET_VARS["variable3"];
>
> Of course if you send with other method (post) change the GET for POST
>
> $HTTP_POS_VARS["variable2"];
> $HTTP_POS_VARS["variable3"];
>
> Regards.
>
> Esteban.
>
>
>
> "ØYstein HåLand" <ha
ematte.se> escribió en el mensaje
> news:20030603150831.24991.qmail
pb1.pair.com...
> > None of my old scripts worx nowadays and the most common error message
is
> > 'undefined variable'. What is the best/simplest way to work around this
> > situation?
> > if !isset($myvar) {
> > do this
> > blah blah
> > }
> > ?
> >
> >
>
>
attached mail follows:
Hi,
What he means is that with "register_globals=off" you cannot do this:
echo $path
you need to do this (if the variable is sent by "POST" action)
echo _POST('path')
and through "GET"
echo _GET('path')
-----Original Message-----
From: Øystein Håland [mailto:ha
ematte.se]
Sent: 03 June 2003 17:02
To: php-general
lists.php.net
Subject: [PHP] Re: Migration from register_globals=on to
register_globals=off
I'm not sure what you mean. To give ONE example:
Earlier I could use this code on top of every page:
if ($printout != "yeah") { include("header.php"); }
This code gives an error today. The variable $printout is set if the visitor
choose to click on the 'print_page_image', otherwise the variable has no
value.
"Esteban FernáNdez" <efernandez
tecsol.cl> skrev i meddelandet
news:20030603154909.78521.qmail
pb1.pair.com...
> When you recivied that error ?, in a form ?, if is in a Form just put in
the
> top of .php files this code
>
> $HTTP_GET_VARS["variable2"];
> $HTTP_GET_VARS["variable3"];
>
> Of course if you send with other method (post) change the GET for POST
>
> $HTTP_POS_VARS["variable2"];
> $HTTP_POS_VARS["variable3"];
>
> Regards.
>
> Esteban.
>
>
>
> "ØYstein HåLand" <ha
ematte.se> escribió en el mensaje
> news:20030603150831.24991.qmail
pb1.pair.com...
> > None of my old scripts worx nowadays and the most common error message
is
> > 'undefined variable'. What is the best/simplest way to work around this
> > situation?
> > if !isset($myvar) {
> > do this
> > blah blah
> > }
> > ?
> >
> >
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Uh, I think you mean
echo $_POST['path'];
and
echo $_GET['path'];
Jonathan Wilkes wrote:
>Hi,
>
>What he means is that with "register_globals=off" you cannot do this:
>
> echo $path
>
>you need to do this (if the variable is sent by "POST" action)
>
> echo _POST('path')
>
>and through "GET"
>
> echo _GET('path')
>
>-----Original Message-----
>From: Xystein Heland [mailto:ha
ematte.se]
>Sent: 03 June 2003 17:02
>To: php-general
lists.php.net
>Subject: [PHP] Re: Migration from register_globals=on to
>register_globals=off
>
>
>I'm not sure what you mean. To give ONE example:
>Earlier I could use this code on top of every page:
>if ($printout != "yeah") { include("header.php"); }
>This code gives an error today. The variable $printout is set if the visitor
>choose to click on the 'print_page_image', otherwise the variable has no
>value.
>
>"Esteban FernaNdez" <efernandez
tecsol.cl> skrev i meddelandet
>news:20030603154909.78521.qmail
pb1.pair.com...
>
>
>>When you recivied that error ?, in a form ?, if is in a Form just put in
>>
>>
>the
>
>
>>top of .php files this code
>>
>>$HTTP_GET_VARS["variable2"];
>>$HTTP_GET_VARS["variable3"];
>>
>>Of course if you send with other method (post) change the GET for POST
>>
>>$HTTP_POS_VARS["variable2"];
>>$HTTP_POS_VARS["variable3"];
>>
>>Regards.
>>
>>Esteban.
>>
>>
>>
>>"XYstein HeLand" <ha
ematte.se> escribis en el mensaje
>>news:20030603150831.24991.qmail
pb1.pair.com...
>>
>>
>>>None of my old scripts worx nowadays and the most common error message
>>>
>>>
>is
>
>
>>>'undefined variable'. What is the best/simplest way to work around this
>>>situation?
>>>if !isset($myvar) {
>>>do this
>>>blah blah
>>>}
>>>?
>>>
>>>
>>>
>>>
>>
>>
>
>
>
>
>
--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
attached mail follows:
yep I did, sorry about that
-----Original Message-----
From: Leif K-Brooks [mailto:eurleif
buyer-brokerage.com]
Sent: 03 June 2003 17:15
To: Jonathan Wilkes
Cc: 'Øystein Håland'; php-general
lists.php.net
Subject: Re: [PHP] Re: Migration from register_globals=on to
register_glob als=off
Uh, I think you mean
echo $_POST['path'];
and
echo $_GET['path'];
Jonathan Wilkes wrote:
>Hi,
>
>What he means is that with "register_globals=off" you cannot do this:
>
> echo $path
>
>you need to do this (if the variable is sent by "POST" action)
>
> echo _POST('path')
>
>and through "GET"
>
> echo _GET('path')
>
>-----Original Message-----
>From: Xystein Heland [mailto:ha
ematte.se]
>Sent: 03 June 2003 17:02
>To: php-general
lists.php.net
>Subject: [PHP] Re: Migration from register_globals=on to
>register_globals=off
>
>
>I'm not sure what you mean. To give ONE example:
>Earlier I could use this code on top of every page:
>if ($printout != "yeah") { include("header.php"); }
>This code gives an error today. The variable $printout is set if the
visitor
>choose to click on the 'print_page_image', otherwise the variable has no
>value.
>
>"Esteban FernaNdez" <efernandez
tecsol.cl> skrev i meddelandet
>news:20030603154909.78521.qmail
pb1.pair.com...
>
>
>>When you recivied that error ?, in a form ?, if is in a Form just put in
>>
>>
>the
>
>
>>top of .php files this code
>>
>>$HTTP_GET_VARS["variable2"];
>>$HTTP_GET_VARS["variable3"];
>>
>>Of course if you send with other method (post) change the GET for POST
>>
>>$HTTP_POS_VARS["variable2"];
>>$HTTP_POS_VARS["variable3"];
>>
>>Regards.
>>
>>Esteban.
>>
>>
>>
>>"XYstein HeLand" <ha
ematte.se> escribis en el mensaje
>>news:20030603150831.24991.qmail
pb1.pair.com...
>>
>>
>>>None of my old scripts worx nowadays and the most common error message
>>>
>>>
>is
>
>
>>>'undefined variable'. What is the best/simplest way to work around this
>>>situation?
>>>if !isset($myvar) {
>>>do this
>>>blah blah
>>>}
>>>?
>>>
>>>
>>>
>>>
>>
>>
>
>
>
>
>
--
The above message is encrypted with double rot13 encoding. Any unauthorized
attempt to decrypt it will be prosecuted to the full extent of the law.
attached mail follows:
Uh, just putting those variables at the top of your page won't help
you. You need to do something with them.
Esteban Fernández wrote:
>When you recivied that error ?, in a form ?, if is in a Form just put in the
>top of .php files this code
>
>$HTTP_GET_VARS["variable2"];
>$HTTP_GET_VARS["variable3"];
>
>Of course if you send with other method (post) change the GET for POST
>
>$HTTP_POS_VARS["variable2"];
>$HTTP_POS_VARS["variable3"];
>
>Regards.
>
>Esteban.
>
>
>
>"ØYstein HåLand" <ha
ematte.se> escribió en el mensaje
>news:20030603150831.24991.qmail
pb1.pair.com...
>
>
>>None of my old scripts worx nowadays and the most common error message is
>>'undefined variable'. What is the best/simplest way to work around this
>>situation?
>>if !isset($myvar) {
>>do this
>>blah blah
>>}
>>?
>>
>>
>>
>>
>
>
>
>
>
--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
attached mail follows:
Then i don't understand you problem.
"ØYstein HåLand" <ha
ematte.se> escribió en el mensaje
news:20030603160229.97136.qmail
pb1.pair.com...
> I'm not sure what you mean. To give ONE example:
> Earlier I could use this code on top of every page:
> if ($printout != "yeah") { include("header.php"); }
> This code gives an error today. The variable $printout is set if the
visitor
> choose to click on the 'print_page_image', otherwise the variable has no
> value.
>
> "Esteban FernáNdez" <efernandez
tecsol.cl> skrev i meddelandet
> news:20030603154909.78521.qmail
pb1.pair.com...
> > When you recivied that error ?, in a form ?, if is in a Form just put in
> the
> > top of .php files this code
> >
> > $HTTP_GET_VARS["variable2"];
> > $HTTP_GET_VARS["variable3"];
> >
> > Of course if you send with other method (post) change the GET for POST
> >
> > $HTTP_POS_VARS["variable2"];
> > $HTTP_POS_VARS["variable3"];
> >
> > Regards.
> >
> > Esteban.
> >
> >
> >
> > "ØYstein HåLand" <ha
ematte.se> escribió en el mensaje
> > news:20030603150831.24991.qmail
pb1.pair.com...
> > > None of my old scripts worx nowadays and the most common error message
> is
> > > 'undefined variable'. What is the best/simplest way to work around
this
> > > situation?
> > > if !isset($myvar) {
> > > do this
> > > blah blah
> > > }
> > > ?
> > >
> > >
> >
> >
>
>
attached mail follows:
on 04/06/03 3:02 AM, Øystein Håland (ha
ematte.se) wrote:
> I'm not sure what you mean. To give ONE example:
> Earlier I could use this code on top of every page:
> if ($printout != "yeah") { include("header.php"); }
> This code gives an error today. The variable $printout is set if the visitor
> choose to click on the 'print_page_image', otherwise the variable has no
> value.
instead of looking for $printout, you need to be lookign for
$_POST['printout'] (for posted vars from a form), $_GET['printout'[ for vars
in the url, $_SESSION[...], $_COOKIE[...], etc.
if($_GET['printout'] != "yeah") { include("header.php"); }
Alternately, if you don't want to dig through old code, you could
a) turn register globals back on via a .htaccess file for SOME
sites/directories/domains
b) do something like
$printout = $_GET['printout'];
$id = $_GET['id'];
etc
c) see this example i wrote:
http://www.weberdev.com/get_example.php3?count=3639
Does the above helps
Justin
attached mail follows:
I tried changing my code to (since the variable $printout in this case is
sent with GET)
($_GET['printout'] != "yeah") { include("header.php"); }
and got the following error:
Undefined index: printout
attached mail follows:
One little addit:
use indeed $_GET for vars passed through the query string and $_POST to read
out postdate .. $_COOKIE for cookies, but you'll find a combination of them
all in $_REQUEST
(nobody happens to know why $_SESSION is not included in that one .. or
knows one that includes $_SESSION in it..?)
Wouter
-----Oorspronkelijk bericht-----
Van: Øystein Håland [mailto:ha
ematte.se]
Verzonden: dinsdag 3 juni 2003 18:45
Aan: php-general
lists.php.net
Onderwerp: [PHP] Re: Migration from register_globals=on to
register_globals=off
I tried changing my code to (since the variable $printout in this case is
sent with GET)
($_GET['printout'] != "yeah") { include("header.php"); }
and got the following error:
Undefined index: printout
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
on top of your script add
extract ($_POST);
or may be a little more checking to see if its actually a form submission by
POST method like
if ($_SERVER["REQUEST_METHOD"] == 'POST')
extract($_POST);
same thing goes for GET
Then you can access all form variables just as you were accessing.
HTH
R'twick
"ØYstein HåLand" <ha
ematte.se> wrote in message
news:20030603160229.97136.qmail
pb1.pair.com...
> I'm not sure what you mean. To give ONE example:
> Earlier I could use this code on top of every page:
> if ($printout != "yeah") { include("header.php"); }
> This code gives an error today. The variable $printout is set if the
visitor
> choose to click on the 'print_page_image', otherwise the variable has no
> value.
>
> "Esteban FernáNdez" <efernandez
tecsol.cl> skrev i meddelandet
> news:20030603154909.78521.qmail
pb1.pair.com...
> > When you recivied that error ?, in a form ?, if is in a Form just put in
> the
> > top of .php files this code
> >
> > $HTTP_GET_VARS["variable2"];
> > $HTTP_GET_VARS["variable3"];
> >
> > Of course if you send with other method (post) change the GET for POST
> >
> > $HTTP_POS_VARS["variable2"];
> > $HTTP_POS_VARS["variable3"];
> >
> > Regards.
> >
> > Esteban.
> >
> >
> >
> > "ØYstein HåLand" <ha
ematte.se> escribió en el mensaje
> > news:20030603150831.24991.qmail
pb1.pair.com...
> > > None of my old scripts worx nowadays and the most common error message
> is
> > > 'undefined variable'. What is the best/simplest way to work around
this
> > > situation?
> > > if !isset($myvar) {
> > > do this
> > > blah blah
> > > }
> > > ?
> > >
> > >
> >
> >
>
>
attached mail follows:
probably because $_SESSION is a server side thing not coming from the client
side in a Request ?
R'twick
----- Original Message -----
From: "Wouter van Vliet" <phpmailinglist
wouter.springt.nl>
To: <php-general
lists.php.net>
Sent: Tuesday, June 03, 2003 12:48 PM
Subject: RE: [PHP] Re: Migration from register_globals=on to
register_globals=off
> One little addit:
>
> use indeed $_GET for vars passed through the query string and $_POST to
read
> out postdate .. $_COOKIE for cookies, but you'll find a combination of
them
> all in $_REQUEST
>
> (nobody happens to know why $_SESSION is not included in that one .. or
> knows one that includes $_SESSION in it..?)
>
> Wouter
>
>
> -----Oorspronkelijk bericht-----
> Van: Øystein Håland [mailto:ha
ematte.se]
> Verzonden: dinsdag 3 juni 2003 18:45
> Aan: php-general
lists.php.net
> Onderwerp: [PHP] Re: Migration from register_globals=on to
> register_globals=off
>
>
> I tried changing my code to (since the variable $printout in this case is
> sent with GET)
> ($_GET['printout'] != "yeah") { include("header.php"); }
> and got the following error:
> Undefined index: printout
>
>
>
> --
> 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
>
>
attached mail follows:
yeah .. I knew it .. but it would be so very helpfull if it would be just
included in a superglobal similar to $_REQUEST ...
-----Oorspronkelijk bericht-----
Van: R'twick Niceorgaw [mailto:rtwick-lists
utkalika.net]
Verzonden: dinsdag 3 juni 2003 19:01
Aan: php-general
lists.php.net
Onderwerp: Re: [PHP] Re: Migration from register_globals=on to
register_globals=off
probably because $_SESSION is a server side thing not coming from the client
side in a Request ?
R'twick
----- Original Message -----
From: "Wouter van Vliet" <phpmailinglist
wouter.springt.nl>
To: <php-general
lists.php.net>
Sent: Tuesday, June 03, 2003 12:48 PM
Subject: RE: [PHP] Re: Migration from register_globals=on to
register_globals=off
> One little addit:
>
> use indeed $_GET for vars passed through the query string and $_POST to
read
> out postdate .. $_COOKIE for cookies, but you'll find a combination of
them
> all in $_REQUEST
>
> (nobody happens to know why $_SESSION is not included in that one .. or
> knows one that includes $_SESSION in it..?)
>
> Wouter
>
>
> -----Oorspronkelijk bericht-----
> Van: Øystein Håland [mailto:ha
ematte.se]
> Verzonden: dinsdag 3 juni 2003 18:45
> Aan: php-general
lists.php.net
> Onderwerp: [PHP] Re: Migration from register_globals=on to
> register_globals=off
>
>
> I tried changing my code to (since the variable $printout in this case is
> sent with GET)
> ($_GET['printout'] != "yeah") { include("header.php"); }
> and got the following error:
> Undefined index: printout
>
>
>
> --
> 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
> yeah .. I knew it .. but it would be so very helpfull if it would be just
> included in a superglobal similar to $_REQUEST ...
Do it yourself, if you must: array_merge()
---John Holmes...
attached mail follows:
How do I grab the first X characters of a string?
attached mail follows:
RTFM
http://us2.php.net/manual/en/function.substr.php
attached mail follows:
> Guys, that's exactly what the SID predefined constant is for -- it's defined
> only when a session is active, and it has the value
> <sessionname>=<sessionid> (e.g. PHPSESSID=1afd764ecb938274) if and only if
> the session id was passed in the URL -- otherwise it contains the empty
> string. So you can safely do:
>
> header("Location: {$location}?".SID);
The SID constant var is a good idea! I didn't realize this existed. Taking
what Justin originally suggested, I've now modified the myHeader() function
to only append the SID if it exists (else, it returns the $location var as
it was passed). It also checks to see whether there is a ? in the $location
var. If so, it will append the SID using a &, otherwise it will append the
SID with a ?.
I haven't tested this yet, but, if anyone has any other suggestions or
recommendations, please post them.
function myHeader($location) {
if (SID) {
if (strstr($location, '?')) {
header("Location: {$location}&".SID);
} else {
header("Location: {$location}?".SID);
}
} else {
return $location;
}
return;
}
Monty
attached mail follows:
> Hi,
> I want action of a form to be PHP_SELF untill user presses "continue"
> button. If continue button is pressed than "next.php" should be the action of
> the form. how to do this? Thanks in advance, Mukta
I'm not sure why it's necessary to do this, but, not sure it can be done.
Maybe with Javascript and an onClick= command inside the <input button> tag
or an onSubmit= inside the <form> tag.
Do you simply want to hide the name of the file that the form will go to
once a button is clicked? If so, you need an "in-between" script that the
form uses to determine where to send the user. So instead of sending them to
PHP_SELF or next.php, use something like goto.php, which can determine where
to send the user next, and then redirects the user using the header()
function.
Monty
attached mail follows:
Best way to do this, in my opinion, is by using a javascript-code like this
<input type="button" onClick="processForm('next.php');">
<input type="button" onClick="processForm('<?php echo $PHP_SELF; ?>');">
The javascript function would then look like this:
function processForm(url) {
document.forms[0].action = url;
document.forms[0].submit();
}
"Mukta Telang" <mukta
darya.nio.org> schreef in bericht
news:3EDCBA03.E4CCB9C6
darya.nio.org...
> Hi,
> I want action of a form to be PHP_SELF untill user presses "continue"
> button.
> If continue button is pressed than "next.php" should be the action of
> the form.
> how to do this?
> Thanks in advance,
> Mukta
attached mail follows:
Hi guys,
I have successfully implemted "pagenting" on one of my pages to generate "
PREV 1,2,3,4 (etc) NEXT" depending on the records that are being returned
and the number of rows i specify in a LIMIT.
One little problem, right now I have very few records so I dont mind it
giving a 1,2,3,4 etc till 10 or more but soon I will have quite a lot of
records and I dont want the client to see a whole page of 1,2,3,4.... for
him to click, is there anyway I can cut it down (eg. like google) to show
only 10 pages or such??
Below is the code that I am using and which so far is working perfectly:
<?php
$connected=mysql_connect("localhost","estwe_uma","balh") or die
('connect:'.mysql_error());
mysql_select_db ("estwe_bh");
$limit = 10;
$query_count = "SELECT COUNT(*) FROM web_shared";
$result_count = mysql_query($query_count) or die("Error: " . mysql_error());
$totalrows = mysql_result($result_count,0);
$page = $_GET['page'];
if(empty($page))
$page = 1;
$limitvalue = $page * $limit - ($limit);
$database["sql"] = "select * from webplans_shared order by company,price
LIMIT $limitvalue, $limit";
print("html output comes here");
if(mysql_num_rows($result) == 0)
{ echo(" Sorry, No matches found!"); exit;}
if($page != 1){
$pageprev = $page-1;
echo("<a href=\"search.template.php?page=$pageprev\">PREV</a>
");
}else
echo("PREV ");
$numofpages = $totalrows / $limit;
for($i = 1; $i <= $numofpages; $i++){
if($i == $page)
echo($i.": ");
else
echo("<a href=\"search.template.php?page=$i\">$i</a> ");
}
if(($totalrows % $limit) != 0){
if($i == $page)
echo($i.": ");
else
echo("<a href=\"search.template.php?page=$i\">$i</a> ");
if(($totalrows - ($limit * $page)) > 0){
$pagenext = $page+1;
echo(" <a
href=\"search.template.php?page=$pagenext\">NEXT </a>");
}else
echo("..");
}
thanks in advance,
Cheers,
-Ryan
attached mail follows:
> I have successfully implemted "pagenting" on one of my pages to
generate "
> PREV 1,2,3,4 (etc) NEXT" depending on the records that are being
returned
> and the number of rows i specify in a LIMIT.
>
> One little problem, right now I have very few records so I dont mind
it
> giving a 1,2,3,4 etc till 10 or more but soon I will have quite a lot
of
> records and I dont want the client to see a whole page of 1,2,3,4....
for
> him to click, is there anyway I can cut it down (eg. like google) to
show
> only 10 pages or such??
>
> Below is the code that I am using and which so far is working
perfectly:
>
> <?php
> $connected=mysql_connect("localhost","estwe_uma","balh") or die
> ('connect:'.mysql_error());
> mysql_select_db ("estwe_bh");
>
> $limit = 10;
>
> $query_count = "SELECT COUNT(*) FROM web_shared";
> $result_count = mysql_query($query_count) or die("Error: " .
> mysql_error());
> $totalrows = mysql_result($result_count,0);
>
> $page = $_GET['page'];
>
> if(empty($page))
> $page = 1;
>
> $limitvalue = $page * $limit - ($limit);
>
> $database["sql"] = "select * from webplans_shared order by
company,price
> LIMIT $limitvalue, $limit";
>
> print("html output comes here");
>
> if(mysql_num_rows($result) == 0)
> { echo(" Sorry, No matches found!"); exit;}
>
>
> if($page != 1){
> $pageprev = $page-1;
>
> echo("<a
> href=\"search.template.php?page=$pageprev\">PREV</a>
> ");
> }else
> echo("PREV ");
>
> $numofpages = $totalrows / $limit;
>
> for($i = 1; $i <= $numofpages; $i++){
> if($i == $page)
> echo($i.": ");
> else
> echo("<a
href=\"search.template.php?page=$i\">$i</a> ");
> }
Instead of going from 1 until $numofpages, go from $page-5 to $page+5,
for example...
$minpage = max(1,$page-5);
$maxpage = min($numofpages,$page+5);
for($i = $minpage; $i <= $maxpage; $i++)
{ ... }
---John W. Holmes...
Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
attached mail follows:
Hi folks,
I've heard something about the possibility to set an option somewhere that
will include a file to each php file requested... but I can't find it..
What I'm trying to do is something similar to things done with mod_perl ..
loading a file which sets things the lib dir and stuff... Set some constants
for ie. database connection (username, password) and of course the full path
dir... And I don't want to use an include() on top of every page, cuz this
gets the entire reason away; not having to use fullpath anywhere..
I hope you, or at least one of you, understands my chaotic message and maybe
even has an answer..
Greetz,
Wouter
____________________________________________________________________________
_____
esctoday.com | your daily eurovision centre
Wouter van Vliet, Staff assistant, member technical staff
E-mail: wouter
esctoday.com
Websites: www.esctoday.com, webzee.mine.nu
MSN Messenger passport: wouter
esctoday.com
Phone +31-(0)6-1539 7471
Based in The Hague, The Netherlands
attached mail follows:
On Tue, 3 Jun 2003 18:41:59 +0200, Wouter van Vliet wrote:
>I've heard something about the possibility to set an option somewhere that
>will include a file to each php file requested... but I can't find it..
It's an ini setting (auto_prepend_file). Check here:
http://us4.php.net/ini_set
It can be set in the php.ini (or on Apache at least) in the .htaccess
as follows:
php_value auto_prepend_file "/www/extract_post.php"
attached mail follows:
Thanks !!!
-----Oorspronkelijk bericht-----
Van: Wendell Brown [mailto:wbrown
arkie.net]
Verzonden: dinsdag 3 juni 2003 18:52
Aan: PHP General; Wouter van Vliet
Onderwerp: Re: [PHP] Automatically include global file ...
On Tue, 3 Jun 2003 18:41:59 +0200, Wouter van Vliet wrote:
>I've heard something about the possibility to set an option somewhere that
>will include a file to each php file requested... but I can't find it..
It's an ini setting (auto_prepend_file). Check here:
http://us4.php.net/ini_set
It can be set in the php.ini (or on Apache at least) in the .htaccess
as follows:
php_value auto_prepend_file "/www/extract_post.php"
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I am trying to create a text only version of an HTML formatted message.
I would like to convert all links from:
<a href="http://domain.tld.page.ext">link name</a>
to:
link name [http://domain.tld/page.ext]
The problem is that some links may have additional modifiers and onthers
may not.
I have seen many examples of doing the reverse, but I can't seem to find
an example of this.
If anyone has done something similar and would like to share, please do.
Thanks,
-Jackson
attached mail follows:
What do you mean by additional modifiers?
Jim Lucas
----- Original Message -----
From: "Jackson Miller" <jackson
coldfeetcreative.com>
To: <php-general
lists.php.net>
Sent: Tuesday, June 03, 2003 9:43 AM
Subject: [PHP] preg_replace help
> I am trying to create a text only version of an HTML formatted message.
> I would like to convert all links from:
> <a href="http://domain.tld.page.ext">link name</a>
> to:
> link name [http://domain.tld/page.ext]
>
> The problem is that some links may have additional modifiers and onthers
> may not.
>
> I have seen many examples of doing the reverse, but I can't seem to find
> an example of this.
>
> If anyone has done something similar and would like to share, please do.
>
> Thanks,
> -Jackson
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
On Tue, 2003-06-03 at 11:52, Jim Lucas wrote:
> What do you mean by additional modifiers?
Some links may be in the format:
<a href="http://domain.tld/page.ext" target="target" name="description
of the link">link name</a>
I just want to ignore any of those modifiers in the text version.
-Jackson
>
> Jim Lucas
> ----- Original Message -----
> From: "Jackson Miller" <jackson
coldfeetcreative.com>
> To: <php-general
lists.php.net>
> Sent: Tuesday, June 03, 2003 9:43 AM
> Subject: [PHP] preg_replace help
>
>
> > I am trying to create a text only version of an HTML formatted message.
> > I would like to convert all links from:
> > <a href="http://domain.tld.page.ext">link name</a>
> > to:
> > link name [http://domain.tld/page.ext]
> >
> > The problem is that some links may have additional modifiers and onthers
> > may not.
> >
> > I have seen many examples of doing the reverse, but I can't seem to find
> > an example of this.
> >
> > If anyone has done something similar and would like to share, please do.
> >
> > Thanks,
> > -Jackson
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
attached mail follows:
At 18:43 03.06.2003, Jackson Miller said:
--------------------[snip]--------------------
>I am trying to create a text only version of an HTML formatted message.
>I would like to convert all links from:
><a href="http://domain.tld.page.ext">link name</a>
>to:
>link name [http://domain.tld/page.ext]
>
>The problem is that some links may have additional modifiers and onthers
>may not.
>
>I have seen many examples of doing the reverse, but I can't seem to find
>an example of this.
>
>If anyone has done something similar and would like to share, please do.
--------------------[snip]--------------------
This should work:
$result = null;
while (preg_match('!(.*)<.*?a.*?href\s*=\s*"(.*?)".*?>(.*)!i', $html,
$aresult)) {
$result .= $aresult[1];
if ($aresult[2]) $result .= ' link name [' . $aresult[2] . ']';
$html = $aresult[3];
}
$result .= $html;
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
At 18:43 03.06.2003, Jackson Miller said:
--------------------[snip]--------------------
>I am trying to create a text only version of an HTML formatted message.
>I would like to convert all links from:
><a href="http://domain.tld.page.ext">link name</a>
>to:
>link name [http://domain.tld/page.ext]
>
>The problem is that some links may have additional modifiers and onthers
>may not.
>
>I have seen many examples of doing the reverse, but I can't seem to find
>an example of this.
>
>If anyone has done something similar and would like to share, please do.
--------------------[snip]--------------------
Sorry - you want the enclosed "link name"
This should work:
$result = null;
while
(preg_match('!(.*)<.*?a.*?href\s*=\s*"(.*?)".*?>(.*?)<\s*/\s*a\s*>(.*)!i',
$html, $aresult)) {
$result .= $aresult[1];
if ($aresult[2] && $aresult[3]) $result .= $aresult[3] . ' [' .
$aresult[2] . ']';
$html = $aresult[4];
}
$result .= $html;
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
Maybe I should clarify.
$message = '<p>Visit <a href="http://jaxn.org" target="_top">My personal
site</a> to learn more about me.</p>
<p>Visit <a href="http://memigo.com">memigi</a> to learn about current
events.';
What I want is to run a preg_replace to get the following:
Visit My personal site (http://jaxn.org) to learn more about me.
Visit memigo (http://memigo.com) to learn about current events.
stripping the HTML is easy, but before I do I want to convert the links.
Thanks,
-Jackson
On Tue, 2003-06-03 at 11:59, Ernest E Vogelsinger wrote:
> At 18:43 03.06.2003, Jackson Miller said:
> --------------------[snip]--------------------
> >I am trying to create a text only version of an HTML formatted message.
> >I would like to convert all links from:
> ><a href="http://domain.tld.page.ext">link name</a>
> >to:
> >link name [http://domain.tld/page.ext]
> >
> >The problem is that some links may have additional modifiers and onthers
> >may not.
> >
> >I have seen many examples of doing the reverse, but I can't seem to find
> >an example of this.
> >
> >If anyone has done something similar and would like to share, please do.
> --------------------[snip]--------------------
>
> Sorry - you want the enclosed "link name"
> This should work:
>
> $result = null;
> while
> (preg_match('!(.*)<.*?a.*?href\s*=\s*"(.*?)".*?>(.*?)<\s*/\s*a\s*>(.*)!i',
> $html, $aresult)) {
> $result .= $aresult[1];
> if ($aresult[2] && $aresult[3]) $result .= $aresult[3] . ' [' .
> $aresult[2] . ']';
> $html = $aresult[4];
> }
> $result .= $html;
>
>
> --
> >O Ernest E. Vogelsinger
> (\) ICQ #13394035
> ^ http://www.vogelsinger.at/
>
>
attached mail follows:
At 19:18 03.06.2003, Jackson Miller said:
--------------------[snip]--------------------
>Maybe I should clarify.
>
>$message = '<p>Visit <a href="http://jaxn.org" target="_top">My personal
>site</a> to learn more about me.</p>
><p>Visit <a href="http://memigo.com">memigi</a> to learn about current
>events.';
>
>What I want is to run a preg_replace to get the following:
>Visit My personal site (http://jaxn.org) to learn more about me.
>
>Visit memigo (http://memigo.com) to learn about current events.
>
>stripping the HTML is easy, but before I do I want to convert the links.
The loop I posted does exactly that (using square brackets as to your
initial requirements). The 3rd parameter of preg_match ($aresult) will be
an array that holds the grouped expressions from the regex:
[0] - whole string
[1] - pre-match (all before <a href)
[2] - the URL part of the link
[3] - the linked text
[4] - postmatch (all after the closing </a>).
Within the loop I use this array to modify the HTML code to read
(pre-match)#linked-text# [#url#]...
which is what you want, after all.
>
>On Tue, 2003-06-03 at 11:59, Ernest E Vogelsinger wrote:
>> At 18:43 03.06.2003, Jackson Miller said:
>> --------------------[snip]--------------------
>> >I am trying to create a text only version of an HTML formatted message.
>> >I would like to convert all links from:
>> ><a href="http://domain.tld.page.ext">link name</a>
>> >to:
>> >link name [http://domain.tld/page.ext]
>> >
>> >The problem is that some links may have additional modifiers and onthers
>> >may not.
>> >
>> >I have seen many examples of doing the reverse, but I can't seem to find
>> >an example of this.
>> >
>> >If anyone has done something similar and would like to share, please do.
>> --------------------[snip]--------------------
>>
>> Sorry - you want the enclosed "link name"
>> This should work:
>>
>> $result = null;
>> while
>> (preg_match('!(.*)<.*?a.*?href\s*=\s*"(.*?)".*?>(.*?)<\s*/\s*a\s*>(.*)!i',
>> $html, $aresult)) {
>> $result .= $aresult[1];
>> if ($aresult[2] && $aresult[3]) $result .= $aresult[3] . ' [' .
>> $aresult[2] . ']';
>> $html = $aresult[4];
>> }
>> $result .= $html;
>>
>>
>> --
>> >O Ernest E. Vogelsinger
>> (\) ICQ #13394035
>> ^ http://www.vogelsinger.at/
>>
>>
--------------------[snip]--------------------
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
I have a customer who wants me to add a bookmarking feature on all his pages
that will create a link on the IE toolbar for that page. Any ideas as to how
I can do this?
attached mail follows:
I know you can use javascript to add the bookmark to the favorites folder,
not sure how to add an icon to the toolbar..
<a href="javascript:window.external.AddFavorite('http://www.yourpage.com',
'Your Page');">Bookmark This Site!</a>
-----Original Message-----
From: Joaco [mailto:joaco182
hotmail.com]
Sent: Tuesday, June 03, 2003 12:51 PM
To: php-general
lists.php.net
Subject: [PHP] Creating favorites
I have a customer who wants me to add a bookmarking feature on all his pages
that will create a link on the IE toolbar for that page. Any ideas as to how
I can do this?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
That's already very helpful. Thanks.
"Edward Peloke" <epeloke
echoman.com> wrote in message
news:NFBBIIKNALMFFNANEKEFKELPEBAA.epeloke
echoman.com...
I know you can use javascript to add the bookmark to the favorites folder,
not sure how to add an icon to the toolbar..
<a href="javascript:window.external.AddFavorite('http://www.yourpage.com',
'Your Page');">Bookmark This Site!</a>
-----Original Message-----
From: Joaco [mailto:joaco182
hotmail.com]
Sent: Tuesday, June 03, 2003 12:51 PM
To: php-general
lists.php.net
Subject: [PHP] Creating favorites
I have a customer who wants me to add a bookmarking feature on all his pages
that will create a link on the IE toolbar for that page. Any ideas as to how
I can do this?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Adding the icon is done like this (grabbed it from the php.net site):
<link rel="shortcut icon"
href="http://static.php.net/www.php.net/favicon.ico" />
"Edward Peloke" <epeloke
echoman.com> schreef in bericht
news:NFBBIIKNALMFFNANEKEFKELPEBAA.epeloke
echoman.com...
> I know you can use javascript to add the bookmark to the favorites folder,
> not sure how to add an icon to the toolbar..
>
>
>
> <a href="javascript:window.external.AddFavorite('http://www.yourpage.com',
> 'Your Page');">Bookmark This Site!</a>
>
> -----Original Message-----
> From: Joaco [mailto:joaco182
hotmail.com]
> Sent: Tuesday, June 03, 2003 12:51 PM
> To: php-general
lists.php.net
> Subject: [PHP] Creating favorites
>
>
> I have a customer who wants me to add a bookmarking feature on all his
pages
> that will create a link on the IE toolbar for that page. Any ideas as to
how
> I can do this?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Thanks guys, didnt realize this would be a javascript question, so this post
is on the wrong site. I appreciate all the help none the less.
"Yves Daemen" <yves.daemen
student.kuleuven.ac.be> wrote in message
news:20030603173254.38289.qmail
pb1.pair.com...
Adding the icon is done like this (grabbed it from the php.net site):
<link rel="shortcut icon"
href="http://static.php.net/www.php.net/favicon.ico" />
"Edward Peloke" <epeloke
echoman.com> schreef in bericht
news:NFBBIIKNALMFFNANEKEFKELPEBAA.epeloke
echoman.com...
> I know you can use javascript to add the bookmark to the favorites folder,
> not sure how to add an icon to the toolbar..
>
>
>
> <a href="javascript:window.external.AddFavorite('http://www.yourpage.com',
> 'Your Page');">Bookmark This Site!</a>
>
> -----Original Message-----
> From: Joaco [mailto:joaco182
hotmail.com]
> Sent: Tuesday, June 03, 2003 12:51 PM
> To: php-general
lists.php.net
> Subject: [PHP] Creating favorites
>
>
> I have a customer who wants me to add a bookmarking feature on all his
pages
> that will create a link on the IE toolbar for that page. Any ideas as to
how
> I can do this?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Someone has sent me a line of text that is base32 encrypted that I need to
decrypt. Does anyone know of a php module or snippet that can decrypt
this? I have searched on google and the php.net site, but was unable to
find anything that can help.
Thanks
CDitty
attached mail follows:
I've never even heard of base32... Only base64... Maybe mcrypt but nah,
can't see why mcrypt would include that... Errmm... Maybe you should check
for some RFC about this... geektools.com seems to let you search RFC's...
"Cditty" <mail
redhotsweeps.com> skrev i meddelandet
news:5.1.0.14.2.20030603115120.00bce9c8
redhotsweeps.com...
> Someone has sent me a line of text that is base32 encrypted that I need to
> decrypt. Does anyone know of a php module or snippet that can decrypt
> this? I have searched on google and the php.net site, but was unable to
> find anything that can help.
>
> Thanks
>
> CDitty
>
attached mail follows:
There's a dec2bas() function on this page that might be helpful...
http://us3.php.net/bc - search the page for base32
There are also a number of references that come up quickly on google
that will explain base32 encoding. You should be able to reverse
engineer it.
--- DvDmanDT <dvdmandt
telia.com> wrote:
> I've never even heard of base32... Only base64... Maybe mcrypt but
> nah,
> can't see why mcrypt would include that... Errmm... Maybe you
> should check
> for some RFC about this... geektools.com seems to let you search
> RFC's...
> "Cditty" <mail
redhotsweeps.com> skrev i meddelandet
> news:5.1.0.14.2.20030603115120.00bce9c8
redhotsweeps.com...
> > Someone has sent me a line of text that is base32 encrypted that
> I need to
> > decrypt. Does anyone know of a php module or snippet that can
> decrypt
> > this? I have searched on google and the php.net site, but was
> unable to
> > find anything that can help.
> >
> > Thanks
> >
> > CDitty
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
=====
Mark Weinstock
mark_weinstock
yahoo.com
***************************************
You can't demand something as a "right" unless you are willing to fight to death to defend everyone else's right to the same thing.
***************************************
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
attached mail follows:
We have a multi-user database we use for telemarketing. It is used across
the internet. All the pages are PHP, I am trying to lock or keep other users
from accessing the same record, so that they do not call the same lead. For
example, the user selects a zip code to work from and then a lead pops up,
once the lead has popped up on the callers screen, I don t want that same
lead to pop up on anyone else's screen. So I am not sure if I need to lock
the row, or if there is a better way of doing it, since the web browser is
stateless. Please any help you can provide would be great, because I have
searched the net and haven t found much information. Thank you.
-Jason
attached mail follows:
> We have a multi-user database we use for telemarketing. It is used
across
> the internet. All the pages are PHP, I am trying to lock or keep other
> users
> from accessing the same record, so that they do not call the same
lead.
> For
> example, the user selects a zip code to work from and then a lead pops
up,
> once the lead has popped up on the callers screen, I don t want that
same
> lead to pop up on anyone else's screen. So I am not sure if I need to
lock
> the row, or if there is a better way of doing it, since the web
browser is
> stateless. Please any help you can provide would be great, because I
have
> searched the net and haven t found much information. Thank you.
Just add an extra column to keep track of whether the "lead" is being
viewed or not. Set it to 1 when someone views it and then only select
leads where the column is zero.
You'll need a system to control setting it back to zero if need be or
"timing" it out after so long...
---John W. Holmes...
Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
attached mail follows:
Now my code is
extract ($_GET);
if ($_GET['printout'] != "yeah") { include("header.php"); }
but I still get the following error:
Undefined index: printout
I understand nothing
"Jonathan Wilkes" <jonathan
callview.com> skrev i meddelandet
news:B7A83DB6E1CFD6119EA100A0C945122602D58A
SWANSVR-01...
Hi,
What he means is that with "register_globals=off" you cannot do this:
echo $path
you need to do this (if the variable is sent by "POST" action)
echo _POST('path')
and through "GET"
echo _GET('path')
-----Original Message-----
From: Øystein Håland [mailto:ha
ematte.se]
Sent: 03 June 2003 17:02
To: php-general
lists.php.net
Subject: [PHP] Re: Migration from register_globals=on to
register_globals=off
I'm not sure what you mean. To give ONE example:
Earlier I could use this code on top of every page:
if ($printout != "yeah") { include("header.php"); }
This code gives an error today. The variable $printout is set if the visitor
choose to click on the 'print_page_image', otherwise the variable has no
value.
"Esteban FernáNdez" <efernandez
tecsol.cl> skrev i meddelandet
news:20030603154909.78521.qmail
pb1.pair.com...
> When you recivied that error ?, in a form ?, if is in a Form just put in
the
> top of .php files this code
>
> $HTTP_GET_VARS["variable2"];
> $HTTP_GET_VARS["variable3"];
>
> Of course if you send with other method (post) change the GET for POST
>
> $HTTP_POS_VARS["variable2"];
> $HTTP_POS_VARS["variable3"];
>
> Regards.
>
> Esteban.
>
>
>
> "ØYstein HåLand" <ha
ematte.se> escribió en el mensaje
> news:20030603150831.24991.qmail
pb1.pair.com...
> > None of my old scripts worx nowadays and the most common error message
is
> > 'undefined variable'. What is the best/simplest way to work around this
> > situation?
> > if !isset($myvar) {
> > do this
> > blah blah
> > }
> > ?
> >
> >
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
can you try if ($HTTP_GET_VARS['printout']!="yeah") {include("header.php");}
does that work?
-----Original Message-----
From: Øystein Håland [mailto:ha
ematte.se]
Sent: Tuesday, June 03, 2003 1:17 PM
To: php-general
lists.php.net
Subject: [PHP] OK guys, thank you so far
Now my code is
extract ($_GET);
if ($_GET['printout'] != "yeah") { include("header.php"); }
but I still get the following error:
Undefined index: printout
I understand nothing
"Jonathan Wilkes" <jonathan
callview.com> skrev i meddelandet
news:B7A83DB6E1CFD6119EA100A0C945122602D58A
SWANSVR-01...
Hi,
What he means is that with "register_globals=off" you cannot do this:
echo $path
you need to do this (if the variable is sent by "POST" action)
echo _POST('path')
and through "GET"
echo _GET('path')
-----Original Message-----
From: Øystein Håland [mailto:ha
ematte.se]
Sent: 03 June 2003 17:02
To: php-general
lists.php.net
Subject: [PHP] Re: Migration from register_globals=on to
register_globals=off
I'm not sure what you mean. To give ONE example:
Earlier I could use this code on top of every page:
if ($printout != "yeah") { include("header.php"); }
This code gives an error today. The variable $printout is set if the visitor
choose to click on the 'print_page_image', otherwise the variable has no
value.
"Esteban FernáNdez" <efernandez
tecsol.cl> skrev i meddelandet
news:20030603154909.78521.qmail
pb1.pair.com...
> When you recivied that error ?, in a form ?, if is in a Form just put in
the
> top of .php files this code
>
> $HTTP_GET_VARS["variable2"];
> $HTTP_GET_VARS["variable3"];
>
> Of course if you send with other method (post) change the GET for POST
>
> $HTTP_POS_VARS["variable2"];
> $HTTP_POS_VARS["variable3"];
>
> Regards.
>
> Esteban.
>
>
>
> "ØYstein HåLand" <ha
ematte.se> escribió en el mensaje
> news:20030603150831.24991.qmail
pb1.pair.com...
> > None of my old scripts worx nowadays and the most common error message
is
> > 'undefined variable'. What is the best/simplest way to work around this
> > situation?
> > if !isset($myvar) {
> > do this
> > blah blah
> > }
> > ?
> >
> >
>
>
--
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
attached mail follows:
On Tue, 3 Jun 2003 19:16:30 +0200, +ystein H†land wrote:
>Now my code is
>
>extract ($_GET);
>if ($_GET['printout'] != "yeah") { include("header.php"); }
>
>but I still get the following error:
>
>Undefined index: printout
>
>I understand nothing
Ok, it looks like you are mixing your metaphors.... ;)
If you use extract( $_GET ); -- you should have a $printout variable
available (assuming you aren't doing a POST form and you are on a
version of PHP that supports $_GET). At least two of the following
should work...
--- Option 1 --- GET method - New PHP
extract($_GET);
if ($printout != "yeah") { include("header.php"); }
--- Option 2 --- POST method - New PHP
extract($_POST);
if ($printout != "yeah") { include("header.php"); }
--- Option 3 --- GET method - Older PHP
extract($HTTP_GET_VARS);
if ($printout != "yeah") { include("header.php"); }
--- Option 4 --- POST method - Older PHP
extract($HTTP_POST_VARS);
if ($printout != "yeah") { include("header.php"); }
--- Option 5 --- GET method - new php - No extract
if ( $_GET[ 'printout' ] != "yeah") { include("header.php"); }
--- Option 6 --- POST method - new php - No extract
if ( $_POST[ 'printout' ] != "yeah") { include("header.php"); }
--- Option 7 --- GET method - older php - No extract
if ( $HTTP_GET_VARS[ 'printout' ] != "yeah") { include("header.php"); }
--- Option 8 --- POST method - older php - No extract
if ( $HTTP_POST_VARS[ 'printout' ] != "yeah") { include("header.php");
}
---- End ---
attached mail follows:
I've tried and here's the output:
Undefined index: input
if ($HTTP_GET_VARS['printout'] != "yeah") { include("header.php"); }
"Edward Peloke" <epeloke
echoman.com> skrev i meddelandet
news:NFBBIIKNALMFFNANEKEFCEMBEBAA.epeloke
echoman.com...
> can you try if ($HTTP_GET_VARS['printout']!="yeah")
{include("header.php");}
>
> does that work?
>
> -----Original Message-----
> From: Øystein Håland [mailto:ha
ematte.se]
> Sent: Tuesday, June 03, 2003 1:17 PM
> To: php-general
lists.php.net
> Subject: [PHP] OK guys, thank you so far
>
>
> Now my code is
>
> extract ($_GET);
> if ($_GET['printout'] != "yeah") { include("header.php"); }
>
> but I still get the following error:
>
> Undefined index: printout
>
> I understand nothing
>
> "Jonathan Wilkes" <jonathan
callview.com> skrev i meddelandet
> news:B7A83DB6E1CFD6119EA100A0C945122602D58A
SWANSVR-01...
> Hi,
>
> What he means is that with "register_globals=off" you cannot do this:
>
> echo $path
>
> you need to do this (if the variable is sent by "POST" action)
>
> echo _POST('path')
>
> and through "GET"
>
> echo _GET('path')
>
> -----Original Message-----
> From: Øystein Håland [mailto:ha
ematte.se]
> Sent: 03 June 2003 17:02
> To: php-general
lists.php.net
> Subject: [PHP] Re: Migration from register_globals=on to
> register_globals=off
>
>
> I'm not sure what you mean. To give ONE example:
> Earlier I could use this code on top of every page:
> if ($printout != "yeah") { include("header.php"); }
> This code gives an error today. The variable $printout is set if the
visitor
> choose to click on the 'print_page_image', otherwise the variable has no
> value.
>
> "Esteban FernáNdez" <efernandez
tecsol.cl> skrev i meddelandet
> news:20030603154909.78521.qmail
pb1.pair.com...
> > When you recivied that error ?, in a form ?, if is in a Form just put in
> the
> > top of .php files this code
> >
> > $HTTP_GET_VARS["variable2"];
> > $HTTP_GET_VARS["variable3"];
> >
> > Of course if you send with other method (post) change the GET for POST
> >
> > $HTTP_POS_VARS["variable2"];
> > $HTTP_POS_VARS["variable3"];
> >
> > Regards.
> >
> > Esteban.
> >
> >
> >
> > "ØYstein HåLand" <ha
ematte.se> escribió en el mensaje
> > news:20030603150831.24991.qmail
pb1.pair.com...
> > > None of my old scripts worx nowadays and the most common error message
> is
> > > 'undefined variable'. What is the best/simplest way to work around
this
> > > situation?
> > > if !isset($myvar) {
> > > do this
> > > blah blah
> > > }
> > > ?
> > >
> > >
> >
> >
>
>
>
> --
> 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
>
attached mail follows:
Hello,
This is a reply to an e-mail that you wrote on Tue, 3 Jun 2003 at 20:04,
lines prefixed by '>' were originally written by you.
> I've tried and here's the output:
> Undefined index: input
> if ($HTTP_GET_VARS['printout'] != "yeah") { include("header.php"); }
You have error reporting set to E_ALL, turn it down a bit.
More information at:
http://uk2.php.net/error_reporting
David.
attached mail follows:
On Tue, 2003-06-03 at 13:20, David Nicholson wrote:
> Hello,
>
> This is a reply to an e-mail that you wrote on Tue, 3 Jun 2003 at 20:04,
> lines prefixed by '>' were originally written by you.
> > I've tried and here's the output:
> > Undefined index: input
> > if ($HTTP_GET_VARS['printout'] != "yeah") { include("header.php"); }
>
> You have error reporting set to E_ALL, turn it down a bit.
>
> More information at:
> http://uk2.php.net/error_reporting
>
> David.
This is a good idea for a production machine, but for your development
environment, turning down error reporting is not a good idea. :) You
will kill yourself trying to track down subtle errors when they aren't
displayed.
Try checking your variables before using them:
if (isset($_GET['printout']) && $_GET['printout'] != 'yeah') {
// . . .
}
Torben
--
Torben Wilson <torben
php.net> +1.604.709.0506
http://www.thebuttlesschaps.com http://www.inflatableeye.com
http://www.hybrid17.com http://www.themainonmain.com
-----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----
attached mail follows:
Hey John,
Thanks, its working fine now, actually a little better than I expected :-)
Dont understand the logic though, if you find time point me to the correct
place where i can read up and figure out the logic you used.
Thanks again.
Cheers,
-Ryan
----- Original Message -----
From: "John W. Holmes" <holmes072000
charter.net>
To: "'Ryan A'" <ryan
jumac.com>; <php-general
lists.php.net>
Sent: Tuesday, June 03, 2003 5:36 PM
Subject: RE: [PHP] pagenting logic to cut short
> > I have successfully implemted "pagenting" on one of my pages to
> generate "
> > PREV 1,2,3,4 (etc) NEXT" depending on the records that are being
> returned
> > and the number of rows i specify in a LIMIT.
> >
> > One little problem, right now I have very few records so I dont mind
> it
> > giving a 1,2,3,4 etc till 10 or more but soon I will have quite a lot
> of
> > records and I dont want the client to see a whole page of 1,2,3,4....
> for
> > him to click, is there anyway I can cut it down (eg. like google) to
> show
> > only 10 pages or such??
> >
> > Below is the code that I am using and which so far is working
> perfectly:
> >
> > <?php
> > $connected=mysql_connect("localhost","estwe_uma","balh") or die
> > ('connect:'.mysql_error());
> > mysql_select_db ("estwe_bh");
> >
> > $limit = 10;
> >
> > $query_count = "SELECT COUNT(*) FROM web_shared";
> > $result_count = mysql_query($query_count) or die("Error: " .
> > mysql_error());
> > $totalrows = mysql_result($result_count,0);
> >
> > $page = $_GET['page'];
> >
> > if(empty($page))
> > $page = 1;
> >
> > $limitvalue = $page * $limit - ($limit);
> >
> > $database["sql"] = "select * from webplans_shared order by
> company,price
> > LIMIT $limitvalue, $limit";
> >
> > print("html output comes here");
> >
> > if(mysql_num_rows($result) == 0)
> > { echo(" Sorry, No matches found!"); exit;}
> >
> >
> > if($page != 1){
> > $pageprev = $page-1;
> >
> > echo("<a
> > href=\"search.template.php?page=$pageprev\">PREV</a>
> > ");
> > }else
> > echo("PREV ");
> >
> > $numofpages = $totalrows / $limit;
> >
> > for($i = 1; $i <= $numofpages; $i++){
> > if($i == $page)
> > echo($i.": ");
> > else
> > echo("<a
> href=\"search.template.php?page=$i\">$i</a> ");
> > }
>
> Instead of going from 1 until $numofpages, go from $page-5 to $page+5,
> for example...
>
> $minpage = max(1,$page-5);
> $maxpage = min($numofpages,$page+5);
>
> for($i = $minpage; $i <= $maxpage; $i++)
> { ... }
>
> ---John W. Holmes...
>
> Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
> Thanks, its working fine now, actually a little better than I expected :-)
> Dont understand the logic though, if you find time point me to the correct
> place where i can read up and figure out the logic you used.
The logic isn't too hard. You're on page X. You show links to other pages
from X minus 5 to X plus 5. So if you're on page 15, you show links for
pages 10 - 20. Those adjust dynamically based upon the current value of
$page.
The min() and max() bits are just easy ways to ensure you don't create links
for pages below 1 or above $numofpages.
---John Holmes...
attached mail follows:
I have the following scenario:
I have this timeclock program that my employees access by logging into and
the program pretty much allows them to clock-in and clock-out. The problem
is that I noticed some of the employees were clocking-in and clocking-out
from their home. The main problem is that the machine at work that the
employees use to access this program does not have a static ip address. Is
there any way to access the mac address in php.
Any ideas?
thanks,
Dale
attached mail follows:
are you wanting to prevent them from using this from home? Do they vpn or
something into the work network and then view this page or can they just get
there from the web?
-----Original Message-----
From: Dale [mailto:DaleHersh
hotmail.com]
Sent: Tuesday, June 03, 2003 1:21 PM
To: php-general
lists.php.net
Subject: [PHP] problems?
I have the following scenario:
I have this timeclock program that my employees access by logging into and
the program pretty much allows them to clock-in and clock-out. The problem
is that I noticed some of the employees were clocking-in and clocking-out
from their home. The main problem is that the machine at work that the
employees use to access this program does not have a static ip address. Is
there any way to access the mac address in php.
Any ideas?
thanks,
Dale
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Couple of clarifications Dale:
Is this an internal intranet server? Can it be?
Do you have admin rights to the server?
What's OS and Server are you running?
~Ed
-----Original Message-----
From: Dale [mailto:DaleHersh
hotmail.com]
Sent: Tuesday, June 03, 2003 1:21 PM
To: php-general
lists.php.net
Subject: [PHP] problems?
I have the following scenario:
I have this timeclock program that my employees access by logging into and
the program pretty much allows them to clock-in and clock-out. The problem
is that I noticed some of the employees were clocking-in and clocking-out
from their home. The main problem is that the machine at work that the
employees use to access this program does not have a static ip address. Is
there any way to access the mac address in php.
Any ideas?
thanks,
Dale
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
The web server sits outside of the office and can be accessed from anywhere
pc. I was thinking that if I could some how query the MAC address of the
store workstation, I could write some code that would allow only pc with
certain MAC addresses to access this timeclock program.
The server is a win 2k server and is running php on iis 5.0
Thanks,
Dale
"Ed Gorski" <gorskie
spjc.edu> wrote in message
news:004201c329f7$d4d55ec0$3f021b0a
admin.SPCollege.edu...
> Couple of clarifications Dale:
>
> Is this an internal intranet server? Can it be?
> Do you have admin rights to the server?
> What's OS and Server are you running?
>
> ~Ed
>
> -----Original Message-----
> From: Dale [mailto:DaleHersh
hotmail.com]
> Sent: Tuesday, June 03, 2003 1:21 PM
> To: php-general
lists.php.net
> Subject: [PHP] problems?
>
>
> I have the following scenario:
>
> I have this timeclock program that my employees access by logging into and
> the program pretty much allows them to clock-in and clock-out. The problem
> is that I noticed some of the employees were clocking-in and clocking-out
> from their home. The main problem is that the machine at work that the
> employees use to access this program does not have a static ip address. Is
> there any way to access the mac address in php.
>
> Any ideas?
>
> thanks,
> Dale
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
What comes in my mind is that usually in offices (or schools) all
workstations have IP's within some IP range.. Unless each workstation dials
up to or makes it's own connection with 'the internet'...
You should be able to do something with that..
-----Oorspronkelijk bericht-----
Van: Dale [mailto:DaleHersh
hotmail.com]
Verzonden: dinsdag 3 juni 2003 20:43
Aan: php-general
lists.php.net
Onderwerp: Re: [PHP] problems?
The web server sits outside of the office and can be accessed from anywhere
pc. I was thinking that if I could some how query the MAC address of the
store workstation, I could write some code that would allow only pc with
certain MAC addresses to access this timeclock program.
The server is a win 2k server and is running php on iis 5.0
Thanks,
Dale
"Ed Gorski" <gorskie
spjc.edu> wrote in message
news:004201c329f7$d4d55ec0$3f021b0a
admin.SPCollege.edu...
> Couple of clarifications Dale:
>
> Is this an internal intranet server? Can it be?
> Do you have admin rights to the server?
> What's OS and Server are you running?
>
> ~Ed
>
> -----Original Message-----
> From: Dale [mailto:DaleHersh
hotmail.com]
> Sent: Tuesday, June 03, 2003 1:21 PM
> To: php-general
lists.php.net
> Subject: [PHP] problems?
>
>
> I have the following scenario:
>
> I have this timeclock program that my employees access by logging into and
> the program pretty much allows them to clock-in and clock-out. The problem
> is that I noticed some of the employees were clocking-in and clocking-out
> from their home. The main problem is that the machine at work that the
> employees use to access this program does not have a static ip address. Is
> there any way to access the mac address in php.
>
> Any ideas?
>
> thanks,
> Dale
>
>
>
> --
> 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
attached mail follows:
Hello,
I have been playing with the mycrypt function. Im having a bit of
trouble understanding why it is important to use a vector IV.
I was wandering if there is a reasonably powerful encryption algorithm.
That uses a key only instead of getting the block size and using a IV.
I basically want to know if there is something simple out there that
will do the same job.
Kind Regards,
Daniel
attached mail follows:
Daniel Rychlik wrote:
> Hello,
>
> I have been playing with the mycrypt function. Im having a bit of
> trouble understanding why it is important to use a vector IV.
>
> I was wandering if there is a reasonably powerful encryption algorithm.
> That uses a key only instead of getting the block size and using a IV.
>
> I basically want to know if there is something simple out there that
> will do the same job.
>
> Kind Regards,
> Daniel
An initialization vector is basically used to 'seed' the algorithm to make
it more difficult to crack the ciphertext. Using an IV with a block cipher
is recommended because it generally makes the cipher more resiliant to
known-plaintext attacks.
You can use an algorithm without an IV, but you're risking security if you
do. In ECB mode, for instance, the IV is actually completely ignored, but
if you use the same key, identical blocks of plaintext will translate to
identical blocks of ciphertext. This is why an IV and block cipher modes
which utilize IVs are important.
Using an IV is definitely recommended. A good start would be Rijndael in CBC
mode with random IVs. You can safely transport the IV with the ciphertext.
If you really, really don't want to use IVs, you should try to stick with a
strong cipher such as Rijndael or Twofish and a mode like CBC. You might
also want to look into a stream cipher, such as ARC4 or SEAL. But I'd still
recommend using an IV.
J
attached mail follows:
I read more on vector IV and I agree with you. I've been reading this manual on mcrypt_encrypt and _decrypt functions. I came up with this from what I read and pretty much took the example. I have a problem with my decrypt statement. Im passing what I believe is the correct params, but I could be mistaken.
Output from my function...
‘Ü_ V¢¢''â€ÃŠ'ÅÆû´3…ån2V½kôR¤üyÃw“Ñ y}P×…õÂe ` <- Encrypted Data...
8†Ì«¢R¿„Þ6¡4±eÚ]xà Loìm
2„*—
ê«ï " œ ez;Tê_=G‘<- Decrypted data...
code <snipit>
srand();
$key = "this is a secret key";
$input = "Let us meet at 9 o'clock at the secret place.";
$size = mcrypt_get_iv_size (MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($size, MCRYPT_RAND);
$encrypted = mcrypt_ecb (MCRYPT_BLOWFISH, $key, $input, MCRYPT_ENCRYPT, $iv);
echo $encrypted," <- Encrypted Data...<br/>";
$decrypted = mcrypt_ecb (MCRYPT_BLOWFISH, $key, $input, MCRYPT_DECRYPT, $iv);
echo $decrypted, "<- Decrypted data...<br/>";
-----Original Message-----
From: Jay Smith [mailto:jay
php.net]
Sent: Tuesday, June 03, 2003 1:58 PM
To: php-general
lists.php.net
Subject: [PHP] Re: Mcrypt functions
Daniel Rychlik wrote:
> Hello,
>
> I have been playing with the mycrypt function. Im having a bit of
> trouble understanding why it is important to use a vector IV.
>
> I was wandering if there is a reasonably powerful encryption algorithm.
> That uses a key only instead of getting the block size and using a IV.
>
> I basically want to know if there is something simple out there that
> will do the same job.
>
> Kind Regards,
> Daniel
An initialization vector is basically used to 'seed' the algorithm to make
it more difficult to crack the ciphertext. Using an IV with a block cipher
is recommended because it generally makes the cipher more resiliant to
known-plaintext attacks.
You can use an algorithm without an IV, but you're risking security if you
do. In ECB mode, for instance, the IV is actually completely ignored, but
if you use the same key, identical blocks of plaintext will translate to
identical blocks of ciphertext. This is why an IV and block cipher modes
which utilize IVs are important.
Using an IV is definitely recommended. A good start would be Rijndael in CBC
mode with random IVs. You can safely transport the IV with the ciphertext.
If you really, really don't want to use IVs, you should try to stick with a
strong cipher such as Rijndael or Twofish and a mode like CBC. You might
also want to look into a stream cipher, such as ARC4 or SEAL. But I'd still
recommend using an IV.
J
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
You're using the same input for both encryption and decryption. Change the
decryption line to
$decrypted = mcrypt_ecb(MCRYPT_BLOWFISH, $key, $encrypted, MCRYPT_DECRYPT,
$iv);
srand() isn't doing anything here, you can get rid of it. Also, the IV does
nothing here, it is ignored in ECB mode. Try using something like CBC mode.
J
Daniel Rychlik wrote:
> I read more on vector IV and I agree with you. I've been reading this
> manual on mcrypt_encrypt and _decrypt functions. I came up with this from
> what I read and pretty much took the example. I have a problem with my
> decrypt statement. Im passing what I believe is the correct params, but I
> could be mistaken.
>
> Output from my function...
>
> ?Ü_ V¢¢''?Ê'ÅÆû´3?ån2V½kôR¤üyÐw?í? y}P×?õe ` <- Encrypted Data...
> 8?Ì«¢R¿?Þ6¡4±eÚ]xàLoìm
> 2?*?
> ê«ï " ? ez;Tê_=G?<- Decrypted data...
>
> code <snipit>
>
> srand();
> $key = "this is a secret key";
> $input = "Let us meet at 9 o'clock at the secret place.";
>
> $size = mcrypt_get_iv_size (MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);
>
> $iv = mcrypt_create_iv($size, MCRYPT_RAND);
>
>
> $encrypted = mcrypt_ecb (MCRYPT_BLOWFISH, $key, $input, MCRYPT_ENCRYPT,
> $iv);
>
> echo $encrypted," <- Encrypted Data...<br/>";
>
> $decrypted = mcrypt_ecb (MCRYPT_BLOWFISH, $key, $input, MCRYPT_DECRYPT,
> $iv);
>
> echo $decrypted, "<- Decrypted data...<br/>";
>
attached mail follows:
Here,.. wait a minute. Let me pull my head out of my arse...
;o}
Many thanks Jay...
-daniel
-----Original Message-----
From: Jay Smith [mailto:jay
php.net]
Sent: Tuesday, June 03, 2003 3:11 PM
To: php-general
lists.php.net
Subject: RE: [PHP] Re: Mcrypt functions
You're using the same input for both encryption and decryption. Change
the
decryption line to
$decrypted = mcrypt_ecb(MCRYPT_BLOWFISH, $key, $encrypted,
MCRYPT_DECRYPT,
$iv);
srand() isn't doing anything here, you can get rid of it. Also, the IV
does
nothing here, it is ignored in ECB mode. Try using something like CBC
mode.
J
Daniel Rychlik wrote:
> I read more on vector IV and I agree with you. I've been reading this
> manual on mcrypt_encrypt and _decrypt functions. I came up with this
from
> what I read and pretty much took the example. I have a problem with
my
> decrypt statement. Im passing what I believe is the correct params,
but I
> could be mistaken.
>
> Output from my function...
>
> ?Ü_ V¢¢''?Ê'ÅÆû´3?ån2V½kôR¤üyÐw?í? y}P×?õe ` <- Encrypted Data...
> 8?Ì«¢R¿?Þ6¡4±eÚ]xàLoìm
> 2?*?
> ê«ï " ? ez;Tê_=G?<- Decrypted data...
>
> code <snipit>
>
> srand();
> $key = "this is a secret key";
> $input = "Let us meet at 9 o'clock at the secret place.";
>
> $size = mcrypt_get_iv_size (MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);
>
> $iv = mcrypt_create_iv($size, MCRYPT_RAND);
>
>
> $encrypted = mcrypt_ecb (MCRYPT_BLOWFISH, $key, $input,
MCRYPT_ENCRYPT,
> $iv);
>
> echo $encrypted," <- Encrypted Data...<br/>";
>
> $decrypted = mcrypt_ecb (MCRYPT_BLOWFISH, $key, $input,
MCRYPT_DECRYPT,
> $iv);
>
> echo $decrypted, "<- Decrypted data...<br/>";
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi,
I've setup a simple PHP script that runs through a database table and sends
an email to a group of members asking them to verify their information. My
new ISP allows me to access the cron tab so we can have this script run at
set intervals. However I'm a little new to the whole cron tab command line
... is it possible to have a PHP script execute on command from a cron
tab? And if so, could someone proide an example of say having the script
run on the first of every month? We're using 4.3.0 if that helps.
Thanks
-Tim
attached mail follows:
On Tue, 03 Jun 2003 12:59:41 -0500, Tim Thorburn wrote:
>is it possible to have a PHP script execute on command from a cron
>tab?
Absolutely!
>And if so, could someone proide an example of say having the script
>run on the first of every month?
It should look something like this.....
0 0 1 * * php -f/update_arkie_net.php
Minutes (0) -- Hours (0) -- Day (1) -- Month (*) -- DayOfWeek (*)
attached mail follows:
[snip]
I've setup a simple PHP script that runs through a database table and
sends an email to a group of members asking them to verify their
information. My new ISP allows me to access the cron tab so we can have
this script run at
set intervals. However I'm a little new to the whole cron tab command
line ... is it possible to have a PHP script execute on command from a
cron tab? And if so, could someone proide an example of say having the
script run on the first of every month? We're using 4.3.0 if that
helps.
[/snip]
Find out where the PHP executable is...
which php
...should return something like /usr/local/bin/php
Put the following line in your crontab
15 2 1 * * /usr/local/bin/php -q /path/to/your/script.php
This will run in the 15th minute of the 2nd hour of the 1st of the
month. The -q get PHP to run quietly.
HTH!
Jay
attached mail follows:
You can also call the file through lynx or wget if you can't call the php
executable directly.
lynx --dump http://www.yourserver.com/file.php
wget http://www.yourserver.com/file.php
Down side is that the file has to be in your web root. Works great for
calling remote files, though.
---John Holmes...
----- Original Message -----
From: "Jay Blanchard" <jay.blanchard
niicommunications.com>
To: "Tim Thorburn" <immortal
nwconx.net>; <php-general
lists.php.net>
Sent: Tuesday, June 03, 2003 2:12 PM
Subject: RE: [PHP] setting up a cron job for a PHP script
[snip]
I've setup a simple PHP script that runs through a database table and
sends an email to a group of members asking them to verify their
information. My new ISP allows me to access the cron tab so we can have
this script run at
set intervals. However I'm a little new to the whole cron tab command
line ... is it possible to have a PHP script execute on command from a
cron tab? And if so, could someone proide an example of say having the
script run on the first of every month? We're using 4.3.0 if that
helps.
[/snip]
Find out where the PHP executable is...
which php
...should return something like /usr/local/bin/php
Put the following line in your crontab
15 2 1 * * /usr/local/bin/php -q /path/to/your/script.php
This will run in the 15th minute of the 2nd hour of the 1st of the
month. The -q get PHP to run quietly.
HTH!
Jay
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi Guys,
I'm trying to do the following:
I've got a multiple selection box build out of a query of table
<td><select name="VALUE[]" size="10" multiple id="VALUE[]">
<?
$query2 = "SELECT SomethingID, Somewhere FROM Someplace WHERE publiceer = 'yes' ORDER BY somewhere";
$result2 = mysql_query($query2) or die ("Error in query: $query2. " . mysql_error());
if (mysql_num_rows($result2) > 0)
{
while($row2 = mysql_fetch_object($result2))
{
?>
<OPTION VALUE="<? echo $row2->SomethingID ?>"><? echo $row2->Somewhere ; ?>
<?
}
}
?>
</option>
</select>
The outcome is stored in the VALUE[]..
Now i want to have an INSERT query that insert each value seperatly..
So if there are 3 selections it must be repeat the INSERT query three times...
Thanks for the help!
Frank
attached mail follows:
What you need to generate as HTML looks smth like this
---
<FORM method=post action=page.php>
<SELECT name='somename[]' size=10 multiple id='somename[]'>
<OPTION value='one'>First Thingie</OPTION>
<OPTION value='two'>Second Thingie</OPTION>
<OPTION value='three'>Third Thingie</OPTION>
<OPTION value='four'>Fourth Thingie</OPTION>
<OPTION value='five'>Fifth Thingie</OPTION>
</SELECT>
<INPUT TYPE='post'>
</FORM>
---
page.php should look a bit like this:
---
<?php
foreach($_POST['somename'] as $Key => $Value) {
$Query = 'INSERT INTO table (value) VALUES ('.$Value.')';
mysql_query($Query);
};
?>
---
What I'm not really sure about are the '[]' in the <SELECT
name='somename[]'> .. might wanna try to leave them out. Also, i'm not sure
if the value of $_POST['somename'] is always an array, also if one option is
selected.. If it gives an errer, just use something like:
<?php
if(is_array($_POST['somename'])) {
foreach($_POST['somename'] as $Key => $Value) {
$Query = 'INSERT INTO table (value) VALUES ('.$Value.')';
mysql_query($Query);
};
} else {
$Query = 'INSERT INTO table (value) VALUES ('.$_POST['somename'].')';
mysql_query($Query);
}
?>
Just to be sure of the correct POST data, I usually do a <?php
print_r($_POST); ?> .. just to test it..
Hope it has been of any help,
Wouter
-----Oorspronkelijk bericht-----
Van: Frank Keessen [mailto:fkeessen
planet.nl]
Verzonden: dinsdag 3 juni 2003 20:55
Aan: php-general
lists.php.net
Onderwerp: [PHP] Multi Selection
Hi Guys,
I'm trying to do the following:
I've got a multiple selection box build out of a query of table
<td><select name="VALUE[]" size="10" multiple id="VALUE[]">
<?
$query2 = "SELECT SomethingID, Somewhere FROM Someplace WHERE publiceer =
'yes' ORDER BY somewhere";
$result2 = mysql_query($query2) or die ("Error in query: $query2. " .
mysql_error());
if (mysql_num_rows($result2) > 0)
{
while($row2 = mysql_fetch_object($result2))
{
?>
<OPTION VALUE="<? echo $row2->SomethingID ?>"><? echo $row2->Somewhere ;
?>
<?
}
}
?>
</option>
</select>
The outcome is stored in the VALUE[]..
Now i want to have an INSERT query that insert each value seperatly..
So if there are 3 selections it must be repeat the INSERT query three
times...
Thanks for the help!
Frank
attached mail follows:
I would look into doing something like this.
The HTML code that Wouter will work just fine. My ideas are for the process
page.
When you insert data into a table, it has to re-index the table if you make
your statement insert all the data at one time it will only re-index the
table one time.
It goes a little something like this.
<?php
if(isset($_POST['somename'])) {
print_r($_POST['somename']);
echo "<BR>";
foreach($_POST['somename'] AS $k => $v) {
$values[] = " (NOW(), '{$v}') ";
}
if(count($values)) {
$insert_sql = "INSERT INTO table_name (date, myValue) VALUES " . join("
VALUES ", $values);
echo $insert_sql;
} else {
echo "Nothing to insert";
}
}
?>
<FORM METHOD=POST>
<SELECT name='somename[]' size=10 multiple id='somename[]'>
<OPTION value='one'>First Thingie</OPTION>
<OPTION value='two'>Second Thingie</OPTION>
<OPTION value='three'>Third Thingie</OPTION>
<OPTION value='four'>Fourth Thingie</OPTION>
<OPTION value='five'>Fifth Thingie</OPTION>
</SELECT>
<INPUT TYPE='SUBMIT'>
</FORM>
Give the above script a shot and see if it does what you want it to do.
Jim Lucas
----- Original Message -----
From: "Frank Keessen" <fkeessen
planet.nl>
To: <php-general
lists.php.net>
Sent: Tuesday, June 03, 2003 11:55 AM
Subject: [PHP] Multi Selection
> Hi Guys,
>
> I'm trying to do the following:
>
> I've got a multiple selection box build out of a query of table
>
> <td><select name="VALUE[]" size="10" multiple id="VALUE[]">
> <?
> $query2 = "SELECT SomethingID, Somewhere FROM Someplace WHERE publiceer =
'yes' ORDER BY somewhere";
> $result2 = mysql_query($query2) or die ("Error in query: $query2. " .
mysql_error());
>
> if (mysql_num_rows($result2) > 0)
> {
> while($row2 = mysql_fetch_object($result2))
> {
> ?>
>
> <OPTION VALUE="<? echo $row2->SomethingID ?>"><? echo $row2->Somewhere
; ?>
> <?
> }
> }
> ?>
> </option>
> </select>
>
> The outcome is stored in the VALUE[]..
>
> Now i want to have an INSERT query that insert each value seperatly..
>
> So if there are 3 selections it must be repeat the INSERT query three
times...
>
>
> Thanks for the help!
>
>
> Frank
>
attached mail follows:
Jim,
Why does the data have to be reindexed??? I don't understand, can you give
me an explenation?
Thanks,
Frank
----- Original Message -----
From: "Jim Lucas" <phplist
zonedzero.net>
To: "Frank Keessen" <fkeessen
planet.nl>; <php-general
lists.php.net>
Sent: Tuesday, June 03, 2003 10:30 PM
Subject: Re: [PHP] Multi Selection
> I would look into doing something like this.
>
> The HTML code that Wouter will work just fine. My ideas are for the
process
> page.
>
> When you insert data into a table, it has to re-index the table if you
make
> your statement insert all the data at one time it will only re-index the
> table one time.
>
> It goes a little something like this.
>
> <?php
> if(isset($_POST['somename'])) {
> print_r($_POST['somename']);
>
> echo "<BR>";
>
> foreach($_POST['somename'] AS $k => $v) {
> $values[] = " (NOW(), '{$v}') ";
> }
> if(count($values)) {
> $insert_sql = "INSERT INTO table_name (date, myValue) VALUES " .
join("
> VALUES ", $values);
> echo $insert_sql;
> } else {
> echo "Nothing to insert";
> }
> }
> ?>
> <FORM METHOD=POST>
> <SELECT name='somename[]' size=10 multiple id='somename[]'>
> <OPTION value='one'>First Thingie</OPTION>
> <OPTION value='two'>Second Thingie</OPTION>
> <OPTION value='three'>Third Thingie</OPTION>
> <OPTION value='four'>Fourth Thingie</OPTION>
> <OPTION value='five'>Fifth Thingie</OPTION>
> </SELECT>
> <INPUT TYPE='SUBMIT'>
> </FORM>
>
> Give the above script a shot and see if it does what you want it to do.
>
> Jim Lucas
>
> ----- Original Message -----
> From: "Frank Keessen" <fkeessen
planet.nl>
> To: <php-general
lists.php.net>
> Sent: Tuesday, June 03, 2003 11:55 AM
> Subject: [PHP] Multi Selection
>
>
> > Hi Guys,
> >
> > I'm trying to do the following:
> >
> > I've got a multiple selection box build out of a query of table
> >
> > <td><select name="VALUE[]" size="10" multiple id="VALUE[]">
> > <?
> > $query2 = "SELECT SomethingID, Somewhere FROM Someplace WHERE publiceer
=
> 'yes' ORDER BY somewhere";
> > $result2 = mysql_query($query2) or die ("Error in query: $query2. " .
> mysql_error());
> >
> > if (mysql_num_rows($result2) > 0)
> > {
> > while($row2 = mysql_fetch_object($result2))
> > {
> > ?>
> >
> > <OPTION VALUE="<? echo $row2->SomethingID ?>"><? echo
$row2->Somewhere
> ; ?>
> > <?
> > }
> > }
> > ?>
> > </option>
> > </select>
> >
> > The outcome is stored in the VALUE[]..
> >
> > Now i want to have an INSERT query that insert each value seperatly..
> >
> > So if there are 3 selections it must be repeat the INSERT query three
> times...
> >
> >
> > Thanks for the help!
> >
> >
> > Frank
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Guys
Just another challenge; i've taken the code of Wouter and as you can see i'm
first passing data to the reis table.. Then i retrieve the ID... But when
you have multiple selection's the trouble starts... The first record is o.k.
but then the second record Get's the ID of the first.. How to avoid this?
Frank
<?
$connection = mysql_connect($host, $user, $pass) or die ("Unable to
connect!");
mysql_select_db($db) or die ("Unable to select database!");
$_POST["submit"]=isset($_POST["submit"])?$_POST["submit"]:"";
if($_POST['submit']!="")
{
$reisnaam=addslashes($_POST['reisnaam']);
$query3 = "INSERT INTO reis(reisnaam) VALUES ('$reisnaam')";
$result = mysql_query($query3) or die ("Error in query: $query. " .
mysql_error());
print_r($_POST);
if(is_array($_POST['somename'])) {
foreach($_POST['somename'] as $Key => $Value) {
$query = 'INSERT INTO ra(reisid, accid) VALUES (LAST_INSERT_ID(),
'.$Value.')';
$result = mysql_query($query) or die ("Error in query: $query. " .
mysql_error());
};
} else {
$query = 'INSERT INTO ra(reisid, accid) VALUES (LAST_INSERT_ID(),
'.$_POST['somename'].')';
$result = mysql_query($query) or die ("Error in query: $query. " .
mysql_error());}
}
?>
<FORM method=post action=<? $_SERVER['PHP_SELF'] ?>>
<input size="70" maxlength="250" type="text" name="reisnaam"><br>
<SELECT name='somename[]' size=10 multiple id='somename[]'>
<OPTION value='1'>First Thingie</OPTION>
<OPTION value='2'>Second Thingie</OPTION>
<OPTION value='3'>Third Thingie</OPTION>
<OPTION value='4'>Fourth Thingie</OPTION>
<OPTION value='5'>Fifth Thingie</OPTION>
</SELECT>
<input type=submit name=submit value=Toevoegen>
</FORM>
----- Original Message -----
From: "Frank Keessen" <fkeessen
planet.nl>
To: "Jim Lucas" <phplist
zonedzero.net>; <php-general
lists.php.net>
Sent: Tuesday, June 03, 2003 10:37 PM
Subject: Re: [PHP] Multi Selection
> Jim,
>
> Why does the data have to be reindexed??? I don't understand, can you give
> me an explenation?
>
> Thanks,
>
> Frank
> ----- Original Message -----
> From: "Jim Lucas" <phplist
zonedzero.net>
> To: "Frank Keessen" <fkeessen
planet.nl>; <php-general
lists.php.net>
> Sent: Tuesday, June 03, 2003 10:30 PM
> Subject: Re: [PHP] Multi Selection
>
>
> > I would look into doing something like this.
> >
> > The HTML code that Wouter will work just fine. My ideas are for the
> process
> > page.
> >
> > When you insert data into a table, it has to re-index the table if you
> make
> > your statement insert all the data at one time it will only re-index the
> > table one time.
> >
> > It goes a little something like this.
> >
> > <?php
> > if(isset($_POST['somename'])) {
> > print_r($_POST['somename']);
> >
> > echo "<BR>";
> >
> > foreach($_POST['somename'] AS $k => $v) {
> > $values[] = " (NOW(), '{$v}') ";
> > }
> > if(count($values)) {
> > $insert_sql = "INSERT INTO table_name (date, myValue) VALUES " .
> join("
> > VALUES ", $values);
> > echo $insert_sql;
> > } else {
> > echo "Nothing to insert";
> > }
> > }
> > ?>
> > <FORM METHOD=POST>
> > <SELECT name='somename[]' size=10 multiple id='somename[]'>
> > <OPTION value='one'>First Thingie</OPTION>
> > <OPTION value='two'>Second Thingie</OPTION>
> > <OPTION value='three'>Third Thingie</OPTION>
> > <OPTION value='four'>Fourth Thingie</OPTION>
> > <OPTION value='five'>Fifth Thingie</OPTION>
> > </SELECT>
> > <INPUT TYPE='SUBMIT'>
> > </FORM>
> >
> > Give the above script a shot and see if it does what you want it to do.
> >
> > Jim Lucas
> >
> > ----- Original Message -----
> > From: "Frank Keessen" <fkeessen
planet.nl>
> > To: <php-general
lists.php.net>
> > Sent: Tuesday, June 03, 2003 11:55 AM
> > Subject: [PHP] Multi Selection
> >
> >
> > > Hi Guys,
> > >
> > > I'm trying to do the following:
> > >
> > > I've got a multiple selection box build out of a query of table
> > >
> > > <td><select name="VALUE[]" size="10" multiple id="VALUE[]">
> > > <?
> > > $query2 = "SELECT SomethingID, Somewhere FROM Someplace WHERE
publiceer
> =
> > 'yes' ORDER BY somewhere";
> > > $result2 = mysql_query($query2) or die ("Error in query: $query2. " .
> > mysql_error());
> > >
> > > if (mysql_num_rows($result2) > 0)
> > > {
> > > while($row2 = mysql_fetch_object($result2))
> > > {
> > > ?>
> > >
> > > <OPTION VALUE="<? echo $row2->SomethingID ?>"><? echo
> $row2->Somewhere
> > ; ?>
> > > <?
> > > }
> > > }
> > > ?>
> > > </option>
> > > </select>
> > >
> > > The outcome is stored in the VALUE[]..
> > >
> > > Now i want to have an INSERT query that insert each value seperatly..
> > >
> > > So if there are 3 selections it must be repeat the INSERT query three
> > times...
> > >
> > >
> > > Thanks for the help!
> > >
> > >
> > > Frank
> > >
> >
> >
> > --
> > 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
>
attached mail follows:
if you are using a mysql data base setup and you have any indecies on the
table that you are inserting the data into, then MySQL will automatically
re-index the table each and every time the data in the table is modified.
Jim Lucas
----- Original Message -----
From: "Frank Keessen" <fkeessen
planet.nl>
To: "Jim Lucas" <phplist
zonedzero.net>; <php-general
lists.php.net>
Sent: Tuesday, June 03, 2003 1:37 PM
Subject: Re: [PHP] Multi Selection
> Jim,
>
> Why does the data have to be reindexed??? I don't understand, can you give
> me an explenation?
>
> Thanks,
>
> Frank
> ----- Original Message -----
> From: "Jim Lucas" <phplist
zonedzero.net>
> To: "Frank Keessen" <fkeessen
planet.nl>; <php-general
lists.php.net>
> Sent: Tuesday, June 03, 2003 10:30 PM
> Subject: Re: [PHP] Multi Selection
>
>
> > I would look into doing something like this.
> >
> > The HTML code that Wouter will work just fine. My ideas are for the
> process
> > page.
> >
> > When you insert data into a table, it has to re-index the table if you
> make
> > your statement insert all the data at one time it will only re-index the
> > table one time.
> >
> > It goes a little something like this.
> >
> > <?php
> > if(isset($_POST['somename'])) {
> > print_r($_POST['somename']);
> >
> > echo "<BR>";
> >
> > foreach($_POST['somename'] AS $k => $v) {
> > $values[] = " (NOW(), '{$v}') ";
> > }
> > if(count($values)) {
> > $insert_sql = "INSERT INTO table_name (date, myValue) VALUES " .
> join("
> > VALUES ", $values);
> > echo $insert_sql;
> > } else {
> > echo "Nothing to insert";
> > }
> > }
> > ?>
> > <FORM METHOD=POST>
> > <SELECT name='somename[]' size=10 multiple id='somename[]'>
> > <OPTION value='one'>First Thingie</OPTION>
> > <OPTION value='two'>Second Thingie</OPTION>
> > <OPTION value='three'>Third Thingie</OPTION>
> > <OPTION value='four'>Fourth Thingie</OPTION>
> > <OPTION value='five'>Fifth Thingie</OPTION>
> > </SELECT>
> > <INPUT TYPE='SUBMIT'>
> > </FORM>
> >
> > Give the above script a shot and see if it does what you want it to do.
> >
> > Jim Lucas
> >
> > ----- Original Message -----
> > From: "Frank Keessen" <fkeessen
planet.nl>
> > To: <php-general
lists.php.net>
> > Sent: Tuesday, June 03, 2003 11:55 AM
> > Subject: [PHP] Multi Selection
> >
> >
> > > Hi Guys,
> > >
> > > I'm trying to do the following:
> > >
> > > I've got a multiple selection box build out of a query of table
> > >
> > > <td><select name="VALUE[]" size="10" multiple id="VALUE[]">
> > > <?
> > > $query2 = "SELECT SomethingID, Somewhere FROM Someplace WHERE
publiceer
> =
> > 'yes' ORDER BY somewhere";
> > > $result2 = mysql_query($query2) or die ("Error in query: $query2. " .
> > mysql_error());
> > >
> > > if (mysql_num_rows($result2) > 0)
> > > {
> > > while($row2 = mysql_fetch_object($result2))
> > > {
> > > ?>
> > >
> > > <OPTION VALUE="<? echo $row2->SomethingID ?>"><? echo
> $row2->Somewhere
> > ; ?>
> > > <?
> > > }
> > > }
> > > ?>
> > > </option>
> > > </select>
> > >
> > > The outcome is stored in the VALUE[]..
> > >
> > > Now i want to have an INSERT query that insert each value seperatly..
> > >
> > > So if there are 3 selections it must be repeat the INSERT query three
> > times...
> > >
> > >
> > > Thanks for the help!
> > >
> > >
> > > Frank
> > >
> >
> >
> > --
> > 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
>
>
attached mail follows:
Lo all,
Some input much appreciated. I upgraded mod_php4 from 4.2.3 to 4.3.2, and
needless to say, something went horribly wrong. PHP compiled without any
serious problems, and the installation seemed to have gone fine as well.
When issuing a apachectl restart, apache immediately core dumped... OOOPS.
Well, my attempts at debugging, so far, was very much unsuccessful...
root
netsphere:/usr/local/etc/apache# httpd --help
Segmentation fault (core dumped)
root
netsphere:/usr/local/etc/apache#
root
netsphere:/usr/local/etc/apache# httpd -h
Usage: httpd [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-v] [-V] [-h] [-l] [-L] [-S] [-t] [-T] [-F]
Options:
-D name : define a name for use in <IfDefine name> directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled-in modules
-L : list available configuration directives
-S : show parsed settings (currently only vhost settings)
-t : run syntax check for config files (with docroot check)
-T : run syntax check for config files (without docroot
check)
-F : run main process in foreground, for process supervisors
root
netsphere:/usr/local/etc/apache# httpd -v
Server version: Apache/1.3.27 (Unix)
Server built: Dec 10 2002 22:10:01
root
netsphere:/usr/local/etc/apache# httpd -V
Server version: Apache/1.3.27 (Unix)
Server built: Dec 10 2002 22:10:01
Server's Module Magic Number: 19990320:13
Server compiled with....
-D EAPI
-D EAPI_MM
-D EAPI_MM_CORE_PATH="/var/run/httpd.mm"
-D HAVE_MMAP
-D USE_MMAP_SCOREBOARD
-D USE_MMAP_FILES
-D HAVE_FLOCK_SERIALIZED_ACCEPT
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D HARD_SERVER_LIMIT=512
-D SO_ACCEPTFILTER
-D ACCEPT_FILTER_NAME="httpready"
-D HTTPD_ROOT="/usr/local"
-D SUEXEC_BIN="/usr/local/sbin/suexec"
-D DEFAULT_PIDLOG="/var/run/httpd.pid"
-D DEFAULT_SCOREBOARD="/var/run/httpd.scoreboard"
-D DEFAULT_LOCKFILE="/var/run/httpd.lock"
-D DEFAULT_ERRORLOG="/var/log/httpd-error.log"
-D TYPES_CONFIG_FILE="etc/apache/mime.types"
-D SERVER_CONFIG_FILE="etc/apache/httpd.conf"
-D ACCESS_CONFIG_FILE="etc/apache/access.conf"
-D RESOURCE_CONFIG_FILE="etc/apache/srm.conf"
root
netsphere:/usr/local/etc/apache# httpd -l
Compiled-in modules:
http_core.c
mod_so.c
suexec: disabled; invalid wrapper /usr/local/sbin/suexec
root
netsphere:/usr/local/etc/apache# httpd -S
Segmentation fault (core dumped)
root
netsphere:/usr/local/etc/apache# httpd -t
Segmentation fault (core dumped)
root
netsphere:/usr/local/etc/apache# httpd -T
Segmentation fault (core dumped)
root
netsphere:/usr/local/etc/apache# httpd -F
Segmentation fault (core dumped)
checking libphp4.so....
root
netsphere:/usr/ports/www/mod_php4# ldd
/usr/local/libexec/apache/libphp4.so
/usr/local/libexec/apache/libphp4.so:
libcrypt.so.2 => /usr/lib/libcrypt.so.2 (0x28297000)
libmcal.so => /usr/local/lib/libmcal.so (0x282b0000)
libc-client4.so.8 => /usr/local/lib/libc-client4.so.8 (0x282bf000)
libexpat.so.4 => /usr/local/lib/libexpat.so.4 (0x28371000)
libsnmp.so.4 => /usr/local/lib/libsnmp.so.4 (0x2838e000)
libpspell.so.15 => /usr/local/lib/libpspell.so.15 (0x283e8000)
libpdf.so.4 => /usr/local/lib/libpdf.so.4 (0x283ea000)
libz.so.2 => /usr/lib/libz.so.2 (0x2847b000)
libtiff.so.4 => /usr/local/lib/libtiff.so.4 (0x28489000)
libpng.so.5 => /usr/local/lib/libpng.so.5 (0x284cd000)
libjpeg.so.9 => /usr/local/lib/libjpeg.so.9 (0x284f1000)
libmysqlclient.so.10 => /usr/local/lib/mysql/libmysqlclient.so.10
(0x2850f000)
libmhash.so.2 => /usr/local/lib/libmhash.so.2 (0x2852b000)
libmcrypt.so.8 => /usr/local/lib/libmcrypt.so.8 (0x28544000)
libltdl.so.1 => /usr/local/lib/libltdl.so.1 (0x28580000)
libpam.so.1 => /usr/lib/libpam.so.1 (0x28584000)
libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x2858e000)
libintl.so.4 => /usr/local/lib/libintl.so.4 (0x28669000)
libgdbm.so.3 => /usr/local/lib/libgdbm.so.3 (0x28671000)
libbz2.so.1 => /usr/lib/libbz2.so.1 (0x28677000)
libssl.so.4 => /usr/local/lib/libssl.so.4 (0x28687000)
libcrypto.so.4 => /usr/local/lib/libcrypto.so.4 (0x286b6000)
libm.so.2 => /usr/lib/libm.so.2 (0x287a9000)
libcurl.so.2 => /usr/local/lib/libcurl.so.2 (0x287c5000)
libudmsearch.so.1 => /usr/local/lib/libudmsearch.so.1 (0x287e5000)
libssl.so.2 => /usr/lib/libssl.so.2 (0x2881c000)
libcrypto.so.2 => /usr/lib/libcrypto.so.2 (0x2884a000)
libaspell.so.15 => /usr/local/lib/libaspell.so.15 (0x28907000)
libstdc++.so.3 => /usr/lib/libstdc++.so.3 (0x289d4000)
libc.so.4 => /usr/lib/libc.so.4 (0x28069000)
libcrypto.so.3 => /usr/lib/libcrypto.so.3 (0x28a1b000)
libssl.so.3 => /usr/lib/libssl.so.3 (0x28b1a000)
Needless to say, I am baffled. The system is FreeBSD 4.8-STABLE, running
apache13-modssl (FreeBSD Ports). I am reinstalling apache as well now to
see if that maybe fixes the problem, but ya... *ANY* ideas much
appreciated...
--
me
attached mail follows:
How I can use php and mcrypt on windows? I mean. What I have to do to turn php able to use mcrypt function on windows.
Thanks
attached mail follows:
Just uncomment the extension php_mcrypt.dll from the php.ini file and
restart the server.
"Gilberto Garcia Jr." <garcia
ensino.net> escribió en el mensaje
news:019c01c32a06$7c9b51b0$07020b0a
giba...
How I can use php and mcrypt on windows? I mean. What I have to do to turn
php able to use mcrypt function on windows.
Thanks
attached mail follows:
Please RTFM before asking questions! http://php.net/mcrypt answers your
question.
Gilberto Garcia Jr. wrote:
>How I can use php and mcrypt on windows? I mean. What I have to do to turn php able to use mcrypt function on windows.
>
>Thanks
>
>
--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
attached mail follows:
Simple question:
How do I check the expiration of a cookie that has been set? I can't
seem to find it on php.net, if it is there..please provide the proper
link for me and I will read up on it.
Thanks,
Tom
attached mail follows:
The browser simply doesn't provide this information. You may be able to
do it with javascript, but certainly not PHP.
Tom Ray [Lists] wrote:
> Simple question:
> How do I check the expiration of a cookie that has been set? I can't
> seem to find it on php.net, if it is there..please provide the proper
> link for me and I will read up on it.
>
> Thanks,
> Tom
>
>
>
>
--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
attached mail follows:
Thanks. I'm using PHP-4.3.1.
The problem is not with $_SESSION. I used session_is_registered("sess_var");
to check from the second script and cannot see the variable("sess_var"). Can
anyone tell me why?
page1.php:
<?
session_start();
session_register("sess_var");
$sess_var = "Hello world!";
echo "The content of \$sess_var is $sess_var<br>";
?>
<a href = "page2.php">Next page</a>
page2.php:
<?
session_start();
if (session_is_registered("sess_var")) {
echo "true<br><br>";
}
else
{echo "false<br>";}
echo "sess_var = $_SESSION[sess_var]<br>";
echo "The content of \$sess_var is $sess_var<br>";
// session_unregister("sess_var");
?>
"Jason Wong" <php-general
gremlins.biz> wrote in message
news:200306031542.09613.php-general
gremlins.biz...
> On Tuesday 03 June 2003 12:28, Eric D. wrote:
>
> > I have two very simple php scripts and the second srcipt is not seeing
the
> > variables session_registered by the first script.
> > I'm running the latest version of php. And have both "register_globals"
and
> > "track_vars" set to "ON".
>
> It's best to state the specific version of PHP you're using rather than
just
> 'latest' (as it could mean different things to different people at
different
> times).
>
> > Well, the first script prints out the session var fine, but not the
second
> > one. What is wrong? Is there something else I overlooked? Thanks for
your
> > help!
>
> If you're using PHP > 4.1.0 then you ought to be using $_SESSION for all
your
> session needs -- see manual for examples.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> I have a map of the United States. It's actual size. I spent last summer
> folding it. People ask me where I live, and I say, "E6".
> -- Steven Wright
> */
>
attached mail follows:
> Thanks. I'm using PHP-4.3.1.
>
> The problem is not with $_SESSION. I used
> session_is_registered("sess_var");
> to check from the second script and cannot see the
> variable("sess_var"). Can
> anyone tell me why?
Your code should work for register_globals "on". Check that:
- php.ini is where it is supposed to be (/usr/local/lib/, I think).
- register_globals is really to set to on in php.ini.
- that cookies are enabled in your browser.
- you don't have an .htaccess file in your directory with register_globals
turned off in it.
Kirk
attached mail follows:
On Wednesday 04 June 2003 04:08, Eric D. wrote:
> Thanks. I'm using PHP-4.3.1.
That's good, so again ...
> > If you're using PHP > 4.1.0 then you ought to be using $_SESSION for all
> > your session needs -- see manual for examples.
Reiterate, read: manual > Session handling functions
> The problem is not with $_SESSION. I used
> session_is_registered("sess_var"); to check from the second script and
> cannot see the variable("sess_var"). Can anyone tell me why?
You're not supposed to mix session_is_registered() (and friends) when using
$_SESSION.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
It's later than you think, the joint Russian-American space mission has
already begun.
*/
attached mail follows:
Thanks Kirk! I have all of the conditions you set out met. And still doesn't
work.
I also added session__is_registered("sess_var") to check and it tells me
that it's not registered.
1st script - page1.php:
<?
session_start();
session_register("sess_var");
$sess_var = "Hello world!";
echo "The content of \$sess_var is $sess_var<br>"; //echos fine here
?>
<a href = "page2.php">Next page</a>
2nd script - page2.php:
<?
session_start();
if (session_is_registered("sess_var"))
{ echo "true<br><br>";}
else
{echo "false<br>";}
echo "The content of \$sess_var is $sess_var<br>"; //$sess_var NOT printed
echo "sess_var = $_SESSION[sess_var]<br>";
session_unregister("sess_var");
?>
"Kirk Johnson" <kjohnson
zootweb.com> wrote in message
news:B11731D518B5D61183C700A0C98BE0D902587138
chef...
> > Thanks. I'm using PHP-4.3.1.
> >
> > The problem is not with $_SESSION. I used
> > session_is_registered("sess_var");
> > to check from the second script and cannot see the
> > variable("sess_var"). Can
> > anyone tell me why?
>
> Your code should work for register_globals "on". Check that:
>
> - php.ini is where it is supposed to be (/usr/local/lib/, I think).
> - register_globals is really to set to on in php.ini.
> - that cookies are enabled in your browser.
> - you don't have an .htaccess file in your directory with register_globals
> turned off in it.
>
> Kirk
>
attached mail follows:
Thanks Kirk! I have all of the conditions you set out met. And still doesn't
work.
I also added session__is_registered("sess_var") to check and it tells me
that it's not registered.
1st script - page1.php:
<?
session_start();
session_register("sess_var");
$sess_var = "Hello world!";
echo "The content of \$sess_var is $sess_var<br>"; //echos fine here
?>
<a href = "page2.php">Next page</a>
2nd script - page2.php:
<?
session_start();
if (session_is_registered("sess_var"))
{ echo "true<br><br>";}
else
{echo "false<br>";}
echo "The content of \$sess_var is $sess_var<br>"; //$sess_var NOT printed
echo "sess_var = $_SESSION[sess_var]<br>";
session_unregister("sess_var");
?>
"Kirk Johnson" <kjohnson
zootweb.com> wrote in message
news:B11731D518B5D61183C700A0C98BE0D902587138
chef...
> > Thanks. I'm using PHP-4.3.1.
> >
> > The problem is not with $_SESSION. I used
> > session_is_registered("sess_var");
> > to check from the second script and cannot see the
> > variable("sess_var"). Can
> > anyone tell me why?
>
> Your code should work for register_globals "on". Check that:
>
> - php.ini is where it is supposed to be (/usr/local/lib/, I think).
> - register_globals is really to set to on in php.ini.
> - that cookies are enabled in your browser.
> - you don't have an .htaccess file in your directory with register_globals
> turned off in it.
>
> Kirk
>
attached mail follows:
Set your error reporting to E_ALL, to see if anything else is going on.
Add this line right after session_start() in both files, to make sure the
session ID is getting passed correctly. The same ID should be displayed in
both files:
echo "ID = " . session_id() . "<BR>";
> -----Original Message-----
> From: Eric D. [mailto:ericd_
hotmail.com]
> Sent: Tuesday, June 03, 2003 3:01 PM
> To: php-general
lists.php.net
> Subject: Re: [PHP] php session not persisting
>
>
> Thanks Kirk! I have all of the conditions you set out met.
> And still doesn't
> work.
>
> I also added session__is_registered("sess_var") to check and
> it tells me
> that it's not registered.
>
> 1st script - page1.php:
>
> <?
>
> session_start();
> session_register("sess_var");
>
> $sess_var = "Hello world!";
>
> echo "The content of \$sess_var is $sess_var<br>"; //echos
> fine here
>
> ?>
> <a href = "page2.php">Next page</a>
>
>
> 2nd script - page2.php:
>
> <?
>
> session_start();
> if (session_is_registered("sess_var"))
> { echo "true<br><br>";}
> else
> {echo "false<br>";}
>
> echo "The content of \$sess_var is $sess_var<br>";
> //$sess_var NOT printed
> echo "sess_var = $_SESSION[sess_var]<br>";
>
> session_unregister("sess_var");
> ?>
>
>
> "Kirk Johnson" <kjohnson
zootweb.com> wrote in message
> news:B11731D518B5D61183C700A0C98BE0D902587138
chef...
> > > Thanks. I'm using PHP-4.3.1.
> > >
> > > The problem is not with $_SESSION. I used
> > > session_is_registered("sess_var");
> > > to check from the second script and cannot see the
> > > variable("sess_var"). Can
> > > anyone tell me why?
> >
> > Your code should work for register_globals "on". Check that:
> >
> > - php.ini is where it is supposed to be (/usr/local/lib/, I think).
> > - register_globals is really to set to on in php.ini.
> > - that cookies are enabled in your browser.
> > - you don't have an .htaccess file in your directory with
> register_globals
> > turned off in it.
> >
> > Kirk
attached mail follows:
Thanks again Kirk.
session_id() is not being passed correctly. The two pages contain different
page ids. I had "display_errors = ON" in php.ini and received the following
msgs:
Notice: Undefined index: sess_var in D:\Program Files\Apache
Group\Apache2\htdocs\page2.php on line 13
sess_var =
So page2.php is NOT see $sess_var from page1.php.
Is there something else that could affect session variables besides
"track_vars" and "register_globals"?
Regards,
Eric
"Kirk Johnson" <kjohnson
zootweb.com> wrote in message
news:B11731D518B5D61183C700A0C98BE0D902587139
chef...
> Set your error reporting to E_ALL, to see if anything else is going on.
>
> Add this line right after session_start() in both files, to make sure the
> session ID is getting passed correctly. The same ID should be displayed in
> both files:
>
> echo "ID = " . session_id() . "<BR>";
>
>
> > -----Original Message-----
> > From: Eric D. [mailto:ericd_
hotmail.com]
> > Sent: Tuesday, June 03, 2003 3:01 PM
> > To: php-general
lists.php.net
> > Subject: Re: [PHP] php session not persisting
> >
> >
> > Thanks Kirk! I have all of the conditions you set out met.
> > And still doesn't
> > work.
> >
> > I also added session__is_registered("sess_var") to check and
> > it tells me
> > that it's not registered.
> >
> > 1st script - page1.php:
> >
> > <?
> >
> > session_start();
> > session_register("sess_var");
> >
> > $sess_var = "Hello world!";
> >
> > echo "The content of \$sess_var is $sess_var<br>"; //echos
> > fine here
> >
> > ?>
> > <a href = "page2.php">Next page</a>
> >
> >
> > 2nd script - page2.php:
> >
> > <?
> >
> > session_start();
> > if (session_is_registered("sess_var"))
> > { echo "true<br><br>";}
> > else
> > {echo "false<br>";}
> >
> > echo "The content of \$sess_var is $sess_var<br>";
> > //$sess_var NOT printed
> > echo "sess_var = $_SESSION[sess_var]<br>";
> >
> > session_unregister("sess_var");
> > ?>
> >
> >
> > "Kirk Johnson" <kjohnson
zootweb.com> wrote in message
> > news:B11731D518B5D61183C700A0C98BE0D902587138
chef...
> > > > Thanks. I'm using PHP-4.3.1.
> > > >
> > > > The problem is not with $_SESSION. I used
> > > > session_is_registered("sess_var");
> > > > to check from the second script and cannot see the
> > > > variable("sess_var"). Can
> > > > anyone tell me why?
> > >
> > > Your code should work for register_globals "on". Check that:
> > >
> > > - php.ini is where it is supposed to be (/usr/local/lib/, I think).
> > > - register_globals is really to set to on in php.ini.
> > > - that cookies are enabled in your browser.
> > > - you don't have an .htaccess file in your directory with
> > register_globals
> > > turned off in it.
> > >
> > > Kirk
attached mail follows:
Hi,
I have two very simple php scripts and the second srcipt is not seeing the
variables session_registered by the first script.
I'm running PHP-4.3.1. And have both "register_globals" and
"track_vars" set to "ON".
Well, the first script prints out the session var fine, but not the second
one. As well I used session_is_registered("sess_var") to check if "sess_var"
is registered in the second script and it says "false". What is wrong? Is
there something else I overlooked? Thanks for your
help!
1st script - page1.php:
<?
session_start();
session_register("sess_var");
$sess_var = "Hello world!";
echo "The content of \$sess_var is $sess_var<br>";
?>
<a href = "page2.php">Next page</a>
2nd script - page2.php:
<?
session_start();
if (session_is_registered("sess_var"))
{ echo "true<br><br>";}
else
{echo "false<br>";}
echo "The content of \$sess_var is $sess_var<br>";
session_unregister("sess_var");
?>
attached mail follows:
On Tue, 2003-06-03 at 02:12, Bix wrote:
> I'm fine with using while loops, use them for most of my listing work, but I
> wanted to try using a foreach loop instead but it seemed not to work as
> expected. For ym table generation, I need the $key to do some maths on in
> order to get my table looking right. All the guts are done, but for some
> reason, when usng a foreach loop, foreach (mysql_fetch_array($result) as
> $key => $value) $value is not an array of the fields. Whereas with a while
> loop, it works fine. Is this a problem with foreach?
>
> If it is, i'll stick to while, but with a counter to generate a key.
Nope...it's working perfectly. mysql_fetch_array() returns an array.
foreach() operates on an array. What you have:
foreach (mysql_fetch_array($result) as $key => $article) {
//. . .
}
...is the same as saying this:
$arr = mysql_fetch_array($result);
foreach ($arr as $key => $article) {
//. . .
}
So it is iterating over the correct array (the returned row array)
instead of the array over which you want it to be iterating (the
array of rows).
Using the counter is probably your best bet. mysql_fetch_array() doesn't
return any information on which row it's currently returning.
Hope this clears it up a bit,
Torben
> "Justin French" <justin
indent.com.au> wrote in message
> news:BB0233DA.28970%justin
indent.com.au...
> > This is correct:
> >
> > while($myrow = mysql_fetch_array($result))
> > {
> > // ...
> > }
> >
> > The iteration of the while loop represents one returned row from the mysql
> > result, with $myrow being an array of values returned.
> >
> > Rather than a SELECT * query, let's look at a something where we know the
> > column names:
> >
> > <?
> > $sql = "
> > SELECT first, surname, age
> > FROM employee
> > WHERE age >= 18
> > LIMIT 50
> > ";
> > $result = mysql_query($sql);
> > while($myrow = mysql_fetch_array($result))
> > {
> > echo "Name: {$myrow['first']} {$myrow['surname']}. Age:
> > {$myrow['age']}<br />";
> > }
> > ?>
> >
> >
> > Now, given the above code, what else do you need to do?
> >
> >
> > Justin
> >
> >
> >
> >
> > on 03/06/03 8:25 AM, Bix (php
bix.cc) wrote:
> >
> > > Hi all,
> > >
> > > I am trying to build up a table using values from a db as follows...
> > >
> > > mysql_select_db($db, $sql_connection);
> > > $result = mysql_query("SELECT * FROM $table WHERE $query LIMIT
> > > $limit",$sql_connection);
> > > $output = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"
> > > width=\"370\">\n";
> > > foreach(mysql_fetch_array($result) as $key => $article){
> > > //stuff
> > > }
> > >
> > > now if I use a while loop ie:
> > >
> > > while ($array = mysql_fetch_array($result)){
> > > //stuff
> > > }
> > >
> > > all the matched rows are processed, however with the foreach model,
> $article
> > > isnt an array, it is the first row all merged together.
> > >
> > > Any ideas?
> > >
> > > ;o)
> > >
> > >
> >
>
--
Torben Wilson <torben
php.net> +1.604.709.0506
http://www.thebuttlesschaps.com http://www.inflatableeye.com
http://www.hybrid17.com http://www.themainonmain.com
-----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----
attached mail follows:
I'm just a little curious, I've never really don't this before, but is
installing mcrypt usually a very hard thing to do, or will it be pretty
simple for a dolt like me? :)
Thanks.
attached mail follows:
Here is how I installed it and got it working. This is straight out of
the PHP manual. You should read it, it helps.
LIV. Mcrypt Encryption Functions
Introduction
This is an interface to the mcrypt library, which supports a wide
variety of block algorithms such as DES, TripleDES, Blowfish (default),
3-WAY, SAFER-SK64, SAFER-SK128, TWOFISH, TEA, RC2 and GOST in CBC, OFB,
CFB and ECB cipher modes. Additionally, it supports RC6 and IDEA which
are considered "non-free".
_____
Requirements
These functions work using <http://mcrypt.hellug.gr/> mcrypt. To use
it, download libmcrypt-x.x.tar.gz from here <http://mcrypt.hellug.gr/>
and follow the included installation instructions. Windows users will
find all the needed compiled mcrypt binaries here
<http://ftp.proventum.net/pub/php/win32/misc/mcrypt/>
-----Original Message-----
From: Tom Ray [Lists] [mailto:lists
blazestudios.com]
Sent: Tuesday, June 03, 2003 3:41 PM
To: PHP List
Subject: [PHP] mcrypt installation
I'm just a little curious, I've never really don't this before, but is
installing mcrypt usually a very hard thing to do, or will it be pretty
simple for a dolt like me? :)
Thanks.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi,
First, let me say many thanks to those who responded to my cron tab
question - it's working well now. And now for my next trick ;)
I'm looking for more of an opinion here. I'm doing an alphabetical listing
of members for this site, I've done a general query of my MySQL table to
select all the members, but I was wondering if PHP could select only the
first character and display only those members who's name begins with an
'A', 'B', 'C', etc?
I know I can do a selective query in MySQL using the LEFT command - but
that would mean doing a query for each letter of the alphabet - is there a
better way, or shall I start querying away?
Thanks
-Tim
attached mail follows:
Hello everybody!
I'm trying to upload a file using the move_uploaded_file function, everyting
works fine when the files have less than 1MB but when I upload one more than
this, IE returns the error The page cannot be displayed and in it's title
shows Cannot find server. I alreary edit php.ini setting UPLOAD_MAX_FILESIZE
to 8388608 (8M), post_max_size = 8388608 and file_uploads = On (memory_limit
is 8388608 too).
Someone could help me?
Thanks in advance!
Maurício Valente
attached mail follows:
I got the same error some time ago, and I almost went nuts trying to find
the cause of this seemingly "insoluble" problem. But it has actually nothing
at all to do with your script or the max_file_size in PHP or the one you
give with the HTML form. Those are offcourse 2 limits which are important,
but there's another limit that counts here, and it's around 1Mb for
standard...
I can't recall how it was exactly done, but it's some default
max_body_request or something in Linux or Apache (thought it was Linux
though, I encountered the problem on a Redhat distribution, but someone else
fixed it for me).. Try looking in Linux's or Apache's settings...
"MauríCio Valente" <mauricio
agp5.com.br> schreef in bericht
news:20030603205446.74672.qmail
pb1.pair.com...
> Hello everybody!
>
> I'm trying to upload a file using the move_uploaded_file function,
everyting
> works fine when the files have less than 1MB but when I upload one more
than
> this, IE returns the error The page cannot be displayed and in it's title
> shows Cannot find server. I alreary edit php.ini setting
UPLOAD_MAX_FILESIZE
> to 8388608 (8M), post_max_size = 8388608 and file_uploads = On
(memory_limit
> is 8388608 too).
>
> Someone could help me?
>
> Thanks in advance!
>
> Maurício Valente
>
>
>
attached mail follows:
move_uploaded_file is copying the temp file to a permanent directory right ?
thats on the server , check if the temp file is there with
$_POST['tmp_name'] or its size value
-----Original Message-----
From: Yves Daemen [mailto:yves.daemen
student.kuleuven.ac.be]
Sent: Wednesday, June 04, 2003 7:44 AM
To: php-general
lists.php.net
Subject: [PHP] Re: move_uploaded_file > 1MB
I got the same error some time ago, and I almost went nuts trying to find
the cause of this seemingly "insoluble" problem. But it has actually nothing
at all to do with your script or the max_file_size in PHP or the one you
give with the HTML form. Those are offcourse 2 limits which are important,
but there's another limit that counts here, and it's around 1Mb for
standard...
I can't recall how it was exactly done, but it's some default
max_body_request or something in Linux or Apache (thought it was Linux
though, I encountered the problem on a Redhat distribution, but someone else
fixed it for me).. Try looking in Linux's or Apache's settings...
"MauríCio Valente" <mauricio
agp5.com.br> schreef in bericht
news:20030603205446.74672.qmail
pb1.pair.com...
> Hello everybody!
>
> I'm trying to upload a file using the move_uploaded_file function,
everyting
> works fine when the files have less than 1MB but when I upload one more
than
> this, IE returns the error The page cannot be displayed and in it's title
> shows Cannot find server. I alreary edit php.ini setting
UPLOAD_MAX_FILESIZE
> to 8388608 (8M), post_max_size = 8388608 and file_uploads = On
(memory_limit
> is 8388608 too).
>
> Someone could help me?
>
> Thanks in advance!
>
> Maurício Valente
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
No it's not possible, you have to see the error to actually believe it ;-)
It goes like this:
You have a form with a file input field, you select a file on your HD, and
almost the "exact" moment you press the "submit"-button, you get a "Page not
found 404".
It's very weird when you see it actually, because it's about the last kind
of output you would expect ;-)
"Electroteque" <daniel
electroteque.org> schreef in bericht
news:EJECKPELDLGDPHHJOEDLMELFFCAA.daniel
electroteque.org...
> move_uploaded_file is copying the temp file to a permanent directory right
?
> thats on the server , check if the temp file is there with
> $_POST['tmp_name'] or its size value
>
> -----Original Message-----
> From: Yves Daemen [mailto:yves.daemen
student.kuleuven.ac.be]
> Sent: Wednesday, June 04, 2003 7:44 AM
> To: php-general
lists.php.net
> Subject: [PHP] Re: move_uploaded_file > 1MB
>
>
> I got the same error some time ago, and I almost went nuts trying to find
> the cause of this seemingly "insoluble" problem. But it has actually
nothing
> at all to do with your script or the max_file_size in PHP or the one you
> give with the HTML form. Those are offcourse 2 limits which are important,
> but there's another limit that counts here, and it's around 1Mb for
> standard...
>
> I can't recall how it was exactly done, but it's some default
> max_body_request or something in Linux or Apache (thought it was Linux
> though, I encountered the problem on a Redhat distribution, but someone
else
> fixed it for me).. Try looking in Linux's or Apache's settings...
>
>
>
> "MauríCio Valente" <mauricio
agp5.com.br> schreef in bericht
> news:20030603205446.74672.qmail
pb1.pair.com...
> > Hello everybody!
> >
> > I'm trying to upload a file using the move_uploaded_file function,
> everyting
> > works fine when the files have less than 1MB but when I upload one more
> than
> > this, IE returns the error The page cannot be displayed and in it's
title
> > shows Cannot find server. I alreary edit php.ini setting
> UPLOAD_MAX_FILESIZE
> > to 8388608 (8M), post_max_size = 8388608 and file_uploads = On
> (memory_limit
> > is 8388608 too).
> >
> > Someone could help me?
> >
> > Thanks in advance!
> >
> > Maurício Valente
> >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Dreamweaver MX has a Live mode.
It uploads the script to a testing server and it shows the output live as
you edit, given whatever post/get/cookie variables you want to pass to it.
Quite clever.
Unfortunately, DW MX is as stable as an elephant on a pole.
"Miles Thompson" <milesthompson
ns.sympatico.ca> wrote in message
news:5.2.0.9.0.20030603090551.01e71030
pop1.ns.sympatico.ca...
>
> The "editor" topic has been beat to death, please check the archive.
>
> However, PHP is code, all code, there's no "visual" component. All a
visual
> editor would give you is a prettier interface; be more concerned about an
> editor that lets YOU write quickly and efficiently, whether it be vim,
> emacs, UltraEdit, EditPlus, Jedit, Notepad, Pico, Joe or something fancier
> like HTMLKit or BlueFish. (PHPEdit seems to be reported as still buggy.)
>
> Cheers - Miles
>
> PS I KNOW someone's favourite, absolute best editor has been left out. Pls
> forgive.
>
> At 12:01 PM 6/3/2003 +0700, agus wrote:
> >hi everyone,
> >i want to know what the good software for PHP Editor Programing, like
> >Visual Age For Java, or Visual .NET from Microsoft...
>
attached mail follows:
I'm attempting to upgrade a machine from SLES7 to SLES8 and when I
recompiled apache + php4 + oracle on SLES8, I get this when attempting to
start apache. I can copy the libphp4.so from the old machine over and it
will start, but it won't connect to the database. Is this a bug in php,
Oracle, or glibc?
I've tried to compile against the following versions of php with the same
result, so I don't think it's php, but don't know where to start next:
4.1.2
4.2.1
4.3.2
Jonathan Paul Cowherd
Linux and Java Administrator
Genscape, Inc.
Email: jonathan.cowherd
genscape.com
Office: (502) 583-3730
Mobile: (502) 314-0444
-----Original Message-----
From: root [mailto:root
gdom.genscape.com]
Sent: Tuesday, June 03, 2003 4:59 PM
To: jonathan.cowherd
genscape.com
Subject: PHP Err
gdom:/usr/local/apache/bin # ./apachectl sslstart
Syntax error on line 239 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/libexec/libphp4.so into server:
/oracle/app/oracle/product/901/lib/libclntsh.so.9.0: undefined symbol:
__cmpdi2 ./apachectl sslstart: httpd could not be started
attached mail follows:
Please dont kill me for posting here. I dont know where else to post. I'm a
newbie and is completly stuck with a php problem :(
I got this code (among with more though...):
***********************
$i1=hentIngresser($nettstedid,38,$sprakid,$offsetannet,$antallmotor);
$i2=hentIngresser($nettstedid,39,$sprakid,$offsetannet,$antallmotor);
if($ingresser = array_merge($i1 ,$i2))
listIngresser($ingresser);
else
echo 'Det oppstod en feil ved henting av ingresser.';
**************************
This code produce the article feeds on this site:
http://www.amotor.no/artikler.php
The articles are feeded from $i1 and $i2, but as you can see on the dates
the newest article does not come first (the code first lists the $i1 THEN
$i2) but what I want is to get the newest on date first, then older and
older.
I talked to the owner of the script and he said that he had a variable named
"$publisertLang; //Publish date of the article in format: yyyymmddhhmmss"
He said I could sort the "$ingresser" (the merged $i1 and $i2) with the
$publisertLand as parameter on listIngresser, but the problem I dont know
how to do that. I've looked through php.net and tryed all sort commands I've
found.
Can somebody please help me?
P.S Excuse my bad English. It's not my native language.
Regards,
A. Lyse
attached mail follows:
Is there any way I can change the state of an already instantiated object?
ex:
$thisone = new Object();
$content = something;
$thisone -> SetContent($content);
$thisone -> Display();
That creates the object. Now if I want to change its content:
$content = something different;
$thisone -> SetContent($content);
$thisone -> Display();
This does not work but it illustrates what I want to do. I need to change
the content property of the "thisone" object.
R/T
attached mail follows:
On Tue, 2003-06-03 at 14:34, Info
Best-IT wrote:
> Is there any way I can change the state of an already instantiated object?
>
> ex:
>
> $thisone = new Object();
>
> $content = something;
>
> $thisone -> SetContent($content);
>
> $thisone -> Display();
>
>
> That creates the object. Now if I want to change its content:
>
> $content = something different;
>
> $thisone -> SetContent($content);
>
> $thisone -> Display();
>
> This does not work but it illustrates what I want to do. I need to change
> the content property of the "thisone" object.
This should definitely work. However, without the code to the Object
class there is little way to tell where the problem is. Presumably the
SetContent() method is deciding not to work a second time for some
reason (perhaps the new content fails to satisfy some kind of
requirement for valid content input?)
Torben
> R/T
>
--
Torben Wilson <torben
php.net> +1.604.709.0506
http://www.thebuttlesschaps.com http://www.inflatableeye.com
http://www.hybrid17.com http://www.themainonmain.com
-----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----
attached mail follows:
I have been looking for answer but have not located any thing that will
solve my problem.
The problem I am having is that I cannot get php scripts to run from the
command line, I can run php straight from the command line and it works
and by using -f it parses my file just fine, but when it comes to
running the script from the command line all I get is the : bad
interpreter : and I know that I am telling it the correct location.
[user
intranet user]# /usr/bin/php -v
PHP 4.3.2 (cli) (built: Jun 2 2003 08:52:29)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
[user
intranet user]# vi test.php
#!/usr/bin/php
<?php
phpinfo();
?>
[user
intranet user]# ./test.php
: bad interpreter: No such file or directory
-rwxrwxrwx 1 user user 39 Jun 3 15:43 test.php
Thank You
Brian Paulson
Sr. Web Developer
Email: Bpaulson
Chieftain.com
Phone: 1-800-279-6397
Fax: 1-719-544-0264
URL: www.chieftain.com
-------------------------------------------
attached mail follows:
Try using #!/usr/local/bin/php
My guess is that when you run:
ls -ls /usr/bin | grep php
you will see that php is a symlink to /usr/local/bin/php
-Jackson
On Tue, 2003-06-03 at 16:54, Brian Paulson wrote:
> I have been looking for answer but have not located any thing that will
> solve my problem.
>
> The problem I am having is that I cannot get php scripts to run from the
> command line, I can run php straight from the command line and it works
> and by using -f it parses my file just fine, but when it comes to
> running the script from the command line all I get is the : bad
> interpreter : and I know that I am telling it the correct location.
>
>
> [user
intranet user]# /usr/bin/php -v
> PHP 4.3.2 (cli) (built: Jun 2 2003 08:52:29)
> Copyright (c) 1997-2003 The PHP Group
> Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
>
> [user
intranet user]# vi test.php
> #!/usr/bin/php
> <?php
> phpinfo();
> ?>
>
> [user
intranet user]# ./test.php
> : bad interpreter: No such file or directory
>
>
> -rwxrwxrwx 1 user user 39 Jun 3 15:43 test.php
>
> Thank You
> Brian Paulson
> Sr. Web Developer
> Email: Bpaulson
Chieftain.com
> Phone: 1-800-279-6397
> Fax: 1-719-544-0264
> URL: www.chieftain.com
> -------------------------------------------
>
>
attached mail follows:
List,
I'm trying to install PHP and after each make I get this:
<snip>
Installing PEAR environment: /usr/lib/php/
[PEAR] Archive_Tar: 'xml' PHP extension is not installed
[PEAR] Console_Getopt: 'xml' PHP extension is not installed
[PEAR] PEAR: 'xml' PHP extension is not installed
[PEAR] DB: 'xml' PHP extension is not installed
[PEAR] HTTP: 'xml' PHP extension is not installed
[PEAR] Mail: 'xml' PHP extension is not installed
[PEAR] Net_SMTP: 'xml' PHP extension is not installed
[PEAR] Net_Socket: 'xml' PHP extension is not installed
[PEAR] XML_Parser: 'xml' PHP extension is not installed
[PEAR] XML_RPC: 'xml' PHP extension is not installed
Installing build environment: /usr/lib/php/build/
Installing header files: /usr/include/php/
Installing helper programs: /usr/bin/
program: phpize
<snip>
I cannot run the program 'pear'.
I've built with this configure command
./configure \
--prefix=/usr \
--disable-all \
--localstatedir=/var/php \
--enable-cli \
--disable-cgi \
--with-pear \
--with-curl \
--with-pgsql=/usr \
--without-mysql \
--with-dom \
--with-expat-dir=/usr \
--with-regex=php \
--with-pcre-regex \
--with-zlib-dir=/usr/include \
--enable-sockets \
--enable-shared \
--enable-static \
--disable-short-tags \
--with-config-file-path=/etc
How do I get my 'xml' PHP extension so I can use pear?
David Busby
Systems Engineer
busby
pnts.com
David Busby
Systems Engineer
busby
pnts.com
attached mail follows:
Hey everyone,
I find myself building alot of admin control areas, or in otherwords, a
group of forms that lets an end user control data and appearances of his/her
site. What I am looking for is a package of classes/functions that will help
me automate and modularize this process a little more. I am not looking for
a "complete system", just a framework from which I can build. Thanks alot,
Christian
attached mail follows:
At 2003-06-01 01:48 -0700, Ralph wrote:
>Maybe it's just that it's late, but can't seem to figure this out. I
>want to show a shipping price depending on the amount of purchase. I
>thought about using a lot of if() statements, but I know this is not the
>best way to go about this.
>
>Can anybody enlighten me on this one and give me a better approach.
>
>Here is an example of my shipping rates:
>
>Less than $20.00 = $7.45
>$20.01-$35.00 = $8.45
>$35.01- $55.00 = $9.45
>$55.01-$80.00 = $10.45
>$80.01-$100.00 = $11.45
>$100.01-$150.00 = $13.45
>$150.01-$200.00 = $15.55
>$200.01 or more = $19.45
Besides using a switch statement or a table
you could use a formula.
In your case (and most shipping rate cases
like this) it's probably:
shipping_rate=constant1+amount**constant2
Whereby '**' stands for 'to the power of',
constant2 is somewhere between 0.55 and 0.75
and constant1 should ideally be 0 but you
can raise it to increase the cost per shipment.
If we use constant1=0 and constant2=0.65 we get:
$10 -> $4.47
$20 -> $7.00
$30 -> $9.12
$175 -> $28.70
I propose that if you're interested you write
a small PHP script that let's you experiment
with different constants. You can also build
in a round-up or round-down function to get
nicer results.
BTW. I think it might be better to charge the
actual shipping costs and they are usually
based on the weight of the packages and the
stamps you have to put on them. You'd have
to charge extra for handling of course.
Greetings,
Jaap
attached mail follows:
Jason Wong,ÄúºÃ£¡
As you know,I'm a newbie in PHP,I tried your way last night,but to my surprise,it do nothing for any way,it didn't delete any line in the TXT-file,even the file "outputfile.txt" indeed!
Perhaps it because that I haven't understand your thought and absolutely copy your words to the program,but,can you give me more help?
After I write "del.php" copy your words,I'v been trying to edit my manage file "edit.php" as follow:
---filename:edit.php------------>
<?
$news=file('this.txt');
$num=count($news);
$fp=fopen('outputfile','w');
echo "<TABLE>";
for($i=0;$i<$num;$i++){
echo "<tr><td>".$news[$i]."</td><td><a href=edit.php?action=del>ɾ³ý´ËÐÐ</a></td></tr>";
if($action!='del'){
fwrite($fp,$news[$i]);
}
echo "</table>ok";
fclose($fp);?>
<--------------------------------
I think this will work as my willings,but it not!
It's troubling so long.I need more help.
Thanks a lot,my friend!
======= 2003-06-03 16:04:00 you wrote£º=======
>On Tuesday 03 June 2003 11:11, poetbox wrote:
>
>> I've been having trouble to delete a line from a TXT-file for days.
>> The content of the text file just like below:
>> ---------------------------begin==>
>> 00145|test|line1
>> 00255|test|line1
>> 01143|test|line1
>> 00469|test|line1
>> 10146|test|line1
>> --------------------------<==end
>>
>> Every line begins with a random number.I read the file (named THIS.TXT)
>> from a simple program just like this:
>>
>> ---------------------------begin==>
>> $news=file("this.txt");
>> $num=count($news);
>>
>> echo "<TABLE borderColor=#ffffff cellSpacing=0 cellPadding=0 width=100
>> bgColor=#efefef border=1>"; for($i=0;$i<$num;$i++)
>> {
>> $message=explode("|",$news[$i]);
>> $id=$message[0];
>> $title=$message[1];
>> $time=$message[3];
>> $bgcol = (($i 2) == 0) ? "CCCCCC": "EEEEEE";
>> echo "<tr bgcolor='#{$bgcol}'><td>¡ù <a
>> href=zcfgcont.php?id=$id>$title</a></td><td>"; echo "<a href=del.php>DELETE
>> THIS LINE</a>";//HOW TO WRITE THIS LINE??HOW TO achieve the function? echo
>> "</td></tr>";
>> }
>> echo "</table>";
>> --------------------------<==end
>> #################################################
>> *********The PROBLEM is:How to WRITE A FILE named del.php or WRITE A
>> FUNCTION() to delete this line? My opinion is to read the content to a
>> array and write any line but" $id=$id" line,but I delete all the content
>> by this,what should I do? It's the first time I ask a question by the
>> MAIL-LIST,my Enlish is poor,sorry. Thank you very much in advance.
>
> "... but I delete all the content by this" Why?
>
>In del.php you would read in the file using file() then write out any lines
>not beginning with $id. So something like:
>
>$news=file("this.txt");
>$fp = fopen('outputfile', 'w');
>foreach ($news as $line) {
> if (strpos($line, $_GET['id']) !== 0) {
> fwrite($fp, $line);
> }
>}
>fclose($fp);
>
>--
>Jason Wong -> Gremlins Associates -> www.gremlins.biz
>Open Source Software Systems Integrators
>* Web Design & Hosting * Internet & Intranet Applications Development *
>------------------------------------------
>Search the list archives before you post
>http://marc.theaimsgroup.com/?l=php-general
>------------------------------------------
>/*
>Rule of Creative Research:
> (1) Never draw what you can copy.
> (2) Never copy what you can trace.
> (3) Never trace what you can cut out and paste down.
>*/
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
= = = = = = = = = = = = = = = = = = = =
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡poetbox
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡phplist
enorth.com.cn
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2003-06-04
attached mail follows:
I could have sworn buildconf was used to rebuild the configure
script with any new extensions added to the ext/ directory. For
some reason though nothing is being added and I'm getting no
warning for PHP 4.3.2 Anyone have any ideas?
Cheers,
Rob.
--
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the |
| stuff of nightmares grasp for your soul. |
`---------------------------------------------'
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]