On Wed, 2006-10-25 at 22:53 -0700, Paul Novitski wrote:
At 10/25/2006 04:09 PM, Stut wrote:
print 'option value='.$day.'';
if ($selected_day_of_month == $day)
print ' selected';
print ''.$day.'/option';
On Wed, 2006-10-25 at 17:35 -0700,
# [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 a
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
Paul Novitski wrote:
It's so interesting that some details bug some people and others bug
others. In an expression such as this:
echo 'option value=' . $day . '' . $selected . '' . $day .
'/option';
or you could write it likes this '
echo option value='$day' $selected $day
Incidentally, a nice side effect of heredoc is that some editors (like
vim) recognise EOHTML, EOSQL etc and highlight the contents
accordingly.
Arpad
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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
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
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
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']='bada';
and so.
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
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
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
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...
?php
foreach (range(1, 31) as $day)
{
print 'option value='.$day.'';
if ($selected_day_of_month == $day)
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
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
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
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
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
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
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
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.
?php
//
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
tedd wrote:
I think a div would work just as well -- span 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
On Thu, October 26, 2006 8:31 am, Jochem Maas wrote:
bunch of space wasters ;-)
?php foreach (range(1, 31) as $d) echo 'option value=',$d,'',($d =
$selDay?'
selected=selected':''),'',$d,'/option'; ?
You messed up. :-)
$d == $selDay would be the correct expression in the middle of that.
My
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 ?
?php
exec(mysql -h hhh -u uuu - test.php,$out,$bin);
print_r($out);
echo $bin;
?
And what does 'perror 1' tell you on the command line?
Or you could go
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 I
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 tags.
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 EOHTML, EOSQL etc and highlight the contents
accordingly.
That's really cool. Never even thought to do that. I wonder if anyone
has done the footwork for
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.
Almost
On Thu, 2006-10-26 at 15:31 +0200, Jochem Maas wrote:
bunch of space wasters ;-)
?php foreach (range(1, 31) as $d) echo 'option value=',$d,'',($d =
$selDay?'
selected=selected':''),'',$d,'/option'; ?
Specifically:
range(1, 31)
Memory waster ;)
Cheers,
Rob.
--
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
$arrHede['kuntin']='bada';
and
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 different
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 'option value=' . $day . '' . $selected . '' . $day .
'/option';
or you could write it likes
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 example
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 option $selected$day/option\n;
}
I don't *think* the w3c
for ($i=1;$i=31;$i++) : ?
option value=?php echo $i; ? ?php if ($selectedDay == $i) echo
selected=\selected\; ??php echo $i; ?/option
?php endfor; ?
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
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 need to
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 span class=firstNameFIRSTNAME/span,
where the engine replaces the content of the span with the value
from the database based on a
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);
$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 unsubscribe,
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
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 =
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 display a paginated
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 (http://www.php.net/)
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 would be
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 option
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
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
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 =
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)
I just
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++){
$selected =
Richard Lynch wrote:
On Thu, October 26, 2006 8:31 am, Jochem Maas wrote:
bunch of space wasters ;-)
?php foreach (range(1, 31) as $d) echo 'option value=',$d,'',($d =
$selDay?'
selected=selected':''),'',$d,'/option'; ?
You messed up. :-)
dang :-P try again:
function genDayOptionTags($c
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 before
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
Robert Cummings wrote:
On Thu, 2006-10-26 at 15:31 +0200, Jochem Maas wrote:
bunch of space wasters ;-)
?php foreach (range(1, 31) as $d) echo 'option value=',$d,'',($d =
$selDay?'
selected=selected':''),'',$d,'/option'; ?
Specifically:
range(1, 31)
Memory waster ;)
any idea as to
Hi
php5
code
$d = '/somedir/subdir';
$od = opendir($d);
if ($od) {
$dl = scandir($d);
natsort($dl);
}
/code
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
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 a
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;
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
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:
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 ---
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
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
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 variety
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 much
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 per
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
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 and a
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
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.
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 - $27
87 matches
Mail list logo