why don't you just echo your $query to see if it is coming out
correctly, before even trying to mess with mysql_query()? I think you
should be able to see the problem from there.
Jordan
On Oct 24, 2005, at 12:44 PM, Mário Gamito wrote:
Hi,
Make this line instead
$result = mysql_quer
I agree with John. It looks like you either need a hammer or the
rooftop of a 5-story building...
Jordan
On Oct 21, 2005, at 3:26 PM, Jay Blanchard wrote:
[snip]
I just noticed that extension_dir in phpinfo is c:\php4 THAT AIN'T
RIGHT!
Why is PHP not loading the proper ini file? This is
Also, look at this function:
http://www.php.net/ctype_digit
Jordan
On Oct 21, 2005, at 2:39 PM, Chris Knipe wrote:
Hi,
Uhm... Let's take the below quickly:
Function DoSomething($Blah) {
$Blah = (int) $Blah;
return $Blah
}
$Blah, cannot be larger than 2147483647, and sometimes, I get ne
Hello,
you could treat your variable as a string, and use the is_numeric()
function (but this will include floats, too). To answer your question
precisely and accurately, you may have to do regex matching since you
are out of the bounds of int.
However, why, *exactly*, are you trying to c
rote it as an example :)).
1MB is more than enough as a buffer. If you have a 53MB file,
what will happen then ?
I have no idea if it's a bug or a feature. Either way I did lose
some hair over this when I switched from PHP4 to PHP5.
Catalin
Jordan Miller wrote:
Catalin,
Wow, tha
Zandstra's "PHP 5 objects patterns practice" has been getting
excellent reviews. i also recommend it.
http://www.amazon.com/gp/product/1590593804/
On Oct 18, 2005, at 1:43 PM, Alan Lord wrote:
Hi all,
Forgive this long diatribe, a bit off-topic I know, but it might
stimulate a good disc
3742
Topics (messages 224207 through 224218):
Funky array question
224207 by: Brian Dunning
224209 by: Minuk Choi
224210 by: Jordan Miller
224211 by: Jordan Miller
224212 by: Jordan Miller
Re: editor
224208 by: yangshiqi1089
a couple of problems with PHP form
22421
one more thing... if you have php <5 and >= 3.0.6, you could use
stristr for case insensitive comparison without having to deal with
the slower and more cumbersome regex.
On Oct 16, 2005, at 11:18 PM, Minuk Choi wrote:
Assuming that you are also accepting partial matches... (e.g. if
you
sorry, I am mistaken here. I forgot that "!==" is the same
functionality as a "===", in that the comparison is made by value
*and* type.
On Oct 16, 2005, at 11:26 PM, Jordan Miller wrote:
Also, note the warning on the man page. you would want to use a
triple eq
Hello,
what have you been trying for comparison so far that has not been
working?
if you have php 5, you would want to use stripos, which is case-
INsensitive, not strpos, which is the opposite.
Also, note the warning on the man page. you would want to use a
triple equals sign "!===false"
javascript is a client-side language, while php is a server-side
language... the value you are passing to $width only exists on the
client side, therefore the php server-side boolean fails.
i think you will have to pass the client-side calculated variable of
screen.width to the php server b
to get rid of potential double spaces after the explode, you could do:
foreach ($words as $word) {
if (!empty($word)) {
$first = $word;
break;
}
}
echo $first;
This will always return the first word.
Jordan
On Sep 20, 2005, at 7:24 AM, Jochem Maas wrote:
how much eas
That is very interesting, thank you. We cannot escape politics, eh?
Jordan
On Sep 19, 2005, at 9:32 AM, Jochem Maas wrote:
Jordan Miller wrote:
On Sep 19, 2005, at 8:31 AM, Jochem Maas wrote:
e.g:
$var = array_pop( explode('-', '1-2-3-4-5') );
.. is bad code (read
On Sep 19, 2005, at 8:31 AM, Jochem Maas wrote:
e.g:
$var = array_pop( explode('-', '1-2-3-4-5') );
.. is bad code (read the manual page for array_pop very carefully)
and would work
in older versions but the engine has been tightened up to disallow
such fauxpas.
Jochem,
Whoa... what
Hey Ken,
The variable you want is already a superglobal known as $_SERVER
['SCRIPT_FILENAME']. See:
http://www.php.net/reserved.variables
Do something like this to get started:
echo $_SERVER['SCRIPT_FILENAME'];
Good luck.
Jordan
On Sep 18, 2005, at 4:58 PM, Ken Tozier wrote:
I'm working
What do you mean? What's wrong with top posting? ;)
Jordan
On Sep 16, 2005, at 11:31 AM, John Nichel wrote:
bruce wrote:
hi..
looking for a good/working/tested php email validation regex that
conforms
to the rfc2822 standard.
a lot of what i've seen from google breaks, or doesn't follow
do you have log files? the page you linked to was generated by
webalizer. is there a reason you can't use that (or Awstats, or
something similar)? you probably don't need to reinvent the wheel
here... though you may need to tweak your webserver to put more
information in the log files so yo
the syntax for variable variables is:
$variable= $$add;
or alternatively:
$variable= ${$add};
Jordan
On Sep 14, 2005, at 2:25 PM, Ross wrote:
$variable= "$".$add;
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
php's
autotyping is so great anyway).
Jordan
On Sep 14, 2005, at 10:54 AM, John Nichel wrote:
Jordan Miller wrote:
you need single quotes around $subnum in the sql statement. don't
know why you seem to be arbitrarily leaving them off (put them
around $uv and $dur
#x27;$comment')");
if(!$res){
echo "insert failed";
}
}
the values of array ($subnum)are not inserted , can you tell me
where the problem is.
Jordan Miller <[EMAIL PROTECTED]> wrote:
I think I finally understand what you are trying to do. I don'
if people are allowed to post copyrighted images to your bulletin
board, shouldn't you have some sort of password protection anyway?
negating that, i would do it with PHP and not Apache. rather than
simply serving up the file raw:
why not setup a php script to do URL referring blocking:
I think I finally understand what you are trying to do. I don't see
any reason why you need to use the token functions, and I would
recommend using array functions instead (also, it is exceedingly easy
to sort the elements of an array... see the end).
I believe this will do what you are try
please provide code and an example output, and say how this is
different than you would like. what you describe is unclear.
Jordan
On Sep 13, 2005, at 4:04 PM, matt VanDeWalle wrote:
hello,
I have a simple question, not really a problem this time.
I know that the function print_r() will p
you need to do it like this:
Order Allow,Deny
Allow from all
Deny from 85.65.154
http://httpd.apache.org/docs/1.3/mod/mod_access.html
Jordan
On Sep 13, 2005, at 2:30 PM, David Pollack wrote:
Hello,
I have a problem where someone is illegally linking to my site.
There site is in an
besides sprintf, number_format will also do it:
number_format(6, 1, ',', '');// Outputs '6,0'
Jordan
On Sep 12, 2005, at 3:52 AM, Gustav Wiberg wrote:
Hi there!
I want to adjust the round() -function a little...
If I put round(6,0) there will be an output of 6
If I put round(6,32) th
Here is a thorough review on the Zandstra book:
http://books.slashdot.org/article.pl?sid=05/08/16/0434205&tid=169&tid=6
Jordan
On Sep 9, 2005, at 6:39 PM, Jason Coffin wrote:
On 9/9/05, Vinayakam Murugan <[EMAIL PROTECTED]> wrote:
I am learning about Object Oriented Programming with PHP. Ca
we *just* had a post similar to this. It's easy, just use the date()
and strtotime() functions:
$timestamp = '2004-05-14 13:24:48';
$RFC_formatted = date('r', strtotime($timestamp));
done!
Jordan
On Sep 10, 2005, at 11:14 AM, Brian Dunning wrote:
I get my timestamp from the db in this form
methinks you should convert the datetime to a unix timestamp with
strtotime(). then you can compare the difference between this
timestamp and a unix timestamp of "now" to find if you have logged in
within a min. of the previous time. Then, once you know what text to
display (e.g. "Less than
like and expect. Another benefit is that this is
more secure than relying on a cookie-supplied expiration time.
Jordan
On Sep 6, 2005, at 8:51 PM, Dan Rossi wrote:
client cookie expires hence no more session ...
On 07/09/2005, at 1:57 AM, Jordan Miller wrote:
Hi Dan,
Couldn't
writing a parse script is okay, but it will be very difficult to
always ensure they are inputting it correctly. I recommend putting a
popup calendar next to the input field. If the field is automatically
populated in this way you will have a much easier time parsing it
correctly. I can't re
== $arr2['id']) {
$_SESSION['arr1'][$key]['selected'] = true;
}
} }
Jordan
On Sep 7, 2005, at 12:22 PM, Jordan Miller wrote:
foreach ($_SESSION['arr1'] as $arr1) {
foreach ($_SESSION['arr2'] as $arr2) {
if ($arr1[&
Hello,
You simply need the $key variable, then you can set a new value for
$arr[$key] for each array element:
$value) {
$arr[$key] = $value * 2;
}
// $arr is now array(2, 4, 6, 8)
?>
http://www.php.net/foreach
If you have PHP 5, you can perhaps more efficiently do this:
As of PHP 5, yo
Hi Dan,
Couldn't you store an expiration time directly in the $_SESSION
variable, rather than relying on cookie expiration (if I understand
your question correctly)? Each time a page is loaded, update the
expiration time in this variable to +24hr from the current time (all
times relati
If you are using php 5, don't forget about str_split, with 4 as the
second parameter.
http://us2.php.net/str_split
so you could do:
echo implode("", str_split($string, 4));
if you still have php 4 or earlier, look at that page anyway as there
is a workaround function in the comments for ear
http://us3.php.net/manual/en/ini.core.php#ini.precision
precision sets the number of significant digits, *NOT* the number of
digits displayed after the decimal point.
If you want to get pi out to 16 decimal places you need a precision
of *17* because the beginning 3 is a significant digit.
why not rewrite it to be more concise... i can't see a problem at the
moment. are you sure you can do a "<" comparison operator on the
'12:00' and '2005-10-02' string?? Maybe if you are using 24 hr format
you could just get rid of the ":" on both sides of the operator to
have the "<" proper
Oh wait... you are not specifying your $_POST variable. you need to
use the key for $_POST. just do a print_r($_POST) to find the key
from the $_POST array that you are looking for. also, i would not
pass a $_POST variable directly to your shell without escaping it
somehow, first...
forea
>'s "recently viewed pages" is
another good example (though probably patented ;))
What are these kind of breadcrumbs called and which classes would you
recommend using to implement them?
Thx,
- Greg
On 8/30/05, Jordan Miller <[EMAIL PROTECTED]> wrote:
They are call
They are called breadcrumbs:
http://www.google.com/search?q=php+breadcrumbs
Jordan
On Aug 30, 2005, at 4:57 AM, areguera wrote:
Hi,
I been wondering the best way to make the level browsing, I mean,
those links up in page which tell you the position you are, and make
you able to return secti
you need to provide more information. we cannot tell what you are
doing. you should:
**PASTE THE RELEVANT SECTION OF YOUR CODE IN YOUR EMAIL**
On Aug 25, 2005, at 2:38 PM, George B wrote:
Łukasz 'nostra' Wojciechowski wrote:
W odpowiedzi na maila (21:21 - 25 sierpnia 2005):
I have wri
if you are using mysql, just put the "DESC" (descending) directive at
the end of your sql statement (default is no "DESC" directive,
meaning ascending). most recent records will be returned first.
Jordan
On Aug 25, 2005, at 2:21 PM, George B wrote:
I have written a shoutbox, and it works g
Good to know about expression evaluation. Writing the expression(s)
like that (left-to-right and right-to-left) solves my dilemma... thanks!
Jordan
On Aug 25, 2005, at 2:44 AM, Richard Lynch wrote:
I personally would use:
((2 < $x) && ($x <= 4))
--
PHP General Mailing List (http://www.
General question,
Is there a technical reason why PHP does not allow comparison
operator expressions like the following:
if (2 < $x <= 4) {}
I prefer this concise way as it is common for mathematics
expressions, and much easier to grasp physically on first glance.
From what I can tell,
Yes, simplexml can do this easily. See:
http://www.php.net/simplexml
Example 7. Setting values
Data in SimpleXML doesn't have to be constant. The object allows
for manipulation of all of its elements.
movie[0]->characters->character[0]->name = 'Miss Coder';
echo $xml->asXML();
?>
The abov
Did you try html_entity_decode?
http://us2.php.net/html_entity_decode
You may want to combine this with mysql_real_escape_string()...?
Jordan
On Aug 22, 2005, at 8:29 AM, Jay Paulson wrote:
I have a problem that I'm sure some of you have run into before,
therefore I hope you all know of an
I agree, you must be careful of SQL injection... use
mysql_real_escape_string().
To chop off the last character of text use substr():
$sqlstruct = substr($sqlstruct, 0, -1);
Jordan
http://www.php.net/substr
Example 3. Using a negative length
On Aug 20, 2005, at 4:55 PM, Greg Donald wro
Yo,
All you need is the mktime() command.
do something like:
$futureDate = date("Y-m-d", mktime(0, 0, 0, $month, $today+
$daysToAdd, $year));
Jordan
http://www.php.net/mktime
mktime() is useful for doing date arithmetic and validation, as it
will automatically calculate the correct value
besides just escaping your strings, i think you are having a quoting
error:
http://www.php.net/manual/en/language.types.string.php
Commas should not have to be escaped, and indeed the
mysql_real_escape_string() function will not escape commas. After
escaping your input data with this functi
Pardon me, but I don't think he is trying to send an HTML email. I
believe he is just asking about making a simple webpage. Relative
URLs should be fine and are often preferable for portability.
Jordan
On Aug 17, 2005, at 7:34 PM, Manuel Lemos wrote:
Hello,
on 08/17/2005 07:42 PM Jake Sa
Hi Jake,
You don't have to do anything special, you just have to have
standards compliant HTML output.
What is the HTML for the IMG tag output to the browser (i.e. go to
the web browser, load the page in question, find the img tag, and
send us this text). I think maybe your images are jus
w is this done?
test form is on http://www.passeycorp.com/event_reg.php check it
out and I
think you'll
see what I mean.
The suggestions and help are greatly appreciated.
Ted
- Original Message -
From: "Jordan Miller" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]&g
Sorry, I believe you are mistaken here... you *can* specify a value
for each checkbox and have it come through. I have written scripts
that do this, and here is another example:
http://www.tizag.com/phpT/examples/formex.php/
all zedleon needs to do is add the correct value parameter to each
wherever you think you are adding data to the gmev array, you are
merely adding the "on" string. I would search your script for the
string "on" and you will find the problem.
what you need is the value in the HTML form to be the text you want
inserted into the array, such as:
Jordan
On
Did you install sendmail?
http://www.php.net/mail
Requirements
For the Mail functions to be available, PHP must have access to the
sendmail binary on your system during compile time. If you use
another mail program, such as qmail or postfix, be sure to use the
appropriate sendmail wrapp
nough as a buffer. If you have a 53MB file,
what will happen then ?
I have no idea if it's a bug or a feature. Either way I did lose
some hair over this when I switched from PHP4 to PHP5.
Catalin
Jordan Miller wrote:
Catalin,
Wow, that worked great, thanks.
I'm curious why you se
will happen then ?
I have no idea if it's a bug or a feature. Either way I did lose
some hair over this when I switched from PHP4 to PHP5.
Catalin
Jordan Miller wrote:
Catalin,
Wow, that worked great, thanks.
I'm curious why you set a static buffer of 1024768... why not just
do
you use the unset() function:
unset($array[$key]); // http://www.php.net/unset
you can reindex the keys if they are numeric with:
$reindexedArray = array_values($array); // http://www.php.net/
array_values
Jordan
On Aug 17, 2005, at 1:12 PM, Tomás Rodriguez Orta wrote:
Hi people.
How Ca
apparently the ampersand means to treat $link as a reference, not as
an optional argument:
http://www.softwareprojects.org/php-functions-12.htm
I think the way to do it would be to set a default value in your
function so that if a value is set by the calling statement that
would override it
bytes.
You have to work around that with:
$fp = fopen($file, 'r');
if($fp) {
while(!feof($fp)) {
echo fread($fp, 1024768);//see the huge buffer to read into
}
} else {
//whatever error handler
}
Catalin
Jordan Miller wrote:
Hello all,
I
Hello all,
I am new to this list and I have searched the archives to no avail. I
am having a peculiar problem when upgrading to PHP 5: My downloads
are now limited to the first 1.9 MB of the file in question, with the
download either terminating at 1.9 MB or seemingly continuously stuck
i
60 matches
Mail list logo