*question* Take multiple results records based on a multiple-select from a form and multiple fields also chosen
thanks
no
sv2_, asking about web design on a web development channel??? ask #web
haha
i think i'm just gonna advise to switch
hi, can I ask you guys a possibly impossible question?
this simply sucks
may i ask a private question here…? may i know what's the highest salary of people here who are working mainly with php?
Karmacom, you can try
I'd rather you didn't run surveys in ##PHP. Try #phpc or something.
fedya.. .yea personal preference and it needs to offer features you'll need. some comparison is here, but read all the comments as nothing is as simple as "yes" or "no" http://www.phpit.net/article/ten-different-php-frameworks/
50,000,000,000,000,000 over here
TML ok
my brother got this crappy position making $40k, he convinced them to give him $45k… he eventually quit because they werent giving him a proper sallary
wow is that even a number
hm, thats not so much
Is that in "millionths of a cent per hour"?
yes, and YEN probably.. not usd
MatteusX, i'd like to point out how wrong that article you posted is
it just depends on the position
Kobaz is that 4.5k or what currency is that?
Zend Framework has templating… it's php templating :p
USD, heh
when you say features i need, what do you mean? some of the newer stuff like web services or whatnot?
he was eventually making $45,000 a year, which is terrible for what his position entailed
that would probaly still work out to a decent rate
also it has no for Auth_Module…. which ZF also has
You might join him in #phpc for that
ok here geos, im going to make a php host or PHPGTK script to automate disconnecting/connecting my printer in a Belkin printerserver wrapper/layer in windows xp, there are two executables: mpfagent.exe and servoapp.exe, i know servoapp.exe is the
resource that does the connect/disconnect-actions, but mpfagent.exe has the buttons ("disconnect/connect"), so mpfagent.exe probarbly sends out a commandline, probarbly a simple one like "servoapp.exe -some
Kobaz so…what's his title?
position i mean
Karmacom, ewwww with php? ewwwww
There's a #PHP-gtk channel
that wasn't my question
heh
Karmacom, don't use a hammer for that… try a saw
cyth, php or basically anything other than having to go inside the complex program, select a stupid menu, then hit connect/disconnect everytime i need to do that simple task, basically im going to make a desktop-shortcut for it if possible
just programmer, but he was doing IT, and a complete rework of their system… and TML doesn't seem to want non-php banter
I just want it in the proper forum, that's all.
forum?
Karmacom, if it can be done by commandline, what's wrong with a shell script?
1. A market place or public place in Rome, where causes were
ive tried looking into the internal commands in resource hacker, tried sniffing dll-activity in windows with processmonitor from MS, but nothjing
does anyone know the search indexing Sphider?
judicially tried, and orations delivered to the people.
fedya, gets complicated i guess. things like templating, caching, php4 or php5 (some people need php4) support. other less concerete things like a strong user community, good documentation, many modules/extensions, etc.
cyth, thats my point, i just dont know what the commandline is, i need to fetch it somehow
i think i'm most interested in good community and documentation
get the SysInternals strace
Karmacom, sounds like you should talk to #windows
i'm thinking that i dont need anything complicated
i mean ill need to process credit cards
easiest way… write another program that just prints out the commandline arguments it recieves into a text file
probarbly, im just a old php-fart and really dont know where to even begin to ask
but would i have to write that as a module or can that be part of the model or how does that work?
and replace the printer .exe's with that program
kobaz, im not following, how do i fetch/get/find out what the actual commandline is in the first place ?
fedya I would think as a module, I don't think credit cart transactions work very well in models :p
Kobaz i am in #phpc talking there
mpfagent.exe sends out a commandline to servoapp.exe when i hit "connect/disconnect", i just dont know what that commandline is
you would need to write a c program or something compiled… and hijack the command line
fedya, you def want to get some opinions from people here. why not try out the Zend framework and see if it works for you.. it has an active community and is well documented. http://framework.zend.com/
how would that work then? if i'm processing a form, i want it to process the request through a gateway and then come abck with the result
kobaz, no programs exists that can fetch/sniff/hijack the commandline in all/general programs allready?
i mean can you use frameworks for things other than db apps?
fedya, you said it, I would handle that in a controller
Yes. Strace, from SysInternals
Karmacom: strace
but the command line hijacking works well too
e.g something like processmonitor, only provessmonitor fetches way too much to even understand for people with less than 5000 in IQ
Strace, thank you TML, i will try that
thanks Kobaz
im off to find strace (afk)
fedya, yeah some frameworks can, a model is a model is a model, if a framework is relying that a model has to be from a database than it's a dumb ol framework
models can represent any resource
fedya, i'd hope most things you can do in php can be done with a framework.. in general they facilitate DB tasks.. but shouldn't be limited to working with a DB.
though.. i am out for now… thanks for the soap/rest info folks.
i was reading an article yesterday and i was under the impression that you have one controller for an application that routes to different models based on requests and actions thereof
cyth - already have… asking here as well….
fedya, no… you have one front dispatcher that routes to different controllers and actions thereof…
yes there will be a bunch db tasks which is why i dont want to have to write tons of procedural logic if it can be simplified with a framework, but i can't fathom how to integrate credit card processing
can you point me to an article or tutorial that explains that
and said actions has access to the model classes it needs, and to the view object for rendering a template
http://www.onlamp.com/pub/a/php/2005/11/03/mvc_controller.html
fedya, honestly no, I just know these things but I would google mvc and web applications
this is the article i was reading yesterday that i got this impression from
if i have www.mydomain.com/getinfo.php and all it has is a field that says Enter Email and a submit button.. and on my other site, instead of linking them to www.mydomain.com/getinfo.php (with a href.. i thought it would be cooler to basically somehow INCLUDE that onto my other site.. like
merging what's on www.mydomain.com/getinfo.php onto another page..
fedya, modules are not models and he is refering to the front dispatcher as a controller … which is technically ok.
but is confusing
anyone know what i mean or how i can do that?
because a front dispatcher is part of the controller process
getinfo.php is just 2 things. email field and submit button. id like to somehow take getinfo.php and insert it onto another .php page (on a remote site). both pages/sites are plain
how would you use more than one controller in that case? it seems to me that he has one and only one controller in his app
(also would a framework help fascilitate prefilling form fields if a transaction is declined and some value needs to be changed, without having to refill the whole form?)
I usually have my routes layed out as /module/controller/action
:-| i thought a controller was at the top of the hierarchy?
front dispatcher will take that url and call the controller class's action method that is organized in the module folder on the filesystem
fedya, your confusing responsibility with filesystem layout
although, I call it section not action
AlexC_, semantics… same thing, I think their actions by tradition though
yeah I really should have called the actions from the start
s/the/them
you just have your own framework that you came up with or do you use a particular one?
fedya, both
I have one I came up with for perl…. and thinking of rolling my own with java, …. for php I use Zend Framework
if you couldn't tell by my praise of it earlier
oh hah
i was just looking at the documentation for it earlier, i was a little lost
and yelling at that comparison page for it's inaccuracies
i need to see a tutorial
fedya there's some good tutorials out there
it seems that cake is like hold your hand framework
you wont get lost looking at my documentation!
and zend is a stripped down version that allows you to do more of the work
I wouldn't call zend stripped down
Zend is more like Lego I like to think
what i mean is they dont have the tools that create the skeleton for you
it's more loosely coupled than cake and easier to customize
I mean I built my blog on ZF, I didn't even use ZF's model solution, I just rolled my own
failed to open stream: Permission denied in
because I don't like Zend's model solution, and it was pretty easy to make one for my app need. (and it's faster)
look at this page its very funny
http://www.pennergame.de/ref.php?uid=2349
Get read permissions for that file
Hi. This is a nusoap question. From this code: http://pastebin.com/d68df5bbe is there a way to find out the methods available to me thru $px?
hi all
roselineX, I doubt you'll get alot of support for nusoap here… I'd find where the nusoap people hang out for support
got a question about php4 to php 5 host migration - haven't touched 5 yet - but assuming there's backwards compatiblity for my php4 code….any funky things in 5 that i should know about?
whether it be irc channel, forum, or mailing list
I know this channel was my last option
MisterGraphics, there's a whole page of funkiness in php.net
argh
TML already have it
PHP says you don't
http://uk.php.net/manual/en/migration5.php
if I put the url into my web browser it works but if I do file_get_contents i get that error
i yam a sad php4 web hosting panda
hello
why are you a sad PHP4 Panda?
How can I get the mysql's datetime?
i yam a sad php4 panda because i have to do this php5 migration
by using php
wfq, use date()
you're life will be so much easier afterwards though
cool
MisterGraphics, death to php4 this december! hoorah!
php 5 forever (or until 6, which ever comes first)
hah
If I have an object, say $x that I created by using $x = new myClass(); is there a way of listing all the methods available through that object (public methods and variables)
ppl im in need of a php4 hosting along with php5 solution
roselineX, yes with the reflection api
cyth thanks
yeah there's some introspection functions, i forgot the names, but yeah
How can I jail users using php?
roselineX, php.net/reflection
open_basedir
thanks cyth I'm checking it now
Mill|ooo, well I'd think you'd have to frame them for something because I don't think using php is all that illegal
hi all
hi BackBone
hi Mathews-
thnx TML and Kobaz (and others) for the help… gonna try and relax now after a hard working day
ciao !
have fun
Gonna be interesting to see if they further develop the php compiler
hmm
help, why is in_array() always returning true?? http://pastebin.com/d1e2864db
[fields]: regex might be better
maybe, I don't see whats wrong with what I got though. Its so bizarre that in_array() is always returning true
No. It is MUCH more slower,
[fields]: in_array($str[$i], $allowed, true)
ahh
[fields]: $arr4 = array("-", "."); - what chars go in this range?
was that from benchmarks or words of wisdom that says so?
Danker, that says array(), not range().
words of wisdom
Oh…
hmm… it ate the '2' as well…
Sorry
then ignore it. when you have to string several dozens functions to do the same thing as a single or two regexes, it's faster with regexes
yeah, but range("0", "9") corrects it from eating that 2
[fields]: range("0", "9") isn't correcting it for me
hmm, strange, it is for me
[fields], it's not for me, either.
[fields]: range("0", "9") returns an array of strings for you?
Check with var_dump()
[fields]: alternative: function convert_filename($str) {return preg_replace(array('@_| |%20@', '@[^0-9a-zA-Z-\.]@'), array('-', ''), $str);}
yep
[fields]: That…shouldn't be. Which version of PHP?
[fields]: in_array((string)$str[$i], (string)$allowed, true) ?
4.4.6
I need to upgrade, I know, just don't know how to
that probably would convert the array to a string, which in_array would choke on
Tfu…
Oh. PHP4.
Forgot that there is an array… Sorrry
hi all
hi
i have a working email form script that i want to modify so that when a user enters their email and hits submit, it will send them an email with a txt file as the body of the email host i have saved on another server. any one able to help
so, would using: in_array((string)$str[$i], $allowed, true) be a way to have this script work fine on php4 and php5?
stealthy, that's quite a vague question
[fields]: no. because the $allowed would contain integers, which would fail the type checking
*would still
let me guess, you just started coding in php this month?
no
grab the remote file and save as a variable using file() compose your message and send
[fields]: Use a regex
a'ight
ciaran, how is it in the uk this time of year?
fields, i am new to php
you got any examples?
thank you for rewriting my 22 line function as 1 line regex function
file_get_contents() might be easier for him
let me try
with file_get_contents()
anyone use symfony?
$message = file_get_contents('blah.txt')
i get error
St3althy, what error?
parse error, unexpected T_VARIABLE
PHP mail functions in Windows, where do I start?
cyth - any suggestions?
that was a genuine question
I'm not ranting
St3althy, itttts PASTEBIN TIME!
is there another chan for Zend Framework, or is this an appropriate place for questions?
#zftalk MatteusX
thanks
Permission denied when I use file_get_contents… But I can browse to the location with firefox
mvfeinstein, that has nothing to do with your file permissions… well some
fixed it Cyber-Dogg
cyth
mvfeinstein, what user are you executing the script in question and what is the file permissions of the file in question.
Hum, guys, would you maybe know with what language are these players like youtube and similar stuff made? JavaScript? Flash maybe?
flash
cyth its running from a webpage so I am assuming as apache
Ouh
youtube is all flash
And this is private host or possible to get somewhere?
Matic`Makovec, flv players are easy to create with flash
Matic…what do you mean "get" somewhere?
are you wanting the authoring software?
mvfeinstein, no suexec or suphp? what user is your apache running as?
cyth not sure how would I find out?
cyth, my knowledge of flash is… lower then 0 most probably
Hi
Matic`Makovec, time to learn or hire
How would you put a PHP script into a C++ app
Matic…my knowledge of flash is limited as well, but i'll help you as much as i can
what are you wanting to accomplish?
why do you want to?
I need a player…a thing that plays clips
The youtube way for example
Cause I need to use C++ to create a presentable front end
Matic`Makovec: the flash plugin already does. or any of a million flv players
Easier in C++
You would need to call the parser and supply it the file to parse
it will return the html
Could you elaborate?
Or point me to a tut?
Hum..I must leave now but be sure I'll return tomorrow to bug you people some more!
Matic, i wouldnt try to reinvent it…it's available on ye ole interwebs
system('php.exe (filname)')
unless you only need very limited interaction with the parser - like what Sean111 is talking about - use a scripting language that's designed for friendly interoperability with C/C++
I just want the C++ to obtain a username and then have the php compare that with a database
the php web hosting script is already made
why not use C++ to connect?
Cause the PHP script is already made
how long is it?
Sounds like you're looking to undergo a lot of work to reuse a fairly trivial script.
well to pass the vaiables via command your gonna need to make it read argv and argc
WafflesFTW, authentication is…. sooo very easy in any language
and pass through system()
access control is the hard part :p
Whats so hard about it?
WafflesFTW, external binary dependency
is there a function that like removes empty array values, example, i got x[0]=a then x[5]=b..i want it to be x[0]=a, then x[1]=b
and obvious uneeded performance loss for something as trivial as authentication
Im not too hot with C++ though
My uncle is doing that part
Im working for him
Internship
so write the whole thing in python.
Why?
a) easy
It needs to be an exe
automated
imho will be just as easy to write the auth in C++ as it will be to get it to use the PHP parser without a hithc
*hitch
how would I go about using the PHP parser
Where do i get one?
having one coder who knows PHP and one who knows C++ is *not* an excuse for using both languages simultaneously on a project.
..anyone
"the PHP parser"?
The parser cannot be trivially divorced from the interpreter
So how would I go about and do this?
ahhh, must be friday
what does the parser do?
it, parses
*question* Take multiple results (records based on a multiple-select from a form) and multiple fields (also chosen from a multiple-selet on the same form) passed as an array via $_POST. What's the most efficient way to retrieve that data and display it in a table?
a loop?
yup, definitely friday
How would I get that to accomplish what I am trying to do
what are you trying to do
Use PHP script in a C++ program
no, what are you trying to do
Buy Sara Golemon's "Extending and Embedding PHP". After you've read it, if you still want to do that, you'll know how.
I just said
no you didn't
That's what i'm trying for, but cant figure out the syntax for it. my first results (select * from 'main_table' where 'country_name' = $country) comes back as an array of arrays. Now I need to go through and pluck out the fields based on the $criteria (from the multiple-select from the form)
the user chose
"If what you want is to do Y, you should ask that question without pre-supposing the use of a method that may not be appropriate. Questions of this form often indicate a person who is not merely ignorant about X, but confused about what problem Y they are solving and too fixated on the
details of their particular situation. It is generally best to ignore such people until they define their problem better."
Use PHP script in a C++ program
Thats what I want to do
Oh, and I'm a beginner PHP'er using CodeIgniter (if that's damning enough)
so i say again, what are you *actually* trying to do
o.O
PHP source is in C
The C++ is gonna be the front end and get user information, and the PHP will be the back end workng with the server and using that information
So, you'll have to write a PHP C++ parser
Er how?
…by going off the PHP sourcecode and coding equivalents into C++
There's already something written in C++ that does that. We call it "A Web Browser"
is this a web application?
:O
is there an easy way to have php web hosting log to /tmp?
There's not much need to use C++ if you're not utilising OOP
php.net/error-log
If you could use C, then just integrate the PHP source code into your application
I just want the PHP to be in an exe
I cna use just C
Then, code that EXE in C
can
you should loop thru the results of your query
… ?
you still haven't answered my question, is this a web application
No
I think what he's saying is, he wants PHP code to parse within a C application
It uses a database
and why wouldn't you just use C++ for the whole application
s/t like $res = $conn-Execute("SELECT …"); while (!$res-EOF) {…}
Even though PHP is great
Its an exe, which company x is using to interact with company ys database
Like abstrakt says, it's unsuitable if you add an extra layer of complexity
you just need PHP to talk to the database.
You can just use C/C++ SQL libraries for that
wow
way too many people in this conversation right now
Maybe you'd be better use something less complex than C
like what?
Python.
I jus tneed to be an exe
zedboy, cool…i'll try that, 'preciate it
It'll be a batch script.
Hmm, it *has* to be a exe?
Why do you "tneed to be an exe"?
lol abstrakt too many cooks in this here support kitchen!
complied
Why?
If it just needs to "do" something, PHP could work fine in shell
Cause It is to be used with company xs app
Whats a shell
A shell is basically a session in the command-line
Meaning, you have access to system utilities, functions and sowhat
If you need something that just "converts" or "does" something, you don't always need an EXE
cyth, totally
so how would I use that to run the PHP script
The php does something
The C makes it into an exe and presents the front end
cyth, now if there were actually people to support then all these cooks might have some use, but as is they're all just adding more confusion to the already confusing dish known as WafflesFTW
DB
If you need a GUI, then you can use Python..
i agree with Halca, as i already asked and you have not yet responded, why not use C++ for the whole app
I dont know python
Qt/Python, or GTK/Python
why not use C++.NET if it's a windows app
?
if you know a bit of php, you can pick up python very easily.
o.O
Why cant I do it like this?
because he's not evil?
I need an exe
Because PHP doesn't work the way you're talking
Why?
I am patient, and i'm absolutely fine with you asking questions. But, could you just tell us.. what are the requirements of the program (i.e has someone asked you to make an exe, or a program)?
You need a thing you can click on and run, right?
Yes
I have nothing against new learners, in fact — they are interesting to see how well they learn.
Okay, well — does it need a GUI. I.e does it have to have a windows-application look?
It needs to be able to be executed automatically
Yes
So write it in Python. Then make a little batch file that says "cpython2.5\python.exe foo.py"
and it will behave just like an exe
Hi there, I'm replacing all my $HTTP_GET_VARS with $_GET does anybody have an easy way for me to change all my files at the same time? im not great at linux text manipulation
Okay, well — does it need a GUI. I.e does it have to have a windows-application look?
Yes
^
Well, it's a good idea to learn Python
i have literally hundreds of entries
For new learners, the C learning curve can be unusual
over numerous files
Because concepts like memory allocation are strange for some learners
http://aptgetanarchy.org/node/121
Best idea is to use Python, which "imitates" an EXE look (you can make it show a GUI) and really the input/output is handled by a script
thanks
II know what mem alloc is
In essence, what a C program is.. but just openly compartmentalised
You know how to do safe memory allocation, but you don't know what parsing is?
That's quite the spotty education you've got
xD
I hacked maplestory for a while
Hey, the important thing is he's learning
Ahh, i know what you're doing this for
An emulator that accesses Database information
Heh
xD
Hi
I learned PHP 2 days a go
9',
then you can learn Python
I just need to know how to port the script to C++
What we're saying is, you're adding an un-neccesary layer of complication
Or C
There's not an answer to that question other than "Write it"
Like getting to your back garden in a jet plane
Or making toast with a flamethrower
You can just use libraries like Qt, or GTK to immediately access databases
If you know C++, just sit down and write the app you need. Forget about PHP.
Even things like MySQL, PostgreSQL and Access
I dont know C++
Exactly, that's what we're saying
My uncle does
He will do that end
You can jump straight in and try C++, but it may not be what you're used to
He owns this company Im just interning for them
I just need to figure out how to do this
That's why TML and others suggested Python
That's where you keep missing the point. C++ and PHP aren't "different ends"
waffles i studied C++ and became rather good at it but found absolutely no use at all for it professionally
They're different means to the same end
now what i know is outdated
I need to know how to make an exe with php then
You deserve it
You can't
no you don't, you need to learn C++
But they are the same end
You can't, it's not a compile-able language
No, he means
9") == -1
Yes, the end is not "make an EXE"
The end is "make software"
You have one purpose — to have an EXE with SQL/DB access
Compled vs interpret i though
To add in PHP is too much in the mix
t
Yes
This is an interpreted language
Yes
malkav, so…given a choice…you might choose a different language as a college requisite than C++
it's never too late for a little … JavaScript!!!
And you don't make EXE/Binary files, but scripts that are parsed by binary files
PHP itself parses PHP code in C
if you want a COMPILED piece of software you can't use an INTERPRETED language to write it
go learn C++
Thats why i want to use C for the front end
if you know how to program then you can learn any language inside a short amount of time
Im supposed to learn C++ in 2 days?
Whoa, whoa — everyone.. just hold on a second
Quiet
This discussion is crazy and ridiculous
hahaha, if you only have two days you've got bigger problems
Slowly, list exactly what you need to do
no man, we know what he needs to do
I need to create a program
he needs to get a clue
And how you plan to do it, then we can attempt to point you (again) in the right direction
(Also, do it in one sentence)
Ok
i already tried that, he didn't listen
*props to Halca for controlling the situation*
he just said "i need0rz teh EXE for hax0rs PHP into C++ appz"
I need to create a program in PHP that authenciates data in a data base but is complied into an exe so it can be automated
STOP IT!
He's not controlling anything, he's beating a dead horse
stop saying you need foo to do bar
I think of it like the scene in kill-bill with the Chinese guy, but not using your hand but your head to break the coffin
bI think of it like the scene in kill-bill with the Chinese guy, but not using your hand but your head to break the coffin/b
just tell us what you need to do!
I need to create a program in PHP that authenciates data in a data base but is complied into an exe so it can be automated
Okay
don't pre-suppose the technology you need to use
You can't make an executable via PHP. You can't make an executable that is a "Front End" to a PHP application, unless you're talking about writing a web-browser. PHP scripts can be automated.
beating a dead horse++
I need to create a program in PHP that authenciates data in a data base — You can do this, without using PHP because PHP uses "hypertext" — hypertext, as in HTTP
i tried this like 15 minutes ago
TML, i think he's grabbing a runaway train, but that's because I have not been paying attention. *slowly sulks in corner*
bTML, i think he's grabbing a runaway train, but that's because I have not been paying attention. *slowly sulks in corner*/b
If you want a program, i.e an EXE for windows, you need the following — A compile-able language, such as C, and extensions for windows
something about strtotime() ?
9 should be handle-able,
But, that seems to be impossible for you to learn in 2 days, so your best bet is #python
/end
-1 means "unsupported input format"
mod_fcgid+php-cgi or mod_php?
trhaynes…just state your issue…many knowledgeable folks on here
relix, mod_php all the way
Benchmark both and let us know
after that fcgid, and last choice is cgi
very well
9 is
given your obvious level of understanding of this situation, you're never going to finish what you need to finish in 2 days
if you've got a deadline… you're already dead
TML too much work changing configs :s
at this point it's just damage control
oh, never mind - it's working now
TML, agreed, I have to deal with both…would be curious to know "definitively"
bang –head=DOH /dev/null/
thanks
You've got a typo or something
bang(head);
lol @ Halca
9")); — works just fine
I feel we're already in /dev/null
My brain feels melty
My brain is in /dev/random anyway
$head-smackAgainst($this-monitor);
Lather, rinse, repeat for the next 10 years, then come talk to me.
any codeIgniter users in here? know a good IRC room (*besides #codeigniter on irc.thinstack.net)??
uany codeIgniter users in here? know a good IRC room (*besides #codeigniter on irc.thinstack.net)??/u
me!
Well, when i've been teaching for a year
I'll show you my hair
:P
teachers are glorified baby sitters
srand[away], know any good IRC rooms that have more than one user in it?
that's why they don't get paid anything
no..just here in freenode
!tell werkinhard4bear about g8
I tutor in 5 subjects for free
can PHP take commandline arguments?
Yes, it can
#codeigniter here on freenode has 22 users
Also writing 2 books in Physics for (AP, AS and HK cert in 1 book) and same for biology
Can they pass out information?
it*
since you're a PHP biginner why don't you forget about complicating your life by trying to learn PHP *and* FartIgniter and just use plain PHP
Releasing them free, when complete into WikiBooks, and also allowing them to be published and bulk-bought inschools for around £0.20 a book
Can PHP pass out information?
if you don't know how php.exe is called, you shouldn't be calling it…
Yes, what kind?
that way you'll understand what PHP really is and then when you learn something like FartIgniter then you'll understand of what use it actually is to you
When you enter input, you usually get output
abstrakt, you know, you may just be onto something there
variables, int char strings
and that way we will be willing to support you in here
Generally, you handle that kind of thing with your own script
variables don't, constants aren't
int char strings?
wtf..
if you're using CodeIgniter we're not gonna support you, you're gonna have to go to the #codeigniter room but if you're just using regular PHP like you should be we'll be glad to help
i.e. we don't support frameworks/cms's/third party scripts
So you cant jpass out chars strings/ints?
abastrakt, I completely agree…that's the path I should've taken…but alas, I was greedy
heh .. "regular php"
it's never too late
Hmm, WafflesFTW - you can run PHP code in shell, but it's up to you what it outputs
by doing echo() or print()/printf()
If you have inputs, then you can do commandline input against a php script
as far as C is concerned for that shell, all it's gonna see is string types
i.e php script -args
alright forget about it
Well, i want to help you.. but you're not giving me much.
My uncle is just gonna right the thing in C
write
*
Hey, i don't mind beginners at all
Good to hear
But, in anything like PHP, or even in Sciences and Maths
In order to get coherent answers
you must ask PRECISE and ACCURATE questions
as it should be, i'm sorry to say but the sad truth is you ain't gonna do your uncle a damn bit of good on this project, you're just gonna get in the way
he should put you on something you're actually capable of doing
I already did his whole verification system/input..
Verification of what?
let it go
please
He didn't think it would be that hard to port PHP to C
Basically Licensing system
for the love of dog, let it go…
Hmm, well — if you know the proceedure you need to do
Then you can look at what data you handle, what the process is, and what the output is
And emulate that in ANY script language
Providing it's extensive enough
I see
Well i gtg lunch
Anyhow, WafflesFTW.. a good idea for now
Thanks for the help
Appreciate it
would be to just google "php tutorials"
and "C beginners tutorial"
I know PHP
php.net is your friend
I know php
…
ahhhhhh!
lol
Well bye
is the controller like the application? backend vs frontend vs frontend priveleged user?
uis the controller like the application? backend vs frontend vs frontend priveleged user?/u
–winar!
–winrar
http://en.wikipedia.org/wiki/Model-view-controller
Even though i hate ESR's face
http://www.catb.org/~esr/faqs/smart-questions.html
mv Halca ~/.Halca
That's a good place to start
mv ~/.Halca /dev/null
fedya…kind of…. not really
"In the world of hackers, the kind of answers you get to your technical questions depends as much on the way you ask the questions as on the difficulty of developing the answer"
controller = business logic, model = business data, view = frontend
yeh, his face is kinda fucked up isn't it
hi
can someone help me? i'm having a problem here:
$data = addslashes(ereg_replace("(a href=\"http://[a-zA-Z0-9/\.\-\"\']+
)(img)", "\\1 class=\"highslide\" onclick=\"return hs.expand(this)\"\\2", $row
['post_content']));
Which is?
aff, that should be just one line
too many slashes. or maybe not enough
What are you trying to do?
SamuraiDio, I have to suggest not using ereg
add highslide class and function to the image links on my blog
SamuraiDio, 1. unobtrusive javascript shouldn't need that
cyth, huh?
You can do that with CSS and javascript
2. adding such thing is cake for simplexml or dom.. assuming your html is xml parsable
ie
Slynderdale, ahh, a havent figure taht out
SamuraiDio, unobtrusive javascript you don't need to bind actions in the html with on* event attributes
in fact many js call that bad practice
Slynderdale, can you gimme a clue? i need to add highslide class and action to all links that point to an image
where do i get a PHP+java or perl Coder ? bussnis to talk ?
!tell thebest about jobs
ereg_replace(): REG_ERANGE in /home/diovani/teste.php on line 12
is it ok to do something like this at the beginning of functions using mysql $conn = get_db_conn(); ?
or do i only need to make 1 global variable and keep the connection?
anyone ever script a zip code radius script before
SamuraiDio, why are you using ereg?
cyth, to add strings between strings, on the correct place
jtm, stay away from global variables, database objects are better kept in a registry
registry?
SamuraiDio, that's what preg_replace does, except faster, and won't be moved to pecl in php 6
jtm, a good registry is a singleton composite
im working on a zip radius script - im trying to output results by distance (outputted from a function) but for some reason i cannot get it to sort….
im not using any programming patterns
design*
im just asking if it's ok to constantly open a connection to a db ?
it's fine
cyth, http://pastebin.ca/644693
whats the code if nothing exists in a field in a table
thanks
jtm, it's fine, it ain't all that either.
it is common to write a mysql_query() wrapper function that connects to the db every time you run a query
abstract, thank you for the referral, you're a great person for that
cyth, it was working before i add \.\-\"\'
it's a fairly negligible amount of overhead
for what now?
ok
jtm, php doesn't support connection pooling (natively) so it's not like there will be a huge difference in performance
i was checking
worried about performance
if you can it's not a bad idea to $dbconn = mysql_connect() and the beginning of the script and then pass $dbconn to your query wrapper
jtm why are you worried about performance? do you have a performance problem?
because in a lot of my functions i have the same few lines i definitely should put them in a wrapper
cyth im a paranoid person
if you're really worried about performance then that'd be the way to eliminate redundant mysql_connect() calls as the culprit
Premature Optimization is the root of all evil
e.g. trying to optimize your code before you know what needs optimizing
i know
it just seemed evil to do it like this lol
however there's nothing wrong with trying to not repeat thyself
abstrakt, for some reason, this is not the advertised channel on codeigniter forums. the advertised one is on irc.thinstack.net…and there was me and the server admin for 4 days straight
i see… i don't usually pay attention to that kind of stuff
also mysql_query do i always have to do stuff like mysql_fetch_row etc
in order to get data
the only reason i go look to see what channel is the advertized one is if the FreeNode channel is empty
I know there are other calls, but mysql_query does what? Gets some sort of handle?
rather than looking for the "advertized" one i basically always just check the freenode channel first
yes you will always need to call mysql_fetch_* if you're using mysql_query()
ok
however, mysql_fetch_* does not use a database connection so there's no overhead there
wasn't sure if that was being redundant either
and btw use mysql_fetch_assoc()
i.e. the whole setting up of an array of length n
where n is the columns
you should never make your code rely on the order of columns
I use assoc
and don't "set up arrays" just use mysql_query() and mysql_fetch_assoc() properly
if you're worried about the performance of multiple mysql_queries() and mysql_connects() then you sure as hell shouldn't repack your result set as an array
but a few functions when i just select 1 column i use [0]
when you call functions is there overhead?
i.e. some sort of stack
yes
but also negligible
well not negligible in recursion
SamuraiDio, http://pastebin.ca/644704 untested how does this work?
unless you've got a million some odd recurses it's still negligible
even then it's probably still negligible, i.e. there are probably other things that are more of a bottle neck in a million recurse function than the function calls themselves
lol im not even using recursion anyway, haven't needed it.
in php is it common to use data structures?
Ok, I want to mess around and learn AJAX + PHP or something like that. What I would basically like to have happen is the javascript call php that will then call gnuplot that will then produce a graph that will then be displayed. I figured I would start with just haveing the php generate and
display the graph before I make the whole asynchronous part to it. So I guess my question is, what is normally used to execute a console like command through PHP?
I haven't seen any examples of trees and such
Hi all how di I return more than one variable from a function? If you put return twice it only returns the first bvariable.
data structures ?
I'm sure there are nodes or you can setup your own classes.
ADTs phpAdam
jtm, that's what php's SPL is for
are there structs?
no structs
sorry i come from C
Anyone?
associative arrays can represent most structures you'll ever need
mtappenden, return an array
Which is faster an lowers loads, having a variable in "$var" or 'Hello World' .$var. '!'
?
yeah
an associative array can do anything a struct can do
neither
it's also negligible
Ok.
lots of preoptimization today
I mean like a varable in double quotes or not.
how do i get rid of the silly $alnum='z' in this statement for($a='a'; $a'z'; $alnum[]=$a++);$alnum[]='z';
"Hello $var World" is generally more readable so i use that
Ok.
we know what you mean
k
wtf kind of statement is that for anyway?
XD
you do realize that preg_ can match alnum… no need to reinvent a square wheel
abstrakt, yes i know that, i want to get an array with Array('a', 'b', … 'z')
why
so i can have a list in a table of letters
k thanks
*why*
…. tdz/td/table
i bet your code has stuff like $one=1;$two=2;$three=3;… doesn't it
abstrakt, not even cloe
close
php doesn't have list comprehsions but i can make do sometimes with for loops like the above
php for( $letter = 'a'; $letter = 'z'; $letter++ ): ?tdphp echo $letter; ?/tdphp endforeach; ?
doh, php for( $letter = 'a'; $letter = 'z'; $letter++ ): ?tdphp echo $letter; ?/tdphp endfor; ?
error'd
abstrakt, that doesn't work
no it doesn't
What function returns the number of matches for a $needle in a $haystack that isn't one of the regex functions?
it doesn't stop at z for me… it goes all the way to yz
cyth, so?
still works, that's the logic in his previous loop anywya
he asked how to get rid of $alnum[]=
jamey-uk, I think strpos does
anyways i'll just use 26
cyth, that's what I thought — I think I've just found it: substr_count (sounds logical right
)
jamey-uk, yeah i was about to suggest trying that one
however http://hashphp.org/pastebin?pid=25659 works just fine
^^
abstrakt, i am ahead of you there but thanks
sure you are
whay my Code PHP get CPU to 99% ?
infinite loop
:P
because you are obviously not what your nickname says
i am the best in SEX
tell /part
argh
abstrakt, i must ask you to reframe from emotive conduct it is against the spirit of freenode, as listed in the guide
you must? lol what, are you going to do, kline me?
abstrakt keep a secret )
i don't give a rats ass my man
go in to #perl, #debian or ##freebsd and say that, see how fast you get kick banned
Blasted Internet connection :s
abstrakt, this is ##php
my_haz, abstrakt, we don't care either, please take that in private
I did $vars['var1'] = $var1; $vars['var2'] = $var2; etc., and then return $vars; but it seems to ahve returned nothing, any ideas?
exactly, i guess you haven't been here very long
mtappenden, var_dump($vars);
poopy pants? wow…
dude stop messaging me
you're preaching about guidelines and then you spam me with /msg s?
dude i'm closing your msg tab before i can even read them so stop
ok someone ban this freak, please
Just says 'NULL'
!tell my_haz about guidelines
abstrakt, has a boyfriend
cyth, more like a not-so secret admirer
mtappenden, you're obviously doing something wrong then, enable error_reporting and display_errors
please keep messaging me so i can have a good excuse to actually report to you an IRCop as a spammer
abstrakt, please, we don't care, stop spamming here about it.
lol freenode drama
i'm not going to humor him in /msg because he's breaking a cardinal guideline about asking permission before messaging whilst trying to chastise me about "being nice" because "being nice" is such a part of the culture here on IRC… wtf?
lol freenode drama indeed
abstrakt, indeed he hasn't been on freenode long
freenode isn't nice
you know I've never really understood that whole ask before /msging rule. I mean maybe back in the days of 2400 baud, but now? Seriously who cares.
plenty of people, like me
but why? That is something you should ask yourself deep down. Why does it bother abstrakt?
dxdt i think it comes from the days of spam bots in irc…. alot of people have pms turned off unless you ask.
bdxdt i think it comes from the days of spam bots in irc…. alot of people have pms turned off unless you ask./b
wow
dxdt, people get burned out on irc, because they try to answer everyones questions. You just got to come and go with flow. And i have been here for about 6 years, so i don't know if you call that long or short. However emotive speak and clogging a channel with drama is something that comes and
goes as well.
i need something in php to store a few objects, any ideas?
erm some sort of data structure
clogging a channel with drama eh? sort of like you spamming me with /msgs ?
alan__, php.net/serialize
ahhh but see it wouldn't apply to them then because they are ignoring all, you know? or are you saying that is why the rule exists? In which case the rule isn't for politeness but a matter of function so messages aren't ignored. Anyway this is getting off topic and polluting the room now and
that I do believe to be rude.
alan__, a class?
Any ideas?
mtappenden, pastebin the code somewhere
dxdt, yes
$var2); and same result, nothing
how do you test the return value ?
dude seriously, keep it up, i've got the logs to report you to the ops, i'd love to see you get banned for this you fucktard
alan__, what kind of datastructure do you need? like a heirarchal tree of objects?
Sorry my Internet connection is really messed up
any ideas?
something like a Vector in java. i just need to add objects, remove objects, iterate.
mtappenden, pastebin the code somewhere
alan__, use arrays, simply
alan__, php SPL has the ArrayObject and appropriate iterators
or you can just use arrays
no need to use objects for the sake of implementing an object that acts like an array, simply use an array
ok
yeh an associative array works fine for that, no need for the SPL
ekneuss, SPL ArrayObject is special case it doesn't act like an array for the sack of having an object be an array
PHP is not like C, you don't need a special vector just to be able to hold an array of objects, arrays in PHP can hold anything
thanks sounds good, just out of interest, how efficient is it?
but SPL ArrayObject is a special case, it works better for large collections
cyth, ArrayObject is most of the time just eyecandy and adds no real features
hi
ekneuss, bullshit
there's a way to install PEAR for the second time withou having internet conection?
cyth, nope, not really, it's not often that you've to distinguish object properties from object indexes, most of the time it's simple "wow, let's make them behave like arrays, because we can"
simplexml does it but for a good reason
mtappenden, you've to do $vars = app_start();
mtappenden, php.net/return
ekneuss, that's not the purpose of SPL ArrayObject at all.
there's a way to install pear from my disk?
without conecting me to internet?
not really
what OS?
Vista
ekneuss, the pont of SPL arrayobject is to allow access with iterators… which are far more efficient at traversing large aggregate structures than recursive looping through an array
the pear script doesn't work on windows anyway
go-pear.phar is broken for whatever reason
i will run it using apache
cyth, you've all the iterators interfaces for that, no need for ArrayObject
just install manually, it's not that tough
did you install with the MSI or with the Zip Package?
i get into a page that showed me the source code, and it told me to save that code in a php file, the run it
i did it, and i installed very well
I'm having a problem with a directory name.
ekneuss, unless you need a composite object rather than an array… you can't extend the functionality of an array
cyth, if you don't need ArrayAccess, don't use ArrayObject, or it will simply be overhead. And if you need ArrayAccess, then its most likely for eyecandy features.
I've got some recursive code that works just fine, but when it gets to a directory called "ecb" it dies.
i just want to know if it may work if i copy the files created and i paste them into another proyect folder
Thanks
ekneuss, plus like i said before, a registry is basically a singleton composite, it's so easy to make your own registry object by extending array object instead of having to rewrite all those accessers that wrap an array.
cyth, you'll still add useless features for the sake of lazyness
ekneuss, what useless features?
ArrayAccess for example, you shouldn't need it for a composite
ArrayAccess
??
Yep ArrayAccess
wtf is this arrayaccess?
$object['foo']
oh i see, it's an interface
Now I have that working, I'm trying to access $vars['theme'] from within another function, so I've put $GLOBALS[var][theme] but that results in the output Array[theme] ?
cyth, yep which is implemented in ArrayObject already
I'm trying to install PDO through pecl
pecl install pdo — works, pdo is installed
how are those not needed in a composite?
pecl install pdo_mysql — complains:
You've configured extension pdo_mysql, which depends on extension pdo, but you've either not enabled pdo, or have disabled it.
I don't get it, pdo_mysql isn't installed yet - I wouldn't be installing it
mtappenden, you should rather pass it as argument. And you can't access multidimentional arrays inside doublequoted string without using the "curly syntax".
if I do extension=pdo.so or remove it from the php.ini file, it makes no difference, same error :s
What's the 'curly syntax' ?
"why would those be needed" ?
mtappenden, php.net/string
k
ekneuss, so you can extend the functionality
anyone here using LUCENE search and can tell me an easy way to paginate or at least limit the search results ?
Mob[St]er, you don't really need to limit the search results
how would you search a string for an IP address and return same? And more if there are more than one.
all pagination I have seen just grabs the offset in the result array holding the docs.
dogday, preg_match_all would be good for that
cyth, as I said, it's most of the time simply eye candy and waste of resources. Not a "because we have to" but "because we can".
so basically, I need to "manually" paginate by playing with the array ?
quick question, I have a function registered for handling autoloading, but now I want to see if a class exists before I execute code xx
ekneuss, waste of resources? have you profiled?
with the autoloader I can't try/catch an exceptoin
is there another method of checking then? class_exists will just run the autoloader and die
cyth, thanks
Mob[St]er, basically
so basically, it sucks ….
cyth, implementing hooks for the sake of having the functionnality will always be a waste of resource.
hello
ekneuss, waste? depends on who you talk too, "for the sake of having functionality" duh… how is that a waste? thirdly, it might be completely negligible amount of resources, as far as memory consumption is concerned objects are stored like arrays their is no memory added there
THanks for the answer though ..
only resources I can see 'wasted' would be the method definitions being held by the compiler during runtime
Mob[St]er, never been a problem, and I guarantee my indexes are larger than yours ;D
cyth, err ?
ekneuss, is human
hehe I beleive ya ! … it's just very painfull to play with pagination !
cyth, "method definitions being held by the compiled during runtime" doesn't make much sense.
Mob[St]er, just gotta get your head around it, the algorithm is the same every time
ekneuss, what doesn't make sense about it?
hi
the whole sentence, it simply doesn't make sense.
hi all. why doesnt this work $phone = $phone1 + $phone2 + $phone3;
St3althy, + is not the concatenation operator, try "."
agreed, $phone = $phone1 . $phone2 . $phone3;
thanks
ekneuss, classes are compiled once… and only once for a given execution… less than that if the compilation is cached….the precious resources for the wrapper methods I guarantee are more than negligible
cyth, how is that relevant to the current case ?
ekneuss, your argument was about wasting resources using ArrayObject
Is there a way to add an arbitrary string to a web server log for the username of the logged in user (not using http auth) ?
mrpoundsign, trigger_error
i think
something like that
I don't think you have access to the access log via php though
cyth, yep, it will be some overhead, which will be minimal, but implementing too much will always be a waste of resources, may them be documentation wise, etc..
unless you specifically open it and write it, which i don't recommend
that doesn't make "methods definitions being held by the compiler during runtime" more understandable.
anyway, I guess this discussion is one hell of a waste of resources.
is there something for PHP that will understand IP Subnets?
mrblur, check error_log
for example 10.0.0.0 255.0.0.0
ekneuss, indeed
Vme, check ip2long()
it will know all the addresses that fall within that subnet?
you preoptimizer you !
in php is there anyway to sort an array of hashes based on a hash field
statc, what do you mean by "based on a hash field" ?
statc, let me reword that for you in php jargon
ekneuss, ??
mrblur, by bad, that was for mrpoundsign
in php is there away to sort a numerical array of associative arrays based on the key?
that's what i ment
sure, ksort/uksort
ok sweet
thanks
Please someone experienced and interested in doing a little modififcation PHP source, in exchange of money, contact me
!tell DimeNocBR_Filipe about jobs
DimeNocBR_Filipe, not the right place to ask that.
sorry
i have a simple function that print a session variable if it exists, else it starts a session and sets the session variable. the session is not persisting across requests. any ideas what might be wrong?
Actualy is not a job to create a php project, but modify its source.. even though, is it ilegal to ask here?
FlimFlamMan, you have to have a session_start for every request in order for it to persist
cyth - ok, thanks, i'll try it
DimeNocBR_Filipe, we don't do anything related to jobs here
ok thanks
cyth - not working
Anyone here ever use YUM to install PHP?
DimeNocBR_Filipe, php-bot should have messaged you with places to go
Hi. Anybody can help me. setcookie works on localhost but not working on host ? Any ideas ?
FlimFlamMan, not working is pretty vague
setcookie, not working is pretty vague
session_start(); var_dump($_SESSION); $_SESSION['test_key'] = 'something';
array(0) { }
So ?
setcookie, more information, im not psychic
FlimFlamMan, check out session_id() and see if it stays the same over requests
FlimFlamMan, the function being called before headers are sent?
I would like to modify PHP source, specificly fwrite() function and upload file section.. I would like to scan the contents whenever these functions are used.. anyone could tell me if im going to overload my server? Words would be read from some file and wouldnt be more than 50
DimeNocBR_Filipe, you still on that?
basically it's just a php block in a file; the block contains the function definition, and the call. that's it.
basically it's just a php block in a file; the block contains the function definition, and the call. that's it.
cyth this is the cookie line == setcookie(anketim1, $_POST['poll1'] , $hour);
Cyth this time I want to pay a coder to make it professional.. you see any problem on making this? I want to save millions of daily scammed users
DimeNocBR_Filipe, your the guy that was going to do that to stop phishing issues am i right?
and if (isset($_COOKIE['anketim1'])) { to check cookie.
cyth yup ehhe
didn't we tell you that was a dumb idea when you first came in here asking about it?
why is it?
lots of reasons
session_id() changes with each request
validation and filtering at that level… is just ROFLCOPTER
FlimFlamMan, your cookie probably isn't persisting
where does your PHP store session_files?
0 and just return the month august without out all the
error_reporting(E_ALL); //have fun debugging
DimeNocBR_Filipe, why don't you just use mod_security and filter that crap out before it even gets to php?
then you won't have custom modifications of php that will keep you from upgrading
FlimFlamMan, if cookie is ok check session files (server;s hdd space) and check if you don't have suhosin installed
and keeping you from dealing with possible side effects and bugs.
on the other hand, sessions are working with my CakePHP app hosted on the same server
FlimFlamMan, did you check if your cookie is getting set?
FlimFlamMan, if the session_id changes, it won't work correctly for sure.
I explode the date a few times to get each variable. then I use date("F", mktime(…));
how doo i know?
so read up on mktime() and take a look at the example there
mktime, roger thanks
do you have to use an array to return two variables from a function?
FlimFlamMan, you got one of them firebugs?
is there a room about algorithm and solutions? i dont wanna help with programming i want help about the best way to do something
great for fast checking for cookies and what not
plus a million other uses
Vme, yes
irisblaze, algorithm's and best practices are often discussed and debated here
though sometimes we seem to have best practice disagreements alot
the problem it's java application not php cyth
irisblaze, well their similar… just make it sound like it's php and apply then apply it to java
anyone knows if i can install php in the default apache in mac os?
doktoreas, I have no idea, but I wouldn't see why not
well ok i am making a multilangual dictionary, storing the words in binary file, now the problem is how to store them and notice it'll be a big file
so i want to store them in a way to make it fast for the app to find them
irisblaze, why don't you store them in a database ?
ekneuss, i dont want people to have to install other files
irisblaze, read up on indexes eg btree
3rd party apps.. etc
irisblaze, sqlite then ?
archivist thanx i will consider that
ekneuss \, still people will have to install it
i just want the app to run on the go
irisblaze, to install what ?
sqlite
Gmm
it's bundled into PHP5, you shouldn't have to worry
irisblaze, but you want them to install java
ah right, java, forgot about it
. users won't have to install nothing. that's what sqlite is for basically
ekneuss, i am talking about java app here / archivist java is almost on every desktop now days
FYI, we just had some spam from Dribbles in #wikipedia, keep an eye open.
irisblaze, its not
cyth told you it's java app hehe you the one who sugested to say the problem here
lol st47, super rat
archivist on it's easy to install java
not allways
irisblaze, the user won't have to install sqlite if you bundle it with your app
and irisblaze you never installed java on FC or ubuntu have you?
or an old debian
zzz
in fact I don't think those distros have java by default do they? they can't distribute them by default because it's not all OSS yeet
yes i installed java on ubuntu and FC cyth
I have a broken java app on my winbox which is version dependent
i am gonna try to use sqlite then
hwo does windows handle alternate installs of java?
multiple subdirs
windows uses the newest installed java
not allways
what if you needed to use an older version of java?
for testing/ development or other?
the mysql migration tookit is 5.8 only does not work with 6
in some distros, you have to run the alternates command
201 CLOSE_WAIT
in some distros, you just switch the symlink
you can then go to the subdir of the older version cyth
and run java from there
but the old download from sun fails this week