logs archiveIRC Archive / Freenode / #php / 2006 / February / 18 / 1
Aldi
stormchase: thanks as well
A_Jelly_Donut
$result is never defined.
kog
yes it is
CWhiz
A_Jelly_Donut: $result is defined on 43.
kog
$result might be an array instead of an object
A_Jelly_Donut
(Action) eats A_Jelly_Donut
cheater
however, i have two problems. first off, apache's .var files don't seem to work at all for me - for example, opening the stuff.html.var file works but if i request stuff.html it's "not found"
Aldi
kog: no, there is just one line in this table
kog
A_Jelly_Donut: cannibal.
Aldi: and?
         

CWhiz
Aldi: Also, the way you're doing that is unsafe. Lookup "variable binding" in the ADOdb manual.
cheater
second off, if i do stuff.php.var?x=y it doesn't see the GET variable
CWhiz
Aldi: It's much easier and significantly more secure.
Kaitlyn
I have the following: preg_replace('/field\[(.*?)\]/', '(v.FieldId=$1 AND v.Value', $filter); is there anyway to change the v.FieldId replacement part with a v(ctr).FieldId... so each replace would get v0, v1, v2... ? putting ctr++ there marks all as 0's...
mfonda
better yet, use something decent like MDB2 :)
Aldi
thanks, cwhiz
A_Jelly_Donut
kog: yes, and it is good.
chris12349
can anyone point me in the right direction on how to send an email without it getting rejected as spam?
CWhiz
chris12349: That's really not a PHP-related question.
chris12349: Search Google or Yahoo!, please.
chris12349
CWhiz: would that be more sendmail?
CWhiz
chris12349: E-mail in general.
chris12349
CWhiz: I was thinking it was something in the script maybe a header
CWhiz: alright thanks
CWhiz
chris12349: Good luck.
A_Jelly_Donut
OS7 for me
oops, wrong tab
Stormchaser
lol
cheater
guys, anyone? :)
webteeth
Would someone here be able to help me with a php issue I'm having?
A_Jelly_Donut
the variable should be $_GET['x], is that what you're trying cheater?
zircu
webteeth: mabey, there is only one way to find out
heh.. now I see how TML was getting sick of that quit message
Stormchaser
cheater: Um... why do you use .var files anyways?
         

A_Jelly_Donut
webteeth, don't ask to ask, just ask :P
cheater
A_Jelly_Donut yes
Stormchaser: how would you do that?
Stormchaser
file.php?blah=x
cheater
A_Jelly_Donut: i do know how to use GET vars. it's just that they're not seen when i do that through a var file.
Stormchaser: i'm using a var file for automatic content negotiation (so, multiple language versions of the same file, automatically selected by apache)
Stormchaser
cheater: Why don't you use gettext for your translations?
cheater
gettext?
Stormchaser
yes, gettext
cheater
could you elaborate on that?
zircu
_('My Text');
Stormchaser
php./net/gettext
zircu
cheater: php.net/gettext
firedemon
lol
Stormchaser
s/\///
cheater
i think gettext is for something else.
Stormchaser
like?
cheater
i have the same files in multiple languages
file, rather
Brice
This may be better for #mysql, but perhaps you guys could help: I parse a mysql dump file to create initial database schema as part of a webapp install process. Some users are complaining that it results in a MySQL syntax error.. and I'm unable to repeat it. Perhaps it's my parsing code or the query? I've posted an offending query + a users error msg to http://pastebin.com/560245
cheater
gettext seems it
err
Stormchaser
cheater: You could also check the browser's default language and include the language files accordingly...
Aldi
:-) It's working now, sql statement was wrong. Thanks so far. Now what's the deal with variable binding?
cheater
Stormchaser: how would i do that?
Stormchaser
cheater: By checking, where the browser language lies in $_SERVER, and use that
cheater
Stormchaser: as far as i know, http request headers can specify multiple languages
mfonda
how is gettext allowed in php, just wondering?
CWhiz
Aldi: Anytime you build a query (or doing a lot of other things) from unchecked user input, you're opening yourself up to being hacked. You should validate your variables to make sure they make sense, and then use variable binding to execute the queries.
zircu
cheater: yes, and you should use the first one that the browswer sends
cheater
is gettext a unix-only thing anyways?
mareks
hello guys
Stormchaser
cheater: Indeed so... But explode on ; and grab the first one.
cheater
zircu: ah.
zircu
that you support
MID-Cloud
__FILE__ returns the full path, is it possible to extract just the filename?
cheater
grabbing the first one isn't good.
Stormchaser
MID-Cloud: basename()
mfonda
MID-Cloud, sure, read manual, basename() :)
cheater
it might be es, fr, de and i only have en and de, with en being default. so grabbing the first one isn't good.
Stormchaser
cheater: And why not? That's what Apache does,
MID-Cloud
thankyou :)
Stormchaser
s/,/.
mareks
mfonda: finding a function isnt always that easy
zircu
grap the first one you support, there is also priority flags within that list as well
cheater
no, apache has a more sophisticated algorithm. read up in the manual.
mfonda
mareks, ?
Aldi
Chwiz: ist there some skript which checks for user inputs? For example that no one enters "; delete from table users; commit" or something?
mareks
mfonda: and not everyone always has the time to read the whole thing...
cheater
zircu: yeah
zircu: is there really no way just to make php work with .var?
CWhiz
Aldi: There's plenty, and you can also use common sense. For example, do you know of any phone numbers with a " in them?
Charbal
cheater: You might be able to fake it out with virtual().
Jymmm
CWhiz "1-900-FREE-SEX"
CWhiz "1-900-FREE-SEX", only $29.95/minute
Aldi
jymm: lol
CWhiz
Jymmm: I said "in," not "around," but your contribution to the channel is appreciated nonetheless.
nforbes
No it's not.
Jymmm
CWhiz 1-900-"FREE-SEX", only $29.95/minute
rixth
What causes PHP error line numbers not to match up?
nforbes
rixth: The PHP parser sucking
cheater
Charbal,
sorry bad keyboard
zircu
cheater: .var is an apache thing you might be able to get apache to make apache recognise those files as php scripts, but that is way beyond topic here
rixth
Undefined variable: adHtml on line 42. The actual error is on line 40.
cheater
Charbal, "virtual"?
Stormchaser
php.net/virtual
Charbal
cheater: The PHP function virtual(). Performs an Apache sub-request.
CWhiz
rixth: Sometimes PHP can't detect the error right away, because it doesn't have all the necessary information yet.
rixth
Ah okay
webteeth
zircu: PM
CWhiz
Aldi: Here's the part of the manual on variable binding -http://phplens.com/lens/adodb/docs-adodb.htm#execute
Aldi
cwhiz: thanx so far!! You don't have a link fpr me for such a user-input-checking function, don't you? :-)
CWhiz
Aldi: The question mark sample is the one you want.
Aldi: I don't know of any validation library link off the top of my head.
Aldi
CWhiz: Thank you so much!
cheater
hmm ok, virtual seems interesting enough
any other way you guys would find the default requested language with php?
mfonda
CWhiz, theres always http://pecl.php.net/package/filter :)
CWhiz
Aldi: There 'ya go.
Stormchaser
cheater: I already told you 2 ways to do it.
cheater
Stormchaser, yeah.
and thanks :)
Tokeiito
good night
Brice
what's the best way of distributing mysql schema in PHP (ie. for a webapp install script).. right now, I'm parsing a mysql dump file made w/ phpMyAdmin, but it results in syntax errors for some ppl with older MySQL servers...
kog
tell people to stop using MySQL 3.23
zircu
heh
TML
Brice: Best would be not to use PHP at all, but use MySQL tools for that.
kog
exec()!
zircu
besides phpMyadmin has a tool to select what format you want it exported as
will
Dump the schema in 4.0 compatibility mode.
Jymmm
TML how you get a list of factoids?
will
kog, Tell people to stop using 4.1 too :)
kog
will: tell people to use PGSQL? I'm with you there
cheater
hmm so the _SERVER thing would be $_SERVER['HTTP_ACCEPT_LANGUAGE'
webteeth
zircu: please check your PM
cheater
$_SERVER['HTTP_ACCEPT_LANGUAGE'] rather... right?
:)
kog
zircu: don't do it, it's a trap!
Brice
TML true.. but I'd like to make a very user friendly install
zircu
webteeth: read the instructions when you joined freenode
Charbal
I usually use listvalues to search them, I think.
Brice
TLM a la wordpress
Charbal
Jymmm: ^^^
webteeth
ok
I'll ask all of you then
Jymmm
Charbal never heard of it
webteeth
I just moved my website to a different host and I have a php error on my website
kog
webteeth: no I will NOT go to the prom with you
webteeth
damn
TML
Brice: That means nothing to me, as I've never seen wordpress. What is "user un-friendly" about using the mysql tools to interface to mysql?
kog
oh wait... different question
sorry, proceed?
webteeth: what's the error?
webteeth
I don't know if this room is the best place to get help, I'm not that experience with php
Jymmm
Charbal ah, ok
mfonda
webteeth, probably they have different php versions. try making your question a little more vague
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 next »