I have looked at phpnet and tried to find how to do this but I am out of luck I understand that doing an include
connect("mysql://blah"); and mysql_connect($dbhost,$username,$password);?
is there a preferred method?
/home/user/public_html/myapp
i have domain.com/file/5443 what header to set default filename in saving to "file.zip" ?
do echo filename and working dir out of the script
hi everyone, i have an ajax/php image cropping app i grabbed online. it uses outputjpeg but for some reason, if i use an ftp client to upload an image, it displays it, if i use moveuploaded file, it will not display, any ideas?
can't get ya
does moveuploadedfile change images somehow?
you mean in a separate script
no, but file access rights might be set wrong
yes or just add the lines….try to print out the template file and dir out of your script
hmmm.
ahhhh
how can i chmod to 755 for q file?
ok
God I am bored
e319, php.net/chmod
so? is there a references-to-functions solution in php?
The only "reference" you can create is
$foo = 'myFunc'; return $foo ();
there is a chmod function in php
you can also do $foo = myFUnc (); // but that does not mean every time you call $foo the function myFUnc will get executed.. It will only get executed once, when you assign it to foo.
i could print all vars normally
sean` : since you said you're bored… how would you get the size of a directory (including contents) from php webhosting ?
hmm….something seems to go wrong with the full filename….any special chars?
fireba11, filesze, readdir/scandir and recursive structures
m0dY, you are having problems with smarty?
sean` : there's no more elegant way ?
sean`: yes
yes, fireba11
hm
sean` : dang .. thanks though
points to #smarty
and can i call functions with their names in strings?
you mean this scrambled auto generated full file name or which one you'r referring to ?
yes
sean`: exactly as long as i get nothing useful from #smarty channel
m0dY, it still is not allowed
i would try to exec a system tool and see if it can do sth. with that encoded filename
if you can't even use a 3rd party script, with such good docs, what are you doing here
sean`: it's not an issue of documentation reading
but ok
switch channel
grr
sean`: you are assuming that any 3rd party script somes from heaven with zero bugs and having problems after reading the docs then it must be something with me, doh
even better then telling ppl that there is a solution, but not teling how the solution is or works….
do you really do code using your hands and your mind or just hands?
m0dY, if the script has errors write your own
If you have problems, come here
what is your problem anyway
($dbhost, $username, $password) = connect_netipm();
lol, sorry
i'm returning those 3 variables from my function?
is that not the right syntax?
Vme, list ($foo, $bar, $baz) = array ('foo', 'bar', 'baz');
m0dY, what is the problem
fireba11, I believe there was some craz function to get the maximum dir size or current dir size of a directory
but I can't remember the name
http://pastebin.ca/635842
m0dY's problem
$foo = new bar(); leads to a new object, created from class bar, true?
sean`: here's the original description of the problem http://www.phpinsider.com/smarty-forum/viewtopic.php?t=11549
so what is new bar(); then, without that variable before?
XrMb2, the same, its just not attached to $FOO
return($dbhost,$username,$password,$database);
that is how i return them
hm, so there's an initialisation of the class, it's constructor is being executed, but with no variable associated?
never heared of arrays?
php.net/types.array
m0dY, do you have yor chmod permissioins correct everywhere?
also check if trailing slashes aren't "necessary" for the vars you're using
..true?
it says - No such file or directory in
sean`: all double checked
php is running an fcgi daemon under the same uid/gid of the user
getcwd return different way than /home/user/smarty/templates_c
so, when smarty whant include that file it really can not find it
hey sorry i have a quick question but i CANNOT figure this one out, i have a value in my database that is set to zero, (it is a counter) how can i add a number to this ? i tried $variable++ and $varaible +1 but that does not work because the value is set to 0
greetings, have someone ever tryed to check a counter strike server for the "right" pw?
m0dY, compile dir and template dir should have a trailing slash
is there anyway i can read this value as it is ? or do i need to change the default value to null or something ?
m0dY, also try to use absolute paths instead of relative ones
the problem is not with including, it's in creating
do checks with file_exists and is_file
sorry im just 100% stuck here
sean`: i used absolutes also no good
m0dY, smarty has proven itself over a 10000000 times.. You cannot tell me it's smarty
It is without a doubt your configuration, I am sure of that
sean`: the problem is that it should create this dir it's searching for and put the index.tpl.php file in it
open("/home/egxldr/public_html/myapp/smarty/templates_c/wrtPCrLWG", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 6
that is from log of strace
sean`: see what yup typed
invinceable, $info = *fetch_assoc ($resource); $info['counter'] += 1;
sean`: templates_c/wrtPCrLWG" is the file which should be named to index.tpl.php
You can also do this in sql hosting if you want to store it, using an UPDATE foo SET counter = (counter + 1)
hve you found occassions of similar problems on the web m0dY ?
whenever i try to run the index.php file it just creates a new file and not the main dir its searching for the file in
ahhh thank you! ill try it
fireball - i added a chmod, and the permissions are right now (755) any ideas why it wouldnt be sble to access it?
can you specify full, not relative pas to yours smarty dirs
sean`: some without a solution and some with this magic scrabled named but was a permission problem, and what i am saying here is that _i_have_no_problem_with_permissions_ by anyway as if i even had a file or dir with 000 i could still access it
m0dY, anyway, use absolute paths
http://paste.ubuntu-nl.org/31545/ would result in "image not found"
and double check them using file_exists, is_dir, is_file etc..
then set up a testing area
?
and tell me m0dY, why do you have a config dir and a cache dir?
sean`: default config asks for that ?
im not a smarty expert
m0dY, remove the cache and the config dir assignments
also remove the use_sub_dirs
template dir and compile hosting dir are the basics
set it up from that, and then move on
the same
e319, you do konw you're in ##PHP, which is about PHP
m0dY, pastebin your config
ok
sean` : remind me to not just c&p examples from the comments on php.net without checking them first ^^ the function for calculating folder size recursively had a huge bug causing it too show twice the real size
ok how can ui get the info of what the php file being called ut producing?
hahaha
smething to analyze the ajax
have you tried absolute pathes ?
e319, can you make a little more sense?
no.
hah
10 mins, have to get launch and be back
how can i see the flow of an ajax request and response? ie, seeing what the server host backend script produces as a resppnse … something for my browser?
the same error ?
bom dia a todos
m0dY, have you tried putting smarty in anothe rlocation
in the web root perhaps
if not, give it a try
hey aaron
ok, then how can i find out exactly what is the problem with this then?$editDirectory = getcwd()."/edit/";
$imageName = $_GET["imageName"];
if(empty($imageName) || !file_exists($editDirectory.$imageName)) { exit; }
$output = imagecreatefromjpeg($editDirectory.$imageName);
imagejpeg($output, "", 100);
imagedestroy($output);
Is there a method in PHP to find out what encoding is used when receiving form data?
$dbhost = $connect_info[0];
shit
sorry
connected yet?
lol
i only wanted it once
i was going to ask i have 4 variables in the array, is there an easy way to access them individually
besides [0] & [1] …etc..
is there a way to determine the DOS short name for a path on windows using PHP?
Vme ["a_name_given_by_you"]
spam much?
spam?
hi all.. i'm having trouble with file_exists($path) where $path contains chars like spaces, ( and [
can i escape those somehow?
Why?
Wolfpaws, don't know.. seems weird. If i do error_log($path), and just copy-paste to php -r 'print(file_exists(file copypaste here));' it says the file exists
hey
hi. I've just compiled PHP 5.2.3 with a failry smple set of extensions. Why do I keep getting "undefined symbol: zend_qsort" when restarting apache2?
(libtool run)
other than back/forward slashes, is there any other kind of santiation that should be applied when taking a querystring to use for an include? e.g. include($myfile . ".php");
hi!
zend_mm_heap corrupted How can I debug this?
"This problem is the result of making configure changes but not running a "make clean" before rebuilding PHP"
bah
http://apache.pastebin.ca/635943 but not with "php -r '$tidy = new tidy;'
Is there a way to take binary data in a variable, and pipe it to a cl app?
Vlet, use a pipe.
Yeah, but how? Say I want to pipe the contents of $x to 'file' to determine it's mime-type, etc, how could I do that?
I can't put the binary data into a shell command
proc_open()
ahh, thanks
Hi i'm doing my first login thing using session_start(); and i came across a problem where i could access anything without login in, so i figured i'd look and see what was in $_SESSION after session_start(); had just been issued and all it said was Array. Why does this happen?
Am i asuming session works in one way than it actually does work here? I was under the impression that once session_start(); was issued the global variable would contain my current session id.
Array('1'=Array('foo'='this'), '2'=Array('foo'='that')) and reduce it down to Array('this','that') ?
hello
Nevermind i think i figured out my own problem.
I have a problem with preg_replace
checkout array_reduce, that might help
[Table 'usr_web1_1.phpb3_config' doesn't exist]
hmm
pg_query_params() [function.pg-query-params]: Query failed: ERROR: syntax error at or near "$1" at character 20 in /home/daniel/public_html/scorpio/server/include/scorpsystems.php on line 18
and I want to replace it with preg_replace at some points. I'm using this pattern:/'([0-9a-z]+)\.([^_]+)/
query looks like this, pg_query_params("UPDATE systems SET $1 = $2 where sid = $3;", array($key, $value, $this-data['sid']));
but it doesn't make any changes to the text
set $1 ?
i didnt' knew that variable names could be numeric
pthreat, it should be $key in the array
and DONT ENCLOSE VARIABLES WITH QUOTES!
?
Everytime someone writes in CAPS, God kills a kitten. Please think of the kittens!
thats why im using pq_query_params insted of pg_query
safer
sigh
I HATE KITTENS
someone can help me?
theyre not variables, theyre replaced by pg_query_params with the elements in the specified array
and made sure that all quotes are \'d out
$?
http://au3.php.net/pg_query_params
You are so evil.
-_-'
B00
and $1 is a field name right …
isn't that illegal for the first character of a var to be a num?
it is
http://au3.php.net/pg_query_params
thats how the official doc says to do it
and it works in every case in my app cept this one
its not a variable
oh. placeholders
ya
but doesnt seem to be working
maybe it only supports a max of two
for an enterprise grade dbms? i doubt it
yeah
well this command works
pg_query_params("UPDATE systems SET ipaddr = $1 where sid = $2;", array($ipaddr, $this-data['sid']));
the one that doesnt:
pg_query_params("UPDATE systems SET $1 = $2 where sid = $3;", array($key, $value, $this-data['sid']));
almost the same, cept for the var instead of ipaddr
perhaps it doesn't allow the column name to be a parameter
yeah, might be
its the same thing that i've asked you
whats $1
is it the column ….
it's a placeholder
pthreat boo?
oh
got that… but im wondering what has he specified as it to be
got the meaning
ah
'ipaddr' atm
ah
hmm
as in 'ipaddr' …
update some_table set 'ipaddr'=1 ?
'127.0.0.1' rather
yeah
maybe its just that …
youre escpaing what youre not supposed to be escaping
s/escpaiing/escaping/
anyways i spelled it wrong .. ;\
i think the function automaticly handles all that
if so, checking the logged sql queries would have saved you time
im not adding any quotes
maybe the function escapes everything properly dude …
yeah lemme check on the server
haha what
UPDATE systems SET $1 = $2 where sid = $3;
its using the placeholders names
I don't think it is a wise idea to have a variable for the colum name
but dropping the $1 would give you the expected sql query?
i'm in a situation where i must allow the a column name to be determined at run time
I am just saying that the colum name can usualy be known at query template definition time
it can
but that makes it alot more static
static can be good. too much flexibility is giving me headaches…
if its done at runtime, it means when i add a colum to the db, i dont need to edit any code really
you probably will need to add a value for it anyway
but yeah, obv this function doesnt like it
ill just wrap it in my own function
well you don't have to
pg_query_params($dbconn, 'SELECT * FROM shops WHERE ' . $key . ' = $1', array("Joe's Widgets"));
ah, yeah thats a better way
altho that could be injected couldnt it?
then escape it
then again, as henke37 said, why would you want variable column names?
because you don't know what column names would be available until run-time?
~….
heh, i had to expand a 285 character line to 18 lines before i realised the logic was screwed
(first post exists and you posted it) or (you are a jr mod and first posters admin level is lower than yours)
should be first post exists and (you posted it or (you are a jr mod and first posters admin level is lower than yours))
How can I contribute to PHP6?
with a check
I mean, is it going to be open for development?
:-p how good are you at c?
ehh, I know C++
:-p
i think php is written in c
iirc
heh, and obvious screw ups in this screw up of a script?
http://sausage.no-ip.org:88/paste/warftpd-useradmin
Alright, well I've heard it's not that hard to learn c after you have a c++ background, obviously differences
But, where would I start?
any*
c is a fairly simple language
you need to know the fundementals of computer science tho if you want to do anything
stacks, heaps, linked lists
pointers, memory
php core is C, but you can write extensions in C or C++ or any other language that knows how to link against C
Alright, well maybe I'll just stick with contributing to opensource projects themselves :-p
learning C from C++ can be tough because C++ makes you lazy, learning C++ from C can be annoying because C++ takes away control
c++ gives you data structures and strings and stuff
you dont get that in c
Sure you do.
I think I've seen 3 actually decent open source php projs. The rest are just whatever.
too hard to make generic data structures in c
whereas c++ has templates and oo
Do you have ANY idea what you're talking about?
?
’cause you sure as hell don't sound like you do.
what do you mean
too hard to make generic data structures in c" That's like saying writing hello world in php is too hard
do the openssl_seal and openssl_open functions work on win32? the docs are unclear.
Yes, but you have to work out the fugly openssl.conf thing
fugly openssl.conf thing?
pollita why?
i'm not sure what you mean
c doesnt have polymorphism or generics or templates
http://php.net/ref.openssl — It's on there somewhere
you cant make a standard library for stuff like that, so you need to know how to implement them from scratch usually
is all im saying
It has C versions of all three of those.
oh goodie, i need to borrow those
c has macros
i wonder what the license is….
Right, templates are just f-ed up versions of macros.
kin dof
but with type checking and smart stuff like that
"smart"
macros just rawly replaces text
That's my point from my original statement. C++ takes away control and makes you lazy
"Here, don't think about the data you're working on, let me do that for you"
you mean the the first comment there?
mm
well, yeah
i aggree
No, in the main docs
-g
ah, i see
the bits about OPENSSL_CONF….
Anyway, don't listen to me… I'm rude and oppinionated.
Welcome to the internet
that reminds me. what happened to jymmmmm?
hmm, building a user profile page, and have a section where users list their languages and the level they have that language at, also have a section where they provide details on their licences,accreditations and qualifications, so have a simple little box per entry in each case with fields
in groups like, language:[lanaguage, level(fiar,good,fluent, native)] certification:[title, accreditingbody, dateissued] and so on…
well done
how can i have the user click add, have the form ammend itself to the column it's in on the user dash, have the user insert the detail about their licence for example, and click ok and have the data saved and display on the page in text? gotta be ajax related, but i've not done any
would be nice to offer that kind of dynamic page effect, but is it possible to ensure that if js is not right the form will degrade gracefully into normal http request
Is there any speed or cpu cycle advantage to using $var == ''; vs empty($var); ? I know that $var is going to be a string, so as far as my code is concerned they are the same thing
i think that optimisation would net you a 0.01% speed improvement. your time might be better spent elsewhere refactoring code
lol…probably, and that's what I thought…I just realized it as I was re-factoring a function, and thought I'd check to see…it's probably not worth the keystrokes to change it
Thanks
empty will check if the var is null, "" or undefined
== "" assumes its not null, and is defined
php is just like C, 0 == NULL ?
i think 0 and NULL are different in php
i don't
and NULL in C is ((void *)0)
null is 0 in c
well, there is no null in c..
sorry, yes, 0 in C ((void *)0) in C++
null == 0 == false
null !== 0 !== false
just put display:block; on the form and then use document.body…appendChild to attatch it to the column. if you want the form to submit without refreshing the page that will require "ajax"
deadroot ?
== doesn't test for types. === tests the types
so 1 == '1' and 1 !== '1'
ahh
and it's not only possible, it is essential. Use javascript to "block" the link to the form loading then do your stuff. If there is no javascript hosting the link will execute as normal
amazon.com/books
!+identity
hi f00li5h
you joined Wolfpaws' cat clan?
how can i save objects in a database ?
i want database mapping
php.net/serialize
noooo
php.net/base64_encode
Mace[work]: purr
nevermind then
Mace[work]: i never joined any kitty klan
i see
what *do* you want then?
hibernate for php
could'a fooled me ('cuse the pun)
hibernate? database mapping? be more specific..
a layer for database, dao, like hibernate api
it's overkill!
Mace[work]: it looks like i did
overkill ?
i have no idea what you're talking about
talk english
lol, i do
the only ORM i know is pear.php.net/db_dataobject, but it's a bit fruity (because it's filled with php4isms)
it's a layer for database right, so when i include it to my application, i do db.save(aPerson); and it do the job on the db
neat, next time you're in Australia/Sydney, look me up
do you really need all that abstraction?
all i have to do is to implement a few methods and config files for db mapping
hah
guys, I'm trying to get my script to write into a db host1 and select from Host2 but aint working, any idea?
sounds like nothing but a headache, g/l
well, right now no, but building like that make application so much more modular
less work next time in other words
implementing cross system api's can only be a good thing
http://www.hibernate.org/hib_docs/v3/api/
looks interesting
an ORM is far better than having to do all the mapping by hand with insert statements
is it possible to read the song name/album name/song length, etc without download a whole file?
java hibernate?
yeah I heard good things about it
*downlading
f00li5h, that really depends on the scale of the application… ORM can be pretty bloated for small apps.
the app won't stay small for long enough for that to matter
f00li5h, some apps stay small
personally, i'd rater use somewhat overspec'ed code for the first part, than writing all that crap myself
me two !
a smaller ap should require less code than a full size one
me three plus when you do a big app you're used to it
if i have to do all those inserts/updates myself (and write test cases for them) there'll be more code in the small, ormless one than in the big ap
thank you captain obvious for that
np
true though
it was going somewhere …
please help!
purr
DavidHKMrPowers, are you talking about id3 tags?
insults in a discussion are ftl
f00li5h purr?
cyth exactly!
purr
DavidHKMrPowers, and why do you need to read them remotely?
moew ?
is there a php framework for testing ?
like junit or something
toste, phpunit
meow
nice nice
or simpletest??? (something like that)
there's simpletest
cyth because i want to search for songs
can it "simulate" POST and SESSION stuff ?
lastcraft.com/simple_test.php
cheers
keyword in php
DavidHKMrPowers, the id3 is in the header of the music file, so you would atleast have to download the header and abort the connection somehow.
A purr is a sound made by some species of felines and is a part of cat communication.
aaaaâàeeeeuuuuh
cyth so, i need to download a fixed or varied length ?
yes, it normally indicates enjoyment, or affection
is the same as echo
DavidCraft, varied
that's about the only one there is
is bad
Mace[work]: why is that so
it's often disabled
cyth oh!
it counts as a 'short tag' and they're discouraged (perhaps deprecated)
errr DavidHKMrPowers varied
cyth thanks !
anyway back on f00li5h's point, we were talking about ORM not premade model classes, which is not necessarily ORM
ok…how about php=$var?
know one script publish news ?
ternary operator is good for shortening code
= looks like jsp eew
ORM will generally pre-generate the classes for you, so they behave a lot like models
i'm not sure that works
idefine no
somestuff here php endif; ?
oh ternary operators are nothing like that
how stupid of me
/sarcasm
cyth omg, id3 is at the end of a file
really?
i could have sworn it was in the beginning
if …. : is an icky construct, why not use {}.. most editors have a go-to-matching-brace function
bif …. : is an icky construct, why not use {}.. most editors have a go-to-matching-brace function/b
that is true.
cyth ys..the last 128 bytes
f00li5h, because that breaks templating in templates
which I am assuming he is doing
hmmm, well a mysql class with insert("table", $array); where all data in array will be place according to the key
how does it break templating?
would be good enough then
Mace[work]: hah, yeah sorry, didn't see your messageo n ternary operators.
is there a way to determine the DOS short name for a path on windows using PHP?
there isn't, that i know of
*shrug*
f00li5h, well actually i shouldn't say break templating, but destroys the readability of a template
again, how so?
http://www.programmingbulls.com/php-tutorial-assignment-arithmetic-string-comparis
{} is fine in all php file, but templates php if($condition){ ?
and some time later php } ?
hm yes
well, … some time later is just as bad for else :, only you have no way to find the matching else
it would take a good ide to match brackets
and an even better eye
Mace[work], my point exactly
who needs a good eye? editors and syntax hilighting can find that for me
hello, somebody can help me to find where the pear files are after installed ?
i have an excellent eye
Hey, how can I use date(); for GMT+1 ?
and it's hard
well, i like better foo(); ?
!+editors
f00li5h, editors and syntax highlighting are not an excuse to mangle readable code
period
etc just make the template a pain
(php-bot) Editor discussion usually degrades rapidly due to personal preference. It is not a valid topic for ##php. Please try http://freshmeat.net/browse/63/ , http://www.php-editors.com/ or http://en.wikipedia.org/wiki/List_of_text_editors and find your own preference
(php-bot) Editor discussion usually degrades rapidly due to personal preference. It is not a valid topic for ##php. Please try a href="http://freshmeat.net/browse/63/"http://freshmeat.net/browse/63//a , a href="http://www.php-editors.com/"http://www.php-editors.com//a or a href="http://en.wikipedia.org/wiki/List_of_text_editors"http://en.wikipedia.org/wiki/List_of_text_editors/a and find your own
preference
Mace[work]: what? i'm not taking about editors at all
http://php.net/mysql - stuck at the sql query .. how can i see all my tables
i'm saying that it is /more readable/ with the {}'s
(f00li5h) who needs a good eye? editors and syntax hilighting can find that for me
Mace[work], hmm, yeh, your right, thanks for the js/ajax tips not directly php related i know anyway.. back to figuring out my mvc stack
in fact I've been on so many systems where I had to refactor code on the fly, with nothign but vi
with nothign
NET||abuse:
Mace[work]: yes, what does that have to do with the editor factoid?
i thought editor meant editor i'm wrong
f00li5h, it is NOT more readable with {}'s
could be anything
to me, it is …
how could that be anything other than the end of a block, of some kind?
only closes one logcial structure period
the % key will take me straight to the beginning of that block
Mace[work], do you use mvc? or your own model? and do you then use a framework? i'm reading through prado, agavi, solar and a few others to see if they're really worth using, or am i better off concocting my own stack of classes,, i've started, but should i cut my time spent on that and use
something prebuilt?
f00li5h, yeah but there's alot of blocks to choose from
Mace[work]: this is what i was looking for: http://www.php.net/manual/en/control-structures.alternative-syntax.php
you must be out of your mind not to use the alternative syntax in templates
no, {…} nests perfectly, there can be only one matching { for each } in the file
Hi there. I'm trying to download a remote file via PHP. For whatever reason, this code is giving me a Syntax error in parameters on ftp_get() (which I've never seen before). Any ideas? http://pastebin.ca/635181
f00li5h, same for endif;
um actually going against what my personal beliefs are at the moment I don't use one, but I plan on using extjs _very_ soon - I've played with it, read reviews. It's the only choice if you ask me
but there's no way to match back to it in any editor I know of
but I can tell it's an end of an if block just by first glance
Googling the error brought me to a few Russian pages, but that's about it.
why doncha use file_get_contents
because the previous if isn't the right one most of the time
f00li5h, that's a feature issue in your editor
Mace[work], ohhh, nooo, i mean php mvc framework
for a given else :
That's a great question! I would love to use file_get_contents, but I can't seem to get the FTP wrapper to work, since our username has an '@' sign in it.
same answer i'm afraid - thought you were talking about form manipulation in the browser? you need javascript..
This file is being downloaded via FTP.
f00li5h, not a clue, never had an issue with it
cuz I can see the structure at a glance
it matters more for larger templates (which should likely be split into smaller templates)
and I don't need an editor to read my code and tell me what's up
cuz i know what's up
Mace[work], same answer? you use your own, or you have a framework in mind as "the only choice"
Oh ffs. I see the problem. Typo. $server_file is not the same as $remote_file.
sigh.
Sorry!
f00li5h, exactly :p
do, you have it give you more information, you don't let it be the only source
the answer being a "helpful" and "understanding" — `no`
if a word is yellow, it's a keyword… that's helpful information
Mace[work], haha, right, got you now
it sounds like you're on the right track, ask around.
Sweet. That's doing something now.
well, i have a form and user profile system to complete.. i'll look further into the frameworks again come the next project
f00li5h, it's helpful, but you shouldn't code around an editor.
you should still try and get it running with file_get_contents
Hey. I'm getting the following error in a script im trying to create. Not sure why. Parse error: syntax error, unexpected '{' in CWAMP\www\realmregister.php on line 122 I have the code up at: http://pastebin.com/m6087524b . Can anyone point me in the
right direction as to what i did wrong?
using code blocks leads to a world of unwanted illsuion of what a page of code means
did you try to urlencode() the username?
No, but that's a good idea.
well, anyways, presentation layer should always be separeted
wait
rawurlencode()
form data, logic etc
from
i'm not coding arround a particular editor, most editors match {'s, even phped can (and phped is made out of fail)
so hrm, tags are the way to go for webdesigner that like to make little pretty drawings and don't understand shit about anything happening behind
f00li5h, that's most editors… and like I said you'll never know what systems your code will end up on and all you have is a featureless text editor
hi all
that's my point
"featureless editors" are no good to me, i'm not going to waste my time with joe
I need lunch shell script from php and I don't wait
how todo that !
system( '… &' )
f00li5h, that's exactly my point f00li5h
what is?
that your useless without your editor
f00li5h, I tested it but noway
That's awesome! rawurlencoding the username worked great! Thanks so much!
but i have to disagree
I m good shell coder I know how to run backgroud process
f00li5h, editors are great, but if you can't code in notepad :p
so what's the problem then?
coding in notepad is a waste of time, it can't even preserve line endings
& doesnt the solution with php
cool!
php wait the end of execution of script
yes, it does, but you need to redirect stdout to /dev/null too, so it doesn't wait for the filehandle end
uyes, it does, but you need to redirect stdout to /dev/null too, so it doesn't wait for the filehandle end/u
f00li5h, yeah then you never been in my shoes. where you get thrown onto some computer and told to fix some code
f00li5h, good idea I will tested it
f00li5h, thx a lot
and you have nothing but vi, and hell if they let you dl something on their computer
bring a usb key with Zend studio ;P
or notepad
givm is 1.5 mb, and can be downloaded and ran as a monolithic binary
it takes no more than 2 mins to get ready
actually they expected me to do php in frontpage
and notepad is better than that
a tradesman needs his tools. end of story.
did ya know that notepad got highligthing tools ?
you can't put in a nail without a hammer… well, not cleanly
f00li5h, a tradesman in our field tools are the language.
if you're thinking of the same notepad as i am, it doesn't
no, there is more than that
the editors are nothing but battlefields.
wrong-o
and you have to be ready to fight anywhere
anytime
bollocs
that's total crap
it's not my fault you can't program without crutches
it's not my fault you're using blunt tools
hmmm am sure to have seen it somewhere
I prefer ide's and a good editor… but I am no way dependent of it, and in no way write my code assuming it's going to be viewed in an editor.
i'm not assuming any editor, we've been over that
because I've been in so many situations where I had nothing to work with.
"situations" like what?
f00li5h, your assuming an editor has certain feautres
no, i'm not assuming that at all.. i'm saying that that feature will make it easier to edit the code
as is an editors job
can anyone point me to a site for PHP authentication with NTLM?
well yeah,
but it should make it easier… not essential
you imagined that it was "essential" i never said that
you've been implying it for this whole conversation :p
no, you've been inferring it
no you
so's your face.
and your mum.
f00li5h, your mom goes to college
I am just saying that I've been in so many situations that I had to code…. and code now…. with nothing but joe, pico, vi, or notepad
and because of such I write my code to be easier parsed by a human,not an editor.
my editor of choice is vim, which is likely to be on most BSD/Linux's, and can be attained from gvim.org in other cases
such is my choice too, but you don't know how many systems I've come across that don't have vim installed
it is quite a large package.
yeah, and i know that each of them has an admin who can install it for you
I have this code usign xajax http://pastebin.com/m3232402d. It work fine for like 4 minutes, The problem is that then the browser stop responding and freeze. The computer slow down and I need to close everything and start the browser again. Someone may
guide me on how to improve that aspect?
f00li5h, yeah, that's if their not busy enough to go out of the way to install an editor on a machine that already has an editor on it.
been there too.
try this line "install vim, and i'll buy you a pint/pizza"
and you know what?
I am sick of RT being so slow :/
what's it running on?
I have no idea, but the search builder is sloooow
everything else is fine
i generally don't look at more than "my tickets" and "unowned tickets"
yeah we have a pretty large system, so I usually have to search around to find anything
i see…
the way we have things set up I have to look in other queues that are not my own
my fallback is to seach for keywords that may be in the subject with the quick search
is it possible to use PHP to track where my swf is embedded?
$_SERVER variables return my own host, not where the swf is being called from
not likely, what specifically do you want?
for example, if a user embeds my swf on myspace, I'd like to know that
the best you can do is track the referrer, and that's only if they hotlink it
isnt the swf url available in the embed tag?
otherwise they can just save it, and upload it ot their server
or object tag
you could includwe something in your flash thingie that dials home
and gets cranky if it's not in one of the pages on your server
well, it's not that I want to disable it, I'd just like it for stat tracking
then that's the win
huh?
I think the dialhome idea is probably the most reliable
what do you mean by dial home though?
how would I get the 3rd party site's url?
you know the sites url, because you're in the page… theres hould be something for that
all you need to do is have your flash animation make a request to yoursite.com/harvested.php?id=this-flash-aps-name&in=the-other-site.com
I need a Christmas miracle to get sendmail working. Anyone up for the challenge?
example.com is registed for that purpose, i wish people would stop using real "dummy" domain names
apt-get install sendmail
it needs to be dynamic, though?
minus the q mark
hrm?
f00li5h, I run this where?
actually, doh- I misread that- I don't think flash can get that var, though
you'd have to find out of what flash has to offer on the subject
i love f00li5h
yeah
good point
in a root shell, ln your debian box
purr
Not a debian box.
example.com isn't likely to be stealing your flash animations though
f00li5h, it is *apparently* installed, although I'll be damned if I can't find the config file.
oh… well, cd /usr/pkgsrc/net/sendmail && make test install clean # on your NetBSD box
CentOS box
it'd be in /etc/, configfile wise
example.com is registed, w3c i think, for use as an example domain
yeah…looked. Not there.
Idiot provider
i'm aware of this, and i use example.com when i write real docs
not everyone is, and people should be in the habit of using example.com
will curl info display in phpinfo()?
it's true… although there are some cases when example.com won't do it (like when you're doing interesting dns lookups)
have a look and see
well i did
and it doesn't show up
i'm asssuming it would be there if it was available
?
yes, Vme
its not, and i'm not root
then extension is not installed/enabled?
i'm really not sure … i don't have it installed
I don't see any mention of it at all
what OS you on?
the server is linux
running apache
yes but what distro?
redhat
Red Hat Enterprise Linux ES release 3 (Taroon)
redhat–
is expose_php set to on?
then make sure the php curl package is installed, maybe yum install php5-curl ?
since when do I have to be a channel op to invite people?
"This includes the PHP and Zend logos, and the credits"
is page rank open to public?
DavidHKMrPowers, the google one?
i mean Page Rank(tm)
ask #web
just type in IRC /page_rank mysite.com
and it will tell you the rank
AlexC_, no need to try to get rid of him
?
AlexC_ it diesn't work in my irc..
client
really? what's the domain - I'll do it
yahoo.com
AlexC_, sorry, I thought that read /server page_rank mysite.com
24 - Yahoo.com
so do I have any good rank?
henke37.cjb.net
65,341 - henke37.cjb.net
is that good?
not sure really, making it all up =D I'm bored
lol
i entered /server page_rank yahoo.com
btw, isn't pagerank from 0 to 10?
libcurl.so.2.0.2
that is in /usr/lib
I'm not sure, but this one seems to display quite high numbers at times
hello
goooooood morning mr kn11px
AlexC_ ok
glad I could be of help
I'm having this super strange problem where echo doesn't seem to be working. http://pastie.caboo.se/82837 Anyone have any ideas?
$person['photo_file'] does not exist
AlexC_ heh
$person[0]['photo_file'] exists
I have a variable "$price['type']" which is either 'unit' or 'load' … and I have $order-price_per_unit and $order-price_per_load variables as well. I want to set ONE of those based on $price['type']. I tried this…but it didn't work AND didn't throw any errors:
$order-price_per_{$price['type']} = $price['price'];
Is there a way to do that?
can i easily convert a object to an array?
is possible to map tables in a mysql_query to an object for each table? ('SELECT * FROM posts INNER JOIN posts ON posts.user_id = users.id' to a 'Post' class and a 'User' class?)
it's easier to do $order-prices[ $type ];
Hi all. I've searched Google with little luck. Anyone know of a free PHP poll script. I want to collect a yes/no answer via a poll that requires authentication. I figured finding one is easier than writing one from scratch (which isn't overly hard I realise)
that may be, but it's already set up the other way, and I have to work with it as is
Adrian_dlcspm tried sourceforge.net?
if you can't use google to find a Poll script … then, well …. how can you not find a poll script on Google?!
there are like millions of them
:effort:
AlexC_, NOt just a poll script, oen that is Auth. driven.
if ($price['type'] == 'load') { $order-price_per_load = $price['type']; } else { $order-price_per_unit = $price['type']; }
i want to convert an entire object to an array of the same structure
big polls, little polls, fat polls, slim polls, funny polls, sad polls etc etc
DavidHKMrPowers, I'll try that, thank you.
all on there
AlexC_, Again, auth driven.
sometimes, the simple way is better
http://drupal.org/project/advpoll is the one dreamhost comes preinstalled with
of course, I goofed and it should be $order-price_per_load = $price['price'];
You have a two dimensional array, ex.: $person[0]["name"] is where the name is
tkx
s/face/fact/
ooow, AlexC_, sort of already said that
=D
why does no where sell chocolate teapots? =(
rycar, Cool, thanks. Good, I needed something where the admins can view who chose what.
rycar, This will be used for sustaining votes, and we need to interview votes to the negative.
I actually just prepended 'price_per' to the type, and then did: $order-$price['type'] = $price['price'];
why would you have $price['price'] ??
this channel is for help making your _own_ code - we don't hand out scripts or tell you want to use
Hopefully I'll get to refactor that whole class in a few weeks
sorry, Adrian_dlcspm
go through the django tutorial, it sets up a poll app.
this is the php channel? that explains why everyone was talking about code
the function that I got $price from returns an array with type and price
are you lost?
AlexC_, Perhaps the channel should be about PHP programming (which should include not reinventing the wheel)
is there a way to change the perspective if an image using phpgd?
yeah but why would you call it $price
perhaps you should go Google
err, no.
perhaps you should pay us for doing your work for you
or pay us even if we do no work?
AlexC_, Maybe you should reread my opening question.
rycar, Work? This isn't paid.
rycar, I'll pay you what I get paid by the church.
yes, you want a poll - a script, one ready handed to you
because an hour ago when I started…I thought "get_price" would return a price…however, I thought wrong…
theocracy + voting = lol
welcome to programming-by-guessing!
rycar, Sustaining actually, not voting.
it's ugly too… 2500+ line class. Could probably be done in 1/2 that and be twice as clean
obviously, they were getting paid per-line.
you can do an imagerotate, would anyone use it or find it useful if it was to accept a 4th parameter, imagerotate(img,degrees,0[,axis])?
fyrestrtr, Heh, indeed. Our church's ministry is not paid (not for anything we do).
lol…or bragging about it. I remember years ago when I started I was SO proud because I had a 20,000 line application (that I could probably do in 200 lines now)
axis? wtf
perspective is not an easy thing to do
I don't think imagerotate should be doing any 3D
there is no 3d involved ….
explain what axis is
x, y, or z
he means so if he rotates it 90* he will just see a 1px line
as if the you have turned to the side of the image
right
how is that not 3d
agreed rycar
I guess we have different definitions of what 3D is ^^
3d should be a separate function (3d is when you have 3 axis instead of two)
actually that definition sucks
I think I know what 3D is
3D = 3 linearly independent orthonormal basis vectors
although i guess the normal part isnt required
ultimate_frisbe1, not possible
since the 3d model got lost when converting reality to a photo
what he wants _is_ possible
3d should be a separate function
so then do you think that there should almost be a whole nother series of function for 3d? image3Drotate, img3Dpolygon, img3Drectangle, etc….?
Theres no such thing as impossible
I wrote a 3d engine once
mmmm image3Drotate
for php? gg
yeah
just use a proper 3D application ….
easily done though if you know C
you just write a DLL
noting too advnaced
that uses direct3d
yeah
imagerotate should rotate images. for perspective you need a new function, such as imagedistort or imageperspective
sorry…not everyone loves M$FT at0miku
i dont either
Who said I liked microsoft?
ultimate_frisbe1, use opengl then
using direct3d
direct3d is what you'd most probably use
LOL @ http://worsethanfailure.com/Articles/Which-Cable.aspx
or opengl
ah…fair enough
which ties it to Windows
apart from that, microsoft sucks
I suppose
opengl runs on linux as well I assume?
of course
obviously the majority of php servers runs on windows
yea
alright
I disagree
which is malarchy
ati and some other companies even makes linux drivers
yeah
haha, ATI and linux drivers
guys we can run directX on wine
ATI stopped making linux drivers I believe
not at all, at0miku
which caused outrage
nvidia 4 life
something like that
infact there are rumours of them opening up their driver,
anyways, linux (especially ubuntu) is stepping up in the world
getting more popular
focus here guys….we go from phpgd to wine
with dell offering it on laptops/pcs
the gfxcard companies will soon all be writing drivers for linux
I dunno
erm, they are?
I prefer Fedora….but i do agree that linux distros are becoming more popular cus of M$FT's latest OS
uI prefer Fedora….but i do agree that linux distros are becoming more popular cus of M$FT's latest OS/u
hey, how do i check if a record in my database already exists?
centosfedora
I'll think about it
I've used a number of distros
nVidia and AIT both have official drivers for linux
select it, then do a record count
][marko][: select it's primary id.
On ubuntu everything worked first time
*
][marko][: see if rows returned 0
fedora was okay
cheers
I really like knoppix, I have it on my bootable usb key
how do u count rows? count() ..?
mysql_num_rows() ?
mysql_num_rows($result);
why do you need to know if it exists already?
Thanks
][marko][: select id from foo where id = 12; if mysql_num_rows($result) == 0 then it doesn't exist.
anyone know how to convert an object to array?
][marko][: no need to count anything.
you might want to look into ON DUPLICATE sql command
just do an INSERT INTO x SET y = 'whatev' ON DUPLICATE KEY UPDATE y = 'whatev'
Wouldn't it be useful though if right out of PHP, you could create 3D histograms or graphs?
you just want the object properties in an array?
yes
yes it would be useful, but that functionality doesn't belong in the imagerotate function
i have structure stdClass that i want to just be an array with the same data
get_object_vars() jonwage
implement the iterable interface.
hmm, what if it has embedded objects
oi
i pass an vars to a class
the var exist before, but when in the consctructor, it disapear
see http://www.php.net/manual/en/language.oop5.iterations.php
wtf could it be ?
no need for the 'oi' …. and pastebin code
how exactly are you passing it to the 'class'?
this is a stdClass structure, not a class I have written
this is from simple_xml
nevermind, stupid mistake
make 'svn up' yours
huh?
it would be a good commercial
how do you do parameters for a mysql query?
i need that little .gif for ajax loading
anyone have an idea ?
http://www.ajaxload.info/
could you help me with this
line 62 is wrong
http://pastebin.com/d40881d17
][marko][: your qutes are messed up, by the looks of it
ajaxload.info is my favorite spot toste
'$number_log';";";
oh ye
][marko][: syntax hilighting tells you that…
][marko][: once you get used to reading colourful code, it makes stuff easier
hey, does anybody know how I can use @subpackage, to have a subpackage of a @subpackage? Basically I want ot be able to set a hierarchy more than 2 levels deep.
you mean in phpdoc?
yes
i'm not sure that you should need to nest packages
I have looked at php.net and tried to find how to do this, but I am out of luck. I understand that doing an include pulls the file into the current spot, however I would like to include a file into a variable. like $file .= include("somefile.txt"); This doesn't seem to be the way to do it
though. Any ideas on what word to search for on php.net that would lead me in the right direction?
I want the documentation to nest, kinda like namespaces.
why?
surely you should just have a pacakge with classes in it
because, I would like the documentation to mirror the folder hierarchy
I want a user navigating my documentation to be able to get to the appropriate classes in a logical manner.
kinda like the MSDN documenation, or any other complex documentation, there are multiple levels deep
as not everything makes sense in the first 2 levels
why would i choose php over perl?
don't, back to perl, kpls
what are advantages
Anybody? Any way that I can include a file into a variable?
$variable = file_get_contents("file");
well?
Sweet! Thanks!
np
the advantages of php are that it has an overly simple syntax, long function names, poor memory management, and is designed only to generate html
I'm sure Zend would disagree with you
would they?
and advantages of perl
So, nobody knows how to nest packages?
hundreds of libraries, and the language's syntax can achieve lots more
perl is much dencer than php code, more happens in a smaller space, so less code is needed to do stuff
and more stuff is done for free, or invisibly
rather, nobody knows how to nest docblock @packages, and @subpackages?
obviously complicated behaviours like that take some learning tohough
it looks like noobody does, do the docs say anything on the subject?
is it possible to stream a file from a remote server through a php script and directly to the end user without php having to buffer the file first?
Unfortunately, no. The phpdocumentor docs were written rather poorly.
"eating your own dog food" is the expression you want
it just gives a simple example of @project, and @subproject
I can modify phpdocumentor, and use my own tags, but was hoping they had something built in, as it seems like something that's necessary
perhaps you just need to do @package foo.bar.baz or something of the sort
perhaps, but is that legitimate, there's really no way to know
PHPdiddy, yes, with fopen
there is, use it, and run phpdoc and see if it picks it up
Thanks, I'll try that
well i tried that, but there's a considerable delay when doing that. i need it to immediately return
PHPdiddy, consider using mod_proxy via apache
that might speed it a little, but not much
someone experienced with smarty here?
well, the problem is, i need to inject my own headers
the problem isn't php, or using fopen
hi, are there ways in php5 to overwrite $_SERVER values from outside of a script ? i want to prevent this so i can be shure the variables are set