# [EMAIL PROTECTED] / 2006-10-26 08:46:27 +1300:
> I'm LOVING php now - its a very simple language limited only by your
> imagination as to how you use it! My knowledge seems to be lacking
> more in HTML and Browser server relationships - I'm basing things on
> my background in Basic programming as
At 10/25/2006 11:24 PM, Robert Cummings wrote:
Now, the thing that I dislike about heredoc for such small strings is
the switching between heredoc mode and the switching back. It's ugly on
the scale of switching in and out of PHP tags.
It's so interesting that some details bug some people and o
Paul Novitski wrote:
It's so interesting that some details bug some people and others bug
others. In an expression such as this:
echo '' . $day .
'';
or you could write it likes this '
echo " $day ";
much easier to read, but slightly more taxing on the server.
--
Regards,
Clive
Incidentally, a nice side effect of heredoc is that some editors (like
vim) recognise <
Hi,
I just wondering this..
For example I had a several php pages. In this page there was an array named
$arrHede
It has lots of values.
in index.php
$arrHede['antin']='yada';
in config.php
$arrHede['kuntin']='bada';
and so.
So I want to write a scrpit check all those files to get all $arrH
Sancar Saran wrote:
I just wondering this..
For example I had a several php pages. In this page there was an array named
$arrHede
It has lots of values.
in index.php
$arrHede['antin']='yada';
in config.php
$arrHede['kuntin']='bada';
and so.
So I want to write a scrpit check all those file
Sancar Saran wrote:
For example I had a several php pages. In this page there was an array named
$arrHede
It has lots of values.
in index.php
$arrHede['antin']='yada';
in config.php
$arrHede['kuntin']='bada';
and so.
So I want to write a scrpit check all those files to get all $arrHede keys
On Thursday 26 October 2006 14:32, Arpad Ray wrote:
> Sancar Saran wrote:
> > For example I had a several php pages. In this page there was an array
> > named $arrHede
> >
> > It has lots of values.
> >
> > in index.php
> > $arrHede['antin']='yada';
> >
> > in config.php
> > $arrHede['kuntin']='bad
Hi,
I have 3 domains:
www.example1.com,
www.example2.com
www.template.com
I have a PHP website on www.template.com with a database. in this
database I have many tables one of which is sites, which has a list of
the sites using the template with a site_id.
Example of this data is:
Site_id,
Hi,
I have 3 domains:
www.example1.com,
www.example2.com
www.template.com
I have a PHP website on www.template.com with a database. in this
database I have many tables one of which is sites, which has a list of
the sites using the template with a site_id.
Example of this data is:
Site_id,
Hi,
I am trying to have 1 template site and have an unlimited number of
websites using this template site to call there own information.
The sites are exactly the same except for the database, each of the
sites also needs there own URL, for example one of these urls may be
www.example1.com and
Kevin, there is no need to post the same question three times to this
list. Your chances on getting helpful responses won't increase.
The issue you describe is more related to Apache (assuming that you
are on an Apache server) and URL rewriting than to PHP. Ask Google
for "Apache mod_rewrit
Hi, Yes there was an error, I never meant to post 3 times it backlogged
in the system and my bulk detector picked up the email from php.net
asking me to register my email so sorry about that.
I am actually using Windows IIS, there is a IISRewrite which does the
same as mod_rewrite, however the
>> Hi,
>>
>> I am trying to have 1 template site and have an unlimited number of
>> websites using this template site to call there own information.
>>
>> The sites are exactly the same except for the database, each of the
>> sites also needs there own URL, for example one of these urls may be
>
Robert Cummings wrote:
> On Wed, 2006-10-25 at 17:35 -0700, Paul Novitski wrote:
>> At 10/25/2006 04:09 PM, Stut wrote:
>>> Dang that's painful!! Try this...
>>>
>>> >> foreach (range(1, 31) as $day)
>>> {
>>> print '>> if ($selected_day_of_month == $day)
>>> pri
Hi Brad,
That sounds like a good idea however:
Where would config.php go? If it goes on the www.solution.com side of
things, then $_SERVER[HTTP_HOST] will always be www.solution.com and if
it goes on another then it would be www.example1.com.
What you have put would be the kind of solution I
Sorry, made a mistake in that last post:
"even if using frames on www.example1.com (using them to load
www.solution.com) $_SERVER[HTTP_HOST] would still equal www.example1.com "
It would actually equal www.solution.com once its in the frame as well
not www.example1.com which is what i've put
Kevin,
Are all these sites hosted on the same box?
-Brad
-Original Message-
From: Kevin [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 26, 2006 9:37 AM
To: php-general@lists.php.net
Subject: Re: [PHP] PHP Template Trouble
Hi Brad,
That sounds like a good idea however:
Where woul
Yes all the sites are located on a Windows 2003 Dedicated Server.
Kevin wrote:
Sorry, made a mistake in that last post:
"even if using frames on www.example1.com (using them to load
www.solution.com) $_SERVER[HTTP_HOST] would still equal
www.example1.com "
It would actually equal www.solu
Yes all the sites are located on a Windows 2003 Dedicated Server.
Kevin
Brad Fuller wrote:
Kevin,
Are all these sites hosted on the same box?
-Brad
-Original Message-
From: Kevin [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 26, 2006 9:37 AM
To: php-general@lists.php.net
Su
Jon Anderson wrote:
Take this with a grain of salt. I develop with PHP, but I am not an
internals guy...
[EMAIL PROTECTED] wrote:
Are the include files only compiled when execution hits them, or are
all include files compiled when the script is first compiled, which
would mean a cascade thr
Cool, then what you want to do is make all the domains point to the same
directory, have your files index.php and config.php in that directory and it
should work like magic.
Then you end up with one copy of the files and how ever many sites you need.
No frames, no duplicated code.
It's been a l
But the dedicated server has security. In order to use it you must
create accounts (these are your ftp accounts) so basically I have
example mapped to www.example.com
and
example2 mapped to www.example2.com
example's root dir would be along the lines of:
c:\inetpub\www\example\htdocs
examp
Well, I'm sure there is a better way to do it, but this should work.
config.php does not need to be dynamic in this scenario.
1. Copy index.php and config.php into each site's directory.
2. Change the $db_name variable in config.php to use the correct database.
".$_SERVER['HTTP_HOST']."";
Brad, I cant thank you enough!!! This has been getting to me for weeks.
I simply moved the mapping of the URL's so that all the URL's point to
the same website, i could then use that http _host to pick them up and
then i've basically used this to query the database and give me what I
want. It
I haven't used IIS for a while, but this should still be similar in the
latest version...
In the website properties hit the Advanced... button next to the IP
address. IIRC the top box is labelled "Web Site Identities" or similar.
You can add identities with the same IP address but a different
At 1:04 AM -0700 10/26/06, Paul Novitski wrote:
At 10/25/2006 11:24 PM, Robert Cummings wrote:
I use a tag based template system, there's no PHP in my content so my
content files for the most part just look like more HTML.
This is a different topic, but also one close to my heart. Yes, I
too
tedd wrote:
I think a would work just as well -- seems so old-world
to me. :-)
The span element is in no way old-world. Spans and divs are two
different things with different goals. A div is a block-level element,
whereas spans are inline. Spans are intended for stylistic changes that
spa
On Thu, October 26, 2006 8:31 am, Jochem Maas wrote:
> bunch of space wasters ;-)
>
> $selDay?'
> selected="selected"':''),'>',$d,''; ?>
You messed up. :-)
$d == $selDay would be the correct expression in the middle of that.
My personal choice is:
$last_day = 31; //calculated from date()/mktim
On Wed, October 25, 2006 2:41 pm, Gert Cuykens wrote:
> i do not get any output from mysql except form echo $bin that displays
> 1 ?
> exec("mysql -h hhh -u uuu - print_r($out);
> echo $bin;
> ?>
And what does 'perror 1' tell you on the command line?
Or you could go whole-hog and install th
On Wed, October 25, 2006 11:58 am, [EMAIL PROTECTED] wrote:
> Are the include files only compiled when execution hits them, or are
> all
> include files compiled when the script is first compiled, which would
> mean a cascade through all statically linked include files. By
> statically linked files
On Thu, 2006-10-26 at 01:04 -0700, Paul Novitski wrote:
> At 10/25/2006 11:24 PM, Robert Cummings wrote:
> >Now, the thing that I dislike about heredoc for such small strings is
> >the switching between heredoc mode and the switching back. It's ugly on
> >the scale of switching in and out of PHP ta
On Thu, 2006-10-26 at 10:50 +0100, Arpad Ray wrote:
> Incidentally, a nice side effect of heredoc is that some editors (like
> vim) recognise << accordingly.
That's really cool. Never even thought to do that. I wonder if anyone
has done the footwork for joe to save me some time *hehe*.
Cheers,
R
On Thu, October 26, 2006 9:33 am, [EMAIL PROTECTED] wrote:
>> If your include file is actually included, it will use memory. If it
>> is not included because of some condition, then it won't use memory.
>
> I wonder if that's the same when a cache/optimiser is used. Probably.
> Maybe I'll check.
A
On Thu, 2006-10-26 at 15:31 +0200, Jochem Maas wrote:
> bunch of space wasters ;-)
>
> $selDay?'
> selected="selected"':''),'>',$d,''; ?>
Specifically:
> range(1, 31)
Memory waster ;)
Cheers,
Rob.
--
..
| InterJinn Application Frame
On Thu, October 26, 2006 6:36 am, Stut wrote:
> Sancar Saran wrote:
>> I just wondering this..
>>
>> For example I had a several php pages. In this page there was an
>> array named
>> $arrHede
>>
>> It has lots of values.
>>
>> in index.php
>> $arrHede['antin']='yada';
>>
>> in config.php
>> $arrHe
On Thu, 2006-10-26 at 11:24 -0400, tedd wrote:
> At 1:04 AM -0700 10/26/06, Paul Novitski wrote:
> >At 10/25/2006 11:24 PM, Robert Cummings wrote:
> >>I use a tag based template system, there's no PHP in my content so my
> >>content files for the most part just look like more HTML.
> >
> >This is a
On Thu, 2006-10-26 at 11:43 +0200, clive wrote:
> Paul Novitski wrote:
> > It's so interesting that some details bug some people and others bug
> > others. In an expression such as this:
> >
> > echo '' . $day .
> > '';
> or you could write it likes this '
> echo " $day ";
>
> much
On Wed, October 25, 2006 4:49 am, Kevin wrote:
> I am trying to have 1 template site and have an unlimited number of
> websites using this template site to call there own information.
>
> The sites are exactly the same except for the database, each of the
> sites also needs there own URL, for examp
On Thu, 2006-10-26 at 11:43 -0500, Richard Lynch wrote:
>
> $last_day = 31; //calculated from date()/mktime() etc
> for ($day = 1; $day <= $last_day; $day++){
> $selected = $chosen_day == $ ? 'selected="selected"' : '';
> echo " $day\n";
> }
>
> I don't *think* the w3c requires/recommends a v
for ($i=1;$i<=31;$i++) : ?>
>
Every HTTP request is separate.
Nothing is preserved from one to the next unless you program it to be
preserved.
You can pass around hidden inputs.
You can use sessions.
You can store stuff in the DB.
You can use shared memory.
But ain't nothing gonna get shared that you don't make it be shar
http://php.net/flush may be of interest.
On Wed, October 25, 2006 2:35 am, Matt Beechey wrote:
> I am writing a php website for users to edit a global whitelist for
> Spam
> Assassin - all is going fairly well considering I hadn't ever used php
> until
> a couple of days ago. My problem is I nee
At 10/26/2006 08:24 AM, tedd wrote:
At 1:04 AM -0700 10/26/06, Paul Novitski wrote:
My comparable example (but in an HTML context) would look like:
Hello FIRSTNAME,
where the engine replaces the content of the span with the value
from the database based on a match of 'span.firstName'
hi!
what would be better solution to count records in table (e.g., how many
customers have last name 'Smith'):
$query = mysql_query("
SELECT COUNT(*) as NoOfRecords
FROM customers
WHERE last_name = 'Smith'");
$result = mysql_fetch_array($query);
$No
$query = mysql_query("
SELECT COUNT(*) as NoOfRecords
FROM customers
WHERE last_name = 'Smith'");
$result = mysql_result($query, 0);
WOW! That was fast!
:D
Thanks Dave!
-afan
> $query = mysql_query("
>SELECT COUNT(*) as NoOfRecords
>FROM customers
>WHERE last_name = 'Smith'");
> $result = mysql_result($query, 0);
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscr
On Tue, October 24, 2006 8:22 am, Steve Lane wrote:
> I have a job posting for a junior PHP programmer. Are there any of the
> PHP
> mailing lists to which it would be appropriate to post that?
PHP-General would be appropriate, I think, unless we get flooded with
job offers.
> If not, can anyone
Hm. There is a little problem - this doesn't work.
Warning: mysql_result(): supplied argument is not a valid MySQL result
resource in /var/www/html/xxx/tests/count.php on line 28
?
> $query = mysql_query("
>SELECT COUNT(*) as NoOfRecords
>FROM customers
>
Post a link to your on-line application.
Also, use LiveHTTPHeaders and such to make sure you are getting what
you think you are getting.
And use vi or TextPad or whatever on your desktop to open up the .zip
file and see what's in there.
If it starts with:
ERROR: PHP error blah blah blah
then you
At 10/26/2006 10:38 AM, [EMAIL PROTECTED] wrote:
what would be better solution to count records in table (e.g., how many
customers have last name 'Smith'):
$query = mysql_query("
SELECT COUNT(*) as NoOfRecords
FROM customers
WHERE last_name = 'Smit
On Mon, October 23, 2006 8:58 pm, Chris wrote:
> Richard Lynch wrote:
>> On Fri, October 20, 2006 10:04 am, Fourat Zouari wrote:
>>> I have PHP/PostgreSQL application were i got a search page with
>>> some
>>> items
>>> to search, am building the search query on server side.
>>>
>>> I need to displ
Sorry, my bad! It works jsut fine. I did misstake.
:)
>>
>>
>> > $query = mysql_query("
>> >SELECT COUNT(*) as NoOfRecords
>> >FROM customers
>> >WHERE last_name = 'Smith'");
>> > $result = mysql_result($query, 0);
>> >
--
PHP General Mailing List
On Thu, October 26, 2006 12:57 pm, Paul Novitski wrote:
>>$query = mysql_query("
>> SELECT COUNT(*) as NoOfRecords
>> FROM customers
>> WHERE last_name = 'Smith'");
>>$result = mysql_fetch_array($query);
>>$NoOfRecords = $result['NoOfRecords'];
This
On Thu, October 26, 2006 12:14 pm, Robert Cummings wrote:
> On Thu, 2006-10-26 at 11:43 -0500, Richard Lynch wrote:
>>
>> $last_day = 31; //calculated from date()/mktime() etc
>> for ($day = 1; $day <= $last_day; $day++){
>> $selected = $chosen_day == $ ? 'selected="selected"' : '';
>> echo "
Would it be ok to use the same code to check if customer is loged in?
$query = mysql_query("
SELECT COUNT(Username) as NoOfRecords
FROM customers
WHERE Username = '$Username' AND Password = '$Password'");
if (mysql_result($query, 0) == 0)
{
echo 'Ple
Wow, pretty aggressive. No reason to EVER use xhtml - hmmm, good attitude,
good evolutionary sense. Let's wait and see. I believe the gent was
referring to the use of 'selected="selected"' and trying to encourage good
habits in someone - which I think is commendable. Why so angry?
Why would you want to do that? Think about what you're trying to do. In the
first case you want a COUNT of records in the database, in the second you
just want to see if the user/password combination or whatever exist, so just
use a normal SELECT query, no need to use the wrong tool for the job...
> Would it be ok to use the same code to check if customer is loged in?
>
> $query = mysql_query("
>SELECT COUNT(Username) as NoOfRecords
>FROM customers
>WHERE Username = '$Username' AND Password = '$Password'");
> if (mysql_result($query, 0) == 0)
At 10/26/2006 11:16 AM, [EMAIL PROTECTED] wrote:
Would it be ok to use the same code to check if customer is loged in?
$query = mysql_query("
SELECT COUNT(Username) as NoOfRecords
FROM customers
WHERE Username = '$Username' AND Password = '$Password'"
>>Would it be ok to use the same code to check if customer is loged in?
>>
>>$query = mysql_query("
>>SELECT COUNT(Username) as NoOfRecords
>>FROM customers
>>WHERE Username = '$Username' AND Password =
>> '$Password'");
>>if (mysql_result($query, 0)
On Thu, 2006-10-26 at 13:13 -0500, Richard Lynch wrote:
> On Thu, October 26, 2006 12:14 pm, Robert Cummings wrote:
> > On Thu, 2006-10-26 at 11:43 -0500, Richard Lynch wrote:
> >>
> >> $last_day = 31; //calculated from date()/mktime() etc
> >> for ($day = 1; $day <= $last_day; $day++){
> >> $sel
Richard Lynch wrote:
> On Thu, October 26, 2006 8:31 am, Jochem Maas wrote:
>> bunch of space wasters ;-)
>>
>> > $selDay?'
>> selected="selected"':''),'>',$d,''; ?>
>
> You messed up. :-)
dang :-P try again:
function genDayOptionTags($c = 31, $sv = 0, $eco = 1)
{
$o = '';
foreac
I use always unix timestamp as well, except in birth date.
""Marcelo de Moraes Serpa"" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
> Hello list,
>
> I've always used Unix Timestamps until now, but lately I've reading about
> MySQL's datetime datatype and its benefits (dates be
Hello list,
I've always used Unix Timestamps until now, but lately I've reading about
MySQL's datetime datatype and its benefits (dates before 1970, after 2030,
SQL functions to deal with them, etc). However, I don't see much support for
them in the PHP API. I'm also a Flash programmer and the Fl
Robert Cummings wrote:
> On Thu, 2006-10-26 at 15:31 +0200, Jochem Maas wrote:
>> bunch of space wasters ;-)
>>
>> > $selDay?'
>> selected="selected"':''),'>',$d,''; ?>
>
> Specifically:
>
>> range(1, 31)
>
> Memory waster ;)
any idea as to what the damage is as compared to the classic for loop
Hi
php5
$d = '/somedir/subdir';
$od = opendir($d);
if ($od) {
$dl = scandir($d);
natsort($dl);
}
The sorted array is available through print_r().
How can I obtain a natsorted array that can be listed using :
while ($i <= $array_count){print $dl[$i]}
Thanks
--
PHP General Mailing
natsort() places the array elements in natural order but not the keys.
If you want your elements printed using "print" in a loop either
reorganise the keys first or use "foreach".
The easiest method would be to use:
foreach($dl as $filename){
print $filename;
}
If you insist on using
hey all,
I'm moving my page from php4 to php5 and I get this error:
Warning: Unknown: The session id contains illegal characters, valid
characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0
this is the code I use to start my session:
$_SESSION['user_id']=$user_id;
$_SESSION['user_log
Hello List,
I have a situation where, when the user logs into the system (Apache 2/PHP
5.1/Win XP) the php script should activate a Java program to run in the
background. This program will keep running in the background while everytime
the user requests something, the subsequent php scripts com
On Thursday 26 October 2006 6:48 pm, Prathaban Mookiah wrote:
> Hello List,
>
> I have a situation where, when the user logs into the system (Apache 2/PHP
> 5.1/Win XP) the php script should activate a Java program to run in the
> background. This program will keep running in the background while
>
I have a web application (not written in PHP) that can return data in
various formats, including JSON and PHP's serialization format. At the
moment my URL scheme looks like this:
staff/engineering?format=json
but I'd like to switch to using a file extension to denote the format:
staff
Ray,
Nope - I cannot have the program running all the time because the port that
it this program will connect to will be accessed by other programs too. So it
needs to run only when the user is online and logged into the system.
Any ideas?
Prathap
-- Original Message ---
From
Hamish Lawson wrote:
I have a web application (not written in PHP) that can return data in
various formats, including JSON and PHP's serialization format. At the
moment my URL scheme looks like this:
staff/engineering?format=json
but I'd like to switch to using a file extension to denote
On Thursday 26 October 2006 7:28 pm, Prathaban Mookiah wrote:
> Ray,
>
> Nope - I cannot have the program running all the time because the port that
> it this program will connect to will be accessed by other programs too. So
> it needs to run only when the user is online and logged into the system
Hello Chris
Thanks for responding.
> But what file extension should I use for PHP's serialization format?
> Obviously it can't be .php - aside from being inaccurate (it's not PHP
> code), using this extension would probably trigger the web server into
> trying to run a (nonexistent) PHP script.
Richard Lynch wrote:
On Wed, October 25, 2006 11:58 am, [EMAIL PROTECTED] wrote:
Are the include files only compiled when execution hits them, or are
all
include files compiled when the script is first compiled, which would
mean a cascade through all statically linked include files. By
stat
Hamish Lawson wrote:
Hello Chris
Thanks for responding.
> But what file extension should I use for PHP's serialization format?
> Obviously it can't be .php - aside from being inaccurate (it's not PHP
> code), using this extension would probably trigger the web server into
> trying to run a (no
On Wednesday 25 October 2006 22:15, Larry Garfield wrote:
> Well since the consensus seemed to be to allow job postings, I'll make
> one. :-)
>
> My company is looking for a few good PHP programmers.
>
> We are a Chicago-area web consulting firm developing web sites and web
> applications for a var
On Thursday 26 October 2006 15:36, Marcelo de Moraes Serpa wrote:
> Hello list,
>
> I've always used Unix Timestamps until now, but lately I've reading about
> MySQL's datetime datatype and its benefits (dates before 1970, after 2030,
> SQL functions to deal with them, etc). However, I don't see mu
On Thursday 26 October 2006 20:28, [EMAIL PROTECTED] wrote:
> > If you have a PHP script that is 4M in length, you've done something
> > horribly wrong. :-)
>
> Sort of. I'm using Drupal with lots of modules loaded. PHP memory_limit
> is set to 20MB, and at times 20MB is used. I think that works p
I have to get a temporary server in place under a tight time frame and
am using a pre-existing server that wasn't configured really for hosting
websites. I've upgraded all the services on it like going from Apache
1.3.x to Apache 2.0.59 and PHP from it's old version to 4.4.2 however I
need to h
This one time, at band camp, Larry Garfield <[EMAIL PROTECTED]> wrote:
> My company is looking for a few good PHP programmers.
8<--- snip -
>
> As a follow-up, since several people have asked:
---8< --- snip -
How much??
Kevin
--
"Democracy is two wolves
Tom Ray [Lists] wrote:
I have to get a temporary server in place under a tight time frame and
am using a pre-existing server that wasn't configured really for hosting
websites. I've upgraded all the services on it like going from Apache
1.3.x to Apache 2.0.59 and PHP from it's old version to 4.
The Caching systems such as Zend Cache (not the Optimizer), MMCache,
APC, etc are expressly designed to store the tokenized version of the
PHP script to be executed.
Note that their REAL performance savings is actually in loading from
the hard drive into RAM, not actually the PHP tokenization.
S
Kevin Waterson wrote:
This one time, at band camp, Larry Garfield <[EMAIL PROTECTED]> wrote:
> My company is looking for a few good PHP programmers.
8<--- snip -
As a follow-up, since several people have asked:
---8< --- snip -
How much??
My guess - $2
Sean Pringle wrote:
>> The Caching systems such as Zend Cache (not the Optimizer), MMCache,
>> APC, etc are expressly designed to store the tokenized version of the
>> PHP script to be executed.
>>
>> Note that their REAL performance savings is actually in loading from
>> the hard drive into RAM, n
Hi,
A client has requested a cart with the following features, any leads
on such a package, preferably open-source?
Is there a way to add things like:
•Customer ratings to the cart?
•Qualifying criteria:
Is there a way to add that to the cart as a
checkbox with descriptor? For example, i
# [EMAIL PROTECTED] / 2006-10-27 02:06:22 +0100:
> Hello Chris
>
> Thanks for responding.
>
> >> But what file extension should I use for PHP's serialization format?
> >> Obviously it can't be .php - aside from being inaccurate (it's not PHP
> >> code), using this extension would probably trigger
89 matches
Mail list logo