You're outputting a blank PNG image, in binary form. In order to
display it (not that you'd see anything since it's blank), you need to
output a Content-Type header first, like so:
header(Content-Type: image/png);
THis will instruct the browser to treat the incoming data as image data.
HTH.
Of course, you could do it in a much more cryptic way... just for fun.
:-)
INPUT:
?php
$a = array( '0' = 'j',
'fname' = 'j',
'1' = 'j',
'lname' = 'j',
'2' = 'jj',
'state' = '',
'3' = '[EMAIL PROTECTED]',
Hey, look... yours IS bigger than mine. :-)
Seriously, though, I think it's safe to say that your mileage may
vary. It certainly doesn't take 2 minutes to compile and install all
of the dependencies along with PHP. It also doesn't take me 6 minutes
to restart my version of Windows (2
Chris Shiflett wrote:
There has been research to support that Linux is attacked more than three times
as much as Windows (http://www.internetnews.com/dev-news/article.php/3076701).
This makes sense, too, because Linux is more likely to be protecting important
data. The argument that those who
Binary search. I'd say I have too much time on my hands, but I don't.
?php
$eggs = array(1,1,1,1,1,2,1,1,1,1,1,1);
$eggs1_6 = array_slice($eggs, 0, 6);
$eggs7_12 = array_slice($eggs, 6, 6);
if (array_sum($eggs1_6) array_sum($eggs7_12))
$half_eggs = $eggs1_6;
else
$half_eggs =
You have two solutions, one of which is better.
A. Fix the problem, and define your indexes.
B. Set error_reporting = E_ALL ~E_NOTICE
I'd strongly recommend doing A before B, as PHP doesn't carp for the
sake of carping.
fatih olcer wrote:
how to disable notice error output
i have set
Cuz the the way the PHP parser is written makes it impossible to
discover the error before it gets to the end of the file, and realizes
that there are no more braces to go around.
It definitely sucks... almost as badly as a stray backtick. Try finding
that little bugger at 1600x1280...
Check out http://php.net/session_set_save_handler, and save your session
data in a database, or leave it as is and access the session file directly.
Here's an example of sharing php sessions with perl... it may provide
some ideas.
My personal favourite is to logically separate actions and views, which
is very easy to do and is virtually foolproof.
This way a user submits a form to a page that outputs nothing. This
page does its work, then redirects to another page which only shows
data. This is invisible to the user,
Why not use a wysiwyg edit box? There are quite a few of them... unless
you don't want to restrict your users too much.
http://www.labs4.com/htmleditbox/2.0/demo.php
Mark wrote, On 2003/Jul/30 11:11 AM:
But isn't this just defining your own version of something like
bbcode? And wouldn't you be
THese are very different things, generally. The first join is an INNER
join. It pulls all records that have the matching ids. The left join
is an OUTER join. It pulls ALL records from table1, and any matching
records from table2. This is useful if you want customer and address
info, but
Sorry to be a stickler... but _technically_ the backtick is shorthand
for shell_exec(). exec and passthru are a little different.
Mike Migurski wrote, On 2003/Jul/25 11:12 AM:
Thanks for the replies guys but the main reason I'm doing this is
because most times I don't have access to the
John,
I'm not sure if you've noticed, but pretty much every question you've
asked on this list of late has received at least one comment about
finding the appropriate resource. If I were in your situation, I'd
start to see a theme.
The PHP General mailing list is for questions about
From a class I wrote...
-- snip --
// hack to work around the inability to use a method as
// a callback for the set_error_handler function
// NOTE: if you forget the '', then all of the settings
// to class properties will be lost
check phpinfo()... it lists the colors that
highlight_file()/show_source() uses.
Better yet, here's the values:
highlight.bg#FF #FF
highlight.comment #FF9900 #FF9900
highlight.default #CC #CC
highlight.html #00 #00
highlight.keyword
This xml+html+xslt paradigm provides great separation, especially when
viewed in light of the traditional xslt=html+code method. I've used it
with good success.
http://www.xml.com/pub/a/2000/07/26/xslt/xsltstyle.html
HTH.
Pete.
--
Pusher
http://www.shaman.ca/pusher
A news aggregator with
IMO, Smarty is just an abstraction of PHP. Smarty templates are HTML
templates, but they still contain their own application logic for
looping, etc, and so are still not a real separation (or are *dirty*, as
'rush' calls it).
XML+HTML+XSLT (or Template Tamer from what I can gather) take it
Also, take a look at isset() and empty()
http://php.net/empty
http://php.net/isset
Jennifer Goodie wrote:
so change it to
-Original Message-
From: Tim Haskins [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 12:12 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] if statment
My bad, I
Some of you may like to stay on top of the PHP world (as well as
countless other worlds) without having to do too much work. To you I
would suggest checking out
http://www.shaman.ca/pusher/
There are a number of news feeds here from various PHP sites.
Cheers,
Pete.
--
PHP General Mailing
Right now the value is in the service, not the code. I use it to keep
up on PHP developments. Some of the already available feeds are blogs
highlighting what high profile people in the PHP community (people like
Sterling Hughes, Zak Greant, etc) are working on. Others are from web
sites
Agreed. Now it allows searching and browsing without sign-up.
Thanks,
Pete
Manuel Lemos wrote:
Hello,
On 03/29/2003 01:22 AM, Pete James wrote:
Some of you may like to stay on top of the PHP world (as well as
countless other worlds) without having to do too much work. To you I
would suggest
If your session id is not stored in a cookie (if url rewriting is on),
then the $url page may not be getting your session id, and thus is
starting a new, empty one?
Tony Bibbs wrote:
I'm wrapping up an MVC implementation for PHP. Everything is working
splendidly except that redirects seem to
It really depends on what you what to do with the data.
For instance, if you want to insert into a database, you'll want to run
addslashes() on it, or some other such quoting.
If you wnat to use the data as a forum post or comment, etc, you'll want
to strip the html out of it with strip_tags()
Could you use a function like strtotime()?
freaky deaky wrote:
this question is not strictly php related, but i thought possibly someone on
this list might have dealt with this type of problem before.
i am exporting a database out of filemakerpro 5 as a comma delimited file, and
importing
It is sent twice a day and contains all of the messages sent during that
period. It's so that you don't get 200+ messages a day in your inbox.
Tom Sommer wrote:
What does the mailing list digest contain, compared to a normal
subscription? What is the difference?
--
PHP General Mailing List
Steve and Niels,
I personally don't think that this sort of garbage has any place on this
list. The PHP lists are for the promotion and assistance of the PHP
community. In our small ways, we are all ambassadors for PHP and should
behave as professionals. Having sexist and inappropriate
Steve Keller wrote:
Sexist and inappropriate? You would be offended because I insulted geeks?
Actually, it was not so much your comment that offended me, but the fact
that you chose to reprint his.
If I was a female coder, I would take great offense to these
comments... but maybe that's just
The tokenizer that Erik was referring to is actually a PHP lexer, not a
general tokenizer. Perhaps you would be looking for the strtok() function?
www.php.net/strtok
Brad Wright wrote:
Erik,
thanks, are you able to pint me to some good reference sources on
tokenizer's... i have never come
Try zero seconds?
Poon, Kelvin (Infomart) wrote:
Hi,
I know this topic was discussed but I deleted my previous mail so I can't go
back and review them. My question is, is there a faster way to redirect
html pages other than just using meta HTTP-EQUIV=REFRESH CONTENT=1;
URL=login.php ? Is
header(), session_start(), etc. can go anywhere in a page (after any
content) as long as you start the page using output buffering
(ob_start()). Example (bad example) follows:
?php
ob_start()
print this;
print that;
if ($forgot)
{
// oops need to redirect
header('Location: foo.php');
}
Only that you can embed vars in the second one.
if $foo='bar';
include('somefile_{$foo}');
will include the file 'somefile{$foo}', where
include(somefile_{$foo});
will include the file 'somefile_bar'
HTH.
Charles Kline wrote:
What is the difference as in... why one or the other?
Is your form enctype set?
Like so:
form name='foo' method='post' action='foo.php'
enctype='multipart/form-data'
Liam Gibbs wrote:
This line:
INPUT TYPE = FILE NAME = imprintpicture SIZE = 22
when clicking submit, produces nothing. I print_r $_FILES[imprintpicture], I try to echo
This was answered just this morning. Please do some research before
asking questions.
-- the answer from this morning
I just tried putting PHP and Microsoft Access into Google. The first
item has the text This code is useful for those who want to use a
*Microsoft*
*Access* database with a
You need to start the session at the beginning of the script, or use
output buffering.
Either:
?php
session_start();
require(...
...
or
?php
ob_start();
require(...
...
You're trying to output stuff to the screen (which implicitly sends the
headers) then trying to send more headers by calling
You could use output buffering to do the rewriting for you.
IF you use ob_start('my_function'); at the top of your page, where
my_function is the name of a callback function
This function might look like this:
function my_function($buffer)
{
return $buffer . '?x=fooy=bar';
}
That's
The method I use is to take their user_id or email and create an HMAC
(hashed message authentication code) by hashing it with a secret key on
my end. This way the activation link looks like the following:
http://mysite.com/activation.php?user_id=petejID=ghjghjg367ghjlkj9hjlkj
THe activation
Try is_numeric()?
Boaz Yahav wrote:
Maybe this can help
Check int / integer - checking if a variable is an integer or not. The
php is_int() function does not check if the string value is integer or
not.
http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1705
How to check
Although I don't know how to do this myself, one of the places I've seen
it done is in JpGraph (www.aditus.nu).
The function that does it is AdjBackgroundImage($bright, $contrast,
$saturation) in jpgraph.php. You could try taking a look at the source?
Pete.
Dimitar Haralanov wrote:
Wondering if any of the gurus out there have any insight...
I'm running a set of php scripts using nested output buffering +
sessions and I'm getting sporadic seg faults. If I turn off output
buffering it seems to work fine, which would be great if I didn't need
it.
I'd post code, but there's
?php
if(!isset($PHP_AUTH_USER) || (isset($logout))) {
header(WWW-Authenticate: Basic realm=\Your Realm\);
header(HTTP/1.0 401 Unauthorized);
echo Your custom 401 message here\n;
exit;
} else {
echo pHello $PHP_AUTH_USER./p;
echo pYour password is $PHP_AUTH_PW./p;
Don't redirect, use curl to post your data to the new page.
Francis wrote:
I'm trying to redirect to another website but doing a post to that website
at the same time. (ie POST rather than a GET (eg: header(Location:
www.anothersite.com/index.php?page=22); )
How do you do an HTML post
, its gonna be quite simple but
whats the syntax? there must be a way to do it...
Pete James [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Don't redirect, use curl to post your data to the new page.
Francis wrote:
I'm trying to
Evan Nemerson wrote:
If you need register globals on for your old stuff, but want to write better
new code, you can just use ?php ini_set(register_globals, 0); ? in your new
stuff.
You can't do this in a php file... by the time it gets to this line,
it's too late.
According to the set_ini
Is there any problem with leaving out the last else and just ending it with
an elseif such as ...
if($a == '1'){
echo '1';
} elseif ($a == '2'){
echo '2';
}
Nothing syntactically, but surely you wouldn't want a rogue '3' or '0'
to fall through the cracks... that wouldn't be very good,
You could also try using Javascript to popup a window when they close
the current one, and reset your cookies (and/or destroy your session) in
that window.
Pete.
Kevin Stone wrote:
Okay sorry for the misunderstanding. You can set the lifetime of the cookie
to die when the browser window
I also would like to hear the answer to this... I try
set_time_limit(3600), but my script still appears to time out early
Jay Blanchard wrote:
Good afternoon,
We have some cases where we run PHP as a standalone executable for scripting
certain processes that can be called from CRON, and
From the php.net manual for pg_fetch_array:
Note: From 4.1.0, row became optional. Calling pg_fetch_array() will
increment internal row counter by 1.
Ilia A. wrote:
On July 5, 2002 07:54 pm, Pete James wrote:
Ilia A. wrote:
The biggest annoyance I've come across is
the fact
Tom Rogers wrote:
Hi
get data is insecure by nature so the whole page is insecure and no
warnings, as soon as you post you invoke the security. You probably have a
url on your page that is coming from an insecure server (http:// instead
of https://)
Tom
Believe me when I say that there
more specific? What fields... from a database?
[EMAIL PROTECTED] wrote:
Hey everyone,
Am working late as usual before the weekend and so I fear i'm a bit braindead!
Anyway,heres my problem
I have fields named total and avg and no idea how many records
how do I get the total and
Thank you, Richard. I think I understand now... I experienced this HTML
behavior when trying to debug this problem, but figured it had little
to do with the problem. HTML coming up in that page (even the pdf, as
garble) was not producing a warning... Now I understand.
One last question,
This is a strange one...
h1test/h1
form action=https://my.server/reports.php; method=post
target=_blank
input type=text value='1' name=pdf_client_num
input type=text value='q1_2002' name=pdf_time_period
input type=text value='reports' name=task
input type=text value='pdf' name=report_type
input
51 matches
Mail list logo