ppl heres my question the code for imagerotate example pasted from the on-line manual otherwise wont work works
for($i = 0; $i = strlen($string); $i++)
and it really isn't an array
str_split() frankr
anyone know how to get the name of the currently executing method?
ok poll, how many people use unix timestamps in their dbs?
vs. say datetime
but it looks so icky
try __METHOD__ I think, if that doesn't work then __FUNCTION__
So does democracy
great, thanks
I only use it when I need a timestamp :p
which 80% of cases I don't
Fair enough :p
I just like the added flare of a "timestamp" field in every table in my DB. It helps me sleep at night. ^_^
k
I have an object that has a node children, which is an array of other objects or strings…I'm trying to make it a tree of nodes that I can then parse…however when I try to loop through and assign each child by reference I'm getting the child array to have an array keyed nothing that has
all the children, instead of an array of children….I can't seem to figure out where that array is coming from….any clues?
eliter, composite pattern?
?
sorry I don't understand that
Beshoy, no
of course, you are using a pattern without knowing you are, it's the nature of patterns
haha…
because they show up again and again and again in architecture to the point where they can be cataloged
Beshoy, this is why designers exist. you do have to be familiar with graphical terms and graphical technicalities, but that is something you would learn over time as the need arises.
basically I am keeping a depth array and then looping through it to the point where I need to create a new child within the parent array..when I create the child it is within another array that I didn't create
eliter, anyway, php5 has classes specifically for that problem in the SPL
got a link I could use?
they have an ArrayObject and Iterators for looping through the ArrayObject
php.net/SPL
documentation sucks on it though, google around for SPL tutorials
great thanks!
when i open a page that contain this "http://pastebin.com/d5a61a29d" code in konqueror web browser it shows nothing why ?
hi all. i have a script where you enter in your email address into a database and it has an id that is generated when its entered. how do i display the id that was used in the form and carry it over to another php page???
mysql_insert_id()
if MySQL, of course
thanks alexC
cya
so how do i carry that id over to another php hosting page?
thanks for tody
ksivaji, putting link in quotes breaks my point and clicker in my client …. thanks
cythrawll what do you mean ?
is there a way of removing empty arrays in array?
ksivaji, the pastebin link you posted… I couldn't click on it because putting it in "" broke it
Is there a way for PHP to get the browser name of the user that is viewing the page the script is on?
Do PHP scripts exist that can pull data from other webservers? I've migrated to a new web host and need to transfer a lot of data, and seeing as wget via perl doesn't work, PHP scripts look like they're the only option.
ksivaji, I don't see anything wrong with your code, does it work in other browsers? are you getting an error?
"this is what i am getting in firefox same manner
disco\\, php might have curl, or webservice support depending on what you need to grab, you can even do it a file_open and/or sockets if you feel like it
ksivaji, php webhosting installed on your webserver correctly?
Thanks, I'll get reading
cythrawll ya php is installed in my machined
machine*
file_get_contents may be the most wget-like solution
ksivaji, correctly?
cythrawll do i need to configure browser to support php
no
cythrawll hope so is there anyway to check that ?
work?
Hello… how do i check if string $str ends with "abc"?
cythrawll wait i will try and tell you
KDan, substr
ah yes of course
cheers
as I expected. What did I do wrong?
cythrawll it works fine with php interpreter but konqueor just show the source php phpinfo(); ?
ksivaji, how do you have php installed on your server?
cythrawll "sudo apt-get install php5"
how are you calling up the php page in your browser?
cythrawll i am using kubuntu
hi!how can i go to the next line on a table from another?
is there any sintax like nextReg…
tavares??
i will write php webhosting script in between html tag
cythrawll
what address are you using in the browser?
to access the php script
cythrawll, i have several buttons(next,previous,end,start) and i whant the next to go to the next line of the table, the previous to the previous one…
html table tavares ?
cythrawll i didnt use any address
how did you open up the php script in your browser???!??!!!!!!!!
it's a simple question
cythrawll, no its a bd table
hi all, so i got the mysql_insert_id() sorted out when i submit data into a database, so how do i pass the same id over to another page so i can update the row?
i have to consult from a db table
bd table? what is that?
sorry…database table
tavares, what database host extension are you using?
cythrawll, i'm using MySql
am I right in thinking that if a query string is appended to a file (say, a swf), a browser will think it's a new file and download it?
as I expected. What did I do wrong?
GET POST COOKIES SESSIONS, choose the appropriate one.
that's because you don't know how to use a character class
caffinated - please enlighten me.
what do you suggest?
[abc] matches a, b or c
yes, i know this.
St3althy, i have no idea I do not know the whole picture of what you are trying to accomplish
ksivaji, have an answer for my question yet?
[^\]]+ matches 0 or more characters that are not ]
can i let you know the situation?
why are you using them at all?
cythrawll ya tell me
ksivaji, no i need you to answer a question for me…
ksivaji, how do you pull up the php script in the browser??
to test it?
caffinated - what do you reccomend instead? I tried /\[\[\[*\]\]\]/ but it didn't work for me.
\[{3}//moreregex\]{3}
/\[{3}.*?\]{3}/
cythrawll /home/sivaji/test/php i think i am suppost to call http://localhost which point to that test.php right ?
ksivaji, yeah you are doing it really really wrong :p
wrap .*? in () to get the capture
is this right
$id = $_POST['mysql_insert_id()'];
cythrawll ya just now i came to know i am suppose call using webserver
ksivaji, you can't expect to open a php source file and expect your browser to parse it… most people run their scripts through a web server which uses php as a content handler to run the code before it's sent to the browser.
ugh, i found the problem, it was totally unrelated.
tags.
cythrawll ok
thanks, caffinated & cythrawll.
stealthy know
er no
St3althy, what is the situation
is pm ok?
i know you want to insert a row, and then update on other pages right? how do users get to the other pages?
St3althy, um sorry I can't help you right this second I gotta go to a meeting
well its like a one time form that has the option for people to add extra info
so 2 forms really
it adds their email hosting address to the db, then on the thankyou page it says fill out the rest of your info if you want
so basically i want to update the row
St3althy, you should have two different tables, an "auth info" table which has the essentials to log in, then a "profile" table, which will have the extra info
i use Zip.php from PEAR … it calls an undefined function: gzinflate()
in php5 … anyone knows in which package this function is included for freeBSD/php5?
Hi, how can I add encoding to domxml_new_doc?
is there some PHP function to use a spot of ram to store data between ALL connections and sessions ?
How could I skip a certain portion of a string, so only certain parts of it are displayed?
substr ?
there you go, thanks
couldnt remember it
anybody know of a function that reads FLV files and gets the duration?
is there a howto for basic mysql use with php?
chris_punches, there are plenty, google it
any you would suggest, or is 'google it' the extent of any help you can provide
(i couldnt find any that were introductary)
chris_punches, I can honestly say that it's been a long while since I needed an intro to sql. I would also suggest reading the sql howtos at mysql.org, as they provide alot of helpful info as well
that might be just an automated response, just google it.
negativerad, that's bad
that would be a nice shirt! "Just Google It!"
haha
and on the back. ".. and STFU!"
JFGI
lol
oh glorious lunch break, bbl
negativerad, there's a nice one for mysqli on the php website somewhere, I think zend is mentioned on the page as well
erm, chris_punches
I'm trying to set the encoding on the dump_mem( true, 'iso-8859-1'); but no good. How can I set the xml encoding using domxml_new_doc?
chris_punches, http://www.phpbuilder.com/columns/ben_robinson20070314.php3 — not the one I was looking for, but good
thx
hi!i have several buttons(next,previous,end,start) and i want the next to go to the next line of the table, the previous to the previous one…
hrmmm
is there any way of doing that?
php looks alot like bash….am I onto something?
uml/dia converter?
no
this is for mysqli– im using just mysql– is there any difference?
i am using autodia but it appears to have issues with fk
chris_punches, mysqli is faster and easier to use
but my server is mysql, not mysqli
winmutt, I have used Visio w/ the ODBC connector, worked pretty well if you are on Windows
chris_punches, the only reason to use mysql instead of mysqli is if you're working on a legacy app which is using mysql instead of mysqli
ya no such luck
that's exactly the case
chris_punches, mysqli is a new module for mysql. it talks to mysql
Am using file_get_contents() to read an mp3 and output it to the browser with echo, correct Content-Type, but it only sends the first 60 K or so, with "Transfer-Encoding: chunked"
so i could have mysql with the mysqli modules and get both mysql and mysqli from the same server without a funky setup?
chris_punches, okay, let me try to explain…
I can download the whole file when I do "Save as Source…" from the lil' audio play bar, but.. ?
php has two modules, mysql and mysqli. they both talk to a mysql server.
oh, good good
mysqli is newer, faster, and simpler than mysql
they both will talk to a mysql server though
well, I'm using a CMS that is setup for mysql only. is it a 'one or the other kind of thing'?
chris_punches, not entirely.. but you are usually better off using only one or the other
i have the mysqli module….i'll see how it works using mysql for the old cms and mysqli for my php/mysql studies
hello!i have several buttons(next,previous,end,start) and i whant the next to go to the next line of the table, the previous to the previous one…
What table are you talking about?
call me a failure
DavidHKMrPowers, you're a failure
is there a visual db creator, like MSA for mysql on linux?
headzoo[afk], i have a table that as several records with several columns
You're a failure!
chris_punches, phpmyadmin
already have it…it's not exactly MSA
thanks guys
Is that an HTML table? i.e. trtd…
lol no where near as productive as the tool for msa
of course i could blame alot of that on my own ignorance
yeah, go with that.
haha
headzoo[afk],no. in the html i have buttons that i want to return'me the next and previous records of the database table
Ah, well that's not too complicated
any php developer here ?
ahmednitul, no
Nah, they all left
i need a 5-10 line php script to be coded
:/
ahmednitul, we use perl here
((
archivist
And ruby. And Python
Aarcane
anything
Perl, CGI, ASP, PHP
ahmednitul, not php though
C++
i just need this things to be worked
lol
Brainf*ck
not C++ it hink ;/
Nomikos, it's a language, you can say it's propername
ahmednitul, I can do it
I have done /some/ php, back in the day..
ahmednitul, PM me
I'll get languaged
preg_match('free work here!!
', $topic) returns FALSE
lol
Nomikos, Brainfuck is the proper name of a legitimate programming language.
hmmm.. with some / there
yeah ok datta one
How much about PHP and SQL do you understand?
Is it possible to explode an already exploded array?, cause i have a list of information that needs * and \n exploded, so then i can insert it into a database.
i work everyday with PHP and sql
Aarcane check pm
ahmednitul, I didn't get, you need to register
i am just bored
ahh
foreach($explodedArray as $row) { $items = explode('*', $row); /* do insert */ }
Then I don't see the problem. The Next button sends a '3' in $_GET['row'], and the Prev sends a '1' in $_GET['row'].. repeat
i am looking to make something like
out.php it will redirect peoples to an website
and trace who has redirected
thanks, ill try that
$items will be an array of stuff which you can then do .. other stuff with. Yanno.
ahmednitul isn't serious folk, he'll stiff ya~
turns my text into like chinese lol
Aarcane
ok, i know that i can do a mechanism that will traduce me the next row, i asked that because in ASP there where funtions that returned the next row, so i whas asking for the funtion..
You can make a database with the links and the hits and out.php will add one to the right record and then redirect the user.
i dont think that anyone will pay $100 USD for this 1 php
foutrelis
ya
something like that
It's not hard I think.
foutrelis
i am not a php developer
thats the problem
foutrelis, I offered to write it for him for $50/hr, 2 hr minimum. he didn't want it
you'll have to edit it a bit to make it work.. right variable names and such
Aarcane whr u from ?
Hire one. Or learn yourself Learning new stuff is always fun
ahmednitul, US
Aarcane then it's ok
foutrelis ya
but i do not have any time atm
lols
i gonna miss a contract for this stupid php
thing
You talk like that to your customer, man? he gonna lolzor!
Aarcane's offer seems cool.
Nomikos who cares!
lol
hrrm
I really don't know of any PHP function that does that
Aarcane whats payment method ?
I'm gonna have to back out, I can't work for someone who treats their clients like that
headzoo:ok, no problem thans for the tips
Aarcane lol
np
anyway! everyone have fun, i'll code that with my employee tomorrow
cya
You can find out how many rows there are with a couple queries though
bye ahmednitul
and my computer's time is 12 hours ahead
hello, champions.
how do i only print lines that don't contain ".*foo.*"
hi is there a channel where i can ask about php extension developing?
if (stristr($string, '.*foo.*') === false) { echo $string; }
are you saying with '.*foo.*' as a regular expression? or the literal string?
regex
i just want to see lines that contain ".*foo.*"
is this an array? or a file? or what? lines from what?
be as specific as possible.
its a string
strings don't have lines.
lol
is there a way to figure out what directory php-ldap looks for certs? there isn't any relevant info in phpinfo() nor at a glance or two at google
to shay
what does print() do
three words is not 'as specific as possible'
How can I take a huge list of games and the game acronym and put it into one string in a while loop?
lets see what pastbin has to say
what kind of list? an array?
Well.
In MySQL, I have a huge list of games and there acronyms.
I want to put that list into an string like.
Mario Kart DS acww: Animal Crossing Wild World ..etc
Right. But coming out of the database, do you have each list stored in an array?
there's about 30 different ways to do it, and about a million examples on the web. It's a very basic tutorial.
No.
Hello, I was wondering if anyone here could recommend a good XML library that will let me select elements and their values.
dom
simplexml
or simplexml
damn
doc|work:
http://pastebin.com/m185513b9
i am trying to get the country code of the user using hostip.info
You want all of the (possibly hundreds) of games to go into one string?
Like, I have the games acronym then the games long name.
I want to be able to have it like.
Mario Kart DS acww: Animal Crossing Wild World ..etc
Right. But it's all going into the same string?
Yea.
why a string?
I mean a variable.
use an array
http://bin.headzoo.com/bin/843
a 2 dimensional array, or an array of objects
Thanks headzoo.
that's kind of a silly design :/
Not sure WHY you would want to do that, but there ya go
Thank you.
there's no separator
use an array….
Not going to run your code, sorry, in a meeting. can you post what the data looks like? How hard is it to say "it's separated by newlines"
when using a socket created by fsockopen, can I see if there are bytes sent by the peer which are waiting to be read?
some ideas, with the little information I have, look at www.php.net/explode and www.php.net/foreach
http://us.php.net/manual/en/function.stream-get-meta-data.php
sweeeeeeet.
How to space that up headzoo?
Space it?
mkds: Mario Kart DSacww: Animal Crossing Wild Worldmph: Metroid Prime Hunterssfc: StarFox commandpbr: Pokemon Battle Revolutionthas: Tony Hawks American Sk8landtds: Tetris DSpkmnd: Pokemon Diamondpkmnp: Pokemon Pearlpds: Picross DSdwds: Digimon World DSchg: Club House Gamestetris: Tetris
DSff3: Final Fntasy IIIstrikers: Mario Strikers Chargedwii: Wiibds2: Bleach DS 2nd Kokui Hirameku Requiemblt: Bomber Land Touchhom: Heroe
a delimiter
You're better off doing what doc|work said, and put them in an array. You can implode the array later on
finally…
like hmm
you'd need a 2-dimensional array, or an array of objects
Some people don't appreciate being shown the right way, they just want their question answered.
I want the right way.
But.
How do you plan on using the data?
Hi, how can I make sure if my system has en_US? Currently setlocale or die dies
Showing the user of all the games he can add his friendcode for. If the user game isn't in there, they can't add there friendcode for it.
is there a header equivalent of going back
when I try to use the global var $_FILES it says undefined index
hello
SAberu|, have you added enctype="multipart/form-data" to your form tag ?
yes
and $_FILES["file"] matches the name of the post id
so it's the right name
i dumped the array and it said this array(0) { }
oh actually
it works
hi, i'm thinking about making a small webpage fpr personal use that collects data from different sites and gives me sort of a news overview. since i don't like re-enventing the wheel, does someone know of a project that does about that i could use ?
unread_bytes always seems to return 0, and the helppage reads 'Note: You shouldn't use this value in a script.'; any further ideas?
A feedreader?
i'm not familiar with that term ..
I tried feof() too with no luck
!+func concat
You know what RSS is?
!+func concat()
yes .. but i want it for information that's not in RSS format …
so i'd probably need to privide urls to check and a regex ro soemthing to get the info out of it. i know a program that provides that, but a webpage would be way more handy
i put the full root of the folder in when using the move uploaded file function
/home/moozicne/public_html/upload/
but it doesn't work
"doesn't work" is not a php error
hmm, not sure. are you using nonblocking?
anyone here still use innodb
is innodb a could have been?
yes
holas
What do you mean, 'could have been'?
quisiera haceles una consulta
?
alguien habla español
#php.es
http://us.php.net/manual/en/function.socket-select.php
er, woops - maybe not
maybe
I've been reading that one, let's see how it works
alguien h abla español
quiero hacer una sonculta
sobre plantillas web
you might need to set your socket to nonblocking.
uh, donde esta el bano?
but test first.
anyone here using PHPUnit?
a little.
learning about unit tests, not 100% proficient.
yes… kinda hard of thinking about test before code
main problem is what the heck should i test
at start
yeah, that's not entirely necessairy to start putting your code into unit tests. another method is when you find a failure, write the test for the fox, to ensure it never happens again.
s/fox/fix/
Anyone with knowledge of perlin noise here?
i can read the request body with file_get_contents('php://input')
notgod, yes but my aproach is to get into TDD
what's the cleanes way to check in advance if the request had a body
maybe the content-lenght header?
how can I search for a key=value in a multidimensional array?
How can I tell how much memory a scrit has used?
must be nice. we're too busy feature-overloading to get things done well here.
in_array() lets me find a key, or a value, but not a key with a particular value
could array_search() work?
http://us.php.net/manual/en/function.memory-get-usage.php
Thanks.
abilitare
my minds gone blank, how do I check if a number is even?
Modulus
Modulus?
how can i learn which characters should be entities in XML and the proper entity they should be?
use a foreach + if :p
ahh %
I was hoping there'd be a function for
foreach($array as $key=$value){ if($key === '..' && $value === '..') { pwet(); } }
yeah, but what if there's another dimension?
there'd need to be a recursive function
oh no ! i've an other idea
and you'd think this sort of thing would have been done before
if(array_key_exist('pwet') && $array['pwet'] === '..'){ }
array_key_exists('pwet', $array) sry
is it not easier to do if isset( $array['pwet' ) ?
interesting, I'll give that a try
Umm guys is there a way to buffer straight up HTML inside a variable or somewhere else I don't want to reformat my html
with the correct syntax of course
sure lol
it's a multi-dim array
what's the easiest way to step through a php program?
without actually installing anything funky
hi
i have a script to make downloads, and i count that downloads with php, but for do that i need read all file with readfile, and that cause some load, its possible i count the download with php, and download file directly ? note: i dont want make a header to link of file, the file is forbiden by
apache… for user cannt have direct access to download
"isset() does not return TRUE for array keys that correspond to a NULL value, while array_key_exists() does." (http://www.php.net/manual/en/function.array-key-exists.php) … i didn't know
oh right
does | have a special meaning in regex?
it means "or"
&~!
I just need to know which to escape ^^
err
no idea :/
meh I'll escape them all
:p
I don't think &~! mean anything
besides the characters themselves
I want to build a php-script which should read a XML-File
http://nopaste.php-q.net/316342
a url or link can contain special symbols like '&' and so on
it seems like that php has a problem with these special symbols
is there a way to escape this special symbols?
use ' quote marks
htmlspecialchars()
"blah$blah" - does weird stuff
'blah$blah' - does what you expect
you mean use quote marks in the xml file?
if you're storing strings, ya
ok, i will test it
hello. if i declare a function with a pass-by-reference parameter, and i don't use ¶m when calling it, is it still passed by reference?
Mr_daniel "\" is the escape charicter
"Quotes" –
have any function on php to call a file with out redirect ?
or better, i want users to make a download of the file
but i wont give direct link to that file
How do you check if a variable is empty / not used for an if?
isset()
hello
thanks
of even if(!$variable)
empty() ?
I've got strange problem on RHEL4 after compilation php 5.2.3 I didn't have in libphp5.so zend_printf
bash-3.00# objdump -T /oracle/php/php-5.2.3/libs/libphp5.so |grep zend_pr
Hi all. mail('to@abc.com','subj','body',"From: to@abc.com\n"); is called, but mta not using the From and is using www-data@hostname instead. Any ideas?
give me empty result, on other linux (gentoo) everything is fine… all compiled in php (on RHEL) addon works fine, but when I starting apache with php as module with saprfc module I receive error that zend_printf can't be found
hi all
hi
does anyone have any idea what I can have fu#$^$% on this RHEL machine ?
does someone want to help me debug a mailing script?
representing a date. how can i create a date in PHP to then insert it in a mysql database in a DATE format ?
strtotime() to parse it, then date() to export it
01 02 1980 for example from my form. how then can i make a php date ?
ok thanks
I'm trying to use imagecopymerge to merge a transparent png and a jpeg but it's not sticking. The template is the transparent png http://pastebin.ca/648983 anyone got any idea why?
php if empty($node-field_related_products[0]['nid']) != 1 ?
don't ask for help with debug but, paste somewhere on web script with errors and add link here - maybe someone will help you
err/// $date = strtotime($day .'/'.$month.'/'.$year);
Something like that?
no, if ( empty( …. ) ) { } php.net/empty
joshteam, then i can add $date in my database (a DATE column) ?
Gotcha, thanks
no
dates are stored yyyy-mm-dd
so you'll need to upload $date = $year.'-'.$month.'-'.$day
I normally store them as unix timestamp
how can I check if a string is an md5?
you can't, jstarcher
$date = strtodate($year.'-'.$month.'-'.$day); then ? and i can add it directly ?
AlexC_, well are md5's all the same length?
Ok, I have a script located at http://delano-e.com/fakemailsender/sendemail.php that fails. The source is at www.delano-e.com/script.txt Anybody know why it fails?
yes, they are
AlexC_, and they are only alphanumeric, correct?
you dont need strtotime
strtotime takes a string and gives you a unix timestamp
jg86jhmn93ldphj7kfybnjodjgu5nblaq is an md5 string
mysql date stores a string in the yyyy-mm-dd format
yeah
is there a way to figure out what directory php-ldap looks for certs? there isn't any relevant info in phpinfo() nor at a glance or two at google
AlexC_, I'll just have to set it up different…thanks
ok thanks joshteam
what are you trying to do?
add " before last ;
AlexC_, I was just making a function that salts a password
ok
and remove {
and…. go to manual…
I've got one, you give it a string ( the password ) then it mixes it up with another string,
so the final string wont be mypasswordSALT but like mspassawtodl etc
AlexC_, heh thats a neat idea but I gotta do it a certain way else vBulletin won't recognize it
oh
Ugh,,, why do people invent their own salting mechanisms….
Pollita, why not?
to aliviate their salting needs?
MUCH SMARTER PEOPLE THAN YOU HAVE ALREADY SOLVED THAT PROBLEM
chill lol
there are no such thing as smarter people than me
and what is the 'correct' way made by these 'smarter' people?
HMAC
It's standard, and it's far far far far less prone to brute force attacks then your primitive salts
o_O salts always seemed pretty useless to me in general, honestly
I know you are kinda busy but just wondering what the best way to do the opposite of $empty is… only display if it has a value
! and it's empty() not $empty - so do !empty()
nuh uh!! md5 sucks!!! hah
My bad, thank you (I have it working correctly the other way around right now)
http://www.phpriot.com/5581 , my problem is that when calling query after calling connect, query says that $this-link is null … any ideas what i've screwed up?
Warning: mysqli_query() expects parameter 1 to be mysqli, null given in Cxampp\htdocs\bankademy\dbAccess.php on line 90
any help?
Thanks to sunnywind
hello
cool thanks, never knew about hash_hmac()
is it possible to send a header that will redirect the page in n seconds ?
hmac isn't that the stuff used to compare signatures in webservices n stuff?
joshteam, yeah they use it for ssl certificates and such
pretty secure
yes.. but i would use javascript or some other alternative.
thanks
why, joshteam?
oh - in n seconds
glontu, and of course you can implement a timer in that
because he wants to time out php
Works perfect, thanks AlexC_
hey all, how do you truncate file_get_contents
you're welcome,
$id = $_SESSION['id']; , if a user write index.php?id=4 , it changes the value of $id to 4 ?
substr()?
oh yeh
urgh you have register globals on
It's used in many places, that being one of 'em
AlexC_, no it's off
so if the file is blah.txt and all i want is 100char how do i do it?
var_dump( ini_get( 'register_globals' ) );
substr(file_get_contents('blah.txt'),100)
?
by going to php.net/substr
AlexC_, what is it ?
checks the php.ini setting for register_globals - do that to check
it's off, i've checked
have you done much with web services, specifically soap in php?
there is no other way afaik that it does that, Nasky - just do that code and paste the output here
Webservices, yes. I tend not to bother with the needless overhead of SOAP though….
POGS works just as well
can i msg?
sure
if($this-link == null){printf("Broken");} also returns "Broken" if done within the query method …
so how can I get $link to be visible? i'm setting it in the connect method …
what exactly should $this-link be?
caffinated http://www.phpriot.com/5581 code is pasted there, it's a class for db access
i came in a bit late, i'm missing the initial explaination
ok, sec
mysqli_query() expects parameter 1 to be mysqli, null given in Cxampp\htdocs\bankademy\dbAccess.php on line 91
caffinated calling the class from another class via $db = new dbAccess(blahblah); $db-connect etc
maybe i should paste the class i'm calling it from as well
caffinated http://www.phpriot.com/5582 class i'm calling it from
any idea of an app that is best to make an online ads system like Adsense?
i have a script to make downloads, and i count that downloads with php, but for do that i need read all file with readfile, and that cause some load, its possible i count the download with php, and download file directly ? note: i dont want make a header to link of file, the file is forbiden
by apache… for user cannt have direct access to download
have any function on php to call a file with out redirect ?
or better, i want users to make a download of the file
but i wont give direct link to that file
copy a tmp file
validateuser and populateuser and others seem broken
take the first line in validateuser - it's passing in undefined variables
caffinated those are pulled from a settings file
they couldn't be though. it's not in scope.
caffinated include 'settings.php';
include 'dbAccess.php';
include 'user.php';
whats the function to just skip the first character of a string ?
$skippedFirstChar = substr($str);
what parameter am i missing
you're missing something fundimental about php scoping. those variables are not available in that method.
caffinated which variables? $this-username, etc?
http://www.phpriot.com/5582 - look at line 33/34 - there is no way those variables can contain values in that scope
$wgServer, $wgBackupServer, etc
caffinated it works when i pull just regular stuff from database class directly, without using from another class.
var_dump() those values inside the class. i'm not kidding.
if (!$handle = @fopen($time_file, 'w+'))
what does the @ sign mean?
suppress error output
caffinated http://www.phpriot.com/5583
you are not listening
caffinated okay i'll var_dump and see
it will work like that because it's _not in the same scope_
do it INSIDE the class.
in class user
you will find that those two methods are broken
okay
you are correct
which you already knew
so, what you need to do is either make them globally accessable (bad idea) or pass them in to the class. another way would be to set constants, as they are available regardless of scope.
does it only work on standard lib functions?
caffinated wow it hates if i just throw const in front of those variables in settings.php
no, it should work on any function or method. if you're using it on something user defined though, you're doing something wrong
i guess i could define them
'const' is a class keyword. you can't use it just anywhere. see: http://php.net/define to do it outside of a class.
w00t thankks all
hell, in most cases (save a few) if you're using @ at all, you're doing something wrong
alive?
I think I remember a function that takes an array and returns the distinct values in that array.. what is it? or am I mistaken?
ahh. array_unique
hello, when using phpdoc generator, can i also use normal php comments (//some comment) ?
because the other comments take to much space in some places so the code is not nice to read
is there a good way for me to define different functions based on the parameters passed? i.e. if "URL" passed to my class file contains https define thisfunction{ some way} else define thisfunction{another way} ?
hey caffinated
i want to keep function named thisfunction{} though
caffinated i did define("WGSERVER","localhost"); and when i var_dump(${WGSERVER}); i get NULL
I have a User model, and HABTM Videos through the guests_videos linking table
How do I create a new link in the guests_videos table?
sorry, User == Guest
earl|work you're calling it wrong
var_dump(WGSERVER);
hey folks, has anyone had problems with pecl commands ignoring memory_limit adjustments? doing something like pecl -d memory_limit=128m install somepackage keeps giving the error "Memory limit of (8M) exceeded."
caffinated k thanks, saw documentation wrong
caffinated okay so i did all that, and i'm still getting the myqli error i was getting before
ensure all values in the class are what you expect them to be.
i already dumped $this-link and it shows up as null =\
in class user ..
has any of you ever used FPDF?
and post the updated code for class user
i have this logical problem and am looking for input
i have an array like $array[0]["uid"]=1234;
"htmlspecialchars(): charset `US-ASCII' not supported, assuming iso-8859-1" with phppgadmin; how can i make this not occur?
heh
so basically it blocks all echo statements of any sort inside the function call
what about nested functions? those get blocked too?
and i would like to transform it so i can access $array[0] as $array[$uid]
no. it blocks non-fatal error output.
$uid = 0
where $array[$uid] is $array[0]["uid"]
DDustin, i can't follow
uid is some random value (session id)
userid actually
sorry, I was more being sarcastic. what I should have said was, please explain what you are trying to do more thoroughly
!tell DDustin about @
how do i introduce these keys into the array like that most efficiently?
I'm creating an interface and I want to force that the user has to create a __construct, if I include that in the interface will they be forced to write a __construct or will that not work because thats already there.
DDustin, still not clear enough?
so how do you echo to the 'error stream'?
sorry, I have no idea
http://php.net/set_error_handler
okay, so it blocks certain trigger_error calls
that I can understand
when running a php script from the command line, the script aborts because it used 16M of memory; however, the memory limit is disabled in php.ini
it's not just trigger_error, it's any non-parse error emitted by that function.
does anyone know what i'm doing wrong here?
can anyone see what's wrong here? http://www.fpdf.org/phorum/read.php?f=1&i=35591&t=35591
we don't support fpdf here - you'll need to contact the author.
ok then, thanks!
any Google gurus?
does php have a built in binary search?
how come if I have function abc() { eval("return false;"); die('abc'); } i see abc and not nothinG?
this is a language help channel, not a place to ask questions about google.
okay, sorry, just gave it a whirl. #google is pretty dead
snoop-: http://php.net/strpos is binary safe.
Hey, I have finished a web app that I will hand over to a web design person to spruce up the frontend and add some javascript/ajax for user friendlyness. What should I do about protecting the source? Anyone in a similar situation?
I think he wants to search a value in a sorted array in O(log n)
the help page of google calculator says "Feel free to experiment with the calculator as not all of its capabilities are listed here."
but i'm unable to figure out whether there's no way to make it convert "90 seconds" to "1 minute 30 seconds" or whether i just can't figure out the syntax
that could be, but when you don't specify what kind of input you're using, i can't really pinpoint what you want. so i offer a 'best guess'
i'm going to tell you again, this is the wrong forum. please do not persist.
snoop-: Not that I know of.
hi people…I have some doubts about sessions in php…can anyone help me?
ask your question.
Dont ask to ask, just ask your question
what's the last value kept in $_SESSION array ?
the last new value you assign.
I saw that this value always increases whenever you load a page with session_start()…
got it?
no.
didn't get it or it doesn't increase its value?
values don't just magically appear in $_SESSION - you have to set them
if you have an ever-increasing value in there, it's because you're doing something in your script to make that happen.
What's the php equivalent to the perl shorthand for print "A"x50; ?
save for a for loop that does more or less the same thing. Is there a function or some sort of expression?
what does that achieve? echo 'A' 50 times?
yes, it prints A 50 times
thanks
take a look here http://hashphp.org/pastebin.php?pid=26067 … $haha will always increase its last value whenever I call this page…what is it like?
$_SESSION['conjuntos'][] = new …
that's likely why
[] is an array 'push' operator
so $_SESSION last key keeps its length?
you're missing my point
you have logic in your code which can keep increasing the session array by 1 every time you call it
ok…could you explain it in another way ?
ok
but why?
what it means?
because of the line i posted
[] is an array push operator
it will append a new element to the array, leaving the other elements intact.
in other words, $x = array(1,2,3); $x[] = 4; $x[] = 5; $x[] = 6; now $x is (1,2,3,4,5,6)
ok…another thing, if I load this page it will only recognize one person has started a session, isn't it?
i'm not sure i understand what you're asking
if I open two tabs of the same page with session_start, will the browser know it is only one person accessing the page?
when the session engine is turned on, it checks the session id passed by the user to the webserver. if there is an active session with that ID, it retrieves it. if there is no sessionid, or that sessionid doesn't exist, it starts a new session and generates an ID which is passed to the user
either as a cookie, or by rewriting links and forms on the page.
Yes, if it's in one browser and you use cookies
taking a look at that code…I don't use cookies, do I? or is it just related to the browser stuff?
it is handled by php during session_start()
http://php.net/session for a more detailed explaination
roger that
http://www.google.com/search?q=90+seconds+in+minutes
0", not
nice
lol i have huge gap in my head
Hey
I have this switch script where it checks if the command is switched off or on.
If the command is switched to 0 hen its on, if its 1 its off. When I query the database to check my function to check isn't working, I'm doing it with a while loop.
I want to pass something with an ampersand as a GET variable, e.g. request=coffee&cream. $_GET['request'] should contain 'coffee&cream', but off course doesn't. How do I encode the URL to do this?
I belive it's #38
I mean
%38
php.net/urlencode()
err, without the ()
Thanks.
I know this doesn't help you, but generally 1 is on, and 0 is off.
hello guys
I'm getting a float (hopefully) via a POST. I want to check if that it is truly a float (IE, no characters)…I can cast it with (float). Is there a way to check if that string is a float? or is the best way a regular expression?
ok I switch it.
php.net/is_numeric php.net/ctype_num
is_numeric() should do the trick
I'm like dont code, but I got a page to show what I'd like to make.. its a simple php form that adds information to a database. an example is at gamedatabase.no-ip.org
haha you guys are great
you will realize, it is the language that is great.
and it is you that achieve greatness through it.
It doesn't work. Even when I use ?request=coffee%26cream, I get seperate $_GET variables.
you probably want to do ?request=coffee&cream
I've installed php5 and the relvent php5-mysql file but when trying to use a mysql type function like mysql_connect() it throws up: Call to undefined function mysql_connect(). I've check phpinfo() and there's absolutely nothing about mysql on it. Any ideas, what I might need to edit or
install first? I'm running Debian Etch just for the note.
and that would be … htmlentities() I think.
fyrestrtr
have you restarted apache?
don't use is_numeric to check for floats.
that's potentially the worst thing you can do.
How do I make a referential foreach in PHP4?
eg. foreach($array as &$value)
oh so simple, I feel so stupid
foreach ($array as &$val) { ..
could someone atleast push me into the right direction.. like tell me how retarded I am about coding pages. gamedatabase.no-ip.org
but as they say, he who asks is a fool for 5 mins, but he who doesn't ask is a fool forever
http://hashphp.org/pastebin.php?pid=26068 doesn't work properly…my problem is: when I call the page as a second time the previous objcts on $_SESSION['conjuntos'] are still objects but they don't "echo" information…..
there are no fools here.
are you defining the class for the object before use?
I feel like one ;P
uhum…wanna take a look?
caffinated here are the new classes and the test index.php file http://rafb.net/p/bgHIjE98.html http://rafb.net/p/NRfdQb30.html http://rafb.net/p/DPpsm490.html
in order to use an object stored in a session, you must first define the class for the object prior to calling session_start()
if I understand correctly, that doesn't work in PHP4 …
you need to make sure the class definition is available before you try to use an object from a session.
mysqli_query() expects parameter 1 to be mysqli, null given in Cxampp\htdocs\bankademy\dbAccess.php on line 90
eh, what caffinated said.
caffinated the query directly using dbAccess works, the query from the user object does not.
that is possible. i'd suggest writing a small test to verify that.
so I must use "include(conjuntos.php) in wich the class is bfore session start…is it that?
http://us3.php.net/foreach says "As of PHP 5, you can easily modify array's elements by preceding $value with &. This will assign reference instead of copying the value."
Works fine in PHP4.
if that file contains the class, yes.
caffinated so i guess the question is, is $this-link referring to $this being user, rather than the dbAccess object
right…thanx
Er, pardon. Mixing questions.
'$this' will always refer to the current object.
Pardon to me?
You got me excited there … how would one go about replicating a referential foreach in PHP4?
Ignore me.
bstra
hey
Ah, while (list/each) I believe.
That should retain references in 4.
caffinated … but why include the class before session_start…could you explain?
because the entire structure of the class is not serialized when you serialize an object.
I have an array, but I want to flip it, so the last value int he array becomes the first, and the second to last comes the second, and the third to last comes the third, and so on and so forth…. and vice versa.. I want to flip the array
how would I do this
PHP has to know which class to make a new instance of.
And it's difficult to make an instance of a class that hasn't been defined.
caffinated i have a feeling link is a reserved word or something
caffinated when i mouseover in my IDE, it says "link - create a hard link"
sorry … my english isn't that thing…what would "serialized" be?
Turning an object into a string representation.
In this case, a list of the properties the object had.
affirmative =D
Or rather, a class name and a list of properties.
'link' is not a reserved word
not in the context of an object anyway
perhaps php.net/array-reverse
it is a defined function though. so you couldn't do: function link() { ..
but using it as a class/object attribute should be fine
caffinated should be, but for some reason it keeps coming up as null …
caffinated it works fine in connect, but in query it fails miserably.
the reason it does that is because something you're doing is broken. it's that simple.
caffinated i realize it's broken, i'm trying to figure out what
how exactly does fgetcsv work…. ?? I am trying to create an $array[row_num][column]
there is a great example at the manual page.
ppl. here's my question. the code for imagerotate() example (pasted from the on-line manual, otherwise won't work!) works on a remote server running php4, compiled with '–with-gd', i installed php5 trough packages (Debian, Synaptic, .deb packages) wich btw. worked, and later on installed
php-gd package (something like that). Anyway, the example doesen't work even though phpinfo() clearly says GD library for handle-ing images IS installed. Help?
1) verify your values. all of them. in the context they are used. this means do it inside the class you're calling it from. 2) verify the response of the function. if it's giving you false on connect, it's probably a connection problem. if it's giving you false on a query, the query is likely
malformed.
there isn't an example of the csv
or i don't see what they are parsing
in the case of the query failing, echo the query, and try it in a console. if you're getting an error in the console, there is no way php can make it work.
it doesn't matter what it is, the example applies to any csv file.
so, the while loop in the example… is it looping through each row?
also, check the contents of mysqli_error() after running the query. mysql errors are not reported by php directly.
it is looping through each line in the file.
which would be a row I assume
caffinated it's not that the query is erroring out, it's that when i call in the variable storing the mysql connection it claims it is null, when i var_dump $this-link inside of connect, it shows it as a mysqli object, when i var_dump from the query method, it shows NULL when being called by
the user class
there is no concept of 'row' in csv-speak. It is a line, in a file.
ok
ppl. here's my question. the code for imagerotate() example (pasted from the on-line manual, otherwise won't work!) works on a remote server running php4, compiled with '–with-gd', i installed php5 trough packages (Debian, Synaptic, .deb packages) wich btw. worked, and later on installed php-gd
package (something like that). Anyway, the example doesen't work even though phpinfo() clearly says GD library for handle-ing images IS installed. Help?
when I simply press enter for a form field…what does the variable in POST or GET keep as value?
is there a way to figure out what directory php-ldap looks for certs? there isn't any relevant info in phpinfo() nor at a glance or two at google
stop pasting gibberish
again, do it in the right context. your test code happens *outside* of the class.
what isn't clear, i can make it clearer?
anyone dealed with GD?
caffinated how would i be able to dump the dbAccess-$this-link inside of a class that is creating an object from that class, considering $this-link is private and only in scope of the dbAccess class, and not the user class
what about .deb's
Hi
that depends on whose ldap libraries you are using.
Is it possible to add data (xml nodes) from one SimpleXML object to another SimpleXML object?
openldap's, I believe
when I simply press enter for a form field…what does the variable in POST or GET keep as value?
unless whose refers to someone else?
"" or "\n"
??
then it is location for openldap's certs on your system.
or " "
why does that matter?
then do it inside dbAccess
read php.net/gd
What would cause one PC on a network to load a SOAP WSDL just fine, but not on the next? The error is along the lines of "soap-error: parsing wsdl: couldn't load from…". The WSDL is being called via HTTPS and the soap:address location is also HTTPS
caffinated i am, and it shows up correctly when calling dbAccess directly, but when it's called from user, it says that $link is NULL.
because I don't want a object to be create if the user didn't filled the gap
then something is not being passed correctly in to the class to set up the connection parameters.
check where $link is instantiated in your class.
anyone know of any live web cam solution out there that doesn't use JAVA? maybel flash? anyone know any good open sourced ones?
d'oh! it reads /etc/openldap/ldap.conf, not /etc/ldap.conf . thanks for the hints
where is configuration file?
caffinated if i do a var_dump of the defined settings that are passed in to the connection in the user class, it shows the correct settings and is not null, it is instantiated in dbAccess in the connect function.
probably timeout? maybe there is an issue with the cert not being trusted by one ua.
for what?
php fkors
check phpinfo()
"add this to your PHP configure command"
wait…
caffinated also, i don't get an error in the connect method when calling from the user class, only from the query method, which both use $this-link without throwing a null
thx
that is only if you are compiling php from source; if your used a package for your distribution, that does not apply to you.
then what?
If it has to do with the cert not being trusted… is there a way around that? It is a self signed cert that is only used for internal purposes
then you need to ask your distribution how they package gd with php, as per the note in php.net/gd
http://php.net/gd one of the replies says i should
there is a way to bypass client-side verification; I did it once in curl. There is probably some optional argument to the soap class, or a property you can set that does the same. Sorry, can't be more help than that.
Installing PHP with GD2 support on a system running Debian Woody is quite easy. You just need to install the deb packages of the libs […]Having those libs installed, add this to your PHP configure command[…]
Thanks for the info however
this assumes you will be compiling php from source; so you need to do that. Instructions for which should be on php.net/installation
make sure you remove the current php install.
your solution though, is to disable client-side verification.
or, get a cert from a trusted CS
s/CS/CA
how come it deals with .deb packages then?
We will eventually get one from a trusted CA if/when we decide this is worth pursuing
I think freecert is well trusted…and can't you get sample certs from most CAs these days?
To be honest, I'm not sure
clearly, you need to install the *gd* from .deb, but build php from source.
I am 90% sure you can get a sample cert from Thawte.
oooh, maan why? why did they make the package then?
of the php that is
there is also freecert.org (I think) that you can use.
ask #debian
Thanks
just go to thawte or verisign and get a 30 day trial cert.
just go to thawte or verisign and get a 30 day trial cert.
they don't like me there anymore :-/
anyone ever heard of a malformed header from script Bad Header=Extension "somefile.php" error coming from a running php as a cgi?
https://www.thawte.com/ucgi/gothawte.cgi?a=b79850273967049007
$array_arquivo = explode('.', $upload['tname']); $extensao = $array_arquivo[count($array_arquivo) - 1];
$ext = pathinfo($upload['tname'], PATHINFO_EXTENSION)
no…
Im just showing the creative way a friend of mine used
actually
oh
he isn't much a friend…
be a friend and point him to php.net/pathinfo
nah… gladly he got another job… he took 2 weeks to make 4 modules using symfony
does xampp come with openssl?
i'm using drupal, and a contrib. module is giving me this error: http://pastebin.ca/649147 . googling seems to suggest i should compile php with libxml, but that *is* already there: http://hosting.beyondboxweb.com/info.php . what else could be wrong?
okay, so i've got a class called dbAccess that has a query method, when called directly it works fine, when called from another class which creates an object of type dbAccess and tries to execute the same method, it says that $link (connection information) is null. i have verified that the
connection information is being passed correctly. any ideas? here are the classes and test file: http://rafb.net/p/bgHIjE98.html http://rafb.net/p/NRfdQb30.html http:/
ask #xampp aka #apachefriends
i went over it, and i'm not sure why you're experiencing that issue. it does look fine. is $this-link immediately null after assignment?
caffinated yes, it's immediately null
ok, and $this-server, $this-username and $this-password all contain values in your connection() method ?
sorry, connect() method
caffinated yes, just checked, but it only shows up for the first instantiation of dbAccess, the second instantiation from inside the user class, it doesn't display anything from var_dump
ok, so it's likely a problem with things that are being passed in
you're using constants to pass in values, correct?
caffinated yes, i defined them in settings.php
anyone know about the METOER SERVER
caffinated in the from define("WGSERVER","localhost");
etc
ok, are you using the same case for your constants everywhere?
caffinated all uppercase.
caffinated maybe i will try hardcoding the values in dbAccess on the connection
Anybody know how to query a mysql database without having mysqli enabled?
there is some logic issue here, i'm just not sure what it is.
using php of course
i'm thinking it could be when you're calling close() that it can't operate on the same link again. are you instantiating the object twice?
caffinated under different names, one called testDb and one called test
caffinated actually test is the name of the object from user, validateUser creates an object called db from class dbAccess
No one know how to query a mysql database using php?
i taking a class on that now
I don't think that's ever been done before.
mysql_query("SELECT * FROM USERS LIMIT 30");
MonsterCheese http://us3.php.net/mysqli
Of course it has
lol
Tried, didnt work.
Wow, you *are* smart, aren't you?
$res = mysql_query("SELECT * FROM USERS LIMIT 30"); while($row = mysql_fetch_assoc($res)) print_r($row);
sure it worked
I get errors if i use mysqli
!seen jymmm
caffinated this is annoying heh
caffinated it /should/ work
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/bavirtua/public_html/login.php on line 9
have you connected to mysql?
Pollita_L Wow, you *are* a cocky little ****, aren't you?
Yes, in line 2/3
well then you're having issues
found it
caffinated pray tell
line 36 in user class.
$db-connect;
you're not calling the method
shit i need () on there don't i
Yes, but I didn't bring any with me today…. They're all at homew
indeed
caffinated thank you. that worked.
sigh.
don't sweat it. i think i looked at that line like 10 times
So now your a STUPID cocky little **?
give over.
caffinated i'm getting a poster that says "it's always a fucking semi-colon" =P
everyone here is a volunteer, not happy? find someplace else.
stfu. she outdoes you in the IQ department by astronomical levels.
haha
'you're'
hey, is there a way to limit viewing a webpage if it wasnt referred by a specific page
hrmmmm, I don't hink I like you very much
'think'
hi
if you don't do it, i will.
Perhaps a second set of eyes could have a look at this, maybe I'm just missing something obvious http://pastebin.ca/649168
important line is line 81
If she outdoes me in IQ, surely she'd be able to spell?
PIKACHU! I CHOOSE YOU!
rofl
LOL
What - no welcome backs?
Uh oh, team rocket's blasting off again
good
Oh, and pokemon's for little kids.
Now that's just uncalled for.
little kids who wrote sections of php.
Do i look like a give two short planks?
Okay! Love you! Bye bye!
perhaps he thought i was talking about userland code
Perhaps he's just a douche and let's move on
worksforme
anyone tried, the METEOR SERVER , aka web 2.0 http server?
web .. 2.0 .. http .. server
i'm having a hard time digesting theat
*that
Looks uninterresting to me….
agreed
an HTTP server written in perl. Sounds ugly and slow
I dunno how that's a "web 2.0 http server" but whatever.
well atleast its free
hello everyone
And you win the stupid remarks of the hour award.
at any rate, I'm still baffled by http://pastebin.ca/649168 line 81
socket_create() Unable to create socket [1]: Operation not permitted while trying to do socket_create(AF_INET, SOCK_RAW, 1) … any suggestion?
Toerkeium, which port ?
it's for ICMP
meebo.com is l33t
anyone here know SOAP really well?
I am not sure but I think it needs to be root to open that create RAW sockets. but I cannot set apache to run as root
Toerkeium, hrrm, I'm clueles then, sorry
hey, is there a way to limit viewing a webpage if it wasnt referred by a specific page??
found that, raw socket can be created bein root, damn! it works on windows! gonna move my webserver to win2k3
)
yes, but it's unreliable,.
and a million kittens cried out at once, and then were silenced.
you can check $_SERVER['HTTP_REFERER'] and take action based on that, but since it's provided by the client it can not be trusted.
hi all
eregi_replace("a[^.]*","",$content); don't remove a href….. and /a
:s
what's wrong
??
any idea?
renkoo.com is prett n33to
all these startup companies pop out of nowhere and create all these pretty looking sites
verboz, try removing the ^
xisix6, no
:s
first, use preg_replace(). second, use something more specific, such as: !a.*?.*?/a!si
third, learn what a character class is.
we seem to have an influx of all these java programmers getting into the web realm