they shouldve kept the original behavior of \r and \n
instead of having 2 characters that mean the same thing almost
all of the time
both examples? $var = str_replace(array("\n","\r"), '',
$string);
In building a really simple webspider, would you say it's faster
to store already spidered urls in an array and run in_array() to
check for already fetched pages or to use a php mysql web hosting
database, running and updates and select on each spidered page?
Crawling a 20 thousand page website is eating up around 300
megabytes of ram.
And a lot of CPU time.
Why don't you use existing ones?
well that basicly screams the answer
doesnt matter once you hit an infinite loop of pages anyway
XD
how come?
Wolfy[drawing]: haven't found a simple one. Nutch is way too
much.
meh, just go with the database
only spider i made was set to crawl one site
mnogosearch, ht://dig
That's what I'm doing as well.
it read every word on the page and stored it XD
I'm spidering a distributor that supplies my store.
may i ask why?
Wolfy[drawing], ahh yes, the array version of said
function... i don't use the array version much
Last time I've used it it was couple of years ago.
product listings and prices. They don't offer an API. :/
well thats one way to do it i guess XD
Does the store knows you're doing that?
nope, I don't see why they'd mind though. They can't expect my
hosting
company to grab listings individually.
I'm looking for a tutorial that covers how to website design a project to
utilize a highly modular structure.
I would mind, if there was indexing engine (other than the known
ones) crawling my shops
it's not a shop. It's a distributor. My company sells their
products.
Talk to the distributor. s/he may offer a better
solution
hopefully. It's draining having to write all this regex.
If that fails, I can't imagine, why do you refuse to use proper
indexing engines.
what do you mean? Mysql?
mnogosearch, ht://dig
Well, I don't think they parse the content.
Nor do I think they offer the ability to logon to pages.
if i want to access the directory that the currently running
php
webhosting file is in, how would i do this?
opendir('.') ?
i believe that's the current execution context. i'm looking
for something like python's __file__
__FILE__ exists in php
dirname(__FILE__) :P
awesome! not so different than. thank you all!
hi,is there a way to display in a webpage an imagefile stored
as a blob, without having to recreate the file ?
actually recreate is not the word, more likely to not to store
the file
caotic, yeah. just read the data and when you're sending it to
the browser use header() to set the content type to image/xxx or
whatever
cool thanks, ill look into that
opendir
it's faster
anyone availble to help me speed up a query i put
together
Whats the query?
any1 alive ?
on my PHP page, I check to see if a user in entered into a
certain table, and if he is not, it enters him. Now what if the
user opens up two pages... is there a chance (however remote) that
this use could be entered in my DB twice?
if so I would I stop such?
how can I insert poll script without using iframe ?
how can I do a loop until no remainder is found like
while((($x/4)!=wholenumber)) ??
linuxbomb, sounds like you've got it
wholenumber()??
is_int()
(int) $x
if ((int) $x == $x) etc.
ok thanks
pastebin running slow man, almost got it
dpaste is faster
thank foobar
http://dpaste.com/13992/
how would I setup a video player like youtube has?
with flash
I want the video's for my site to be played rather than
easily saved.
how difficult is that?
as difficult as you make it
flash video servers are expensive... you can easily embed
youtube movies in your site and save on bandwidthe
lumgwada, that's not what he asked
Quentusrex, you need to investigate flash video players, there are
several freely available ones out there
you will, of course, need to host the .flv files somewhere
though
you can still decompile the flash (or sniff the url with
wireshark), download the .flv and convert it to avi or
something
wireshark!
yeah, what about it?
if you want to include a page into another, but disable direct
viewing, how do you do that ?
this is notPHP related more javascript hosting
but I am not getting any replies in #javascript and I am hoping to
get something here. It is regarding the googleMapsAPI. I am getting
the following message. missing ) after argument list. The line that
it is complaing about is map.setCenter(new GLatLng(41.878249,
-071.369899), 15);
!+g8
#sql, #mysql or #postgresql. Apache Q's: #apache. linux web hosting Q's:
Either #yourdistro, #linuxhelp or #linpeople. HTML/CSS/JavaScript
Q's: #web. Just because some other channel is 'dead' does NOT mean
you can ask here.
what is that ??? - it's client/server: you control only the
server
i figured as much
i mean, i want to include file_inc.php into mainfile.php
but if you point your browser at file_inc.php it says "direct
access denied" or whatever
Using a .htaccess file is preferable if you use apache (one
centralised list of files disallowed), otherwise you can have a
define in the file that is doing the indluding and at the top of
the file that is being included do a check to see if the define is
set.
There might be a better way, but I generally use one of
those.
how would you write the values in .htaccess?
require_once ?
no..
i figured it out, $_SERVER['SCRIPT_FILENAME']; helps
http://www.auburn.edu/docs/apache/mod/mod_access.html
thank you lumgwada
it's useless to redirect from php to php - do it right in the
first place
im not redirecting
chickcoder, you put the include file outside the webroot
chickcoder, in reference to your question at 21:18:59
if (basename($_SERVER['SCRIPT_FILENAME']) ==
basename(__FILE__)) { die("direct access of this file is denied.");
}
^ that works
a slightly nicer way might be...
defined('INTERNAL') || die();
and then in the web hittable pages, define('INTERNAL',
true);
thanks waawaamilk
although .htaccess or directories outside the webroot will apply
to images and support files etc across the board ... more elegant
in the long run
what would '\\\\' be? two backslashes slashes or four?
four
if its asingle quoted string then 4
putting the files outside of public_html seems pretty smart /
foolproof
yes single quoted. thanks.
wow first php
marriage
where are pics
damn i wish i had a geek girl
hey guys
double edged blade there, if she's too geeky she'd want to be
doing geeklike things instead of be a girlfriend =p
does anyone try to use apache mod_proxy_balancer with php5 hosting yet ?
should I put stickysession=phpsessid ?
your problem is: you put html generating code in include
files - strictly split html and functions/classes
you actually have no idea what i am doing :P
no
chickcoder, well... i have a dream of a geek girlfriend who'd
hack code with me
pkrumins, geek girls generally arent hot
we'd just hack and not do much else
pkrumins, although they can talk dirty Pascal to you
lol
hey, i want no pascal
i hate to admit it but yeah, f00bar2k is kinda right. spend 1
day at gencon and you'll want to bleach your mind clean of any
dirty thoughts involving geeky girls
haha
aight. i am off.
I didn't realise real people said "aight"
f00bar2k, this is IRC... we're not real people
f00bar2k, i say "aight" all the time
im off
aight
my homies
anyone know of a good orm for php, thats not propel?
I need some help with PHP, so far I'm creating a 100+ line
PHP script, I've gotten everything to work except 1 function, I
need it to find the @ sign, then I need it to put the whole email
address into a variable, if it finds more than 2 email addresses
then create as 2 variables, can anyone help me?
whats the diffrence between echo and print. i have alway's
used echo but i just came across a script that uses print
heavily
they do the same thing
jcapote, doctrine
I need some help with PHP, so far I'm creating a 100+ line
PHP script, I've gotten everything to work except 1 function, I
need it to find the @ sign, then I need it to put the whole email
address into a variable, if it finds more than 2 email addresses
then create as 2 variables, can anyone help me?
echo $foo,"bar",$baz; but not with print.
(using commas to separate things to print)
which is faster than using .
do i have to generate anything or it figures it out at
runtime
so I usually use echo rather than print
ok just so im not missing anything, thanks guys
i use printf
I use fwrite
jcapote, go read the docs, i don't know... but propel sucks...
and doctrine is better
jcapote, that's not to guarantee that doctrine might not suck,
but afaik doctrine is pretty darn good
so I am just learning how to cahce my sql results using this
guide http://devzone.zend.com/article/1258-SQL-Query-Caching.
here is my script adapted in my e-commerce system. http://pastebin.com/945552 now in
the file i can see everything and it looks correct. also when
running the script it returns 5 'test' comments from the echo which
the correct number of rows it should return. can anyone have a look
and see if im missing somethin
foreach ($records as $id=$row) { i think this may be my
problem
hmmm, the parameter order for mysql and mysqli escape is
reverse
how thoughtful of them
thanks gaiz!!
what tdoes $id=$row action mean
input type="submit" value="Send"
beardbar, http://php.net/foreach
at least php is consistent in its inconsistency
Is there any way to do the same (send data) with PHP
code?
beardbar, read the manual. this channel is not a substitute
for reading the manual. this is a manual supplement.
!tell beardbar about g11
lumgwada, mmmm... not it's not even that much actually
ya read that again im using it right then
i have a table that basically counts how many items get
posted. It has a row that has unix timestamp. Is there any tricks I
can do to easily count how many are sent per day
what is stored in the table?
items?
it lists how many times an image is used
so I have an ID, DATE, IMAGE_ID
the DATE is a unix timestamp
right
i need to know how many rows there are for each day
for lets say 7 days as an example
select count(*) from [table] group by [somefunction](date)
the [somefunction] should take the date and convert it into a
day
like 20070710
or something
I presume you're using mysql, I do not use mysql so could not
tell you precisely how to do this
you could even alias somefunction so that you can trim the
return with HAVING
well I have that part down, the part I have an issue with is,
getting multiple days
can you paste the query you have currently?
stevenc|| each row is a day in the above example
what i have right now is this
$days = time() - (60 * 60 * 24 * 7);
$days ORDER BY date";
right, so that will return all rows where date is newer than
a week ago
yes
How can I send $_POST values to a another .php file?
what you really want is
select count(*) from [table] group by
[somefunction](date)
something like that
then you'll get a result set like
1 | 23
2 | 28
3 | 4
etc.
select image_id, count(*) from [table] group by
[somefunction](date)
hrmm
is it bad form, to call views from views. or should they all be
called from the controller
hello?
Anyone familiar with poedit / gettext?
a little (gettext)
hrmm im just trying to get it to work
i got a .mo file
and i got some text translated
but i cant get php to show it
you've compiled the file to a po?
I'm trying to set the value of an input type="text" to
something with quotes, ie value="These are \"quotes\""
hrmm.. i have both a .po file and a .mo file
but this is not working... any ideas on how to achieve
this?
and use the php gettext initialisation functions?
i'm reading some tutorial
(i've contemplated using a textarea, but it's multiline, and
i only want single line input... )
you should use htmlspecialchars
e.g.
and it has like a localization.php that accepts
locale=??_??
&?
that type?
i kindda included that in my test.php
'input type="text" value="' + htmlspecialchars($value) + '"'
yeah
php
require_once("localization.php");
echo gettext("Hello World!");
echo gettext("test");
?
see anything wrong with that?
have you set the text domain?
nm got it
textdomain..
hrmm
you need to tell gettext to use your language files
php
$locale = "jp_JP";
if (isSet($_GET["locale"])) $locale = $_GET["locale"];
putenv("LC_ALL=$locale");
setlocale(LC_ALL, $locale);
bindtextdomain("messages", "./locale");
textdomain("messages");
?
yeah, like that
thats inside the localization.php
and then where is your .po file?
you seem to be missing some \s if there are multiple
lines...
my messages.mo and messages.po are in
/var/www/locale/jp_JP/messages.po and messages.mo
my php files are in /var/www/
value=\"(.+?)\" would also probably be better as
value=\"([^\"]+\"
test.php and localization.php
well that looks like it should be ok then
(in my limited knowledge of gettext)
and you have compiled the .mo to the .po file?
yeah.. i didnt compile it.. this poedit thing did
i go to http://localhost/test.php?locale=jp_JP
and nothing has changed
okay... can you paste your .mo file into http://pastebin.ca?
http://pastebin.ca/612009
u want po too?
no, will be a compiled mess I would think
oh hang on
maybe I _do_ want the po
it actually looks ok
pastie it?
heh
that's the one I wanted
first time i used pastebin :p
heh. they're useful for keeping noise out of irc channels
anyways
i seem to have followed the instructions on the tutorial to
the dot.. but i dunno why
how can i test if the localization.php is actually
included..
I'm not sure of what the .mo file format is, but I can't see
Hello World in there...
just echo 'hi' in it or something...
hrmm
k lemme try that
i checked out the .mo file
it doesnt have like references to anything
dunno why
the .po file definitely does tho
the .po is the source file
if you were translating manually, you'd write a .po file
I presume that poedit is writing that out
ah
so .mo is what is being read
hrmm
maybe it compiled bad
yeah, it gets compiled to .mo and then the php gettext
function uses the .mo file
try removing the .mo file and getting poedit to recompile
it?
ok
ill try the echo thing first
if that works
then its definitely a bad compile
the echo worked..
!+enter
Don't use the enter key as punctuation. Think in complete
thoughts, then type.
geez, that's a bit anal...
I don't make the rules
why is that even a rule?
to irritate you - why else
I thought there might not be a coherent reason...
hrmm.. o well.. lets just concatenate my sentenses.. just so
people that have very low tolerance level can chill out.. anyhow..
is it correct that there should be a .mo file for each
locale?
um, not sure. At least for the language you want to use,
yes
(id like to say that.. even programmer dont program in one
line, its ugly)
i think i might have found the solution...
?
nvm
php golf?
can some give me some pointers. ive been changing up some querys
to improve speed and for some other reason. http://pastebin.ca/612030
if you look there it shows what i use to use, but now im using
foreach but cant get the same functionality. is it
possible?
heh... we had a question like that last night
$i = 0; foreach (...) { $i++; ... }
what was the result. oh stellar
yep works perfecto, thanks wwawwamik
still doesnt work ... gonna read up forum then restart
I'm in my own little translation hell at the moment, tho not
with gettext...
give up.. restarting
Howdy all.
$password=mysql_result($result,$i,"password"); -- this works, but
things that look like HTML entities (e.g. &xyz still get
interpreted by the browser as such.
Short of writing my own parser to translate any ampersands into
& -- is there an easier way to fix this?
the HTML output is done like this:
print " tr\n td$device/td\n td$login/td\n
td$password/td\n";
htmlspecialchars
hey I'm using a form to submit text and then store it in a mysql
db
I'll google that, but can you elaborate a tad? :P
what is a good mvc framework for php
I'm using mysql_real_escape_string to escape any special
characters from the users input...so text like "foo's" is being
stored in the db as "foo\'s" ...
ah, it's a function
indeed
..and it was that easy. Thanks waawaamik.
:P
but when I go to do a select to search for "foo's" it's not
finding a match (even though my search queries are also using
mysql_real_escape_string) ... what do I do?
(give me () as a hint next time
do you have access to the mysql shell?
I think so
prompt
mysql
yeah, I'm pretty sure I do
why do I need that?
for this problem
can you run SELECT * FROM [table] WHERE [condition] such that
the row with 'foo's' is in the result, and paste the result at
http://pastebin.ca ?
but why?
because I am half convinced you are double escaping the
'
you may be righ
it's very late
you from the us somewhere?
San Bernadino, California?
:P
yup
EST
you kids and your /whois
get off me lawn!
not that whois means much anymore
ugh...
2/3 are masked and the remainder have all kinds of
vhosts
it's mildly entertaining at 1:17AM
heh
printing out the query that's getting run.... it's searching for
"foo\\\'s"
sounds like you have magic_quotes on
they are teh evil
I don't see the point of hiding your online identity
really...
good lord
not that I have any problem against nicks
I don't either, which is why I put my real name in my
whois
search for foo\'s ... it's submitting a query for
foo\\\\\\\'s
eep
*sigh*
lol
it says "Nigel"
so
:P
you probably have magic quotes on
and perhap
where do I check that again? just phpinfo()?
escaping the query once more when not needed
um, I think ini_get('magic_quotes_gpc') will be 1 if you have it
on
I have put a print_r line in my code, and now have lost
it
To include GNU gettext support in your PHP build you must add
the option --with-gettext[=DIR] where DIR is the gettext install
directory, defaults to /usr/local.
do you compile your own php?
kikkomanchow, means pretty much what it says
did you get a fatal error when trying to call gettext()? if
not, then you don't need to worry about that...
no i dont
I didn't set up this server at all
so I really don't know if it was compiled or what
kikkomanchow, you need A) the gettext lib and B) the gettext
extention or gettext compiled directly in to PHP
?
kaylee_, php.ini magic_quotes_gpc
I was rejected by E Harmony
Out of late night curiosity more than anything else, does
anyone here use PHP with a web server other than Apache or
IIS?
i dunt get what you mean... i did the apt-get install
gettext
jameswf-home, hahaha... yeah lots of people are rejected by
eharmony
it says i have the latest version or something
PHP & IIS quivers
kikkomanchow, apt-get install gettext != apt-get install
php-gettext
im using the gettext extention thing
instead of php-gettext
but then again, if you called gettext() in your php code and
it didn't die with a fatal error, then you probably have it set up
correctly...
kikkomanchow, um... php-gettext would probably be the package
name *for* that "extension thing"
o it would have died?
it would have been a fatal error, so the message would either be
on screen or in your error log
get_magic_quotes_gpc() == 1
You can use the native gettext PHP extension or you can use a
library implemented in PHP that does not need any extension, such
as php-gettext
kaylee_, php.ini
kaylee_, fix it
so it is on
yeah...don't have access to that
I'll have to submit that info
so im guessing the "extension thing" is not php-gettext
kaylee_, ini_set('magic_quotes_gpc', 'Off');
kaylee_, alternatively you can use .htaccess
or maybe not..
you can't turn magic_quotes_gpc off at runtime can you?
kaylee_, hopefully your host will be kind enough to turn it off
for you in your php.ini
it's already done before your script gets control?
yeah, they probably will
for mahara, we wrote some code that will reverse the effect of
magic_quotes_gpc if it's on. You're welcome to borrow it
so you don't need to worry about the setting
nah...it's easier just to pass the buck and make someone else
fix it
though I would make more money with a work around
humm
you pick dealing with a hosting company as easier than
importing some code? good luck to you!
waawaamillk u mean it would have a fatal error by doing
gettext("blah") if gettext wasnt installed correctly?
yeah
kaylee_, or you could submit a support ticket to the webhost
and then wait until it's fixed and then charge your client for the
time you spent sitting and waiting
lol
ooh... I like that idea
hrmm
kaylee_, you might be lucky, it could take days! *grin*
D
I'm trying to replace the names of nodes of an xml file from
another website dynamicly. Yet I keep getting a home page returned,
why is this? Script: http://pastebin.ca/612075 XML:
http://www.nintendowifi.com/gaminghub/displayActivities.do?gameCode=ADM
Page: http://www.wildworldmag.co.nr/DisplayActivities.php
(about to blow up)
ugh..I think this stupid magic quites stuff has borked my data
too
*sigh*
so I strip slashes out of the keyword before passing it to the
query...
no results
only way to get results is with foo\\'s
grr
your script doesn't look like it will work...
Why not?
the second str_replace
is being done on $str again
it should be done on $XML
is there a way i can keep users logged into a site even if
the url jumps from www.domain.net to secure.domain.net
?
Oh ok. I fixed it. But it still returns a home page..
currently i use cookies, and i dont know how i could make
secure.domain.net read www.domain.net cookies
so you're requesting
http://www.nintendowifi.com/gaminghub/displayActivities.do?gameCode=ADM
and it's returning the homepage?
Yes
http://www.aspergercolony.com/AnimalCrossingMag/DisplayActivities.php
variable_office, you can't you have to write the Cookie from
www.domain.net for secure.domain.net http://www.php.net/manual/en/function.setcookie.php
have a look at "domain"
I'm not sure why that would be...
when I hit that page I get a 200
I'm thinking maybe its a security thing?
200?
as in HTTP 200 OK
DeusFigendi, would it be possible to do between two different
domains.
Do you see HTML or XML?
ie. my.domain.net and mydomain.net ?
yes
really? what would the str be for domain?
well hitting that URL gives me HTML
if (basename(__FILE__) == basename($_SERVER['PHP_SELF'])) exit;
// how reliant is this?
heh...
there's a better way
not using magic defines
that's the better way
rofl
When I load it into a different script (Actionscript) it
loads xml ..
that's better than relying on the contents of
$_SERVER...
i just want to be able to have one line at the start of a
script
variable_office, well the domain itself... but it might be
that the browser does not accept that.
well...
you can have this:
defined('INTERNAL') || die();
and then in your scripts that should be hit, define('INTERNAL',
true);
hm
Do /s need to be escaped?
in str_replace? no
well i'll switch to SCRIPT_FILENAME, and if it ever breaks,
then i'll think about doing all that
In the url
don't believe so
but my magic defines are actually shorter!
it's not really that important it doesnt get called anyway
it's not going on the web and they don't actually do
anything
I wish Flex had support as good as this
i have come to a conclusion
##php is the only nice and helpful channel on the network
XD
:p
then again i've only been to apache and c for afew hours
each
and i have nothing to do with anything else
Why would it do it for PHP but now for ActionScript?
you might need to send a header
Or a browser??
to say you want XML
Oh
that's the only other thing I can think of
How do I send a header?
you probably need to use the curl extension
http://php.net/anything
99% of the time you'll find what you want
you send headers with header()
Hmmm, what would be the best idea for getting the xml once I
get it?
I mean once I get it working with the header
o.O
0] Kai_wp Hmmm, what would be the best idea for getting the xml
once I get
my brain just exploded
you can't use header() for this
that function sets headers for the response your script is
making
LOL sorry, I mean, how would I actually get the XML and
send a header for it?
probably with the curl extension
ooh
http://nz.php.net/curl
try google for 'php curl example' or something
Wouldn't I have to run an installer?
depends. you can quickly check if your server has curl
available
theres php implementations for curl aswell
can i have two cookies of the same name if the domain is
different?
yes
http://www.aspergercolony.com/AnimalCrossingMag/Infos.php
'--with-curl=/usr/bin/curl' Is that Curl?
down a bit
curl
CURL support enabled
CURL Information libcurl/7.10.6 OpenSSL/0.9.7a ipv6 zlib/1.2.3
so yes
Oh ok
I guess tho.. you need to work out what you need to do to get
XML back from that URL
my friend asks me how popular still is php4
i am trying to setup two cookies, one for each domain, but the
domain that my site is not running on is not creating a
cookie?
he's developing some cool script and he does not want to make
two versions for php4 and php5
i could not really give him a good answer on this one
anyone?
what does the script do?
pkrumins, php4 is still the most popular version on vhost
environments
waawaamilk, it's yet another photo album
heh, and so he wants to distribute it for other people to
use?
yeah
he is creating a better version
how much does he care about others using it? If he wants
other people to use it, then php4 is still, sadly, the way to
go
err
s/other/more/
having said that, if you write a good project in php5, you'll
get people using it
I have such a project
as far as i know it is actually a plugin for wordpress blogging
platfrom
oh, if so then it should use the version of php that
wordpress supports...
are you allowed to setcookies for domains other than the one
your site is running on?
variable_office, you can set them, you just can't read
them
imo wordpress is written in php4 and runs on php5 fine as
well
so he should write in php4
boingolov, for some reason i am unable to set them, it just
doesnt appear
any ideas?
variable_office, what are you trying to do?
thanks guys.
my site has multiple domains, but defaults to one, I want users
to be able to login on site a, and set the login cookie on site a
and siteb so that when they get on siteb they still are logged
in
you can only set cookies for the domain on which your script is
running.
I just tried sending a curl request asking for xml, and I got
html back...
fyrestrtr, so if i am on my.domain.net i cant set cookies for
mydomain.net ?
that is not a domain, that is a *host*
variable, you should be able to, yes
read php.net/setcookie
variable_office, use .mydomain.net instead of
mydomain.net
http://wp.netscape.com/newsref/std/cookie_spec.html
is not domain.net and mydomain,net two different
domains?
if the script is running on domain.net, it can only set cookies
visible for all hosts on that *domain* only. So foo.domain.net
bar.zoo.domain.net but *not* example.com
less confusing example. i want to set a cookie on this.net from
sub.here.net
Me too
that is not possible.
so i cannot setcookie() to other domains?
just my local domain
variable_office, erm, you can put whatever string you want
for the domain variable
but, it wont actually set it in the browser unless the string
is equal to some subdomain of the domain you are currently
on
?
the funny thing is
you can put anything after the .do part of that url
like .dosalkjsdakfkhas
and it still returns the same page, which is stupid
http://wp.netscape.com/newsref/std/cookie_spec.html
i did, it answers nothing
"Only hosts within the specified domain can set a cookie for
a domain" -- that is the end of the discussion.
and it states it right there in the spec. Not sure what you were
"reading"
Thats really wierd
I've used 2 other xml files from there and they parse just
fine...
Hello all, is there existing php function to compare 2 arrays
?
yes.
theres multiple
look for it in php.net/array
thanks
http://paste2.org/p/4534
Why does this give me Error:?
, no real error message
Keigo-kun: because you don't have a connection to the
database, and you have turned off error reporting.
No. This is only a small part of the code, I do have a
connection. And error reporting is on since I got errors there
before.
this is not the part of code where error happens
Keigo-kun, what about the $dbname variable? did you select
the database with mysql_select_db()?
Keigo-kun, with mysql_query() you use the link resource from the
connection not the database name and anyway it is not required for
mysql_query()
hi, im tring to add GD support to my WAMP instalation, i have
got the php_gd2.dll in the correct folder but wile tring to restart
the apache server it tells me that it cannot find that extension in
that same path, any hints ?
also when i make a phpinfo() it prints "Configure Command
cscript /nologo configure.js "--enable-snapshot-build"
"--with-gd=shared""
hi. do I have to do some specific escaping when sending
email? like htmlentities when displaying as html
content
anyone use dadabik
jmut, it depends on what you want to allow
thats the thing..alow anything... pretyy much feedback from.
people could enter anything there...I want it emailed.
xcaht crashed on me
jmut, if its a feedback form then you don't want anything i
would probably just force it to plain text and do a very good job
sanitizing the from and subject field to make sure they cannot
insert extra headers
so the subject should have no new line chars and the from email
should be exactly one email address
i'll repeat my question due to the disconection i got
recently, dunno if someone answered me
caotic, no one answered in
mm oh ok
thats the thing...I don't want to sanitize anything... meaning
subject is given by me.... from email: geven by me + to: mail given
by me. It is just kind of report thing. just couple of form fields
that will be send.... In short....is it ok to send message of email
anything I want?
s/in/it/
jmut, well just pass make sure its not interpreted as HTML
caotic, you do any other modules work?
other than mysql not really
isn't this more or less up to mail client? if he want to
interpres all as HTML..I cannot stop it .... and on other hand
maybe using htmlentities will be safe enough
edman007, did you had the same problem ?
jmut, yea, but i think there may be some headers to say its
plain text
caotic, i use linux
jmut, specifying extra headers may be better then letting your
client assume something
edman007, got you, i use linux also, but im tring to migrate an
app for my job
MS servers
caotic, often the problem your having is just that the extension
dir is wrong, is the GD dll in the same folder as the mysql
dll?
caotic, i can point you to some Linux ISOs if you need to update
your server
caotic, when you say wamp you mean a 3rd party thing or you
installed every apart by yourself?
yup
eljak, nope, wamp just for abreviating windows, apache, mysql,
php
hello all
yep..I guess... but it is more or less ready lib I use...and
i think it is sending as html.... Will just htmlentities all
contents in message. thanks
eljak, yas i installed evey part
caotic, well did the GD dll come with your install of
PHP?
caotic, ah i see because under windows i use something called
wamp from wampserver.com where everything comes with it and
enabling modules is just one click
nope it didnt
caotic, no to who? me?
yes
edman007, sorry for that
caotic, where did you get this version of PHP? it should come
with its own GD dll
caotic, because i once i had the same issue with a dll and it
appears that there are versions of them that work with precise
versions of php
eljak, i have tried XAMP but, it want to learn to do it on my
own
edman007, php.net. i guess i didnt put the gd checkbox when
installing
caotic, why not? if you want GD use that one
does the installer even come with extensions?
edman007, yeah but i didnt know i neded it at the time i
installed it
TehSausage, it comes with most
the idea of "installing" php makes me cry
TehSausage, your a baby!
download the zip package
eljak, that did crossed my mind, but if the error message
says that it can't find it in the path it is ... kindda make me
wonder
i'm pretty sure gd2 is there
has the same mod date as every other file in there
GD2 is part of PHP, its a modified version and supports more
things
yeah that may me the case, im even tempted to reinstall php, but
its a pain ...
you can get GD2 separate, but it doesn't do as much in PHP,
but it can be useful if you need some bleeding edge
feature
the problem with php extensions is they have to be the same
version, and now they have to be the same threadsafe setting
+_+
it's hard to find the right one unless you get them all as
one
TehSausage, that kindda questions the Dynamic part in "dynamic
lybriaries"
probably why people never update php XD
TehSausage, well use linux and write a script to do
everything, that what i do, just download the latest and run the
script and i'm done
PHP runs better in Linux as well
winmodem
lol
unless they get a 100% speed emulator, i'm stuck with
windows+cygwin
those still being a problem
i havent use a modem in like 5 years :P
TehSausage, ndwiswraper doesnt help you with yout winmodem
?
FC5 install in VPC was afew hours, 10-20 minutes native
this modem is pretty old
TehSausage, is it a laptop ?
no
TehSausage, get broadband
no
XD
mabe you may wana remplace it
NO!?!?!?!?
Compaq Data Fa(il)x Modem
the modem i mean
either that or i really sucked at setting it up
because i copied the settings exactly, then tried every other
combination
TehSausage, winmodems suck, just get broadband and be done with
it
why waste money for something i don't need/want?
TehSausage, or you can get a Linksys router/modem combo
i'm happy with windows anyway
only problem is my compilers suck
and you need some microsh** products to compile php on
windows
is life worth living without a high-speed net connection? i
think NOT!
i don't feel like flooding the internet with
1000000000mbps
...i do
edman007, i agree
it's called "DoSing your ISP and other major internet
routers"
imagine 4 billion people with 100mbps trying to use the internet at
once
im gonna reinstall php , i hadnt tweaked it a lot so
...
if you have to install php, you're doing it wrong XD
yeah well, that error message doesnt make any sense
what is it
and is it cli, cgi, apache or all 3
Unablo to load dynamic library 'mypath\dll i just downloaded"
The specified model could not be found
o.O
makes perfect sense
really
you put the dll in the wrong place or extension_dir is set
wrong
check if theres a php.ini in any PATH locations overriding the
main one\
yeah, but it IS in the correct folder
and if you're using apache, you have to restart to make
changes
check extension_dir
TehSausage, the path in the error message is the same to de
gd2 dll i have
also the same path to mysql.dll
the error promps at restarting apache
did you use extension=dir/module.dll or something?
nope
iirc it doesnt give path names if a module is missing
just extension=php_gd2.dll
well heres my php.ini anyway XD
http://sausage.no-ip.org:88/php.ini
TehSausage, this is the path to my dll 'cservices\php\ext\'
here is the path in the erro message
'cservices\php\ext\'
permissions right? XD
PHP Startup: Unable to load dynamic library
"DPHP\dfdsahahgihsa\php_mysql.dll"
Does anyone know of a function that I can use to check if my
servers are up. I want to run a cron task every so often that will
email me if a server is down.
try a php script with if
(file_exists(''C\services\\php\\ext\\php_gd2.dll')) echo
"";
mon, nagios..
Nagios is pretty cool, if a little arcane to get going
initially.
ive got a
I'll check it out. Thanks!
TehSausage, i got the '' still think the error makes sense
?
lawl
easy way to fix it would be copy php.ini-dist over it and
uncomment it there
freaking xchan for windows is unstalbe as f*ck
im leaving now, thanks everyone i'll see you around
What do you think about offering "open full news in new
(pop-up) window", "open images in new (pop-up) window", "open
file's description in new (pop-up) window" in configuration of
CMS?
too much maybe?
popups are awful
I think no one cares for that.
I currently have these options but they can occur some problems
(instead of all layout, only the main part is displayed and i have
to care about it in another subpages)
and i think if i should eleminate these options
hi, which function can i use to get errors (php equivalent to
strerror(errno)) ...?
errors of what kind?
on file manipulation (opendir, readdir, unlink, rename, ...)
...
i'd like to know it when there's no such file or directory
...
hi. any ideas why on my local server, when i'm creating an
XML document - it's okay, but on the remote server i get Reponse
headers Content-Type text/html, when i do define them in the file
header('Content-type: application/xml; charset=utf-8');. The files
on my server and the remote server are identical :/
they return false if the operation fails, but i think thats
the only sign they give
arf ...
swordon, file_exsits() perhaps?
thx ...
http://www.withlove.lv/trash/mt/ajax
- remote server. http://nexsja.no-ip.info/w/mt/ajax
- my local
* file_exists()
zacs7, yeah but i'd like to get errors by a php native
function...
for example for mysql errors i use bts an mysql_error ...
they don't give error codes, they only return false
ok...
and if it fails to write, theres very few reasons why
out of diskspace or bad permissions
yeah but if it fails to rename, there's at least4 reasons
...
the easiest way it to avoid the errors
5] zacs7 *
the easiest way it to avoid the errors
file_exists() is_readable() and is_writable() will stop you
trying to do stupid things
well swordon if it exists, that nails one.
that's why i want to know it when it happens ... :
my turn to ask a question...
http://pastebin.ca/612210
can someone run this and tell me what happens?
zacs7, right ...
waawaamilk, don't have to run it.
i'lli can test it after a call to debug_backtrace ...
thx, zacs7 ...
good idea ...
you know what's wrong with it?
It *should* replace 'hi' with 'hi', why the hell are you
using the e modifier ? Bad idea
i was wondering if there is anyway to let php read ruby on rails
sessions
it's a simplified test of an example that needs the e
modifier
anything is possible
but don't expect it to be done for you
k, well it should replace hi with hi... I dunno haven't done
POSIX regexes in a while
yes sure but i even dont know how to start it!
why not run it and see what happens
find where the sessions are saved
not what you expect for sure
waawaamilk, cause I don't like PHP - I'm not even a php
dev
then try to understand them, and make a parser in php
i can get the rails entries from the db but i dont know how
to let php understand them
fair enough. It doesn't do what you say it does tho
php doesnt understand them
you have to write code so it does
anyone else here prepared to give it a quick try?
so there should be something ready
i wont be the first to do that
the function name i assume is breaking it
indeed...
it's not "lambda_1" it's "(some character)lambda_1"
try with a static function
the character is somewhere high in the unicode range
yeah, with a static function it's fine
but it's really suck that you can't use create_function like
that...
hi all
hi
good evening
can you suggest me a function that returns a last mysql
auto_increment value?
i just forget it ^(
I did a loop to populate date of a month in a drop down menu,
does anyone know how to add a "0" for numbers from "1" to
"9"??
mysql_insert_id or something, I don't use mysql
try http://php.net/mysql - it'll
be listed there
[bash] str_pad
$month = str_pad($month,2,'0',STR_PAD_LEFT); (01-31)
thanx a lot
although the first thing people usually try is if ($month 10)
$month = '0'.$month;
or strlen() == 1
...can i repeat my issue now? since there was no answer
what was the problem?
try it on one more server
and pastebin the code
oh mysql_insert_id thats it
thanks a lot
waawaamilk
"any ideas why on my local server, when i'm creating an XML
document - it's okay, but on the remote server i get Reponse
headers Content-Type text/html, when i do define them in the file
header('Content-type: application/xml; charset=utf-8');. The files
on my server and the remote server are identical :/"
I tried '0'.$month but I was looking for some function
i get different Header responses on different servers, but
the files are identical :/
okay. post the file on http://pastebin.ca
server might be sending its own header
are you trying to write to the xml file?
and, is it available publicly for us to see?
i am. and it's working, on my local server
try remove charset aswell
http://www.withlove.lv/trash/mt/ajax
- remote server. http://nexsja.no-ip.info/w/mt/ajax
- my local
print 'xml version="1.0" encoding="UTF-8" ?'."\r\n";
header('Content-type: application/xml; charset=utf-8');
that's what i'm sending at the start
did you try utf8_decode(); while writing to the file?
so about persistant connections (mysql_pconnect()), where
would i be able to say "ok no activity on this connection for long
enough, i'm closing it" so that i don't just accumulate connections
forever (until i hit my database's max_connections)
[bash] nope... everything is in UTF-8 ...
epswing, um, i don't think you quite understand how persistent
connections work
Kopcap, do you have a proxy?
abstrakt, you don't need em
as i said, everything is working fine on my server. so i
think it might be the server's issue... and... i dunno how to fix
that...
edman007 nope
well I had the same error before and it was solved when I
used utf8_decode();
Content-Type: text/html
when are they let go? they must be close at some
point...
the server is ignoring header() =\
TehSausage right
edman007, surely that was meant for epswing
why could that be?
pastebin the code
the whole code?
that's a wierd server configuration to override the
header...
abstrakt, correct..
sure
does a real xml file return right?
epswing, you don't need persistent connections
why do you say that
it can help if they also stop hotlinking
?
epswing, its for when you have a server with a high
connection overhead, and thats pretty much never
php header('Content-type: image/jpeg'); echo
file_get_contents('img.jpg');
bypasses anything stopping access to .jpg files from remote
locations
oh...
TehSausage i guess that's what you'll need. http://pastebin.ca/612225 the rest
doesn't matter
epswing, a server that is local or on the same LAN has a low
connection overhead, using persistent connections puts undue load
on the mysql server by using too many connections
how high is 'high'? let's say i have 1 hit per
second
nothing looks wrong in there...
(the db is running on the same machine as apache)
that's what i'm saying
does text/xml work?
the file works perfect on my server
and with no charset?
is there a simple/quick way to test permissions on a file
...?
i'll try
epswing, high as in the server is over a 300ms or higher
connection
is_readable() is_writable() etc.
epswing, local is 0ms
yesterday it didn't, TehSausage
TehSausage, thx ...
epswing, as in the ping
is_ executable is_dir is_file is_link
nope
the server is still rewriting the headers
ls -l ?
dunno how you'd get the file owner
ah, stat() returns group and user id
epswing, persistent connections leave extra connections open
so you don't have to open them when your script is called, it helps
with high latency connections, but in all other situations it slows
down mysql
what do you know, theres a fileperms()
that returns the numeric permissions
waawaamilk, i'd like sooo much ...
c'mon, php has so many functions that there's got to be one
for every day of the week!
epswing, if you have a high latency mysql connection then the
fix is to move the server and/or fix the network
fileperms_monday(), fileperms_tuesday()...
:P
does anyone know why xml was moved to application? =\
some background information, this is for a dead simple ajax chat
app i'm writing. new lines are fetched every 3 seconds. so if say 5
people are chatting (usually only 2 though), that's 100 db hits in
60 seconds. so those 100 connections are opened and closed. it
doesn't make any sense to leave 6 connections open and work with
them?
even javascript is text
err, 5* connections
won't there only be one connection open?
unless at one point one of them was not available, at which time a
second would be opened and added to the 'pool'
has anyone memorized up to 2147483648 ?
i have up to 16777215
+1 XD
blarg
is there a way to declare a class member variable read only
without using a get function?
use a constant instead. that's what they are for.
hi
-1
but how to del/clear an array?
unset() it
remove all entries from it?
anybody knows if windows has problem with system(). means I
don't get any feedback from the function
yeah
thank you so much
$array = array(); 'new' empty array, or unset($array); which
makes it unavailable at all
Shrike|work, is there a way to declare a class member
variable read only without using a get function?
Sorry I forgot to meson that I need to access it from an object
and according to the maual constant values cannot be accessed from
an instance of the object
sure they can
show me where the manual says that, not user comments i
hope
http://no.php.net/manual/en/language.oop5.constants.php
they can't be accessed like $this-constant_name, but can be
by ClassName::constant_name or (I think)
self::constant_name
thanx!
waawaamilk, thanks
hmm. thats a badly written page.
Shrike|work, Ill try it and see what happnes
i agree it sounds like you shouldn't use class constants in
instance methods.
but of course, you can.
Shrike|work, waawaamilk, Mmm.. this dos not solve my problem.
Ill just use get set functions I just tried to be lasy
what is your problem?
Shrike|work, I am creating an object with a lot of info from the
database and I need to make some of the variables read only. I
think get set is the proper way of doing it but I was just
wondering if there is a quicker way.
hi
mark them as private perhaps?
Shrike|work, yes. but I need the info form the object so Ill
just make them private then use a get function that returns them
.
I have just moved from php4 to php5, enabled extension_mysql
in php.ini, restarted server - but I got error: Call to undefined
function mysql_connect()
phpinfo() does not report any mysql
I want to write some books with a CMS, which CMS is the best
one?
is there a function which returns the whole output of an
external program (like system() )
not just true/false
please, could anyone point me what could be wrong?
Backtick operator: http://au2.php.net/manual/en/language.operators.execution.php
does anyone of you know a good pear-channel here or in
another network?
The official channel's #pear on EFnet.
Anyone? error: Call to undefined function
mysql_connect()
could it be that this doesn't work on windows (xp)?
id_sonic, drupal has built in book structure that you can
use
thanks!
id_sonic, you can add content as book pages
No idea, since I don't use Windows.
radone, make sure you have mysql extension installed
PHP API 20041225
argh, it perfectly works on linux
stupid windows
extension is available ext\php_mysql.dll and ext\php_mysqli.dll
are on its place
radone, enable it in php.ini
there olready is line extension=php_mysql.dll
and server was restarted
without any success
phpinfo() does not report anything about mysql
I want to write some books with a CMS, which CMS is the best
one?
id_sonic, i think i answered your question
radone, i dont know what is the problem try searching in google
to see the cases where you have this problem
eljak, thanks
Unable to load dynamic library 'cphp5\ext\php_mysql.dll'
File cphp5\ext\php_mysql.dll olready exists
Procedure not found.
any idea?
hammertime!
MikeSeth, hello, how's going?
tolerable
I havent killed anyone this morning yet
mmm, how's your business?
rolls
I need an ice cream now
U Can't Touch This
Anyone here able to help me with a SimpleXML problem? I'm using
PHP5's SimpleXML functions to read the feed at
http://ws.audioscrobbler.com/1.0/user/daniel_1515/recenttracks.xml...
you English or American?
tags?
Mace[work]: Israeli
Explains a lot
MikeSeth, any work for freelancer?
$element['uts'] ?
Mace[work]: why? *confuzzled*
at this moment? Nah. Maybe in 3-4 months.
oh
Cool, thanks
(MikeSeth) I havent killed anyone this morning yet
Only messin'
Mace[work]: ah. No, it's because people are dumb.
hi
what is an easy way to remove all entries in an array that only
contain whitespaces?
php.net/foreach
openssl module can crypt only an text ?
Mace[work], is there no function which removes array fields
which only contain whitespaces?
Chris-NB: php.net/array
Chris-NB: (no)
Mace[work], ok.
How do I, with PHP, check a mySQL database table for values in a
column, then just return the various values in this column? One
return for each unique value in that column.
SELECT DISTINCT?
Chris-NB: php.net/array_filter and php.net/array_walk
are there any cases where an exit() wouldn't actually end
running the script?
Mace[work], thanks!
hey might be wrong channel but em there is one youtube vid
what i like, is there way i could rip the song there?
Select distinct sounds good, will look that up on google.
Thanks
aa^way: tried that once. You will get stuck on a file called
p.swf - if you can crack where that pulls the data from you'll have
what you want
aa^way: I wasn't that bothered
aa^way: too much effort tbh
Can't think of one, but any registered shutdown handlers will
still run before the script terminates.
Mace well actually its really simple to get video file from
youtube in .flv format, but hm .flv to .mp3 converter should help
me actually
so there is no content, only song
I presume that same's true of destructors, although I'm not so
sure on that count.
hmm, don't have any. there's a require() later on though, do
they get run as any other function in line order, or...?
They get run in line order, so it should never get triggered
if it's after the exit().
aa^way: oh, like i say - i couldn't be bothered getting past
the p.swf bit some years ago now before Google bought them - you
could always capture the sound output that your computer gives out,
there are programs which can record it - Google.
odd. I have a cronjob running a php script, and sometimes it
gives me the exit() message only like it should, but sometimes
error output after it too, in another error message
What you mean by getting past of p.swf? Isnt just decompiling
:P?
aa^way: Flash sucks :P
lol
aa^way: So does actionscript :P
hi does anyone know about a way how to dump variable into a file
, like when i do print_r , but i want to output it into
file
php.net/fopen php.net/fwrite
I can't think why, I'm afraid.
quit
Mace[work] but if the variable is array i want to see the
array as when you do print_r but not to print it into html but i
want to put it into a file
cause i am doing with flash and i dont see it in html cause i am
not looking on it with browser
php.net/ob_start php.net/ob_get_contents
is the only way.
SoöemtAsassin there is imo a parameter so the data would
be in var not output
$output = print_r($variable,true) perhaps
omg im rock at writin
var_export($var, true);
omh
omg
f you would like to capture the output of print_r(), use the
return parameter. If this parameter is set to TRUE, print_r() will
return its output, instead of printing it (which it does by
default).
im retarded i didnt notice it
me too
heh
ye im god
I'm really tempted to chip in
omg Online-based flv to mp3 converter
php rox !!
hi guys, I need to be able to delete a certain row from my sql
table on a link click. I'm not sure how to implement it.
Haha
you gotta be kidding me
i waited 10 mins and it sayd your email is invalid because i forgot
to add it
heh finnaly this rapid flash php multi upload is
finnished
f00li00h yoo
aa^way: how's it going?
goodgood ,you?
aa^way: just got back from an allnight cardgames and sillyness
event
wow i almost pood myself when i opened my music dir and saw
there is nothing
but theni notied i have two dirs musicc and musiccc lol
hrm, that'll get you every time. i have ~/music and
~/music/all.m3u # i like to keep things simple
f00li5h you listen what?
aa^way: i like all manner of things
i have 50gb in /mnt/mp3
heh, i have 20gb on hda ...
well, wd0i, actually
how can i crypt an image with openssl ? for me only string
works
I don't think ssl does encryption of arribity things
only socket conections
hey guys
get image as binary string
I have a question that I doubt anyone will get...
just ask
ok
if i write base54_decode() openssl is die
hi
oh boy
I'm looking for a function which will return the value
associated to a key
gsuveg, what does it mean?
I have a .txt file, how do I know which line in it has the
most chars and how many chars it has?
what do you want to get?
'value'
you KNOW you're in trouble when you open some code you worked on
3 years ago and the first thing you see is this
i need send data (image, video, html) and i need encode
it
jessy_, try the [] operator
/* WARNING! LEET HAX AHEAD!
jessy_, $array['test']
with string it works
gsuveg, sure, use it as string
I have a .txt file, how do I know which line in it has the
most chars and how many chars it has?
yes. mcrypt() works with images
gat-man, by manualy counting it
what is your idea ?
gat-man, use cycles and count
a while loop?
gsuveg, use things that works for you
edman007, yes but I want to combine end($array)['test'], it
doesn't work
maybe a foreach loop, but that is not that relevant
jessy_, is it a nested array?
henke37, while($line = fgets($handle, 1024)) { blablabla } for
example
gpg isnt works as stable with php right ?
or 'for' cycle
?...
gsuveg, why you need to use such crypt functions, why don't you
use simple?
jessy_, just make an extra variable
I think the forced end parm sucks
gat-man, example
ok
edman007, mhh yes...
I wonder why people use 1024 for fgets? Id like just want to
knwo
we havent https at isp
aa^way: because they dont understand the buffered IO?
i need write an crypt in my two side
aa^way, same shit, just example one string patternally contain
1024 characters
that still doesn't tell me the number of chars the line
has.
gsuveg, mm, maybe simplier to get https working?
no. is'nt
change your isp or use some other protocol
its a big story. and dont me the boss
gat-man you are trying to do what?
aa^way: I'm trying to get the "width" of the text file, if that
made sense..
mahahahaha
"If you encounter problems with this cra^H^H^Hsoftware, let me
know"
gat-man: line char length?
line length *?
"quit emailing me with problems you caused yourself you
bastard^W valued customer"
maybe i need use mcrypt
gat-man: calculate the length of every line in the file, return
the biggest number of characters
aa^way: not just any line, the longest line
hm
the line with the biggest number of characters
aha!
idk, that's what i'd do
gsuveg, think one more time, maybe you need to develop some
other way to solve your problem
no how do I count the number of chars for each Line ?
$temp ? $content; $tempt; } @ gat-man
now*
what does niggers.pl do on the mailserver
gat-man: open the file, use fgets to get one line of a file,
then strlen
you called a filter that? nice job
yes. i know.
I must get the longest line in the file, so I'm gonna while
loop fget
does PHP have anything like
http://msdn2.microsoft.com/en-us/library/system.math.floor(VS.71).aspx
or http://www.w3schools.com/jsref/jsref_parseFloat.asp?
how do I know how many lines the file has?
that's nothing. My mailserver speaks lolcat! 220 PLZKTHX and
550 OMG WTF GTFO
gat-man: a standard way to work that out is count the
newlines
gat-man: count(file("filename")) // returns File lines
thanks
file line count*
aa^way: meanwhile, reading the whole file into an array and
throwing away the result... not good for
memory/performance
i dont use now C
waawaamilk well he could do operations with that one
anyway
oh crap...
what if I have a variable?
or a string if you will...
s/i dont use/i dont want use/
gat-man: look up the function substr_count on php.net, might
help in that case
excelent... although some MTA's will quote your mailserver in
their fail messages
that's the plan, yes
hi
gsuveg, what about isp changing and what the main idea/aim of
your project?
i see
you dont even wanna know what my mailserver says to the clients
that it deems spammy out of the blocklist
let's just say it mentions fire, suicide, and non-consentual
sex
Related Topic:
So what do you do with all this data if you want to pass it around or to have it persist between requests its