php-general Digest 6 Jan 2002 03:16:54 -0000 Issue 1094
Topics (messages 79557 through 79591):
Re: adding users on *nix
79557 by: Bogdan Stancescu
Re: check browser communication
79558 by: Bogdan Stancescu
79559 by: Daniel Urstöger
Plz help w/ php/MySQL
79560 by: Anthony Rodriguez
79562 by: Bogdan Stancescu
PHP 4.1.1 problem after compile
79561 by: DWilliams
Help Please
79563 by: Necro
79568 by: Phillip Oertel
Re: Paging through MySQL results in PHP
79564 by: Phillip Oertel
ob_gzhandler doesn't seem to be working
79565 by: Andrew Brampton
Re: Still need help with miscount
79566 by: Bogdan Stancescu
Re: Checking the season
79567 by: Bogdan Stancescu
79590 by: webapprentice
Re: Help Please (clarification)
79569 by: Phillip Oertel
Webmail with attach
79570 by: Luz Lopez
79575 by: Luz Lopez
print on printer
79571 by: Luz Lopez
xmldoc undefined with domxml apparently enabled
79572 by: Luca
MySQL error... but it works!!??
79573 by: Simon Kimber
79574 by: Adam Baratz
79578 by: Adam Baratz
79580 by: Mehmet Kamil ERISEN
Re: PHP XML with Dynamic Content
79576 by: Emile Bosch
XML based content management system.
79577 by: Emile Bosch
Can't get accurate day of year
79579 by: Hugh Danaher
79582 by: Jim Winstead
79583 by: Hugh Danaher
output compression and imp 2.x not working under IE
79581 by: Robert Mena
Here ya go..
79584 by: Chris Hall
HTML doc check in PHP? How to?
79585 by: Kraa de Simon
Re: jukebox
79586 by: Meir Kriheli
quote 76
79587 by: Rambo Amadeus
Re: array_walk inside class method
79588 by: Gyozo Papp
sorting and limitin sql in php pages??????
79589 by: Mehmet Kamil ERISEN
regular expressions
79591 by: Gerard Samuel
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 ---
I'm not sure how you'd go about doing that, but be warned that you're walking
on very thin ice (security-wise) to allow such an action. You must be very
extra super careful not to get hacked!
Not only that you'll be potentially allowing hackers to create users on your
machine, but at some time the input from the user (username/pass) will be
processed by a script running as root (you can't create users otherwise).
That's one of the riskiest tricks I've seen around.
Take care!
Bogdan
Chris Hogben wrote:
> Is there a way of adding a user to a *nix box thru php. Like, someone signs
> up, and they're account is added? Thanks.
--- End Message ---
--- Begin Message ---
What do you mean exactly? You want to be able to monitor (as in "see") the
data being transacted by your browser with the server or is it something
else you're after?
Bogdan
"Daniel Urstöger" wrote:
> Hiya !
>
> A little offtopic this question, but really important ..
> I need to check all the communication between my client PC and a server
> in the world wide web. Inlcuding all the header info and so on ..
> Would be a great help for developeing my script ...
>
> Could anybody of you suggest me something ?
> I am using IE6 and Opera 6 ..
> thx !
--- End Message ---
--- Begin Message ---
"Bogdan Stancescu" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> What do you mean exactly? You want to be able to monitor (as in "see") the
> data being transacted by your browser with the server or is it something
> else you're after?
>
> Bogdan
>
Yeah, exactly ! I wanna view all the data coming from the server, and the
data which
is sent by the client.
Is there any program who could show this ? The headers and so on ? Bcz the
IE only
shows the HTML file ..
thx ..
Cya !
Daniel
--- End Message ---
--- Begin Message ---
The following php script successfully e-mails both messages but it doesn't
update in the table "scr_149" the column "notified". Why?
<?php
$connection=mysql_connect("localhost","wagner","123") or die ("No
connection!");
$db=mysql_select_db("sbwresearch_com",$connection) or die ("No database!");
$message_1="
Congratulations!\n\n
You've qualified to take the online survey # 149.\n\n
To take the survey, go to www.sbwresearch.com and click on Survey / Tests.\n\n
";
$message_2="
Sorry!\n\n
You've not qualified to take the online survey # 149.\n\n
We'll notify you by e-mail of upcoming screeners.
";
$qry_1="select * from scr_149 where q05a!=\"0\" && notified=\"n\"";
$qry_2="update scr_149 set notified='y' where username='$username'";
$result_1=mysql_query($qry_1,$connection) or die ("No query # 1!");
while ($row_1=mysql_fetch_array($result_1, MYSQL_ASSOC))
{
$username=$row_1["username"];
$e_mail=$row_1["e_mail"];
mail("$e_mail",
"News from SBW Research",
"$message_1",
"From:SBW Research <[EMAIL PROTECTED]>\n");
$result_2=mysql_query($qry_2,$connection) or die ("No query # 2!");
};
mysql_free_result($result_1);
$qry_3="select * from scr_149 where q05a=\"0\" && notified=\"n\"";
$qry_4="update scr_149 set notified=\"y\" where username='$username'";
$result_3=mysql_query($qry_3,$connection) or die ("No query # 3!");
while ($row_2=mysql_fetch_array($result_3, MYSQL_ASSOC))
{
$username=$row_2["username"];
$e_mail=$row_2["e_mail"];
mail("$e_mail",
"News from SBW Research",
"$message_2",
"From:SBW Research <[EMAIL PROTECTED]>\n");
$result_4=mysql_query($qry_4,$connection) or die ("No query # 4!");
};
@mysql_free_result($result_3);
@mysql_close($connection);
header ("location:done.htm");
exit;
?>
Thanks!
Anthony F. Rodriguez
([EMAIL PROTECTED])
--- End Message ---
--- Begin Message ---
Anthony Rodriguez wrote:
> The following php script successfully e-mails both messages but it doesn't
> update in the table "scr_149" the column "notified". Why?
>
> <?php
> $connection=mysql_connect("localhost","wagner","123") or die ("No
> connection!");
>
> $db=mysql_select_db("sbwresearch_com",$connection) or die ("No database!");
>
> $message_1="
>
> Congratulations!\n\n
> You've qualified to take the online survey # 149.\n\n
> To take the survey, go to www.sbwresearch.com and click on Survey / Tests.\n\n
>
> ";
>
> $message_2="
>
> Sorry!\n\n
> You've not qualified to take the online survey # 149.\n\n
> We'll notify you by e-mail of upcoming screeners.
>
> ";
> $qry_1="select * from scr_149 where q05a!=\"0\" && notified=\"n\"";
> $qry_2="update scr_149 set notified='y' where username='$username'";
^ What's the value of $username here?
> $result_1=mysql_query($qry_1,$connection) or die ("No query # 1!");
> while ($row_1=mysql_fetch_array($result_1, MYSQL_ASSOC))
> {
> $username=$row_1["username"];
^ Because setting $username here is too late...
You should define $qry_2 after defining $username (move that line here).
>
> $e_mail=$row_1["e_mail"];
> mail("$e_mail",
> "News from SBW Research",
> "$message_1",
> "From:SBW Research <[EMAIL PROTECTED]>\n");
> $result_2=mysql_query($qry_2,$connection) or die ("No query # 2!");
> };
>
> mysql_free_result($result_1);
>
> $qry_3="select * from scr_149 where q05a=\"0\" && notified=\"n\"";
> $qry_4="update scr_149 set notified=\"y\" where username='$username'";
^ Same thing here...
>
> $result_3=mysql_query($qry_3,$connection) or die ("No query # 3!");
> while ($row_2=mysql_fetch_array($result_3, MYSQL_ASSOC))
> {
> $username=$row_2["username"];
^ ...being moved here.
>
> $e_mail=$row_2["e_mail"];
> mail("$e_mail",
> "News from SBW Research",
> "$message_2",
> "From:SBW Research <[EMAIL PROTECTED]>\n");
> $result_4=mysql_query($qry_4,$connection) or die ("No query # 4!");
> };
>
> @mysql_free_result($result_3);
> @mysql_close($connection);
> header ("location:done.htm");
> exit;
> ?>
--- End Message ---
--- Begin Message ---
I am trying to ugrade php 4.0.3pl1 to PHP4.1.1...I am VERY new at this
compiling stuff, but I though I had pretty good instructions to go by.
My configure statement:
./configure --prefix=/usr --with-mysql --with-apxs=/usr/sbin/apxs --with-gd
--with-gettext=/usr --enable-safe-mode --with-config-file-path=/etc/httpd --
with-exec-dir=/usr/bin --with-zlib --enable-magic-quotes --with-regex=system
--with-ttf=/usr/lib/libttf.so --enable-track-vars --enable-xml --disable-de
bug --with-db --with-interbase=shared --with-pgsql=shared --with-ldap --with
-imap
No errors that I could determine on "make install". I stopped Apache, and
restarted. Then I got this error:
Setting up Web Service: Syntax error on line 58 of
/etc/httpd/conf/httpd.conf:
Cannot load /etc/httpd/modules/libphp4.so into server:
/etc/httpd/modules/libphp4.so: undefined symbol: gdImageColorResolve
/usr/sbin/httpd
Does this mean I have an incompatible version of gd? Did I jump to many PHP
versions? Or did I miss something else?
Thanks for any help,
Dennis Williams
--- End Message ---
--- Begin Message ---
Can anyone help me with this...
<?
if ($HTTP_POST_VARS["action"] == 1)
{
checklogin($HTTP_POST_VARS["user_name"], $HTTP_POST_VARS["password"]);
exit;
}
function checklogin($user_name, $password)
{
login($user_name, $password);
if ($sid != -1)
{
header("Location:
http://localhost/infekt/packages/imanager/index2.php?sid=$sid");
}
else
{
header("Location:
http://localhost/infekt/packages/imanager/index.php");
}
}
function login($user_name, $password)
{
$db = "imanager";
$SQL = "SELECT * FROM users WHERE user_name='".$user_name."' AND
password='".$password."'";
# $connection = db_connect();
$query = mysql_query('$SQL');
if (mysql_num_rows($query) != 1)
{
return -1;
}
$row = mysql_fetch_array($query);
$user_id = $row["user_id"];
$sid = md5("blah blah".$user_id.$ttime);
$remip = getenv ("REMOTE_ADDR");
$ttime = date("YmdHis");
$SQL2 = " INSERT INTO session ";
$SQL2 = $SQL2 . " (user_id, sid, ttime, remip) VALUES ";
$SQL2 = $SQL2 . " ('$user_id','$sid','$ttime','$remip') ";
#######
$result2 = mysql_db_query($db,"$SQL2",$connection);
if (!$result2) { echo("ERROR: " . mysql_error() . "\n$SQL\n");
mysql_close($connection); exit; }
#######
SetCookie("iManager", "$user_id:$sid:$ip", time()+3600);
return $sid;
}
?>
It is meant to check a user login from the same page POSTed back to it.
Fields being user_name and password.
When I try it I get an Error on Line 30:
if (mysql_num_rows($query) != 1)
Thankyou
--- End Message ---
--- Begin Message ---
line 29: mysql_query('$SQL')
will send the following query to your db:
$SQL
i know of no db that understands that ;-)
everything in single quotes is NOT parsed by php. here, use
double quotes, or better, none at all.
hope it works now,
phil.
--- End Message ---
--- Begin Message ---
hi nelson,
i'm not sure if i get you right, but you could store the
'base' of your generated SQL query in a session variable,
that way you don't have to drag the $kw array along.
// before any html output (sends http headers)
session_start();
// build query from keywords
--> results in string $s_base_query
session_register("s_base_query");
then, for every new page you build your full query like this:
$query = $s_base_query . " LIMIT $firstitem,$items";
hope this helps,
phil
--- End Message ---
--- Begin Message ---
I thought I would try out the ability to GZip my PHP pages, so that they would be sent
quicker and use less of my bandwidth :)
Anyway I have found the following tutorials and information on this:
http://www.zend.com/zend/art/buffering.php
http://www.php.net/manual/en/function.ob-gzhandler.php
http://www.phpbuilder.com/columns/piergiorgio20010321.php3?page=3
Unfortually I have been unable to get any of my pages to actually GZip up during
transmittion.
I have enabled
output_buffering = On
output_handler = ob_gzhandler
in the php.ini file, with no luck
I have tried
php_flag output_buffering on
php_value output_handler ob_gzhandler
in .htaccess files
I have even tried
ob_start("ob_gzhandler");
at the top of my PHP Files..
Unfortually the output is NOT GZips, I have been testing the output with this script:
http://leknor.com/code/gziped.php or by manually sending a HTTP Request:
GET /whatever.php HTTP/1.0
Host: localhost
Accept-Encoding: gzip
Nothing I try gets the page GZipped.
I am using php 4.0.6 binaries on windowsXP with apache 1.3.20
If anyone has been able to get this working, or has a solution to my problem please
contact me,
Thanks
Andrew
--- End Message ---
--- Begin Message ---
I don't know if this is actually it, but the line
$num_vals[$i] = mysql_fetch_array($result);
seems strange to me - doesn't mysql_fetch_array return an array? You should try
list($num_vals[$i]) = mysql_fetch_array($result);
and see if you get any improvements...
Daniel Alsén wrote:
> I have worked this over in my head over the holidays and still haven´t got a
> solution. Can anyone help?
>
> I have a MySql table populated with numerical values from 0 to 10 in five
> different fields. I need a function that counts all occurances of each
> value, ie: 1: 12, 2: 3, 4: 74 etc...
>
> I have worked with this code:
>
> $num_vals = array ();
> for ($i=0; $i<10; $i++)
> {
> $shot_count = "SELECT COUNT(*) FROM statistik WHERE shooter='$shooter_login'
> AND ((shot_one = '$i') OR
> (shot_two = '$i') OR (shot_three = '$i') OR
> (shot_four = '$i') OR (shot_five = '$i'))";
>
> $result = mysql_query($shot_count);
> $num_vals[$i] = mysql_fetch_array($result);
> }
>
> The code works...but returns the wrong results. If i count from the database
> manually there is always some occurances missing.
>
> So, today i tried to count the values from an array instead:
>
> $shotcount = "SELECT shot_one, shot_two, shot_three, shot_four, shot_five
> FROM statistik WHERE shooter='$shooter_login'";
> $results = mysql_query($shotcount);
> $bam = mysql_fetch_array($results);
>
> $count = array_count_values ($bam);
>
> while (list($key,$value) = each($count)) {
> echo "$key : $value<br>";
> }
>
> But this works even worse...it seems to stop populating the array (or
> counting the values) after only a couple of rows from the db. The result
> looks like:
> 3 : 4
> 5 : 2
> 7 : 2
> 9 : 2
> And there should be alot more of those keys...and a couple of keys more as
> well...
>
> I would appreciate any help on this guys. I am soooo stuck :(
>
> # Daniel Alsén | www.mindbash.com #
> # [EMAIL PROTECTED] | +46 704 86 14 92 #
> # ICQ: 63006462 | +46 8 694 82 22 #
> # PGP: http://www.mindbash.com/pgp/ #
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
You could do a case() or if/elseif, check if it's spring, summer or autumn and leave
the code for winter as default/else.
Bogdan
webapprentice wrote:
> Hi,
> Just need a sounding board to help me think this through.
>
> I want to check the current date to determine what "season" it is and display the
>appropriate picture.
>
> I define spring as 03/21/YYYY, summer as 06/21/YYYY, autumn as 09/21/YYYY, and
>winter as 12/21/YYYY.
>
> I form a string for the current date and get a timestamp via mktime().
> I also get the equivalent timestamps for the dates above for the seasonal changes.
>
> Then, I compare the current date to see if it's between the seasonal dates.
> The problem is when I go from 12/31/YYYY to 01/01/(YYYY+1).
> Since winter and spring dates are one year apart, the current date timestamp
>comparison gets messed up and nothing displays.
>
> How do I do a proper comparison? I was thinking of just seeing if the current date
>timestamp is greater than each of the seasonal date timestamp, but it feels like I
>would miss something. Would I? Or is there another solution?
>
> Thank you for your time.
>
> --Stephen
--- End Message ---
--- Begin Message ---
I'll have to use and if/elseif construct, because I don't believe a switch()
constructs cases can take expressions, can it?
----- Original Message -----
From: "Bogdan Stancescu" <[EMAIL PROTECTED]>
To: "webapprentice" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, January 05, 2002 11:38 AM
Subject: Re: [PHP] Checking the season
> You could do a case() or if/elseif, check if it's spring, summer or autumn
and leave the code for winter as default/else.
>
> Bogdan
>
> webapprentice wrote:
>
> > Hi,
> > Just need a sounding board to help me think this through.
> >
> > I want to check the current date to determine what "season" it is and
display the appropriate picture.
> >
> > I define spring as 03/21/YYYY, summer as 06/21/YYYY, autumn as
09/21/YYYY, and winter as 12/21/YYYY.
> >
> > I form a string for the current date and get a timestamp via mktime().
> > I also get the equivalent timestamps for the dates above for the
seasonal changes.
> >
> > Then, I compare the current date to see if it's between the seasonal
dates.
> > The problem is when I go from 12/31/YYYY to 01/01/(YYYY+1).
> > Since winter and spring dates are one year apart, the current date
timestamp comparison gets messed up and nothing displays.
> >
> > How do I do a proper comparison? I was thinking of just seeing if the
current date timestamp is greater than each of the seasonal date timestamp,
but it feels like I would miss something. Would I? Or is there another
solution?
> >
> > Thank you for your time.
> >
> > --Stephen
>
>
--- End Message ---
--- Begin Message ---
Phillip Oertel wrote:
> line 29: mysql_query('$SQL')
> will send the following query to your db:
>
> $SQL
--> it sends exactly this string instead of the content of
your variable $SQL, which contains the real query.
--- End Message ---
--- Begin Message ---
Hi all,
I am making a small webmail, But I need that this webmail have attach, I can
to put one attach athis mail, but I need many attach in the webmail, I made
a bucle for many attach, but now I can't to manipulate this attach for that
the user send mail with many attach.
Some body can help me?
Thanks in advanced,
Regards
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
--- End Message ---
--- Begin Message ---
Hi All,
I am making a webmail, this webmail can send with just one attach, but I
need that that my webmail can send mail with many attach.
Now my function have the follwing code line:
if ($attach != "none")
{
$file = fopen($attach, "r");
$contents = fread($file, $attach_size);
$encoded_attach = chunk_split(base64_encode($contents));
fclose($file);
//$encoded_attach = base64_encode($attach);\
//$encoded_attach = $attach;
$mailheaders .= "MIME-version: 1.0\n";
$mailheaders .= "Content-type: multipart/mixed; ";
$mailheaders .= "boundary=\"Message-Boundary\"\n";
$mailheaders .= "Content-transfer-encoding: 7BIT\n";
$mailheaders .= "X-attachments: $attach_name";
$body_top = "--Message-Boundary\n";
$body_top .= "Content-type: text/plain; charset=US-ASCII\n";
$body_top .= "Content-transfer-encoding: 7BIT\n";
$body_top .= "Content-description: Mail message body\n\n";
$msg_body = $body_top . $msg_body;
$msg_body .= "\n\n--Message-Boundary\n";
$msg_body .= "Content-type: $attach_type;
name=\"$attach_name\"\n";
$msg_body .= "Content-Transfer-Encoding: BASE64\n";
$msg_body .= "Content-disposition: attachment;
filename=\"$attach_name\"\n\n";
$msg_body .= "$encoded_attach\n";
$msg_body .= "--Message-Boundary--\n";
}
How can I do it?
Some body can help me?
Thanks in Advanced,
Regards,
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
--- End Message ---
--- Begin Message ---
Hi All
I have a php that access to database and show the values in the browser, But
I need add hte option of print on printer, but that only print the table
with values.
Somebody can help me?
Thanks in Advanced,
Regards,
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
--- End Message ---
--- Begin Message ---
Hi,
I can't get DOMXML to work. The line
$doc = xmldoc($xml); // (line 26)
(where $xml is a string containing a valid xml document) raises
a fatal error:
"Fatal error: Call to undefined function: xmldoc() in
d:\...\class.xmltemplate.php on line 26"
I'm running PHP 4.1.1 as an Apache module with Apache 1.3.22 on
Win98 (but I was experiencing the same problem with PHP 4.0.6, 4.0.7,
4.1.0 and Apache 1.3.14). All the required dlls (libxml2.dll,
iconv-1.3.dll) have been copied to the system directory, and
phpinfo() tells me that DOMXML is enabled (with libxml 2.4.1).
Same problem with xmldocfile().
Best regards,
Luca
--- End Message ---
--- Begin Message ---
Does anyone have any idea why this is giving me a "Warning: Supplied
argument is not a valid MySQL result resource in..." error?
The funny thing is that apart from that error message it works perfectly!!
---------------------------
$crdate = date("Y-m-d");
$result = mysql_query("SELECT * FROM sites WHERE creation_date = '$crdate'
AND status = 'T'");
while ($sitedata = mysql_fetch_array($result)) {
echo $sitedata['name'] . "<br>";
}
---------------------------
Cheers
Simon
--- End Message ---
--- Begin Message ---
> Does anyone have any idea why this is giving me a "Warning: Supplied
> argument is not a valid MySQL result resource in..." error?
You'll have to give more code, which line you get that error from, etc., to
give us a better idea why it's "not working."
However, a quick tip:
> $crdate = date("Y-m-d");
> $result = mysql_query("SELECT * FROM sites WHERE creation_date = '$crdate'
> AND status = 'T'");
These two lines can be condensed since MySQL has a built-in function to get
the current time/date:
SELECT * FROM sites WHERE creation_date = NOW() AND status = 'T'
-Adam
--- End Message ---
--- Begin Message ---
----- Original Message -----
From: "Bas van Rooijen" <[EMAIL PROTECTED]>
To: "Adam Baratz" <[EMAIL PROTECTED]>
Sent: Saturday, January 05, 2002 4:39 PM
Subject: Re: [PHP] MySQL error... but it works!!??
>
> maybe try:
>
> if (!$result)
> {
> echo(mysql_error());
> }
>
> bvr.
> On Sat, 5 Jan 2002 15:55:39 -0500, Adam Baratz wrote:
>
> >> Does anyone have any idea why this is giving me a "Warning: Supplied
> >> argument is not a valid MySQL result resource in..." error?
> >
> >You'll have to give more code, which line you get that error from, etc.,
to
> >give us a better idea why it's "not working."
> >
> >However, a quick tip:
> >
> >> $crdate = date("Y-m-d");
> >> $result = mysql_query("SELECT * FROM sites WHERE creation_date =
'$crdate'
> >> AND status = 'T'");
> >
> >These two lines can be condensed since MySQL has a built-in function to
get
> >the current time/date:
> >
> >SELECT * FROM sites WHERE creation_date = NOW() AND status = 'T'
> >
> >-Adam
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
>
--- End Message ---
--- Begin Message ---
Hi,
So far the best way to troubleshoot mysql+php for me has been to add an "or die" after
the sql exec.
$crdate = date("Y-m-d");
$result = mysql_query("SELECT * FROM sites WHERE creation_date = '$crdate'
AND status = 'T'") or die ('CAN NOT EXEC SQL');
Or you can do
$sql = "SELECT * FROM sites WHERE creation_date = '$crdate'
AND status = 'T'";
echo $sql;
$result = mysql_query($sql) or die .....;
and try to run your sql against mysql directly to make sure your sql is fine.
one thing to always check is your connection to the database..... did you connect?
Simon Kimber <[EMAIL PROTECTED]> wrote: Does anyone have any idea why this is giving
me a "Warning: Supplied
argument is not a valid MySQL result resource in..." error?
The funny thing is that apart from that error message it works perfectly!!
---------------------------
$crdate = date("Y-m-d");
$result = mysql_query("SELECT * FROM sites WHERE creation_date = '$crdate'
AND status = 'T'");
while ($sitedata = mysql_fetch_array($result)) {
echo $sitedata['name'] . "
";
}
---------------------------
Cheers
Simon
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Mehmet Erisen
http://www.erisen.com
---------------------------------
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail.
--- End Message ---
--- Begin Message ---
Writing it on the fly would be kinda redundant.. I think.. :(
from mysql data to xml to data.. .. would slow things down a bit i
think.. :(
"Brian Clark" <[EMAIL PROTECTED]> wrote in message
20020105030550.GD17616@ganymede">news:20020105030550.GD17616@ganymede...
> * Emile Bosch ([EMAIL PROTECTED]) [Jan 03. 2002 15:38]:
>
> > Hi a lot of todays proffesional content management systems use XML, now
> > i was wondering how it's possible to mix XML with Dynamic Content, or
> > content which is change sensitive, IE A shop, or an auction,
> > let's say you have a shop with 1000 products, how am i gonna mix this in
> > the XML?
>
> > Does anyone know how this is solved, because i don't think that you are
> > gonna write hundreds of XML files for each article, can someone please
help
> > me out here?
>
> I understand the first paragraph up to "how am i gonna mix this in the
> XML?"
>
> Why couldn't you store information in a database and write the XML files
> on the fly when you need XML? Or update the XML file when something
> changes? Or, why use XML at all? Do you _really_ need it? *confused*
>
> --
> Brian Clark | Avoiding the general public since 1805!
> Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
> Sex is the most fun you can have without laughing.
>
--- End Message ---
--- Begin Message ---
Does anyone know an opensource XML based content management system? Written
in PHP?
Warm regards,
Emile Bosch
--- End Message ---
--- Begin Message ---
Hello All and Happy New Year.
I have a simple routine to get the year, date and the day of year. Year and date come
out correctly but the day of year is one less than the date. It being January, it's
easy to see the error. The only thing I can figure, is that the date(z) function gets
a fractional value and rounds down not rounds up. I really could use some input on
this before I just add one to the result and move on.
Thanks,
Hugh
$date_array=getdate(); / / gets today's date info
foreach ($date_array as $key=>$val)
{
$key=$val;
}
$current_year=$date_array[year]; / / returns 2002
$std_date=date("n-j-y"); / / returns 1-5-02
$day_of_year=date(z); / / returns 4 !!
--- End Message ---
--- Begin Message ---
Hugh Danaher <[EMAIL PROTECTED]> wrote:
> Hello All and Happy New Year.
> I have a simple routine to get the year, date and the day of year.
> Year and date come out correctly but the day of year is one less than
> the date. It being January, it's easy to see the error. The only
> thing I can figure, is that the date(z) function gets a fractional
> value and rounds down not rounds up. I really could use some input on
> this before I just add one to the result and move on.
as http://www.php.net/date says, the range of the 'z' format is from 0
to 365. january 1st is day 0.
jim
--- End Message ---
--- Begin Message ---
So, I add 1 to the number and move on.
Thanks,
Hugh
----- Original Message -----
From: Jim Winstead <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 05, 2002 3:24 PM
Subject: [PHP] Re: Can't get accurate day of year
> Hugh Danaher <[EMAIL PROTECTED]> wrote:
> > Hello All and Happy New Year.
> > I have a simple routine to get the year, date and the day of year.
> > Year and date come out correctly but the day of year is one less than
> > the date. It being January, it's easy to see the error. The only
> > thing I can figure, is that the date(z) function gets a fractional
> > value and rounds down not rounds up. I really could use some input on
> > this before I just add one to the result and move on.
>
> as http://www.php.net/date says, the range of the 'z' format is from 0
> to 365. january 1st is day 0.
>
> jim
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--- End Message ---
--- Begin Message ---
Hi, I've recently upgraded my server to php 4.1.1 and
turned on the output compression under php.ini.
For some browsers (IE 5/5.5 so far) it made imp stop
working.
Does anybody know if this is a "limitation" of php,
imp or explorer ?
Anyone has tried that with the latest imp/horde ?
thanks.
__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
--- End Message ---
--- Begin Message ---
5 hosting plans, apache 1.3 - debian 2.22r3. lets also say i have the same 5
plans, except on a windows 2000 adv server. i want to limit access levels
and functions my users are allowed to use. This is preliminary -- I am
somewhat familiar with how shell hosting works, and I believe my answer is
there, but I could be wrong..if anyone has conquered this problem ( i know
some of you have ) help is in dier need. Thnx in adv.
---------------------------------------
Chris Hall
Web Application Development
---------------------------------------
hardwired industries
--- End Message ---
--- Begin Message ---
Hi,
I would like to be able to check html documents against a "template html
document" using PHP.
In the example below I would like to check if the document starts with a
<h1> + string + </h1>, and is followed by a <h1> + "version" + ... etc.
etc.
Should/could I use XML?
Any ideas would be greatly appreciated!
<center>
<h1>DataSelect Installation and Configuration</h1>
<h3>version 1.0 - Dec 20th, 2001 (dsl/d0001v10)</h3>
by Simon.de.Kraa ([EMAIL PROTECTED])
</center>
<h2>Table of content</h2>
<ul>
<li><a href="#introduction">Introduction</a>
<li><a href="#installation">Installation</a>
<li><a href="#configuration">Configuration</a>
<ul>
<li><a href="#dataselect_objects">DataSelect Objects</a>
<li><a href="#dataselect">DataSelect</a>
</ul>
</ul>
<!-- --- INTRODUCTION --- -->
<h2><a name=introduction>Introduction</a></h2>
This document describes the complete process of installing and configuring
DataSelect.
<!-- --- INSTALLATION --- -->
<h2><a name=installation>Installation</a></h2>
...
<!-- --- CONFIGURATION --- -->
<h2><a name=configuration>Configuration</a></h2>
<h3><a name=dataselect_objects>DataSelect Objects</a></h3>
...
<h3><a name=dataselect>DataSelect</a></h3>
...
Met vriendelijke groet / With kind regards,
ICL Nederland B.V. Simon de Kraa
e-Applications / Logistic Systems Systems Architect
Het Kwadrant 1 Tel. +31 346 598865
Postbus 4000 Fax +31 346 562703
3600 KA MAARSSEN
The Netherlands mailto:[EMAIL PROTECTED]
---
Progress 9.1c, Roundtable 9.1c, NuSphere Pro Advantage 2.3.1 @ MS Windows
2000 5.00.2195 SP 2
Progress 9.1c @ SCO UnixWare 7.1.1
--- End Message ---
--- Begin Message ---
On Friday 04 January 2002 22:20, Scott wrote:
> Has anyone experimented with controlling an mp3 player like mpg123 from
> php? I want to build a radio automation system using a web interface, but
> not sure how I want to handle the actual playing of music.
>
> Basically I would have a mysql database that rotates the music based on
> categories and it would move down the list resetting every hour.
>
> If you have done an exec to mpg123 before, how did you control the output?
> I want the output to be on the local machine and not streamed across a
> network.
>
> Thanks in advance.
>
> -Scott
Hi Scott,
A quick search at freshmeat shows several projects doing the same thing
already, you might want to check them out for reference:
http://freshmeat.net/search/?q=jukebox%20php
--
Meir Kriheli
--- End Message ---
--- Begin Message ---
Hi,
how can i make data submited throug form, Quoted Printable Encode to 76
characters.
thanks
--- End Message ---
--- Begin Message ---
it may be better:
array_walk($this->array, array(&$this, 'func1');
"Attila Strauss" <[EMAIL PROTECTED]> wrote in message
001d01c195db$67647da0$[EMAIL PROTECTED]">news:001d01c195db$67647da0$[EMAIL PROTECTED]...
| hi
|
| $this->func1();
|
|
| best regards
| attila
|
|
| >
| >
| > Hi All,
| > I want to use "array_walk" function inside a class method. But the
| > problem is i want the second argument to array_walk ( function name )
| > be a another function of the same class. when i gave like that its telling
| >
| > Error : function not exist.
| >
| > class some()
| > {
| >
| > function func1()
| > {
| > }
| > function func2()
| > {
| > array_walk($array,"func1");
| > }
| > }
| >
| > What is the syntax or way to do this.
| >
| >
| > Thanks in Advance.
| >
| > S.Murali Krishna
| > [EMAIL PROTECTED]
| > =====================================
| > We grow slow trying to be great
| >
| > - E. Stanley Jones
| > -------------------------------------
| >
| >
| > --
| > PHP General Mailing List (http://www.php.net/)
| > To unsubscribe, e-mail: [EMAIL PROTECTED]
| > For additional commands, e-mail: [EMAIL PROTECTED]
| > To contact the list administrators, e-mail: [EMAIL PROTECTED]
| >
|
--- End Message ---
--- Begin Message ---
Hi,
As the data grows I like to add the functionality that people see 30 lines of the
result on one page. Also I like to give users the ability to sort per columns...
I know this is done pretty much everwhere. What's the best or easiest way of doing it?
Mehmet Erisen
http://www.erisen.com
---------------------------------
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail.
--- End Message ---
--- Begin Message ---
Need some help with this one. Dont know where to begin. I have content
in a string and a constant that changes depending on if yourre in the
root or in a directory.
The purpose of the constant is to provide dynamic links.
The string will have href links like <a href="index.php">Index</a>
I want to figure out a way to inject my constant value into the href like so
<a href="'._CONSTANT'index.php">Index</a>
I would like the rules to say,
If string contains <href="> and there are <alphanumerical chars> .php
place _CONSTANT between <href="> and <alphanumerical chars>
I figure a regular expression, but I have no idea where to start..
Thanks
--- End Message ---