php-general Digest 29 Jul 2003 10:17:09 -0000 Issue 2204
Topics (messages 157252 through 157288):
Re: Parsing MySQL query return
157252 by: Nicholas Robinson
157271 by: Jason Wong
Re: Script Execution Time
157253 by: Petya A Shushpanov
157255 by: Chris W. Parker
157256 by: Petya A Shushpanov
157259 by: Jeff Harris
Re: Store array as Session Variable
157254 by: Rob Adams
curl question
157257 by: Dale Hersh
open source content management systems?
157258 by: r-militante.northwestern.edu
157274 by: Angelo Zanetti
157275 by: Davy Obdam
157283 by: Per Jessen
Re: How is this possible?
157260 by: Simon Fredriksson
157261 by: Simon Fredriksson
Unable to configure PHP5 on Linux
157262 by: Jonathan Villa
157266 by: Evan Nemerson
157268 by: Jonathan Villa
Re: The session finishes unexpectedly
157263 by: Tomás Liendo
looking for some kind of CMS breakthough (slightly OT)
157264 by: Justin French
Re: Get Local IP Address
157265 by: Tom Rogers
Re: problem: creating global alias inside function
157267 by: Tom Rogers
157270 by: Tom Rogers
Re: $_GET['sort'] & argument separator
157269 by: Ow Mun Heng
DHCP web interface. New version.
157272 by: Daevid Vincent
157273 by: Chris W. Parker
157281 by: Tom Rogers
Re: variable in function parameter
157276 by: 386-DX
xls2pdf
157277 by: jan
157286 by: sven
PHP port problem
157278 by: Nabil
Re: uploading a file from a form
157279 by: Tom Rogers
PHP suexec: html files as PHP.
157280 by: Joan McGalliard
Re: Upload files
157282 by: Tassos T
How can I add records to database every 60 minutes???
157284 by: phpu
157285 by: Sćvar Öfjörđ
CGI Timeout
157287 by: imran
Backtip operator
157288 by: desa15.necso.es
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
It occurred to me after my first reply that you might be able to do something
in mysql.
This works (given my earlier assumptions):
select left( paras, if ( locate( '\n', paras ) = 0, length( paras ), locate(
'\n', paras ))) ...
It will work with \n\n as well.
N
On Monday 28 Jul 2003 7:57 pm, Ewout de Boer wrote:
> ----- Original Message -----
> From: "John" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, July 28, 2003 8:22 PM
> Subject: [PHP] Parsing MySQL query return
>
> > Hey All,
> >
> > I have a question regarding parsing text from a MySQL query. Basically, I
> > have several paragraphs of text in a field in MySQL. I run a query, get
>
> the
>
> > results, no problem. However, I would like to only display the first
> > paragraph of the data returned.
> >
> > What is the best way to do this?
>
> That depends on te format of the text/paragraphs in the mysql field.
> How are the paragraphs separated ?
>
>
>
> regards,
> Ewout
--- End Message ---
--- Begin Message ---
On Tuesday 29 July 2003 04:16, John wrote:
> I'm using someone elses data here (inheriting). But it looks like it was
> typed into the field, possibly using PHPMyADMIN. I would assume the
> paragraphs are just seperated by carriage returns. Is there a way to tell
> for sure?
Yes, examine the contents.
--
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 don't want to be young again, I just don't want to get any older.
*/
--- End Message ---
--- Begin Message ---
<?
class jTimer {
var $start = 0;
var $stop = 0;
var $elapsed = 0;
function start() { $this->start = microtime(); }
function stop() { $this->stop = microtime(); }
function elapsed() {
if ($this->elapsed) {
return $this->elapsed;
} else {
$start_u = substr($this->start,0,10);
$start_s = substr($this->start,11,10);
$stop_u = substr($this->stop,0,10);
$stop_s = substr($this->stop,11,10);
$start_total = doubleval($start_u) + $start_s;
$stop_total = doubleval($stop_u) + $stop_s;
$this->elapsed = $stop_total - $start_total;
return $this->elapsed;
}
}
}
$timer = new jTimer;
$timer->start();
#your code here
$timer->stop();
echo round($timer->elapsed(),5);
?>
--
Petya A Shushpanov
tel.: (+7 916) 556 16 27
mail: [EMAIL PROTECTED]
site: www.eastof.ru
----- Original Message -----
From: "Radek Zajkowski" <[EMAIL PROTECTED]>
To: "PHP GENERAL" <[EMAIL PROTECTED]>
Sent: Tuesday, July 29, 2003 1:09 AM
Subject: [PHP] Script Execution Time
> Could someone pass on a snippet, a function or a technique for measuring
> script times. It appears the host I am with is having some PHP engine
> performance problems and I need to send them the figures.
--- End Message ---
--- Begin Message ---
Petya A Shushpanov <mailto:[EMAIL PROTECTED]>
on Monday, July 28, 2003 3:41 PM said:
> <?
> class jTimer {
[snip]
> }
> $timer = new jTimer;
> $timer->start();
>
> #your code here
>
> $timer->stop();
> echo round($timer->elapsed(),5);
You could one up this class by creating another method that
automatically performs the last line.
i.e.
$timer->stop();
$timer->report();
Chris.
--- End Message ---
--- Begin Message ---
Tnx. I`ve it fixed jet.
----- Original Message -----
From: "Chris W. Parker" <[EMAIL PROTECTED]>
To: "Petya A Shushpanov" <[EMAIL PROTECTED]>; "Radek Zajkowski"
<[EMAIL PROTECTED]>; "PHP GENERAL" <[EMAIL PROTECTED]>
Sent: Tuesday, July 29, 2003 3:50 AM
Subject: RE: [PHP] Script Execution Time
Petya A Shushpanov <mailto:[EMAIL PROTECTED]>
on Monday, July 28, 2003 3:41 PM said:
> <?
> class jTimer {
[snip]
> }
> $timer = new jTimer;
> $timer->start();
>
> #your code here
>
> $timer->stop();
> echo round($timer->elapsed(),5);
You could one up this class by creating another method that
automatically performs the last line.
i.e.
$timer->stop();
$timer->report();
Chris.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Jul 29, 2003, "Petya A Shushpanov" claimed that:
|<?
|class jTimer {
|[snip]
|
|$timer->stop();
|echo round($timer->elapsed(),5);
|?>
|
|--
|Petya A Shushpanov
|
Or, you could use http://pear.php.net/package-info.php?package=Benchmark
--
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.
--- End Message ---
--- Begin Message ---
"Pushpinder Singh Garcha" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> $details is empty !!
>
I'd check your sql query and see if any rows are being returned. Also, put
the initializing of the array ($company_name = array()) outside of your
loop, just in case.
I used to think that you had to serialize arrays before saving to session,
but apparently that's not the case. Good to know.
-- Rob
> Thanks
> --Pushpinder
>
>
> On Monday, July 28, 2003, at 03:31 PM, CPT John W. Holmes wrote:
>
> > $details is an array (just like $company_name was). Try to view
> > print_r($details); and see what you get.
> >
> > ---John Holmes...
> >
> > ----- Original Message -----
> > From: "Pushpinder Singh Garcha" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, July 28, 2003 3:18 PM
> > Subject: [PHP] Store array as Session Variable
> >
> >
> > hello All,
> >
> > I am trying to store an array as a session variable.
> >
> > while ($row = mysql_fetch_array($result))
> > {
> > if ( !is_array($company_name) ) $company_name = array();
> > array_push($company_name, $row['company']);
> >
> > // try to register session variable
> > $_SESSION['link'] = $company_name;
> >
> > }
> >
> >
> > Now when I try to access this session variable in another file...I am
> > getting a junk value.I am not sure if I am getting this right.
> >
> > $details = $_SESSION['link'];
> > echo "LINK: ".$details."<br>";
> >
> >
> > Can some one fill me in on this. Appreciate it ! Thanks in advance.
> >
> > --Pushpinder Singh
> >
>
--- End Message ---
--- Begin Message ---
I am using authorize.net and I need to get this curl function working on a
win 2k server platform in order to process credit card transactions through
php. I have read through the manual and I am still failing to integrate php
with curl. I was wondering if anyone could provide help or step by step
instructions on how to install and integrate curl with php on a win 2k
server.
Thanks,
Dale
--- End Message ---
--- Begin Message ---
hi all
does anyone have any recommendations for good open source content
management systems for
websites? - preferably, written in php...
i have about a 50000 page site running on a freebsd/apache server. it
gets a fair number of hits a day.
right now, the great majority of my pages are statically generated by my
30+ ftp users. there is no
consistency of layout between sections of the site.
i wanted to investigate open source content management systems in order
to make our pages easier to
create and update (preferably so i can do away with the majority of my
ftp accounts and have my users
create and update pages from a webbrowser), and maintain a consistent
layout scheme across the site.
i'd also be into investigating commercial cms's, although i'd like to
stick with open source if possible...
thanks
redmond
--- End Message ---
--- Begin Message ---
Hi dunno if this will help but freevcs might be an option. www.freevcs.de
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 29, 2003 2:39 AM
Subject: [PHP] open source content management systems?
> hi all
>
> does anyone have any recommendations for good open source content
> management systems for
> websites? - preferably, written in php...
>
> i have about a 50000 page site running on a freebsd/apache server. it
> gets a fair number of hits a day.
> right now, the great majority of my pages are statically generated by my
> 30+ ftp users. there is no
> consistency of layout between sections of the site.
>
> i wanted to investigate open source content management systems in order
> to make our pages easier to
> create and update (preferably so i can do away with the majority of my
> ftp accounts and have my users
> create and update pages from a webbrowser), and maintain a consistent
> layout scheme across the site.
>
> i'd also be into investigating commercial cms's, although i'd like to
> stick with open source if possible...
>
>
> thanks
> redmond
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Hi Redmond,
Take a look at http://www.opensourcecms.com/
On this site you can see opensource content management systems written
in php in action. I found it to be very usefull.
Best regards,
Davy Obdam
[EMAIL PROTECTED] wrote:
hi all
does anyone have any recommendations for good open source content
management systems for
websites? - preferably, written in php...
i have about a 50000 page site running on a freebsd/apache server. it
gets a fair number of hits a day.
right now, the great majority of my pages are statically generated by my
30+ ftp users. there is no
consistency of layout between sections of the site.
i wanted to investigate open source content management systems in order
to make our pages easier to
create and update (preferably so i can do away with the majority of my
ftp accounts and have my users
create and update pages from a webbrowser), and maintain a consistent
layout scheme across the site.
i'd also be into investigating commercial cms's, although i'd like to
stick with open source if possible...
thanks
redmond
--
-----------------------------------------------------------------------
Davy Obdam
Web application developer
Networking4all
email: [EMAIL PROTECTED]
email: [EMAIL PROTECTED]
internet: http://www.networking4all.com
-----------------------------------------------------------------------
--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:
> hi all
>
> does anyone have any recommendations for good open source content
> management systems for websites? - preferably, written in php...
http://typo3.com/
/Per
--
Per Jessen, Zurich
http://timian.jessen.ch - an analog report formatter using XSLT.
http://www.dansk.org - for alle danskere i udlandet!
--- End Message ---
--- Begin Message ---
Ryan A wrote:
Hi,
I am trying to get my data into a very similar layout as this:
http://hostfilter.com/ComparePlan.asp?IntVal1=389&IntVal2=546&IntVal3=605
see the table with the plans...how is he getting that in one table? what
kind of logic is that? the best I can do is for each column I have to use
another table (nested tables) but he has somehow managed to get all in
one... is this a special ASP thing?
This is my implemption of it:
http://bestwebhosters.com/compare.php?id%5B%5D=1&id%5B%5D=2&id%5B%5D=4&id%5B
%5D=5&id%5B%5D=13&type=1
Its much slower, because it uses more tables and nested tables...but its in
php :-)
I just cant understand it...any ideas?
Cheers,
-Ryan
That's acutally a quite easy procedure if your table is structured
correctly. My suggestion is that you simply make the SQL table like you
the HTML table look.
Columns:
title : lp1 : lp2 : lp3......
Values:
ssh : 1 : 1 : 1
php : 1 : 1 : 0
ssi : 1 : 0 : 0
Just structure the table like that. It's not the wisest thing to do if
you're gonna have loads of columns, but it's an easy solution.
//Laban
--- End Message ---
--- Begin Message ---
Just solved your problem and made a better solution for my previous answer.
The code is available at http://mirror27.sytes.net/~webhost/
//Simon
Ryan A wrote:
Hi,
I am trying to get my data into a very similar layout as this:
http://hostfilter.com/ComparePlan.asp?IntVal1=389&IntVal2=546&IntVal3=605
see the table with the plans...how is he getting that in one table? what
kind of logic is that? the best I can do is for each column I have to use
another table (nested tables) but he has somehow managed to get all in
one... is this a special ASP thing?
This is my implemption of it:
http://bestwebhosters.com/compare.php?id%5B%5D=1&id%5B%5D=2&id%5B%5D=4&id%5B
%5D=5&id%5B%5D=13&type=1
Its much slower, because it uses more tables and nested tables...but its in
php :-)
I just cant understand it...any ideas?
Cheers,
-Ryan
--- End Message ---
--- Begin Message ---
My current setup is httpd 2.0.47 on a Red Hat 8.
When I try to configure php I do
./configure --with-apxs2=/etc/httpd/bin/apxs --disable-cgi
it runs for a while until I get
configure: error: libxml2 version 2.5.1 or greater required.
but yet, when I do an rpm search for libxml2
rpm -q libxml2
I get
libxml2-2.5.1-1
Any ideas on this?
--- End Message ---
--- Begin Message ---
Ya- you have to have libxml2-devel installed. Possibly
http://rpmfind.net/linux/RPM/rufus/libxml/libxml2-devel-2.5.1-1.i386.html
but check your distro cd first. Or you could rpm -e libxml2-2.5.1-1, get a
tarball, and compile it yourself
On Monday 28 July 2003 07:13 pm, Jonathan Villa wrote:
> My current setup is httpd 2.0.47 on a Red Hat 8.
>
> When I try to configure php I do
>
> ./configure --with-apxs2=/etc/httpd/bin/apxs --disable-cgi
>
> it runs for a while until I get
>
> configure: error: libxml2 version 2.5.1 or greater required.
>
> but yet, when I do an rpm search for libxml2
>
> rpm -q libxml2
>
> I get
>
> libxml2-2.5.1-1
>
> Any ideas on this?
--
Status: 0
Content-type: text/html
[cgi]
"The missionaries go forth to Christianize the savages- as if the savages
weren't dangerous enough already."
-Edward Abbey
--- End Message ---
--- Begin Message ---
Thanks! That was it...
On Mon, 2003-07-28 at 21:41, Evan Nemerson wrote:
> Ya- you have to have libxml2-devel installed. Possibly
> http://rpmfind.net/linux/RPM/rufus/libxml/libxml2-devel-2.5.1-1.i386.html
> but check your distro cd first. Or you could rpm -e libxml2-2.5.1-1, get a
> tarball, and compile it yourself
>
>
>
> On Monday 28 July 2003 07:13 pm, Jonathan Villa wrote:
> > My current setup is httpd 2.0.47 on a Red Hat 8.
> >
> > When I try to configure php I do
> >
> > ./configure --with-apxs2=/etc/httpd/bin/apxs --disable-cgi
> >
> > it runs for a while until I get
> >
> > configure: error: libxml2 version 2.5.1 or greater required.
> >
> > but yet, when I do an rpm search for libxml2
> >
> > rpm -q libxml2
> >
> > I get
> >
> > libxml2-2.5.1-1
> >
> > Any ideas on this?
>
> --
> Status: 0
> Content-type: text/html
>
> [cgi]
> "The missionaries go forth to Christianize the savages- as if the savages
> weren't dangerous enough already."
>
> -Edward Abbey
>
--- End Message ---
--- Begin Message ---
For pasign the session variables I'm using the $_SESSION array. I am not
sure if this responds your question..
Tom.
"Curt Zirzow" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> * Thus wrote Tomás Liendo ([EMAIL PROTECTED]):
> > Hi people, I made a system in PHP wich uses sessions. While I'm testing
the
> > system some times the session finishes unexpectedly. Some times the
system
> > works during one hour without problems but other times the system
finishes
> > after five minutes and return to the login page.
> > I think that the session variables "forget" their values for some
reason.
> > Something in the PHP configuration may be? But the time is not always
the
> > same.
> > Well, I hope you can guide me with this problem. Ahead of time, thank
you
> > very much.
>
> Are you using cookies or GET method for passing the session around?
>
>
>
> Curt
> --
> "I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
Hi all,
I've been writing CMS's for years now, and at the moment, I find myself
looking for some breakthrough, or at the very least, a change in the
way I do things.
Anyone can write a CMS to manage simple articles with a data structure
like:
id
author
date_written
heading
body
keywords
description
publish_date
expires_date
But, it still requires the writer to know a little mark-up
(p,b,h1,h2,i,a,img,etc) in order to create an article with multiple
paragraphs, sections, headings, images, etc, with well structured,
valid mark-up.
So, I've started thinking about how this can be tackled.
Idea #1 was to have an unlimited number of 'blocks' or 'objects'
*related* to an article, resulting in two tables:
ARTICLE
id, author, date, title, keywords, desc, etc
BLOCKS
id, articleid, heading, content, order, etc
But the reality is that different types of pages will require different
types of blocks (some with headings, some with images, some with
captions, etc). On the surface, this seems either too big to tackle,
or too complex to expect the writer/contributor to grasp.
I'd be really interested in hearing how any one else is tackling this
stuff, even if it is only remotely related to PHP.
Justin
--- End Message ---
--- Begin Message ---
Hi,
Tuesday, July 29, 2003, 3:11:43 AM, you wrote:
CZ> * Thus wrote Tom Rogers ([EMAIL PROTECTED]):
>> Hi,
>>
>> Monday, July 28, 2003, 4:29:46 PM, you wrote:
>> >>Try this:
>> >><?php
>> >>exec('ipconfig',$catch);
>> >>foreach($catch as $line){
>> >> if(eregi('IP Address',$line)){
>> >> list($t,$ip) = split(':',$line);
>> >> echo 'IP is '.$ip."\n";
CZ> btw, the $ip needs to be trimmed it actually contains a space at
CZ> this point ' XXX.XXX.XXX.XXX'
>> >> }
>> >>}
>> >>?>
>>
>> CL> Thanks Tom, but I think it only work for Win NT, how about Win 9x?
>>
>>
>> There is ipconfig.exe in win98 SE thats about all I know.
CZ> win98 has that command. when I issue that on my computer I get
CZ> multiple interfaces back something like:
CZ> interface 0:
CZ> [interface data]
CZ> interface 1:
CZ> [interface data]
CZ> So the above code wont guarantee the correct IP address.
CZ> Curt
CZ> --
CZ> "I used to think I was indecisive, but now I'm not so sure."
Here is a modified version to eliminate the first entry as it is
0.0.0.0. If you have more than one interface you will have to store
them in an array.
exec('ipconfig /all',$catch);
foreach($catch as $line){
if(eregi('IP Address',$line)){
list($t,$ip) = split(':',$line);
$ip = trim($ip);
if(ip2long($ip > 0)){
echo 'IP is '.$ip."\n";
}
}
}
--
regards,
Tom
--- End Message ---
--- Begin Message ---
Hi,
Tuesday, July 29, 2003, 12:32:33 AM, you wrote:
MP> The following code illustrates a problem I've got with references (running
MP> on PHP 4.3.2). Can anyone explain it for me? Thanks in advance for any
MP> assistance!
MP> Martin
MP> <?php
MP> $globalvariable = 0;
MP> $one = 1;
MP> //want to set up $globalvariable as a reference to $one
MP> setglobal($one);
MP> echo $globalvariable; //prints 0, not 1
MP> function setglobal(&$one)
MP> {
MP> global $globalvariable;
MP> $globalvariable =& $one;
MP> }
?>>
You don't need the =& in the function as you are passing a reference
already. So you are setting $globalvariable to point to a reference
that is pointing to $one. You just need:
function setglobal(&$one)
{
global $globalvariable;
$globalvariable = $one;
}
--
regards,
Tom
--- End Message ---
--- Begin Message ---
Hi,
Tuesday, July 29, 2003, 12:32:33 AM, you wrote:
MP> The following code illustrates a problem I've got with references (running
MP> on PHP 4.3.2). Can anyone explain it for me? Thanks in advance for any
MP> assistance!
MP> Martin
MP> <?php
MP> $globalvariable = 0;
MP> $one = 1;
MP> //want to set up $globalvariable as a reference to $one
MP> setglobal($one);
MP> echo $globalvariable; //prints 0, not 1
MP> function setglobal(&$one)
MP> {
MP> global $globalvariable;
MP> $globalvariable =& $one;
MP> }
?>>
Now that I read what you really want :)
You can use a class to track a variable which may achieve what you
want like this:
class globalvariable {
var $gv = 0;
function globalvariable(&$var){
$this->gv =& $var;
}
}
$one = 1;
$g = new globalvariable($one);
echo 'global '.$g->gv.'<br>';
$one = 2;
echo 'global '.$g->gv.'<br>';
--
regards,
Tom
--- End Message ---
--- Begin Message ---
It worked!!! Thanks VERY much. Now if someone could explain to me the
difference between urlencode and rawurlencode. In the manual, it states that
both are similar (but not the same), urlencode will encode spaces into '+'
wherelse rawurlencode does not.
Hence, in my below purposes, which should I be using?
<snip>
It would probably be better to pass the actual column names instead of
the alias.
</snip>
As for the above comment, I don't believe that I can as I'm actually using
the SQL statement to put the alias and getting the alias to be spitted out
using mysql_field_result.
But I'm open to how to make the code better.. ideas?..
Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia
DID : 03-7870 5168
-----Original Message-----
From: John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Monday, July 28, 2003 7:17 PM
To: Ow Mun Heng
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] $_GET['sort'] & argument separator
Ow Mun Heng wrote:
> Hi,
>
> I have this problem, which could easily be solved through a name
> change but I would like to learn more.
>
> There's a table set up from a MySQL query like this
>
> row1) Eval # Title # Heads My Findings
> row2) P1000 Title1 6 This is my findings
> row3) P1223 Eg 2 3 2nd findings
>
> row1 is the header columns, the title names are derived from sql statement
> executed as SELECT eval_no as "Eval #" etc..
>
> row1 is also set up such that if the user clicks the link, it will trigger
a
> SQL comand to sort it.
>
> The problem here is the '#' sign/key. spaces are no problem. the
> $_GET['sort'] is not able to get the whole field, as such "Eval #" can
only
> be recognised as "Eval" and thus sql is not able to sort it.
[snip]
> This is how the link looks like
>
http://10.0.0.1/trackit/trackit-2003-07-28/view_set_tracker.php?sort=Eval%20
> #&dir=ASC
The string with the # character needs to be run through urlencode() or
rawurlencode(). The # character is making your browser look for a
bookmark named "&dir=ASC" on the view_set_tracker.php page.
It would probably be better to pass the actual column names instead of
the alias.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
PHP|Architect: A magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Heya. I've just put up a new version of the DHCP web front end if anyone is
using it or has a need for this type of thing.
Major feature of this version:
* a bug where if the arp table showed an "(incomplete)", I ignored the entry
since the MAC is the hash key, many machines wouldn't show up as they kept
over writing each other (of course, they were bunk anyways)
* ping & nmap tests (if ping fails, nmap is used as a backup)
this is useful for firewalls that may block ICMP
* tests can be disabled for radically faster page rendering (off by default)
* 10 minute refresh by default rather than 10 second.
* SORTING! by IP now, rather than arp entries
* many more icons (tivo, zaurus, replay, linux, notebook, servers, DAR, etc)
* complete/incomplete tally
* Name in config file is only used if dhcp doesn't show a name already
This is also IMHO an excellent way for a beginer or advanced coder alike to
see some very useful OOP/PHP coding as I use arrays of objects, sorting by
variables IN the object (custom sort algorithm with key integrity), hashing,
system calls, regex parsing, DHTML, etc.
If anyone knows how to force the arp table to be current, that would help.
Sometimes a machine is on the network, and I *know* for a fact it is, but it
doesn't show up in "arp -n" *grumble*.
Follow the link below.
http://daevid.com/examples/dhcp/
Check out my resume. Hire me. ;-)
http://resume.daevid.com/
N'joy.
Daevid.
--- End Message ---
--- Begin Message ---
Daevid Vincent <mailto:[EMAIL PROTECTED]>
on Monday, July 28, 2003 9:41 PM said:
> Heya. I've just put up a new version of the DHCP web front end if
> anyone is using it or has a need for this type of thing.
New version? I din't even know you HAD a version.
So for us people that have never heard of this, what exactly does it do?
thanks,
chris.
--- End Message ---
--- Begin Message ---
Hi,
Tuesday, July 29, 2003, 2:40:55 PM, you wrote:
DV> If anyone knows how to force the arp table to be current, that would help.
DV> Sometimes a machine is on the network, and I *know* for a fact it is, but it
DV> doesn't show up in "arp -n" *grumble*.
DV> Follow the link below.
DV> http://daevid.com/examples/dhcp/
DV> Check out my resume. Hire me. ;-)
DV> http://resume.daevid.com/
DV> N'joy.
DV> Daevid.
You could loop through your ip adddresses that you are interested in
and send a couple of pings.
That should force the arp cache to be current for those ip's that
exist
--
regards,
Tom
--- End Message ---
--- Begin Message ---
Yes.
I simplified the example for clearance but what I really want is to send a
string as a parameter which includes variable names to be processed inside
the function. eval() works fine, but I'm sure there was another way.
"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> * Thus wrote CPT John W. Holmes ([EMAIL PROTECTED]):
> > > * Thus wrote 386-DX ([EMAIL PROTECTED]):
> > > > Hello. Let's say I have something like this:
> > > >
> > > > function aa($test) {
> > > > $a = 8;
> > > > echo $test;
> > > > }
> > > >
> > > > $a = 2;
> > > > aa("a is ". ($a>5?"greater":"equal to or less"). " than 5".);
> > >
> > > http://php.net/eval
> >
> > No... you need to make $a global within the function for that change to
> > affect $a outside the function
> >
> > function (...)
> > {
> > global $a;
> > $a = 8;
> >
> > (can maybe do that in one operation, try it and see)
>
> A yes, I did forget to mention that but as per requested I was
> assuming they wanted the string test to be evalulated.
>
> <snip>
> I want this to output "a is greater than 5".. how can i modify the
> code so that the function parameter is evaluated inside the
> function?
> </snip>
>
>
>
> Curt
> --
> "I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
Hi!
what's the best to convert xls to pdf (using PHP) ?
maybe there is util (binary executable) xls2pdf i dont know about which
would help me as well ....
thanks
Jan
--- End Message ---
--- Begin Message ---
Jan wrote:
> Hi!
>
> what's the best to convert xls to pdf (using PHP) ?
>
> maybe there is util (binary executable) xls2pdf i dont know about
> which would help me as well ....
hi jan,
i don't know, whether there is such a tool.
but for your convertion it depends on what tool you got. as .xls is a
microsoft excel file you either need to parse this file manually to get your
cells and then put them to a pdf-file via a php-class or a php-extension.
but i think its much easier to work with a com-extension and force microsoft
excel to print your sheet to a vitual pdf-printer (i.e. acrobat)
ciao SVEN
--- End Message ---
--- Begin Message ---
Anyone can explain to me why when we use mssql_connect to connect directly
to MSSQL server
mssql_connect ('192.168.0.15:1433' , 'username' , 'password')
it still not communicating thru port 1433 , but it use 445 and some others
protocols ...
And actually I have no idea WHY!!!
Because there is a firewall in the network between the Linux and the SQL
server.. and it only allowed TCP port 1433,
Nabil Attar
Advanced Web Solutions
/***
Everyone is a beginner once, and no one is an expert at everything.
***/
--- End Message ---
--- Begin Message ---
Hi,
Friday, July 25, 2003, 1:48:50 AM, you wrote:
AM> I am having a problem with uploading a file from a form. I changed the
AM> permission on the directory, but I am still getting an error. Here is my
AM> error:
AM> Copy failed./home/vencel/www/images/apt/company_logo/14Update Failed!
AM> It looks like it's not finding the file type. Here is my code:
AM> <? include("../includes/database.php"); ?>
AM> <?
AM> $long_path = "/home/vencel/www/images/apt/";
AM> $short_path = "../images/apt/";
AM> if (($REQUEST_METHOD=='POST')) {
AM> for(reset($HTTP_POST_VARS);
AM> $key=key($HTTP_POST_VARS);
AM> next($HTTP_POST_VARS)) {
AM> $this = addslashes($HTTP_POST_VARS[$key]);
AM> $this = strtr($this, ">", " ");
AM> $this = strtr($this, "<", " ");
AM> $this = strtr($this, "|", " ");
AM> $$key = $this;
AM> }
AM> //Check for form fields, insert them.
AM> //Pull out the id auto-incremented from previous insert.
AM> //Check to see if a full-sized photo was uploaded
AM> if ($photo == "none") {
AM> echo "No photo.";
AM> } else {
AM> $end = strrchr($photo_name, ".");
AM> echo $end;
AM> $new_photo_name = $company_id[0] . $end;
AM> if ([EMAIL PROTECTED]($photo, $long_path . "company_logo/" . $photo_name)) {
AM> echo "Copy failed.";
AM> echo $long_path . "company_logo/" . $photo_name;
AM> echo $new_photo_name;
AM> } else {
AM> $long_photo_path = $long_path . "company_logo/" . $new_photo_name;
AM> $photo_path = $short_path . "company_logo/" . $new_photo_name;
AM> if ([EMAIL PROTECTED]($long_path . "logo/" . $photo_name,
AM> $long_photo_path)){
AM> echo "Full sized photo not renamed.";
AM> }
AM> }
AM> }
AM> $add_image_query .= "UPDATE apt_company_t set
AM> company_logo_path='$photo_path', ";
AM> $add_image_query .= "WHERE company_cd = $company_id[0]";
AM> mysql_query($add_image_query) or die("Update Failed!");
AM> }
} ?>>
AM> <FORM METHOD="post" ACTION=<? echo $PHP_SELF ?>>
AM> <table>
AM> <TR>
AM> <td colspan = 2><B>Use the <i>Browse</i> button to locate your file on
AM> your computer or local network.</B></td></tr>
AM> <tr>
AM> <td>Company Logo File: </td><td><input type="file" name="photo"
size="30">></td></tr>
AM> <tr>
AM> <td colspan=2 align=center><INPUT TYPE="submit" VALUE="Add"></td>
AM> </tr>
AM> </table>
AM> </FORM>
AM> Any ideas?
The first thing is to add ENCTYPE="multipart/form-data" to the form
tag.
<FORM ENCTYPE="multipart/form-data" METHOD="post" ACTION=<? echo $PHP_SELF ?>>
Then the rest will depend on what version of php you have.
It may be worth doing print_r($_FILES); to see if that is available.
--
regards,
Tom
--- End Message ---
--- Begin Message ---
Hi,
I'm getting a little desperate here, and running out of places to ask.
My hosting company changed - without warning - to PHP Suexec, which
completely broke to sites. They haven't been able to tell me how to
fix it, just vague suggestions, and when I ask for detailed
instructions, they send me a URL that has no connection with my problem.
So it's pretty simple, I want to know how to get html files parsed as
PHP files with PHP Suexec on. IE I want:
http://www.mcgalliard.org/index.html
to look like
http://www.mcgalliard.org/index.html
thanks for any help!
joan
--
Joan McGalliard, UK
http://www.mcgalliard.org
--- End Message ---
--- Begin Message ---
hi
check the size of file and the post_max_size in phpinfo.
you can change the post_max_size in php.ini.
Rosen wrote:
Hi,
I have some problem with uploading files on server with PHP.
The upload is ok, but I must set directory permissions with FULL Access -
but this is not a good idea :((
Have someone idea how I can do this with no setting permissions to full
acess ?
Thanks,
Rosen
--- End Message ---
--- Begin Message ---
Hello
I'm making an online game in php and mysql. Can someone tell me how can I add records
to database every 60 minutes (even when i'm not online)
--- End Message ---
--- Begin Message ---
I'm not sure if this is possible in PHP, but Apache's Cron should take
care of this.
-----Original Message-----
From: phpu [mailto:[EMAIL PROTECTED]
Sent: 29. júlí 2003 09:49
To: [EMAIL PROTECTED]
Subject: [PHP] How can I add records to database every 60 minutes???
Hello
I'm making an online game in php and mysql. Can someone tell me how can
I add records to database every 60 minutes (even when i'm not online)
--- End Message ---
--- Begin Message ---
Hi,
i facing a error during uploading a big size file (abt 200 MB). i incred =
upload file size in php.ini and also incred connection time in IIS (web =
server), but i getting again this below written error msg.
any one known abt this...
CGI Timeout
The specified CGI application exceeded the allowed time for processing. The server has
deleted the process.
thnx
gnome
--- End Message ---
--- Begin Message ---
Hi to all, any one can tell me, what is the correct way to write secure
applications in php and how is the best way to remove or prevent the
backtip operator.
I think what my code is very insecure.
What is the correct way to do this ???
$Myusername = isset($HTTP_POST_VARS['username']) ? trim(htmlspecialchars
($HTTP_POST_VARS['username'])) : '';
$Myusername = substr(str_replace("\'", "'", $Myusername), 0, 25);
if ($Myusername ==""){
exit;
}
elseif (eregi(";", $Myusername) ){
echo "Hacking attempt";
exit;
}
elseif (eregi("`", $Myusername) ){
echo "Hacking attempt";
exit;
}
$Myusername= str_replace("\'", "''", $Myusername) ;
$Myusername= str_replace("`", "", $Myusername) ;
Un saludo, Danny
--- End Message ---