Matthew Oatham wrote:
Hi,
Is there an elegant way to recover from DB errors in MySQL using PHP,
i.e. transactions and rolling back - basically I have an insert
statement then an update statement. if the insert succeeds the update
is run but if the update fails I want to undo the insert!
Hi folks. Given the last response by Justin to my comment about some
people's dislike for DB abstraction layers I'm electing to throw this
out into the general discussion as a new topic.
I have mixed feelings about abstraction layers. At times I love them
(mostly) and at times I hate them. I
German wrote:
the problem consists of which I must list all the tables of a data
base under SQL server, but I do not have idea of like doing it...
Quick and dirty way:
Download ADOdb (http://php.weblogs.com/adodb#downloads) and use their
MetaTables() method
snip
The idea is exactly not to do any queries dynamically generated based
on user input! In the rare cases where this is needed you should not
allow any unparsed input.
/snip
A RARE case, in the world of web applications??? Hardly!
I agree that in an optimal situation queries will not
snip
PG A RARE case, in the world of web applications??? Hardly!
PG
PG I agree that in an optimal situation queries will not be based on
PG user input, but in the world of the web this is a pipe dream. In
PG 99.99% of the cases there will be some dynamic element to a query.
PG The only
Sheeraz fazal wrote:
Hi All,
I have a list box in a page (html select tag with multiple
selection option). Items are added dynamically in list box, using
javascript. Can i get all elements of listbox in my php code.
If i do $_POST['select_tag_name']. I get a variable not an array.
Thus
Hi folks. Has anyone out there ever had any issues with a user's
personal firewall munging up the HTTP_REFERER for a page?
I've got a mailer script which is accessed from a few domains within our
network of sites, and sometimes users have been getting an error which
informs them the script has
snip
The reason is security. A prepared statement cannot comprimize the
security of our database because all sql-statements are precompiled
in the DBMS. An example using pear:
$res = DB:connect('mysql://someuser:[EMAIL PROTECTED]/thedb');
$sth = $res-prepare('select * from sometable
Elliot J. Balanza wrote:
Hi
I've been trying to use MySQL dump with a php query (since we dont
have like a mysql_dump function) but it's not working.
Can anyone please point me to a page so i can read a method to backup
MySQL databases to an .sql file using php?
thanks.
Vamp
Why
Ryan A wrote:
Hi,
I have this simple code in my php script:
* * * * *
$res = mysql_query(SELECT product_id, now()-1 FROM .$tc._prods
where cno=$cno AND product_id='$product_id' LIMIT 1);
if($res)
{
$r = mysql_fetch_row($res);
$product_id2 = $r[0];
$th_pres= $r[1];
echo debug
David Westbrooks wrote:
I have articles held in a MySQL database for a law firm. When I pull
the information from the DB and display it, words like that's are
shown as that\'s. To take care of this problem I have done this:
$newsart = eregi_replace(\\\',', $newsart);
Is there a better
Hi folks. Has anyone encountered any problems parsing large log files
with PHP?
I've got a log file that's about 1.2 gig that I need to parse.
Can PHP handle this or am I better of breaking this down into 12 100mb
chunks and processing it?
Any advice is appreciated.
Cheers,
Pablo
--
PHP
snip
What kind of a log file are we talking here? regardless what processing
you need to do generally working on a 1.2GB file with out RAID and/or
lots of memory is going to be slow.
Pablo Gosse wrote:
Hi folks. Has anyone encountered any problems parsing large log files
with PHP?
I've got
to break the file into 100MB
chunks.
Thanks for your help.
Cheers,
Pablo
Pablo Gosse wrote:
snip
What kind of a log file are we talking here? regardless what processing
you need to do generally working on a 1.2GB file with out RAID and/or
lots of memory is going to be slow.
Pablo Gosse wrote
snip
You might already be fed up with my posts but I'm a complete PHP newbie
and find these groups are the best way to learn! Anyway I have the
database date in the format: -mm-dd hh:mm:ss e.g. 2004-02-24
07:57:59 but when in some situations I only want to show the user the
date in the format
Hi folks. I've got a quick question about security when running a php
script through a cron job.
I've got a cron job set up that executes every minute and looks for idle
users and pending content within a cms.
I know that if I wanted to execute the script with an exec() call from
within another
snip
php /home/pablo/cmsutil/CMS_monitor.php
and the permissions on CMS_monitor.php are as follows:
-rw-rw-r--1 pablopablo3636 Feb 21 00:48
CMS_monitor.php
My question is under these permissions could someone else with an
account on this server execute this file? I'm
Lucas Gonze wrote:
I have a situation where I want to send a cached result back then
recalculate the cache. This is necessary because it takes a long time
to generate a page. Is there a way for me to return what the browser
needs, then terminate the connection without stopping my script?
snip
Beau Hartshorne wrote:
as you (6.0.2800.1106) (different product ID though), and can't
reproduce the problem on any of my Linux webservers, or the one Win2k
machine I have running PHP/Apache. I also hit your URL with IE, and
The problem only occurs in the second form. Did you try
snipHello, I decided to make a pre-URL caller into my script, so when
user
try link to another URL, instead show these annoying http errors (when
URL off), I could direct him to more user friendly environment.
I checked FOPEN($url-name,'R') command, but in some cases it will pop up
fire-walls
Hi folks. I'm wondering if anyone out there can point me in the
direction of a good tutorial/article on how to implement authentication
using Kerberos in a PHP application running on Apache 2.0.
I've googled and searched the lists but I can't find any tutorials or
articles which fully explain
snip
I have a script that allows the user to browse his/her local hard
drive
for
a file and email it as an attachment. Text files come through OK but
any
binary type file, e.g., JPEG or PDF arrive broken. JPEG will show as
a
red
X in my browser and Adobe will complain about the PDF. I don't
Hi all. I've got a simple mailer script that I wrote a few years ago
that has been acting up over the past week.
The problem is with the following check I perform at the very top of the
script:
if (!stristr($_SERVER['HTTP_REFERER'],unbc.ca)) {
die(You can't access this script outside of our
Hi folks. I have two virtual servers running under Apache. I want each
to have a different include_path so I've set the following in each conf
file:
For Domain 1:
IfModule mod_php4.c
php_value include_path .:/u0/vservers/domain1.mydomain.ca/html
/IfModule
For Domain 2
IfModule mod_php4.c
Hi all. Quick quesiton about PCRE vs. POSIX-extended regular
expressions.
How much of a difference is there between these two types of regular
expressions. I know I've read that PCRE is faster, but is it that much
of a difference?
A while ago I had to write a bunch of regular expression
snip
My site, at the moment, uses SSI to call a Perl browser-sniffing script.
I would like to:
1. use php to call the Perl script.
2. then save the values the Perl script outputs as php variables.
Can this be done? If so, how?
/snip
Hi, Philip. If you are not 100% stuck on using a perl script
Hi all. I'm trying to install PHPDocumentor (www.phpdoc.org) and I'm
getting an error when using the pear install feature.
I've got the necessary files stored in /home/phpDocumentor-1.2.2 but
when I run pear install /home/phpDocumentor-1.2.2/package.xml I get the
following error:
Invalid
snip
Was wondering what everyone's favortie IDE is for
coding in PHP. I've got a big PHP project in the
works. I'll be doing alot with it and am looking for
ways to boost my productivity.
--Jough
/snip
If you're willing to purchase a commercial product I'd highly recommend
Zend's IDE. I've
snip
Hi,
I'm on a win2k pro machine and need to copy a modified httpd.conf file
to my
linux box,
I dont really know much about SSH and just learned a bit with my pals
help
(google)
I am able to navigate around the directories, get a directory listing
and
delete...am unable to copy files from my
Kelly Hallman wrote:
On Mon, 8 Dec 2003, Chris W. Parker wrote:
Ok so I am working on the admin sectin of the e-commerce app I'm
writing and I'm hoping there's a better way to do what I am currently
doing. In an effort to prevent circumvention of the login page I've
placed a check at the
Hartley, Matt wrote:
I am sort of new at this, I am wondering if it is possible to find
the display settings of the user I know that
?php echo $_SERVER[HTTP_USER_AGENT]; ?
will give you
Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
is there one that will recover the display
Kelly Hallman wrote:
On Mon, 8 Dec 2003, Chris W. Parker wrote:
Ok so I am working on the admin sectin of the e-commerce app I'm
writing and I'm hoping there's a better way to do what I am currently
doing. In an effort to prevent circumvention of the login page I've
placed a check at the
Hi all. I'm wondering if anyone can tell me how long temporary session
files stay on the server after the session has ended if
session_destroy() is not called.
I'm curious as part of the CMS I've been writing for the past year is a
class which dynamically generates and validates all forms in the
Jonathan Villa wrote:
Where can I find information on installing/configuring PHP for Domino?
http://www.alise.lv/ALISE/technolog.nsf/0/b2dc72112f3df625c2256dad002e40
c5?OpenDocument
It's called Google man. Use it and love it.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
John J Foerch wrote:
Hi,
Is there some way to turn off maximum execution time?
Preferably within the script itself? Thanks, John
ini_set('max_execution_time',0);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi all. I'm curious as to the performance difference between scripts
that use sendmail vs. smtp for their mailing abilities.
I use the following class for delivering emails,
http://phpmailer.sourceforge.net http://phpmailer.sourceforge.net/ ,
and since I don't have sendmail running on my
Hi all. I'd like to use Kerberos to authenticate users and I'm looking
for a decent tutorial on how to accomplish this. I've Googled this and
have searched the archives but I can't find any decent links which point
to useful tutorials.
Anyone have one they'd like to share?
Cheers and TIA,
Jay Blanchard wrote:
[snip]
I want generate an excel table download it as a file (not view in
IE), what HTML mimetype should i use? [/snip]
header(Content-Type: application/vnd.ms-excel);
header(Content-Disposition: inline; filename=\excel.xls\);
header(Expires: 0);
Hi all. Is it possible to have different php.ini settings for different
sites running on the same server (Apache)?
What I want to do exactly is change the include_path on a per-site
basis, without having to call ini_set in each page.
I have the following:
/home/vservers/cms.mysite.com
Hi all. I'm trying to alter the include_path for three different sites
running on the same machine, and I do not want to use ini_set in each
file.
Here's what I've set up for each virtual host inside my httpd.conf file:
VirtualHost ###.###.##.###
IfModule mod_php4.c
php_value
.
Pablo
-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 3:02 PM
To: Pablo Gosse
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Changing php directives inside apache config file
Pablo Gosse wrote:
Hi all. I'm trying to alter the include_path
David Strencsev wrote:
You may play with these functions:
addslashes();
stripslashes();
htmlentities();
html_entity_decode();
Thanks for your help manu and david. I'm going to attempt converting
the html characters and see if that works, but something also makes me
think this might be a
Hi all. I'm not sure if this is a browser issue, or a php issue, but
while I'm leaning more towards the side of browser I'm not really
certain and I'm interested to see if anyone has had problems similar to
this.
I've got a form by which html code is being submitted to a database.
When I submit
Raditha Dissanayake wrote:
[snip]The biggest XML job i have handled with PHP is parsing the ODP RDF
dump which is around 700MB. Obviously arrays are out of the question in
such a scenario, even though only one user will be accessing the script
At a given moment. the ODP dump has a couple of
Teren wrote:
Anyways, it works fine if I put 0 in for 1 on line 9 where it
uses the rand(), but it include 0 and I can't have 0.
Why not just change the following:
if($ran == $sh) {
$add = no;
}
to:
if($ran == $sh || $ran == 0) {
$add = no;
}
On Thursday, November 13, Jeff wrote:
[snip]What I now need to do is store not only the userID but the email
address as well. Is there a way using a form to store 2 values using
one drop down box? So basically I want to store the userID and the
Email address to a variable in the form so that
On Wednesday, November 12, 2003 8:23 AM Alan and Chris wrote:
--- Alan ---
can I put a function_name() in the form action=... place holder?
--- Chris ---
I think you can do this with JavaScript, yes.
What is it that you hope to achieve by using a function instead of a
url? You could, as
On Wednesday, November 12, 2003 10:50 AM, Steve wrote:
I am looking for a simple easy to edit php calendar program. Does
anyone
know where I can find one?
Pear is always a good place to start:
http://pear.php.net/package/Calendar
Cheers,
Pablo
--
PHP General Mailing List
[snip] It might be best to not try and definitely declare what counts as
foreign data, because it's a sort of everything else type of thing. If
it doesn't originate within the PHP script itself, it is foreign.[/snip]
What about data from a database which is retrieved within the PHP
script? Would
On Thursday, November 06, 2003 10:31 AM, Josephin wrote:
snip
xy.html ---form.html--formmailer.php
want the $HTTP_Referer or HTTP_URI, file only, (of xy.html)
--to be forwarded to form.html,
--to be converted in a variable,
--which is passed on to formmailer.php, which will use it as
: Thursday, November 06, 2003 12:48 AM
To: Pablo Gosse; [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions within new windows
If, as Chris wrote, this is indeed a feature/bug of
IE, then it must be
configurable somewhere, though I'm lost as to where
that might be.
Does anyone have any ideas how
On Wednesday, November 05, 2003 8:03 AM, Dimitri wrote:
I'm trying to allow users to upload files to my server. I have the
appropriate code (I think) but I'm getting this error message. Can
someone
tell me why, and how to fix this?
Warning:
move_uploaded_file(/home/unit-
That's strange, as I've been writing a CMS over the past year which
requires the user to have IE 5.5 or newer, and I have no problems with
pop-ups accessing session values under IE 6.0.
Perhaps it's an issue of how you're invoking the new windows?
Are you using a normal link with target=_blank
:
a href=View_Article.php?ID={ID} target=_blankimg
src=../Images/view.gif width=22 height=22 border=0/a
-Original Message-
From: Pablo Gosse [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 11:17 AM
To: [EMAIL PROTECTED]; Donald Tyler; [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions
On Wednesday, November 05, 2003 12:38 PM, Chris wrote:
I would also be interested in this, as well as some sort of
confirmation
of this behavior. It could be that the person who described this
behavior
was wrong. :-)
I think Chris is correct in thinking that the person who started the
Hi all. A quick question as an extension to the threads about input
validation over the past weeks.
It's obviously best practice to rigorously check and validate all input
coming via $_GET or $_POST, but what about $_SESSION values?
Without proper checking of $_GET and $_POST, it is very easy
Hi all. Sorry for the repost but the query got seriously mangled in the
previous post.
A quick question as an extension to the threads about input validation
over the past weeks.
It's obviously best practice to rigorously check and validate all input
coming via $_GET or $_POST, but what about
about
attempting to hack the values of a session other than through hacking
into the session files, so if anyone has any input on this please pass
it along.
Cheers,
Pablo
Pablo Gosse wrote:
Hi all. A quick question as an extension to the threads about input
validation over the past weeks
On Tuesday, November 04, 2003 8:12 AM Adam wrote:
I want to access a value of an array by key, but the array is not a
variable - it is a constant.
How do I do it?
I tried
$value = PL_ORT[$key];
, but this doesn't work (parse error)...
I even tried
$value = {PL_ORT[$key]};
Hi Adam.
As
On Tuesday, November 04, 2003 8:35 AM Shaun wrote:
I want to generate an email with a link in it that links back to the
domain name I am sending it from. How can I do this in PHP?
$_SERVER['SERVER_NAME'] will return of the domain under which the script
is called.
Cheers,
Pablo
--
PHP General
On Tuesday, November 04, 2003 12:45 PM Kevin wrote:
[snipped]
How can I test for it without getting an error if it is not checked??
[/snipped]
Hey Kevin. Use isset($var) to test if a var has been set.
So you would need:
If (isset($_POST['checkboxname']) $_POST['checkboxname'] == 'on')
{
On Tuesday, November 04, 2003 3:28 PM Jay wrote:
echo forminput type=test size=25 value=$xyz/form;
[snip]
The text box shows up with Hello NOT Hello World. How do I get the
entire variable?
Hi Jay.
You need to wrap the value attribute in quotes, or else it'll truncate
at the first space.
On Wednesday, October 29, 2003 8:04 AM David wrote:
One of my friends wants to create a page that shows current time by
pressing space key or enter key.
What is the best way to do this with PHP?
PHP is a server-side technology, and what you want to do is on the
client side. Your friend will
On Wednesday, October 29, 2003 8:20 AM Robb Kerr wrote:
I am attempting to hack a tutorial from the Zend site. I have found
the
tutorial/project to be excellent, but I don't completely understand
what's
being done in the following Query statement.
//query database, assemble data for
On Tuesday, October 28, 2003 8:50 AM Frank Tudor wrote:
$query=SELECT payment FROM payment WHERE
dln='.$_POST[dln].' = payment.dln='.$_POST[dln].' and
users.password='.$_POST[password].';
Okay, there seem to be a few problems here.
The first issue is:
users.password
Using this means you are
On Tuesday, October 28, 2003 8:57 AM Jed R. Brubaker wrote:
Is there a way to preserve URL variables and have a link simply add a
new
variable to the end?
I am tabulating data and I have URL variables defining which dataset
to
view and in what way to view it. I would now like to set the SQL
Yours:
$query=SELECT payment
FROM payment
WHERE payment.dln='.$_POST[dln].'
= users.dln='.$_POST[dln].'
and payment.payment='.$_POST[payment].';
Mine:
$query=SELECT payment
FROM payment
WHERE payment.dln='.$_POST[dln].'
AND
users.dln='.$_POST[dln].'
and
Hi Robb. This is exactly what you'll need to do.
Something like the following, assuming you're populating an array with
user information:
script type=text/javascript
!--
var users = new Array();
?php
$count = 0;
while (!$users-EOF))
{
echo 'users['.$count.'] =
Hi Rob. That seems perfectly logical. I've written a Content
Management System which (when it's finished in a couple of months ;o)
run the website at the university where I work.
I can presently open an instance of the CMS in IE, login as admin, then
open a new window and request another
On Tuesday, October 28, 2003 2:13 PM CPT John W. Holmes wrote:
It may depend upon how you open the second window, too. Control-N may
use
the same cookies whereas starting a whole new instance may not.
This is the case with IE. If I'm in my CMS and ctrl-N to get a new
window, I can operate
On Tuesday, October 28, 2003 6:46 PM wrote:
Hi there, i am experiencing a session timeout problem with one of my
projects. One of the users had left their machine for less than 15
mins,
maybe a bit more and it logged them out when posting data. This isnt
good
as they lost their data. I was
On Tuesday, October 28, 2003 6:53 PM Jason Williard wrote:
I would like to display part of the output of a query. In many cases,
the string returned by this query exceeds 200 characters. Is there a
way to cut it off after 200 characters? Even better, is there a way
to
cut it off at the
On Monday, October 27, 2003 11:26 AM, Frank Tudor wrote:
This one worked (kinda)
I have no more errors but it doesn't do the redirect (hmmm)??
?PHP
$payment = 1;
function payment(){
global $payment;
if ($payment == 0){
header ('Location: http://ftudor/test/test_page.html');
}
On Larry Brown wrote:
-
Does anyone know whether the use of persistent connections with php will
allow a temp table created by a script to linger around and cause a
problem
with the next execution of the script when it tries to create the temp
table
again? Also if it does
On Sunday, October 26, 2003 5:40 PM Al wrote:
Is it just me, or would everybody else like to see a case-insensitive
string comparison operator introduced into PHP?
You could use the strcasecmp() function as well:
http://ca3.php.net/manual/en/function.strcasecmp.php
?php
$var1 = Hello;
$var2
Hi, Timo. Why can't use use hidden fields instead of appending the
values to the url? It would be the same to access them via
$_GET['para1'] $_GET['para2] (unless you were using post as your method,
in which case it would simply be $_POST['varname']) if they were on the
url or in hidden fields.
On Friday, October 24, 2003 8:28 PM Luis Lebron wrote
I tried that but it did not work.
Can you post the html code you used?
Setting form action=foo.php target=frame should do the trick.
This is very standard, so if it's not working that's very strange.
Post the code so we can take a look.
AM, you wrote:
PG Hi all. I'd like to take a brief sentence to introduce myself
first.
PG My name is Pablo Gosse, and I've just recently joined the
php-general
PG list. I've been using PHP since early 2000, and work as webmaster
PG at the University of Northern British Columbia.
PG I'm running
corruption takes place?
Have you opened the files with a hex editor to see the contents? I am
sorry if you have mentioned these before, i don't have the older
messages in this thread.
Pablo Gosse wrote:
Hi Tom.
make sure you have ENCTYPE=multipart/form-data in the form tag
Thanks
-Original Message-
From: Raditha Dissanayake [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 10:48 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Images being uploaded in ASCII format
Hi Pablo
Pablo Gosse wrote:
Hi Raditha. Thanks very much for your reply. I've not been having
Strange, because I just set up the code exactly as posted below, under
Win2K and Apache 2.0, and it worked fine.
Cheers,
Pablo
-Original Message-
From: Golawala, Moiz M (IndSys, GE Interlogix)
[mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 1:11 PM
To: Daniel Guerrier; [EMAIL
Hi all. I'd like to take a brief sentence to introduce myself first.
My name is Pablo Gosse, and I've just recently joined the php-general
list. I've been using PHP since early 2000, and work as webmaster
at the University of Northern British Columbia.
I'm running into a problem with file
a href=path/to/file.php?var=?php echo $val; ?link/a
And on the receiving page access var via $_GET['var']
Of course, how you actually append the value in question to your link
will depend on your own code.
I use ADOdb for all my db work, so for me it would be something like
this:
echo 'table';
101 - 183 of 183 matches
Mail list logo