Brian V Bonini wrote:
>>> I can echo out the command and get a well formed command, i.e.
>>> one that will execute from a command prompt, but when I try to
>>> exec() $cmd from within the script the globbing is taken
>>> literally.
Try shell_exec(). I don't think exec() goes via the shell.
--
PH
= sprintf('/services.php/%s'. $i);
header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . $url);
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
er("Status: 301 Moved Permanently");
>
> ?>
Waste of time. Go read the HTTP spec. Apologies for missing the typos, I
was rather in a hurry. The point is, it wasn't a 301 redirect.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
t a different result. Can anyone
> help with the SQL?
Read up on the MySQL DATEDIFF() function, if you are using MySQL. Other
DBMSs should have an equiv. function.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
close it in the following, unless you
like infinite loops:
if($_SERVER['HTTPS'] != 'on') {
}
Assuming that you're using Apache. I'm not sure if other servers set
that variable.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Mario netMines wrote:
> Hi Jasper and thanks for the quick reply.
>
> something tells me it's not a straightforward SQL query that I have to
> use here but a logic using PHP and SQL.
Please don't top-post.
It can be done in SQL quite easily, as can many things people
nter, you probably want "ESCAPED BY '\''" rather than
"ESCAPED BY '\'" (added a ' to close the first quote, as the second one
is escaped.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
n't need OCR in most cases, as the text is stored as real text,
not as images of text, in the PDF.
Surely there must be a PDF-to-text utility out there somewhere, because
there's plenty of open-source PDF reading utils around...
Jasper
--
PHP General Mailing List (http://www.php.ne
or the
service, as you will end up much better off.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Satyam wrote:
Now, am I missing something in all this? Please comment. Thanks
Satyam
Just use the Arbitrary Precision Mathematics functions in PHP, set to a
precision of 2 decimal places. There's bcmath[1] and GMP[2].
Jasper
[1] http://www.php.net/bc
[2] http://www.php.net/gmp
-
ts as it
likes during processing, and use number_format() whenever displaying to
limit it to 2 decimal places. That, coupled with storing them as
decimals with 2 decimal places in my MySQL databases, achieves
everything I need.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To uns
ell, firstly your subject does not match what you're doing. PHP is
weakly-typed, so $result may be a value that evaluates to FALSE while
not actually being a boolean value.
In your subject you use the === operator to check types, but you're not
doing it in the code sample.
You should
as 1988-07-06 it is showing
it as
17 years old instead of 16...any idea whats wrong in the above code?
Use floor() instead of round(). Using the round() function will round
anyone whose age is above 16.5 to 17, while floor() always rounds down.
Jasper
--
PHP General Mailing List (http://www.ph
e users table and
then looping over the data table separately inside the users loop.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ross wrote:
value=""
Keeps the value of $subject that was previously entered in the textarea even
after the form is submitted with php_self(). Is this possible with the
listbox??
{ ?> selected>Some Option
Alter to suit your needs, of course.
Jasper
--
PHP General Ma
t; or something similar."
How do I solve this problem???
If you're on Windows, follow the other posted advice :)
If you're on *nix, make sure PHP was compiled with MySQL support, i.e.
the MySQL client libraries were compiled in.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
LacaK wrote:
I see contents using Network Monitor, so I se response header and
contents andthey are uncompressed, so somresion does not uccured.
It's likely the browser is uncomressing it before you ever see it. I
would telnet to port 80 and make an HTTP request to see for sure.
To turn
by design -- it doesn't make sense to
allow setting it at runtime as some output could already have been made.
Be interesting to see what the bug report digs up, though -- can we have
a link?
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Bruno B B Magalhães wrote:
That's my problem: I have a configuration files with the following
structure...
$vars['varname'] = 'varvalue';
If you trust the config file:
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
e 404
error page you've set up in Apache config.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
scripting isn't important for your
application...
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ys that gd should be
supported out of the box. I am going to try and find the rpm for
php-4.3.11 and reinstall it.
That is the GD library, not the GD PHP extension. The latter requires
the former, but they are not equivalent. Please don't top-post.
Jasper
--
PHP General Mailing List (htt
sers use IE, so unless you enjoy shutting out the majority of
your customers, we do need to work around it.
Let's not get this thread OT though.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
efore the first Unicode BOM, or any kind of output can screw it up.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
tring of text.
Don't forget to mysql_real_escape_string() it.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
s the Internet.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
added via JavaScript when
a link/button is clicked, then it won't be visible in the source.
Regardless, though, it's not really any form of security.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
y
objects in the reverse order that they were created? Is there any way to
work around this?
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
to account your expertise in PHP and MySQL, and in the problem
domain. If you do not have a lot of expertise in either of those areas
then you may not want to charge as highly.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Evert | Rooftop wrote:
Jasper Bryant-Greene wrote:
I'm in New Zealand and charge NZ$50/hour as a base rate for PHP web
development. I don't know what that is in your currency, try
www.xe.com/ucc to find out.
That's almost probably as cheap as india.
True, but markets a
Shaw, Chris - Accenture wrote:
Jasper,
I would have thought php would have called the destructors on each of the
classes in a LIFO fashion, but if it doesn't, just use unset() as a
workaround, where you can remove the classes in the order you want.
I should add that this behaviour see
than using system() to execute 'uptime' etc.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
want performed. If you execute, for example,
"/some/path/somescript &", then the exec() function will return
immediately and somescript will continue to run.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
tead,
execute the query once (without the "hour(time)=$1 and " and the "limit
1", and use a while($row = mysql_fetch_assoc($result)) { } type function
to get all 23 rows. That will be much faster.
By the way, that should probably be "order by time desc" not "o
your message is
hidden within another thread and is very likely to be missed.
In this situation I would simply use the PHP execution functions
(exec(), system(), shell_exec(), etc.) to call Perl scripts that use the
modules or functions written in Perl.
Jasper
--
PHP General Mailing List
Jesús Alain Rodríguez Santos wrote:
Hello I'm new:
I need to know how can I stop a php sentence if my db is empty, for example
I have writed a php sentence, if every fields from mmy db are full, there
is no problem, but I delete every values from the all fields in my db when
I ejecute my script m
Photo {
private $caption;
[...]
public function setCaption($newCaption) {
$this->caption = $newCaption;
}
}
It just seems so pointless..
Thanks in advance for any comments.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Or if it's PHP 5 they might be using an __autoload() magic function
which gets called whenever a class that isn't declared is instantiated.
That function could be require()ing another file.
Jasper
Chris wrote:
That isn't created by PHP, it must be declared in the code so
If you use PHP 5 just use the __toString() magic method which does
exactly that.
http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring
Jasper
Rory Browne wrote:
Um - did you read my last email regarding var_dump var_export and print_r
Did you try them?
Do they
Well if you're using 4.3.10 as you said in your other post then
__autoload is not supported anyway. A grep on autoload would've turned
it up.
I'm assuming you've tried a grep for "CFG" to find the declaration?
Jasper
wayne wrote:
Hi Jasper,
I thought abo
Jasper
Wong HoWang wrote:
as title, how to start a global variable within a function?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
on?
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ErrorDocument as specified in Apache's config.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
d doesn't exist in the DB, Apache
will not automatically display the ErrorDocument. So my suggestion is
simply to include() it in that case.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
specific question then post back to the list.
Oh, and a descriptive subject rather than "N/A" may help if you want
people to read your message.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
R. Ragunathan wrote:
can we implement lock to a table using postgres with php.
if any of u all knows the solution do reply back.
You may also want to look at the following URL:
http://www.postgresql.org/docs/8.0/interactive/explicit-locking.html
--
PHP General Mailing List (http://www.php.net
y be a PHP 5 feature?
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
If it's MySQL, then just do an SQL query with a WHERE
clause like this:
WHERE updated > DATE_SUB(NOW(), INTERVAL 1 YEAR)
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I couldn't care less
about what any other search engine (evil or not) does or sees.
robots.txt will not do what you want it to.
Just sniff for those robots' User-Agents (Google, MSN and Yahoo all
publish their UA strings on their websites, AFAIK) and send different
content if it
Jochem Maas wrote:
Jasper Bryant-Greene wrote:
robots.txt will not do what you want it to.
Just sniff for those robots' User-Agents (Google, MSN and Yahoo all
publish their UA strings on their websites, AFAIK) and send different
content if it's one of those.
they will hammer
nt to hide your content from the
major search engines, since they all use robots.txt
You misunderstand his original question. He wants to show different
content to search engines than to users. He understands this is a bad
thing to do, but just wants to know how to do it anyway.
Jasper
--
PHP
($this->CMS_base_path);
In other words, tell us what the $this->CMS_base_path field contains
when that line is executed.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
email
addresses at [1], or just Google for PHP email validation [2].
Jasper
[1] http://www.ietf.org/rfc.html
[2] http://www.google.com/search?q=php+email+validation
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
John Taylor-Johnston wrote:
Folks are complaining mail arrives and text will not wrap. $message
comes directly from a textarea. Old mail readers, I guess?
How can I make their life better and make the text wrap?
http://www.php.net/wordwrap
--
PHP General Mailing List (http://www.php.net/)
To
and the nested statement(s) are executed. If
it evaluates to FALSE, the execution of the loop ends."
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
$i is less
than 3.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[EMAIL PROTECTED] wrote:
Hello Jasper,
Does your means :
I need to rewite the source / result page as the following ?
[snip]
Yes.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
l for the job. Take a look at the iconv
extension[2].
Jasper
[1] http://www.php.net/utf8_encode
[2] http://www.php.net/iconv
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Dotan Cohen wrote:
And, the thing is, within this javascript_dump.php, HTTP_REFERER shows
nothing, because it gives you the referer of the html page (page1)
that contains this
tever is appropriate for your application) and which executes all
jobs in the table and removes them when complete.
That way you don't need to dynamically alter your crontab.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
#x27;s no real reason for doing this although it may be a hack because
some of the required files in that script may expect a $CFG object to exist.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
an explanation.
The post I just sent to the list regarding your earlier question
explains this. If you do not instantiate an object before using it, it
is automatically instantiated as an object of the stdClass class. You
can then add and read attributes, like an "array dressed up as
e+MTA+server
Now surely you could have managed that?
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
d have to be two NEWLINE characters... PHP eats (does not output) any
NEWLINE character immediately following a ?> closing PHP tag.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ng are in
your character set.
For example, I use UTF-8 for all output, and all the characters I ever
use are (of course) in the UTF-8 character set. Therefore I only need to
use htmlspecialchars() to turn characters that have special meaning in
HTML (&, ', ", <, >, etc.) into
unday') {
$dayInFuture = strtotime("+1 day", $dayInFuture);
}
Disclaimer: untested code.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
uploading bit, and perhaps a database abstraction layer such as PEAR's
DB package[3] for the MySQL bit.
Before I sit down and start coding this thing from scratch, does anyone
know if there is something similar out there already that could give me
a head start?
HTH
Jasper
Richard Lynch wrote:
On Fri, August 19, 2005 3:47 pm, Jasper Bryant-Greene wrote:
For CSV, it's as simple as explode() the data by "\n" (perhaps strip
out
any "\r" before you start) and then explode() by ",". Depending on the
software they're using, you
super-user-friendly and your users didn't necessarily know
how to use FTP).
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
n what you actually want to do:
colname<>''
colname<>0
colname IS NOT NULL
Or, if you're in MySQL >= 5.0.2 and are using true boolean values:
colname IS TRUE
or, if you just want to check if it's TRUE or UNKNOWN:
colname IS NO
Wong HoWang wrote:
Hello, I want to know that is there any way to create a super global in PHP?
Only with the runkit extension. Take a look:
http://www.php.net/runkit
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Kevin Waterson wrote:
This one time, at band camp, Jasper Bryant-Greene <[EMAIL PROTECTED]> wrote:
Wong HoWang wrote:
Hello, I want to know that is there any way to create a super global in PHP?
Only with the runkit extension. Take a look:
http://www.php.net/runkit
This is e
n, \r when you meant \\r, \t when you meant \\t, and so
on...
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Kevin Waterson wrote:
This one time, at band camp, Jasper Bryant-Greene <[EMAIL PROTECTED]> wrote:
Because he asked for superglobals, not globals. $GLOBALS (not $_GLOBALS)
meh, force of habit
happens to be an example of a superglobal.
and variable can be set within its scope,
#x27;ping -c 10 168.192.0.1', $nn);
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Juan Pablo Herrera wrote:
Thanks Jasper,
well, i need make a explode of results of the ping. The idea is check
a host and when the host don´ t response send a email.
I don't explode the result of the ping.
If it was me, I'd try opening a socket connection to the host instead,
and ch
e functions.
And please refrain from spamming the list with 4 almost-identical messages.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Lizet Pena de Sola wrote:
Hello all:
I need to test whether a library is installed with php or not. In this
case it's the tidy library I need for a project.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 21 Aug 2005, at 21:24, Jasper Bryant-Greene wrote:
As far as your database problem goes... Have you recently installed
MySQL 4.1 or has it previously been working with MySQL 4.1?
Alex Scott wrote:
I Installed it about a month ago (from RPM's) and php 4.4 as well
the two were wo
M. Sokolewicz wrote:
Jasper Bryant-Greene wrote:
Well, it's hard to say without a bit more detail. Are you able to give
us the actual error that PHP is giving on the database connected pages?
I assume you are using the mysqli functions rather than the mysql
functions to access
ent XMLRPC vulnerabilities affecting a large range of PHP
applications. IMHO the vulnerability is much more likely to be in an
application built in PHP than in PHP itself.
Do you run a firewall on your server? Which ports remain open?
Jasper
--
PHP General Mailing List (http://www.php.net/)
To u
look at any filesystem or shell calls you make and
ensure that all parameters that are sourced from user input are properly
checked to ensure that the user hasn't entered something they
shouldn't've. For example "../../../etc/passwd" to a file_get_contents()
call.
Jaspe
;);
imagejpeg($my_gd_image);
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
simple loop until EOF and using fread(). I haven't
tested that claim, so YMMV.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
might be called by the browser before the calling page has finished
loading (esp. with newer pipelining browsers), and therefore before the
session vars are saved...
You could try it, though. Any other ideas?
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http
same, or an equally long, list to the calling script in the URL...)
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
you assign the output of fread() to a variable and
then print it? Why not just:
print(fread($fd, 2048));
which would be faster because it doesn't need to assign to a variable,
wouldn't it? Maybe I'm missing something..
Jasper
--
PHP General Mailing List (http://www.php.net
ct
that the character following it happens to not make it a special character.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Richard Lynch wrote:
On Tue, August 23, 2005 12:48 am, Jasper Bryant-Greene wrote:
Kim Steinhaug (php list) wrote:
I'm using this method, works fine with 50mb+ files :
if( $fd = fopen ($filepath, 'r')){
while(!feof($fd)) {
$buffer = fread($fd, 2048);
filesystem encoding,
that on Mac OS X is Unicode, so I tryied this before:
$filename = utf8_encode($filename);
Wouldn't it be utf8_decode(), since you're trying to go *from* a Unicode
filesystem (Mac OS X)?
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, v
ou haven't
defined one, it will use the error handling methods set up in PHP
(log_errors or display_errors).
HTH
Jasper
[1] http://www.php.net/trigger_error
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
o you mean by domain in this example? You can include() or
require() the file with the function declaration in it...
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
e/xml?productID=54385 and returns some XML data for
that product.
Then call it from varupiraten.se and parse the XML.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
1); // Or whatever is acceptable for you
function float_equals($a, $b) {
return (abs($a - $b) <= MAX_FLOAT_DELTA);
}
Then use float_equals($x, $y) instead of $x == $y.
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
as a last resort use addslashes().
Jasper
[1] http://www.php.net/mysql_real_escape_string
[2] http://www.php.net/docs.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
George B wrote:
Jasper Bryant-Greene wrote:
George B wrote:
I made a script that posts data into a database but it has a problem
whenever I enter a ' or a ". How do I bypass this problem?
If it is MySQL, use mysql_real_escape_string() [1]. If any other
database, have a look
y in the first place.
Then you can do things like:
mysql_query("INSERT INTO table (col) VALUES ('{$_SAFE_POST['val']}')");
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Robert Cummings wrote:
On Wed, 2005-08-24 at 23:12, Jasper Bryant-Greene wrote:
Graham Anderson wrote:
Is there a way to loop thru all of these GET requests by:
putting the GET variables into an array
processing the variable strings with trim/striptags/etc in a loop
exploding the variables
Burhan Khalid wrote:
Jasper Bryant-Greene wrote:
Robert Cummings wrote:
[snip]
Still need to check isset() status unless you've disabled E_NOTICE which
I don't advise since it's sloppy ;)
Yeah, I usually would in a real script. Just slipped my mind when
writing that exam
->AddAttachment($_FILES['userfile']);
(square brackets, as $_FILES is an array, not a function)
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
101 - 200 of 408 matches
Mail list logo