php-general Digest 31 May 2004 09:39:30 -0000 Issue 2794
Topics (messages 187245 through 187267):
Query Query
187245 by: The Digital E
187246 by: Khan
187247 by: hitek
187248 by: Daniel Clark
187249 by: Johan Holst Nielsen
187251 by: Curt Zirzow
187253 by: Mark Charette
hyperlink to the mysql data
187250 by: CurlyBraces Technologies \( Pvt \) Ltd
187252 by: Daniel Clark
Windows to Linux -- Getting errors still...
187254 by: Ryan Schefke
187257 by: Thomas Seifert
drop down menu populated from a directory
187255 by: Dustin Krysak
187256 by: Torsten Roehr
Simple calender
187258 by: Ryan A
187267 by: Torsten Roehr
triggering php scripts...
187259 by: Chris Wagner
187260 by: Travis Low
Re: PHP Coding Standards
187261 by: Travis Low
kill a script
187262 by: CurlyBraces Technologies \( Pvt \) Ltd
Re: CMS with best administration part?
187263 by: Justin French
Re: Simple preg I think [SOLVED]
187264 by: Dave Carrera
Re: Send HTML/plain text email using PHP
187265 by: Jeremy Johnstone
Re: CVS web front end
187266 by: Jeremy Johnstone
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 ---
This may be better suited to the MySQL lists, but I'd appreciate it if
someone could help. I'm probably just missing something stupid here but
have been coding non-stop for a week and need another set of eyes.
Here's the line of code giving me an issue. I can print all the
variables in the script to screen and know that they're ok. It returns
successfully, but fails to update the database. I'm sure I'm about to
feel pretty stupid, so fire away... just please fire the answer too.
$query="UPDATE $table_name SET company_name='$company',
first_name='$first_name', last_name='$last_name', address='$address',
city='$city', state_province='$state', postal_code='$postal',
office_phone='$office', fax_phone='$fax', email='$email' WHERE
company_name='$mod_dataset'";
Thanks
--- End Message ---
--- Begin Message ---
The Digital E wrote:
This may be better suited to the MySQL lists, but I'd appreciate it if
someone could help. I'm probably just missing something stupid here but
have been coding non-stop for a week and need another set of eyes.
Here's the line of code giving me an issue. I can print all the
variables in the script to screen and know that they're ok. It returns
successfully, but fails to update the database. I'm sure I'm about to
feel pretty stupid, so fire away... just please fire the answer too.
$query="UPDATE $table_name SET company_name='$company',
first_name='$first_name', last_name='$last_name', address='$address',
city='$city', state_province='$state', postal_code='$postal',
office_phone='$office', fax_phone='$fax', email='$email' WHERE
company_name='$mod_dataset'";
you have 'company_name' in SET and then again in WHERE. This looks fishy.
--- End Message ---
--- Begin Message ---
This may sound stupid, but are you actually EXECUTING the query?
$doit = mysql_query($query);
At 12:32 PM 5/30/2004, The Digital E wrote:
This may be better suited to the MySQL lists, but I'd appreciate it if
someone could help. I'm probably just missing something stupid here but
have been coding non-stop for a week and need another set of eyes.
Here's the line of code giving me an issue. I can print all the variables
in the script to screen and know that they're ok. It returns successfully,
but fails to update the database. I'm sure I'm about to feel pretty
stupid, so fire away... just please fire the answer too.
$query="UPDATE $table_name SET company_name='$company',
first_name='$first_name', last_name='$last_name', address='$address',
city='$city', state_province='$state', postal_code='$postal',
office_phone='$office', fax_phone='$fax', email='$email' WHERE
company_name='$mod_dataset'";
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Can you send more of the code? I looks good so far.
>>This may be better suited to the MySQL lists, but I'd appreciate it if
>>someone could help. I'm probably just missing something stupid here but
>>have been coding non-stop for a week and need another set of eyes.
>>
>>Here's the line of code giving me an issue. I can print all the
>>variables in the script to screen and know that they're ok. It returns
>>successfully, but fails to update the database. I'm sure I'm about to
>>feel pretty stupid, so fire away... just please fire the answer too.
>>
>>$query="UPDATE $table_name SET company_name='$company',
>>first_name='$first_name', last_name='$last_name', address='$address',
>>city='$city', state_province='$state', postal_code='$postal',
>>office_phone='$office', fax_phone='$fax', email='$email' WHERE
>>company_name='$mod_dataset'";
--- End Message ---
--- Begin Message ---
The Digital E wrote:
$query="UPDATE $table_name SET company_name='$company',
first_name='$first_name', last_name='$last_name', address='$address',
city='$city', state_province='$state', postal_code='$postal',
office_phone='$office', fax_phone='$fax', email='$email' WHERE
company_name='$mod_dataset'";
What does mysql_error() says?
Tried to print out the query and execute it directly in the mysql prompt
or phpmyadmin? What happens then?
--
Johan Holst Nielsen
Freelance PHP Developer
http://phpgeek.dk
--- End Message ---
--- Begin Message ---
* Thus wrote The Digital E ([EMAIL PROTECTED]):
>
> $query="UPDATE $table_name SET company_name='$company',
> first_name='$first_name', last_name='$last_name', address='$address',
> city='$city', state_province='$state', postal_code='$postal',
> office_phone='$office', fax_phone='$fax', email='$email' WHERE
> company_name='$mod_dataset'";
Funny how a mysql question gets a lot of attention...
select * from $table_name where company_name ='$mod_dataset'
expect:
0 rows
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
> From: Khan [mailto:[EMAIL PROTECTED]
> you have 'company_name' in SET and then again in WHERE. This looks fishy.
Very common, often required, and perfectly legal.
Mark C.
--- End Message ---
--- Begin Message ---
|
hi ,
i have retrived some perticular data
from mysql , and them show in the web browser.( It is very few data
)
When clicking on one of that that perticular data
, i want to show the whole information with related to the above
mentioned part.
So , can some body help me to add like this hyper
link to the mysql data ?
thanx in advance
curlys
|
--- End Message ---
--- Begin Message ---
Can you post some of the code?
--Original Message Text---
From: CurlyBraces Technologies ( Pvt ) Ltd
Date: Mon, 31 May 2004 01:49:17 +0600
hi ,
i have retrived some perticular data from mysql , and them show in the web browser.(
It is very few data )
When clicking on one of that that perticular data , i want to show the whole
information with related to the above mentioned part.
So , can some body help me to add like this hyper link to the mysql data ?
thanx in advance
curlys
--- End Message ---
--- Begin Message ---
Hello,
I successfully tested the GD library and several scripts with PHP locally on
my windows machine. I went to test the same php-files on my internet server
(Linux).
But on the server I get the following error:
Warning: imagejpeg: unable to open 'temp.jpg' for writing in
/home/httpd/vhosts/tgwedding.com/httpdocs/tgwedding/photos.php on line 29
I already changed the file permissions but it didn't still work.
Does anybody know how to solve the problem?
This is line 29:
imagejpeg($base_image, 'temp.jpg'); //convert and save it to temp.jpg
Thanks,
Ryan
--- End Message ---
--- Begin Message ---
This is line 29:
imagejpeg($base_image, 'temp.jpg'); //convert and save it to temp.jpg
Hi,
you should give it a path, i.e. ./temp.jpg or a full absolute path.
thomas
--- End Message ---
--- Begin Message ---
Hi there....
What I am hoping to do is have a drop down menu that would be populated
from the contents of a directory via php. Now The link names would be
generated by the file name minus the file extension. Has anyone seen a
tutorial on accomplishing something like this? All of the links would
be to quicktime movies, but I am hoping to have them embedded in HTML
(or PHP)..... So the movie is displayed in a browser....
thanks in advance!
Dustin
--- End Message ---
--- Begin Message ---
"Dustin Krysak" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi there....
>
> What I am hoping to do is have a drop down menu that would be populated
> from the contents of a directory via php. Now The link names would be
> generated by the file name minus the file extension. Has anyone seen a
> tutorial on accomplishing something like this? All of the links would
> be to quicktime movies, but I am hoping to have them embedded in HTML
> (or PHP)..... So the movie is displayed in a browser....
>
> thanks in advance!
This should do the trick:
// opening select tag goes here...
if ($handle = opendir('/path/to/files')) {
while (false !== ($file = readdir($handle)))
if ($file != '.' && $file != '..')
$fileName = str_replace('.mov', '', $file);
echo '<option value="' . $file . '">' . $fileName . '</option>';
}
}
closedir($handle);
}
// closing select tag goes here
Haven't tested it. Hope it works and helps ;)
Regards,
Torsten Roehr
--- End Message ---
--- Begin Message ---
Hey,
been looking at a lot of calenders most of them are either too big for my
use (whole page), not free, in javascript or too complicated.
I require a calender that is simple, loads fast,small and not javascript,
the closest I found is at:
http://scripts.franciscocharrua.com/calendar.php
just two problems with it,
1. It does not have the days on top (eg: s,m,t,w,t,f,s - sunday,
monday....etc)
2. (not required but would be nice if it would) allow me to link from the
days of the calender to some page/s
I guess I could modify the above calender as it pretty good + open
source...but if anybody is using a calender already which is like the above
+ the 1 or two points I wrote....your response would be appreciated. ;-)
Thanks,
-Ryan
--- End Message ---
--- Begin Message ---
"Ryan A" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hey,
>
> been looking at a lot of calenders most of them are either too big for my
> use (whole page), not free, in javascript or too complicated.
>
> I require a calender that is simple, loads fast,small and not javascript,
> the closest I found is at:
> http://scripts.franciscocharrua.com/calendar.php
>
> just two problems with it,
> 1. It does not have the days on top (eg: s,m,t,w,t,f,s - sunday,
> monday....etc)
> 2. (not required but would be nice if it would) allow me to link from the
> days of the calender to some page/s
>
> I guess I could modify the above calender as it pretty good + open
> source...but if anybody is using a calender already which is like the
above
> + the 1 or two points I wrote....your response would be appreciated. ;-)
Hi Ryan,
there is an excellent calendar package in PEAR with good documentation:
http://pear.php.net/package/Calendar
Here is a simple sample script to build a calendar that can easily be
modified:
http://pear.php.net/manual/en/package.datetime.calendar.intro-inahurry.php
Hope this helps.
regards, Torsten
--- End Message ---
--- Begin Message ---
hello,
i am wondering if there is a good way to trigger a php script from a web
page *without* sending the user to a new page or opening a new browser
windows.
for instance, suppose you wanted to make a button/link on a web page
that, when clicked, would cause a database entry to be decremented.
however, you do not want to refresh the page or open a popup window or
any stinky little tricks like that.
or, if this is not possible, does anyone know how to trigger a php
script when someone accesses a particular file from an apache server?
or if a file from a particular directory is downloaded...
thanks a lot!
--- End Message ---
--- Begin Message ---
Chris Wagner wrote:
i am wondering if there is a good way to trigger a php script from a web
page *without* sending the user to a new page or opening a new browser
windows.
for instance, suppose you wanted to make a button/link on a web page
that, when clicked, would cause a database entry to be decremented.
however, you do not want to refresh the page or open a popup window or
any stinky little tricks like that.
Use a virtual include to call the php script.
or, if this is not possible, does anyone know how to trigger a php
script when someone accesses a particular file from an apache server?
or if a file from a particular directory is downloaded...
I don't think you can do that unless the php script is used to access the file
or perform the download you speak of.
cheers,
Travis
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--- End Message ---
--- Begin Message ---
I have to say I like everything about the PEAR coding standards except for the
K&R bracing style. I much prefer:
if( foo )
{
blah;
}
to
if( foo ) {
blah;
}
The latter form (K&R) conserves vertical space, but I find it a lot harder to
follow. Harder to move blocks of code around too. I'm sure plenty of people
disagree, so of course this is IMHO.
cheers,
Travis
Michael Nolan wrote:
charles kline wrote:
Hi all,
I was having a conversation with a friend and talking about coding
standards in the open source community (focusing on PHP). I seem to
remember there being a document out there that sort of laid it out
pretty well.
Anyone know where I might find a copy?
PEAR has a page in their documentation about coding standards:
http://pear.php.net/manual/en/standards.php
HTH,
Mike
--
Travis Low
<mailto:[EMAIL PROTECTED]>
<http://www.dawnstar.com>
--- End Message ---
--- Begin Message ---
|
i used this script to run that abc.pl in command
prompt. It is perfectly running.
<?php
//$ExhibitA =
shell_exec('/root/whole/abc.pl');
// Perfect. $ExhibitB = shell_exec('env -i
/root/whole/abc.pl');
?>
* Actually i need to stop that as well ,
i got this result by ps -e
1182
pts/0 00:00:00 abc.pl
so , plz help for that ,
thank u
curlys
|
--- End Message ---
--- Begin Message ---
Also checkout Textpattern (in gamma right now, with g1.19 due in the
next few days, which should be pretty much perfect for everything I've
ever wanted).
http://www.textpattern.com/
FWIW, it *is* standards compliant, has clean/smart PHP code, has a
beautiful interface, an amazing support community, an awesome
developer/owner (Dean Allen), nice plug-in architecture, role based
permissions structure, unlimited blogs (actually, they're sections of
the site with categories and sub-categories), so it's really a CMS the
feels "bloggy".
And as of g1.19, Textpattern will be open source.
What it does lack (I guess) is maturity and an abundance of plugins.
But on the other hand, it has everything you want (I think), right out
of the box, and a great community to help you write plugins. At the
moment it lacks message boards and things like that, but everything
will be there eventually.
Even at this early stage, every other CMS I've ever used (and even the
one I've spent a year developing part-time) pales in comparison. It
may not do "everything" right now, but it will -- trust me. This thing
will crush MT, Wordpress, and everything else out there, and will never
cost you a cent.
I can't speak highly enough of it right now, and the future is very
bright.
Justin French
On 31/05/2004, at 4:51 AM, Khan wrote:
Hello,
I'm looking for CMS that have great administration part. I'm not
interested in site displaying, speed, HTML standards or anything like
that. I just need stable administration part with modules:
- News with archives;
- Blogs;
- Some users Can be administrators of blogs;
- Link directory;
- Navigation with multiple categories and subcategories;
- Different news for different parts of my web site;
Web site will be very large and it will have almost any module that
you can find these days :)
I like XOOPS [1]. I also have my eye on Mambo [2]. A friend of mine
told me that Drupal [3] has best community and if not drupal that I
should check EZ [4].
What do you think? Which CMS has best PHP coding standards, best
community, most modules etc...
Any advice is appreciated.
1. http://xoops.org/
2. http://mamobserver.com/
3. http://drupal.org/
4. http://ez.no/
If you know of some other CMS please send link. I know of
opensourcecms.com but I'm interested in your opinions about project
future, community etc.
---
Justin French
http://indent.com.au
--- End Message ---
--- Begin Message ---
Thanks to everyone who answered my request for help with this.
Yes, as some of you have pointed out, the pattern was correct but my logic
was wrong.
So once again thank you to all that helped.
Dave C :-)
-----Original Message-----
From: Liu Jihua [mailto:[EMAIL PROTECTED]
Sent: 31 May 2004 01:53
To: Dave Carrera
Subject: Re: [PHP] Simple preg I think
Dave Carrera
You are right!
$str = "asdf./test";
echo preg_match("/\.\//", $str ,$arr); //print 1
print_r($arr);
======= 2004-05-30 11:55:00 您在来信中写道:=======
>Hi List,
>
>How do I match an accordance of "./" in a string (without the quotes) ?
>
>I have tried preg_match("/\.\//i", $str);
>
>Which I thought would work , as per the manual, but no joy.
>
>Any help or guidance is appreciated
>
>Thank you in advance
>
>Dave C
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.692 / Virus Database: 453 - Release Date: 28/05/2004
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
= = = = = = = = = = = = = = = = = = = =
致
礼!
Liu Jihua
[EMAIL PROTECTED]
2004-05-31
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.692 / Virus Database: 453 - Release Date: 28/05/2004
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.692 / Virus Database: 453 - Release Date: 28/05/2004
--- End Message ---
--- Begin Message ---
Just as an FYI, the following line will get your email a lot of spam points in
SpamAssassin:
$headers .= "X-MSMail-Priority: High\r\n";
Also, I don't know if this has already been suggested, but there is an awesome
class named htmlMimeMail which will handle your needs perfectly. Google it
and you will have everything you need.
-JEremy
On Friday 28 May 2004 05:49 am, Matt MacLeod wrote:
> I've been having a little trouble configuring a script to send a
> multipart email using PHP.
>
> The script send the message, but when I recieve the email it doesn't
> display the HTML version and I have to tell my mail client to displlay
> the plain text version (Mail on OS X 10.3.3).
>
> Here's the script:
>
> $headers .= "FROM: [EMAIL PROTECTED]";
> $headers .= "Reply-To: [EMAIL PROTECTED]";
> $nonhtml = strip_tags($emailsend);
> // This is the important part!
> // This content type identifies the content of the message.
> // The boundary delimits the plain text and html sections.
> // The value of the boundary can be anything - you can even use the
> same one we used here
> $headers .= "Content-Type: multipart/alternative;
> boundary=\"----=_NextPart_000_002C_01BFABBF.4A7D6BA0\"\n\n";
> $headers .= "X-Priority: 1\r\n";
> $headers .= "X-MSMail-Priority: High\r\n";
> $headers .= "X-Mailer: PHP/" . phpversion()."\r\n";
> $headers .= "X-Sender: [EMAIL PROTECTED]";
> $headers .= "Return-Path: [EMAIL PROTECTED]";
> // Now begin your message, starting with the delimiter we specified in
> the boundary
> // Notice that two extra dashes (--) are added to the delimiters when
> // They are actually being used.
> $message = '------=_NextPart_000_002C_01BFABBF.4A7D6BA0
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> ';
> $message .= $nonhtml;
>
> $message .='
> ';
>
>
> // Now begin your HTML message, starting with the delimiter
> // Also notice that we add another content-type line which
> // lets the mail client know to render it in HTML
> $message .= '------=_NextPart_000_002C_01BFABBF.4A7D6BA0
> Content-Type: text/html; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> ';
> $message .= $emailsend.'
>
> ------=_NextPart_000_002C_01BFABBF.4A7D6BA0--';
>
> // Now send the mail.
> // The additional header, "-f [EMAIL PROTECTED]" is only required by
> // some configurations.
>
> echo $message;
> $v = '[EMAIL PROTECTED]';
>
> mail($v, "Test", $message ,$headers,"-f [EMAIL PROTECTED]");
>
>
>
> Any ideas would be gratefully received!
>
> Thanks,
> Matt
--- End Message ---
--- Begin Message ---
Although I have never seen a full app, I have seen PHP code which handles
checkin/checkout of files as a class. I don't know if that will help you, but
if it will then please let me know and I will dig it up.
-Jeremy
On Saturday 29 May 2004 09:50 pm, Brian V Bonini wrote:
> On Sat, 2004-05-29 at 15:01, Johan Holst Nielsen wrote:
> > Lists wrote:
> > > <<As far as I can see, it have nothing to do with an web frontend?>>
> > >
> > > you're so right. I meant to send the link for horde
> > >
> > > http://www.horde.org/chora/
> >
> > Are you able to check out files? check in etc.?
> > As far as I can see - it is just a web cvs viewer?
> >
> > The request was "Not just a file/project
> > browser..."
> >
> > Anyway - thanks for the link to tcvs :D I have downloaded it and I like
> > it :D
>
> Since a web based CVS front-end is looking slim how about a
> recommendation on a web based file sharing app.? (possibly with some
> sort of primitive version control.)
>
> --
>
> s/:-[(/]/:-)/g
>
>
> Brian GnuPG -> KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
> ======================================================================
> gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
> Key Info: http://gfx-design.com/keys
> Linux Registered User #339825 at http://counter.li.org
--- End Message ---