[fields], thx
Allowed memory size of
20971520 bytes exhausted (tried to allocate 375884 bytes)" This
should be the "memory_limit" variable in php.ini, correct?
i got a core file from xdebug
[fields]: you could substr as well, as long as you know the
first and last sections are fixed length
how can i see what's in it?
or analyze it?
true true
Memory leak
rjune jep, ini_set should also work in your script
rjune i think memory size is too big, i might not be right but
try to reduce it. I think biggest value is LONG INT for size or
no?
or set it using .htaccess
na looks right
date('d-m-Y')) -- but it only looks at the day. how do i tell
it to look at the date as a whole and check it?
hi
put the date in Y-m-d format
"Warning: mail(): SMTP server response: 504 david: Helo
command rejected: need fully-qualified hostname in
Ddeveloper\www\email.php on line 6"
Aragorn16, david isn't a fully-qualified hostname
david is set to my static static ip hosting
address in my hosts file.
Aragorn16, it's still not fully-qualified
david needs to resolve to the IP, and the IP needs to resolve to
david
You confused me a bit on that one...what could I use instead?
localhost?
[fields], so how do I use mktime() to produce the name of a
month based on the number?
date("F", mktime(...
nice
hello
check out the date function in the manual for all the
possible arguments
alex`: hm?
how can i tell if an image
hosting exists and if not show a noavailable.jpg pic
What I tend to do when comparing dates is put them in an
8-digit numerical format of YYYYMMDD.
if(!file_exists(...)) noavaible.jpg
For example, date("Ymd") would give the number 20070709.
Simple for comparisons.
alex`: thanks
ain't that the truth!
Still around?
im trying Y-m-d and seeing if that works... if not i'll try
your way then (thanks)
np
Why not date('U') ? (Unix Time) ?
what's the best
way to make a directory require a password on shared
hosting??
josh[n00b]: .htaccess
If you're using apache
ok its your way then
not a memory leak, it's an abnormally large wiki host
page
I did that.. made the .htaccess and the .htpasswd and :-/
iono, doesnt work
.htaccess, dynamicdrive.com has a htaccess password
generator
it's just md5
you can use freenode to do it
I don't know what's wrong though, I have memory_limit = 64M
in my php.ini file
josh[n00b]: Your hosting provider can disable htaccess, check
that this has not happened
have anyone here ever detached from a php script and exit
cleanly (whilst it continue the process in the
background)
Yeah, you could do that, although typically dates are given
in some sort of readable format, beit MM/DD/YYYY or DD-MM-YYYY.
Using simple substr calls, it's easy to strip out what's needed to
arrange the contents to be as a number.
Oh, I just do strtotime()
anyone live near sacramento and want a job?
It might actually be faster to do it your way, but I like the
readability of the functions.
ignore_user_abort() if you mean with http
no, because it prompts me for the username & password,
but it never accepts the u/p i supply
arpad# / ok but how can i rpevent the script from
hanging
Bit generic there, don't ya think?
like most scripts hang until it finished the process what ever
it may have been
Willing to relocate for six-digit figure. ;-)
looking for replacement web dev/small network admin in
sacramento. I got a job offer from cisco and am leaving
soon
i'm getting a segmentation fault, how can i use xdebug to see
a stack trace?
thats what i'm doing
you could load another url on the client side
example if you dont mean
example of what you mean
Geez, inflation must be high down there.
and honestly, this job played a hgue role in getting me that
figure
alex`: any idea why memory_limit is being ignored?
look at window.location in js or meta tags in html
so someone else can have a chance to get themselves up
there
I think you need to restart apache
[fields]: done that.
set the value, restarted apache.
does phpinfo show the change?
Any other ideas on how I can send email from a Windows
machine?
the right way :P ...thanks (it works)
lol
[fields]: yup
arpad# / there must be another solution i dont think that would
be a good idea
Aragorn16, just use localhost instead of david
found it.
It's been set explicitly in the script using ini_set.
thanks alex`225
OK, where would I set this? In php.ini?
alex` ^
to a css element for a div, the footer vanishes
No, I guess not, considering it doesn't show up there...
What would setting memor_limit to -1 do?
you could try setting a location header and flushing, i think
the client would wait for the connection to be closed
though
arpad# / there must be a php http trick to detach from that
process
is this the channel for help coding php
you could create another process with an http request to
localhost
that hangs
i tried that several time arpad
which you then ignore_user_abort() on the receiving script and
close the connection on the client one
http://uk2.php.net/pcntl
maybe ?
i'm trying to debug a php script with gdb. can anyone help me
find where it segfaults?
i want to know the invalid address that it jumps to
that will only work with cgi/cli - i'd go with the http
method
is there a php function to put commas in the right places in
numbers? so 17000 becomes 17,000
http://bugs.php.net/bugs-generating-backtrace.php
when I include() an html file, the size is wrong, but if i
remove the include, and put some text in there, that column lays
out correctly
number_format()
any ideas?
thanks
http://speaker219.ath.cx:8080/tests/while.php
x/s $esp
woops wrong box
testing something
that doesn't sound like a php issue, but if it's just html you
should be using readfile() not include
can you guys beta test my stuff at http://speaker219.ath.cx:8080/
thanks
readfile() eh? thanks
and yeah i think its a cass layout issue,
Hi all
who foo you foo
I hope someone can help me
i have a core file. how would i run gdb? gdb php and then run
script.php ?
to the div element, it makes the footer vanish
evoxy# / its easy
gdb php core?
whoever's trying out my message service, you need to write a
message first
and i know about the xss
i always forget this, whats the function to find number of
occurences of a string in a string?
substr_count()
gdb -q "/usr/bin/php script.php" core.file
how?
ah wait i'm gonna try
evoxy# / gdb -q "/usr/bin/php script.php" core.file
a message has to be written at http://speaker219.ath.cx:8080/message/send.php?hand=jjjj
indigophone
if you know about the xss why don't you fix it?
i am now
evoxy# / other wise do
accepting any user given in the url is a bit of a design flaw
too
run /usb/bin/php script.php
How do I create a message?
xss was fixed
jmccafferey, click on view code, then click on the link that
shows up.
/usr/bin/php ./sploit.php: No such file or directory.
it's designed to work as a contact form for a developer, so
they post that code on their sites and users can contact
them
just click "view code" then click "or use this link" then write
a message, it should show up in your control panel
I see no message
jmccafferey, what name did you use?
(gdb) bt
#0 0x0821e112 in ?? ()
llama?
it just gives me that
This is showing in my URL, hand=%3C?php%20echo%20$a;%20?%3E
obviously a problem
yea
jmccafferey, go here:
http://speaker219.ath.cx:8080/message/admin.php?hand=llama
please, correct you my code - http://nopaste.com/p/ayLyQkZD5
hold on jmccafferey, lemme fix this bug
i just started coding php today so its horrible
http://speaker219.ath.cx:8080/message/admin.php?hand=llama&code=true
then click (or use this link)
You will help ?
can someone beta test my project? http://speaker219.ath.cx:8080/message/
i am writing code for a contact form which needs to be able
for the user to add a file attachment and send it so that it goes
to the company email account. Does there user need to upload the
file before sending it, or can the user just browse for the file
and then click submit to send the form without actually uploading
the file first before submitting the form? thanks
Who is here ?
can you help me beta test guys? http://speaker219.ath.cx:8080/message/
help
same to you
Nobody will help me ? ;[
;(*
evoxy# / have you got a shell we can work on it
together
evoxy# / join #disasmain so we can work on it
193.77.***.***,
http://speaker219.ath.cx:8080/message/admin.php?hand=you%20suck&view=true
you do.
haha
anyways guys this is a tool for developers that lets you have a
contact form on your site for people to write
comments/suggestions/bug reports. just paste the code onto your
site and then people are able to leave comments or whatever, then
you can go to your admin panel and read the messages people wrote.
the project is brand new and can be found at http://speaker219.ath.cx:8080/message/
(any reports would be appreciated as i learned
http://speaker219.ath.cx:8080/message/send.php?hand=admin
This isn't #betatesters
rofl
3 people just joined #betatesters
when making a contact form, do I need the user to upload a
file attachment before they submit the form?
bwhen making a contact form, do I need the user to upload a file
attachment before they submit the form?/b
cute
do you want them to upload an attachment?
no i dont
then there is no need, is there? :P
ok, im a noob sorry
lol
were all noobs at some point :P
#betatesters
do you a know a tutorial that shows me how to do this, I've done
the whole form apart from the file attachment i don't know how to
do it
I thought you didn't want a file to be uploaded?
i have 29 feet of bubble wrap here, its a shame i have to use
it
www.php.net/features.file-upload
burst them all!
no i don't, i just want the user to select a file from the
hard drive and then click submit and the form including the
selected file will be sent to the inbox
that is uploading a file,
http://nopaste.com/p/ayLyQkZD5
- its wrong, correct you this code, please
What is the proper shebash string for a CLI php program?
#!/usr/bin/php -q ?
oh ok
Dash Q doesn't seem to work.
so where do i tell it to upload?
does it say on that site?
why not look :P
#!/usr/bin/php should work by itself, shouldn't it?
ok
i hope so
I've just tried it and it does, at least with 5.2.3.
you only need -q if you're using the cgi binary rather than the
cli one, to suppress the http headers
-bash: ../trackpoint_out_sim.php: /usr/bin/php^M: bad
interpreter: No such file or directory
although which php returns /usr/bin/php
You've got DOS line endings.
oh!
damn. how horrible.
dos2unix should fix that right up.
thanks a bunch. I just changed my editor to output unix line
endings.
I'm having an issue with some quote stuff. I get an error that
there is a wrong = on the onclick line. How to solve this ?
http://www.pastebin.ca/611127
Awhile back I had to work with a windows box.
http://nopaste.com/p/ayLyQkZD5
No problem. I'm just taking it as reason #642084 not to use
Microsoft products if I can help it.
global $pos = strpos($mystring, $findme);
Nobody will help me ?
i mean public $pos = strpos($mystring, $findme);
syntax error,
You'll need to set $pos in the constructor.
You can only use public $field = EXPR; where EXPR is
constant.
thanks lawnGnome, i was wondering whats up
no is no, cya
come to think of it, thats makes __construct see more important
than it did before to me
change your ' to \"
[fields], ok thanks
but that javascript doesn't look good.
is the trim() function multibyte safe? will it mangle
multibyte uft8 strings? if so what is the mb_ trim equiv? i cant
seem to find one in the mnauals
don't you want something like:
onclick=\"location.href='somepage.php?".$_GET['info']."'\"
Anyone know a place that will help me in creating a simple
WSDL file?
[fields], you are right, it was a quick C/P
[fields], but you have helped solving the problem
thanks/np
mysql_fetch_assoc(): supplied argument is not a valid MySQL
result resource in
/var/www/vhosts/iptriple.com/httpdocs/API/index.php on line
507
:|
while($provisioned = mysql_fetch_assoc($result)) { - line
507
and whats $result?
and if you used $result = mysql_query($query); whats
$query?
$result = mysql_query($query, $switch) or die("There was a
problem with the mysql connection or query. \nPlease contact
support about this issue.");
$query = "SELECT firstName, phone, pinAccountId, orderNumber,
status from `orders` WHERE (statussent) IN ('0') AND ((withError)
IN ('1') OR (status) IN ('1'))";
:P
hmmm, I've never used IN
I think your where clause is messed up
ahhhhh
i know the problem
i have a loop...and i have $result = blahblah; later on :P
lulz.
damn loops
better stick to Fruit Loops
lawl
well see the problem is...i didn't have a loop before :P...
damn yesterdays
lulz
[domon]: #sql
is it a conincidence or have those two guys planned to annoy
with their nicknames ?
[yes]
me and [fields] ? :P
YAR IT IS A CONSPIRACY
[domon], basically, yes :]
Hi, can anyone recommend a good accelerator for PHP to
replace Eaccelerator without too many config changes?
well, look at APC
I'm having mysql errors while trying to create a simple session
based login script, here is the message:
mysql_query(): supplied argument is not a valid MySQL-Link
resource in /var/www/dbcon/index.php on line 19
dlapoint, check that the second parameter passed to mysql_query
is a valid return value from mysql_connect
Does APC work with PHP 5.2.x? Looks like the last version says
"4.3.0 or newer" - I thought PHP5 was significantly
different?
Smashcat, yep, APC works with 5.2.x
http://whatsthecrack.net/Student-Suspended-Over-Suspected-Use-of-PHP
Ok, thanks - I'll give it a go - Eaccelerator is just too
unstable for a busy server.
indeed
Do you use APC yourself?
ekneuss, how would I go about doing that?
(i'm a bit new to this, sorry)
i am stuck with using php 4 and am trying to get xml to work,
how can i tell if domxml is enabled
phpinfo()
dlapoint, well, what are you passing as second parameter of
mysql_query ? var_dump it
$db=mysql_connect_db(); mysql_query("SELECT * ...",$db);
I'm passing $dbh
$db produces the same error
but what in there am i looking for
gives you ?
s,:,;
when i try to upload a file attachment to my server using a
PHP form, i get the following error:
move_uploaded_file(/var/www/uploads/cv.doc)
[function.move-uploaded-file]: failed to open stream: No such file
or directory in /home/gamelqi/public_html/upload.php on line
7
heh, "NULL"
wow, it's definitely monday in ##php
major contrast from the weekends
ratmas, give us a pastebin
yeah, right
I don't think you're telling it the right source file
ratmas, have you read php.net/features.file-upload
ratmas, make sure you have write permissions on both the /tmp
dir and the destination dir
Cannot instantiate non-existent class: domxml_new_doc
ok, so, it puts out "NULL", which means the mysql_connect
failed?
is *domxml* enabled?
comphappy, well, that would make sense if XML is inabled
comphappy, now if XML was enabled, that wouldn't make much
sense
...
it a monday give me a brake
I repeat my question: Do you have domxml or not? And which
PHP?
!tell dlapoint about pastebin
php 4 and my first Q was how can i tell if domxml is enabled
phpinfo says XML Support active but is that what i
want?
xml != domxml
comphappy, i'm not trying to mess with you. i'm just being
pedantic and subtley condescending. quite the norm for IRC, really.
take it as a joke. it means i don't hate you. if i hated you, you'd
know :P
comphappy, xml != domxml
thankyou for saying what wolfpaws said
oh, well :]
now how do i tell if domxml is enabled
comphappy, phpinfo() and look for dom xml
*grumble* I should upgrade to 64-bit distro :|
not there
Then enable it
hosting company
...
what is the best whois database to use to check if a domain
is available? it needs to be pretty fast, i plan on checking 91k
domains.
Bloody hell! APC is twice as fast as Eaccelerator with my app
;-)
Then talk to the admin
will do, just rather sound stupid here first
and make shure that i know what i am asking for
That's not any of our problem.
http://rafb.net/p/FyqcYj96.html
i wanted to make shure that it was not enabled before
demanding that they enable it
I need icecream
comphappy, if you want to make sure, var_dump(in_array('domxml',
get_loaded_extensions()));
Can you tell difference between weekend and Monday?
24 hours
I wasn't asking you.
What's a "weekend"! I haven't seen one in two months!
but i responded
so if I want to use a switch statement based on the url info, is
there a super global I can use?
they want me to pay $30 a month more for domxml
ahaha
http://rafb.net/p/FyqcYj96.html
change your hosting company then.
othere than that they are nice
and i signed a contract
they don't look that nice, charging 30$ a month for a stupid
extension.
$_GET
thanks mate
they say "It tends be resource intensive, which can cause
issues on shared machines "
o.O
Sure it can be "resource intensive", if you're uploading 2GB XML
file.
anything can be resource intensive, by the way
ahh now the truth comes out"We do have a newer machine that
has domxml enabled and we can move your site to that machine
without cost"
ekneuss, I have uploaded my code here, http://ethernetdat.org/tmp/code.txt
since pastebin is being so slow right now
er
apparently they like my $300/year
change "dat" to "day" in that URL
I've managed to kill a shared server with simple for loop and
mysql_query
dlapoint, well, there are enough pastebins out there, pick
one, I don't trust unlighlighted code
Wolfpaws:
alright
[domon]: I'm talented, what can I say :3
You can easily kill a shared server that has Eaccelerator ;-)
Just create lots of references to objects and it'll completely kill
apache!
dlapoint, change $dbh to $dbconnect
.......wow
I can not believe I missed that
if ive got an array of users, and each $user has a
$user["name"] and a $user["id"], how can i sort the array by
name?
heh, thanks ekneuss
hi
where can i find good graphing tools for php?
f00bar2k, http://colder.ch/repository/php/sample/sort.php
jpgraph
is there graphs like google finance?
trying to use the switch() for page navigation, not real sure
how to go about it
Go... And... See.
php.net/switch
i'm lookin at that
still a lil confused
is called
i must be missing somethin
break
got those in there
Haha! No wonder APC seems much faster than Eaccelerator did
on my test machine here - Eaccelerator doesn't work with PHP 5.2.1
;-) so it wasn't loading the module. Doh!
ekneuss, thanks that's perfect, i knew there was some
function which allowed a user sorting function
if you do not put break; after the statements the default
will be reached
got break; for each statement
hrm
idiotben, and even with them the default is still
reached?
yeah, i'm doing something dumb I just know it
i'm new at this though
idiotben, put your code somewhere
switch ($_GET) {
but I suspect i'm missing a step
Um. No.
print_r($_GET);
hrm
well i knew it was an array
i don't quite understand how $_GET can help me
wow @ ps3 price drop :P
that was FAST lawl
idiotbe, what are you trying to do dude?
based on what is in the url like index.php?someshit, i want
to pick what gets readfile();'d
but so far i'm proving that my irc nick fits lol
watch the language please
idiotben, could you give me an example of a url that you are
using?
if you want that, then you probably want
$_SERVER['REQUEST_URI']
Wolfpaws, hmmm... can I tell the difference in general? no
not really, all days sort of blur together for me, i work whenever,
for however long, weekday, weekend, holiday, whatever
that seems to give me more information lol
lets say I do a index.php?page=test for example
Wolfpaws, but the lamer ratio seems to be much higher on
weekends because there's so little traffic and and the traffic that
does exist on weekends is often hobbyists. lotta people during the
week are actually being paid to do what they do, which doesn't
necessarily mean they end up being any less lame, but still, the
ratio is a little worse on weekends
i get the directory names and such where the file life
err file lives
i suspect thats a little more info that i'd prefer to match with
my case statements
i guess what i'm after is something like an argv i reckon
idiotben, index.php?page=test to read that you need to read from
$_GET['page'], are you doing this?
ack i figured i was missing something, lemme give that a shot
vega
thats precisely what I needed I think
Well, that is somewhat true
idiotben, $_GET is an array that holds all data passed using
the GET method. You need to supply the parameter name you want to
access as the array index $_GET['param123'], $_GET['otherparam']
etc...
that did it vega
thanks a bunch
you're welcome
If I've submitted form values as an array named myparam[], can I
access individual elements with something like
$_POST['myparam'][0]
posix^, yes
can I unset($_POST['myparam'][0]) ?
yes
If i've got an array of users, and an array of my friends,
what is the best way to get a random list of 10 users who are my
friends and 10 users who aren't my friends?
whats the function to check if a string is alphanumeric?
unset seems to be ignoring the index and unsetting the entire
array..
shuffle() and array_slice()
Chatmasta, use regular expressions
ctype_alnum()
thanks i just found that
arpad, good one
theres a bunch http://us.php.net/ctype
posix^, but it shouldn't
posix^: what's the point of unsetting a post variable?
what about seperating users who are friends and non
friends
f00bar2k, don't you already have that done? you've got two
different arrays already, users and friends
f00li5h, just get all users who are not also in the friends
array
yp RichiH
just use array_rand() on your friends array for the first
one, and array_diff() to make the array for the second
*yo
f00bar2k, and why don't you do this with SQL? it'd be much
easier
what is the php command to parse out possible sql injection from
variables?
?
abstrakt, because the data source isnt a database
RichiH, mysql_real_escape_string()
f00bar2k, why not? sounds like a perfect candidate for a
database
arpad; I'm trying to unset particular elements of a $_POST'd
array
because i dont control the data sourcer
mysql_escape_strings()
so, just to be certain, when i use that function, i can be
_certain_ that they will be escaped properly?
the friends in the friends array aren't necessarily
users
GODAttach, actually no, it's not plural, and use
mysql_real_escape_string() instead
RichiH, if you're using MySQL for your database yes, that is the
only function with which you can be certain it will be escaped
properly for MySQL
RichiH, if you're using MySQL for your database yes, that is the
only function with which you can be certain it will be escaped
properly for MySQL
RichiH, http://php.net/mysql_real_escape_string
- use that one, the other is deprecated
RichiH, "real" factors in the character set of the database, the
other does not
indeed
ideally use prepared statements, which protect non-string values
too
among other advantages..
yah, just read that. thanks
arpad, RichiH prepared statements are only for MySQL 5 and
only if you then have the mysqli extension enabled
i normally do in my perl code, but in this case, i need to
build the queries dynamically
how do you read a specific line from a .txt file? i can read
the file, i can read the first line (fgets) but how can i get the
2nd?
and i wouldn't call that ideally, i've used prepared
statements before, i didn't see any major value
or PDO
couple of nice features, about the same amount of work
eh? they're perfect for dynamic queries - true separation of
query and data without messy escaping
bah, PDO is worse than just the regular sql extensions
if you have longer-running programs, you save db connections
and if you need to do lots of queries (10,000+) you save
time
PDO abstracts DMBS specific features out completely... SQL is a
good thing... DBMS specific optimizations are also a good thing
RichiH, save all this by using what exactly?
not if the string itself is being modified. you could build the
query and prepare that, but then the extra value of preparation is
gone, anyway
?? paste
RichiH, there's also mysql_pconnect if you're worried about
those 10,000+ extra connections
regular SQL is plenty abstract anyway
if you want to use DBMS specific optimisations, PDO doesn't
stop you.. it just gives you a unified interface
by preparing the statement and keeping it in an optimized
state. i don't know exactly what happens in the background, but in
perl, you can save a fair amount of time with prepared statements.
that might or might not be true for php, i don't know
so does anyone know a good whois database to use that lets me
check if a domain is available?
nah, this code does only a few queries
RichiH, ok, well yeah this isn't #perl and i don't know
either
you just bind the data to the query and execute it multiple
times
Chatmasta, google does
how do you read a specific line from a .txt file? i can read the
file, i can read the first line (fgets) but how can i get the
2nd?
checked out php.net/fgets already ?
!tell aLMR about pastebin
use the one on your server: system('whois
chatmasta.com');
i know, i was just trying to answer your question
im on http://www.tizag.com/phpT/fileread.php
RichiH, k
abstrakt, i meant doing it with PHP in huge bulk
aLMR, try http://devzone.zend.com/node/view/id/627
- that's a better one
The main reason to use prepared statements for single queries is
security
by the way i couldnt figure out the query strings
;(
Chatmasta, still not a question for ##php because you could
do that with any language... search for a whois provider with an
API for the web
and not that one again abstrakt
Hey folks, I have an if statement that doesn't work!
if ($toogleswitch=='0') {} /* nothing triggers this */
if (($toogleswitch!='0') {} /* everything triggers this! */
I'm guessing it is PHP comparing $toggleswitch to false rather then
zero, but I can't work out what to do instead. Any ideas?
What the hell...?
foo-to-foo, what is $toogleswitch?
A string.
!tell foo-to-foo about pastebin
why not make it a boolean?
Because it needs more then one value, plus it gets the value
off the command line.
well boolean comes in two values :P
Indeed
I meant, it needs more then TWO values.
hi.. i upgrade from php4 to php5 and now i have..
Assigning the return value of new by reference is deprecated in
/home/asopruis/asopruis/themes/engines/phptemplate/phptemplate.engine
on line 335.
date() [function.date
In this case, it needs to be one of four possible ones.
well say what you mean
which are?
0, 1, 2, 3
foo-to-foo, there is one ( more than necessary I think
Ah, I know.
Ignore it.
foo-to-foo, try !==
and ===
!== doesn't work.
=== doesn't work either...
what it could be?
=!= ?
Rather, !== triggers everything.
uuhhuhu
"PHP Fatal error: Allowed memory size of 41943040 bytes
exhausted (tried to allocate 12288 bytes)". my limit in my php.ini
is set to 80M (phpinfo() says 40M) ... but why isn't 12288 bytes
working?
=== nothing.
foo-to-foo, so it's a logic problem
Ah, never mind guys.
Yup.
foo-to-foo: var_dump() to see what you actually get rather
than just guessing
foo-to-foo, vardump your $toogleswitch and see what type php
is reading that variable as.
$a = new MyClass
An echo on the previous line says it is a whatever I put in
it.
Never mind guys.
Thanks anyway, help these other folk instead.
ekneuss, what?
foo-to-foo, var_dump() not echo
ekneuss, i'm using drupal maybe i need to upgrade it?
w/e
p3rti, disable strict warnings if you're trying to run a php4
compatible script under php5
ekneuss, how i disable that.. in php.ini.
?
p3rti, yep, change the error_reporting to simply E_ALL
hi. How can I get the width of a string in pixels, for a true
type font? I'm trying to center a text for an image created with
imagejpeg, depending on the width of the text.
"PHP Fatal error: Allowed memory size of 41943040 bytes
exhausted (tried to allocate 12288 bytes)". my limit in my php.ini
is set to 80M (phpinfo() says 40M) ... but why isn't 12288 bytes
working?
imagettfbbox()
no need to repeat. Now; What are you doing and how?
bkudria, local or master php.ini?
thanks! Will look that up
it's trying to allocate 12299 bytes *over* the max
s/99/88/
memory leak
i'm trying to use the image import module of drupal 5.1 to
import an image that is 2M
so i guess i should ask in #drupal
that 'over' thing wasn't clear to me, sorry
ekneuss, nothing
ekneuss, look http://tux.uis.edu.co/asopruis/
yeah. You should ask in #drupal
p3rti, it looks like a user defined error handler is
used
it's trying to allocate 40M + 12288B and the limit is only
40M
ekneuss, let me see.
p3rti, error_reorting doesn't apply for user defined handlers,
check specific settings of that handler.
hmm..my limit in php.ini is set to 80M, so why is it only
going up to 40?
heh. error_reorting :3
restarted the web server?
aah. no
You restarted Apache after fiddling with php.ini?
ekneuss, so.. if i put error_reporting to E_ALL &
~E_USER_NOTICE it doesnt work?
nope :0
still, 40M is a hell of a lot of memory for a single php
process
You mean E_NOTICE?
true...not quite sure why it needs so much, i'm filing a
bug
Wolfpaws, no.. i mean E_USER_NOTICE because.. ekneuss say that
http://tux.uis.edu.co/asopruis/
error maybe its user defined error.
but this client also needed this stuff yesterday. after i
import the images, i'll turn it back down
p3rti, I said user defined handler, different story
ekneuss, :O
Those are E_STRICT errors
(with addition of pass-by-reference thingy)
how can i self-reference on the php file? i.e. i want to get
the full path and name of the file the script is running
from
__FILE__
ta
Wolfpaws, my error reporting its E_ALL & ~E_STRICT &
~E_NOTICE
E_ALL doesn't include E_STRICT, so E_ALL & ~E_NOTICE is
sufficient
we're talking php5, of course.
ekneuss, of couse..
ekneuss, i dont know what it could be.. i make that change.. and
still problem.
does php not like object casting ?
(object) $var gives you StdClass
how do i execute a process and write data to it?
trying to go from MyObject to (ThereObject)MyObject where
ThereObject extends MyObject
Can I replace a specific item in an array with another
one?
Oh, you meant type hinting?
not sure what they call it with php
I'm not sure, that what you want to do is valid in PHP. look
in php.net/oop
yeah
For example, item number 2 in an array would be replaced with
something else.
nevermind my question
$array[2] = $newvalue;
Why do you want to cast it?
when the first version of php5 was released?
cause another object is providing a similar object
2005, IIRc. php.net/history
thanks
the first beta was 2003
What do you mean, can you offer me a small example?
Object1 provides Widget
SuperWidget extends Widget
need Object1 to provide SuperWidget
anyone has a downloadable sample of $_GET query strings?
So, class Widget; class SuperWidget extends Widget; $foo =
new Widget; and you want $foo to be a SuperWidget now?
That can't happen in OOP
Downloadable sample?
Well it can I guess, but you would just create a new object
SuperWidget based on a Widget using a copy constructor or some
such
I am developing an application in php, but i want to have a
computer system set up to handle the database and all queries run
by a system. Anyone know any companies that could assist me with
this?
Wolfy[drawing]: serialize will do it
wanderingii, lots?
or most hosters?
what do you mean by lots?
That is a poor way to do it
ah, __FILE__ gives me the full file system path, not the path
apache finds it under. i.e. i don't want to have $DOCUMENT_ROOT in
that path
Not that I actually know of what you wanted to do, but
okay...
Wolfy[drawing]: see http://us2.php.net/oop last
comment
thats dirty but it seems to be the only way to cast an
object
Just because some guy made it work doesn't mean it is good at
all
Because it isn't
"class casting per se is not part of the object/class
implementation in PHP"
how can I configure PHP under mod_php and apache2 to run PHP
scripts as MY user ?
im open to any suggestions for object casting
What I mean is the idea where foo can become bar in that
scenario is not good design
really? you sure? object casting is bad design ?
so, how do i get the filename of the current file?
without any leading path would be fully OK
basename() on __FILE__
$filename = basename(__FILE__);
kuuuuuuuuuuuuuuuuuuuuuujjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjaaaaaaaaaaaaaaaaaaaaa!!!!!!!!!!!!!!!!!!!!!!
sup Wolfy
I've made a pytubepod
i see we have never heard of polymorphism nor have you had
much experience with oo programming
Wolfy[drawing]: Cool, using PyQt?
If you think you need to upcast to have polymorphism than you
are pretty much wrong
no... CLI for the moment... In libs...
the concept is the same if its obect or my object
Wolfy[drawing]: Ah right, cool. Are you using keepvid.com to
retrieve the URLs?
yesh
lemme paste the code
Meh... if only I had time to rewrite TubePod...
I am not willing to argue with you about your design or what
you think is good or bad, I was simply stating that up-casting is
going to be a bad design decision, especially in a setting where it
isn't even supported. Your opinion of me or my experience in the
field of software development are inconsequential to me. I suppose
there might be a case where you would need this, and it would be
the preferred method of implementation,
anyone any ideas?
use substr and the like to remove that bit
or print_r($_SERVER) and see what you get
I sacrifised drawing time
um...
i already gave him an answer that doesn't require barbaric
techniques such as substr()
$filename = basename(__FILE__); // like I mentioned
earlier.
I am not sure what you are asking
that isn't what he wants
so, how do i get the filename of the current file?
without any leading path would be fully OK
SEEMS to me that's what he wants.
i need some sort of a server that can hold the database and
enable 3000 users to access it at any one time.
but i dont know what im looking for or what i need.
ah, I'm answering a different question he asked...
Have you developed this application already?
ah, __FILE__ gives me the full file system path, not the path
apache finds it under. i.e. i don't want to have $DOCUMENT_ROOT in
that path
developed the bulk of it
that one
What RDBMS are you using, MySQL?
Wolfy[drawing]: interesting
yes
What do you think?
Wolfy[drawing]: Except controller is misspelt
Your OO design isn't much like mine, but hell if it works than
that's cool
What's your OO design? CamelCase?
Pretty much any host will support php and mysql, if you have
heavy loads you should consider running a colo or getting a
dedicated host.
Wolfy[drawing]: Naturally that, yeah
Wolfy[drawing]: Naturally my code would probably just be broken
down into 2 libraries
Well, in PHP I've used to do that. Now I don't care
Keepvid and FFmpeg libraries
how do I make PHP scripts run as system users ?
cron
noo
jmcaffery, we are looking to get our own server and looking to
know how about gettin it
I'd like to allow users to log in and have a real username on
the system
and have the scripts they run execute as the user who's logged
in
someone can explain me what this thing and how i can read
it?==http://saint-tomy.miniville.fr
Welp, I've only added one library; wutils... Mostly for proress
and stuff.
kiwi`MouThon: What do you mean "read it"
see the code
Wolfy[drawing]: http://rafb.net/p/WCnpYr88.html
-- This is probably how I would've broken down my code and probably
how I'm going to implement the new TubePod.
kiwi`MouThon: You can't
short of substring, there is no sane way of doing this?
That's cool.
can someone throw a ban after kiwi`MouThon please?
look in print_r($_SERVER), see if you get what you want
Why?
for spamming game urls
Wolfy[drawing]: Thanks. Basically TubePod is just gonna be a
joint software that ties keepvid and ffmpeg together.
not a first time offense either
aye, will do
thanks
Wrapped in rubyGTK, of course. I made a few major mistakes in
my code, tho
Anyone? Here's what I'm trying to do. I'm trying to query a
database, and get a certain piece of code (contained in the record)
back. Then, I want to replace the corresponding piece of code in
another mysql array with that.
Of course, with Ruby-GTK.
How would I possibly go about that?
"mysql array" ?
An array returned from mysql_fetch_assoc()
$a = mysql_fetch_assoc(); ........ $b = mysql_fetch_assoc();
$b['code'] = $a['code'] ?
KomodoKoffee, so you're selecting "randomblobofcode" from one
row, then inserting "randomblobofcode" into one row ?
Well, like I said, that code needs to be fixed up a bit
(mine), but it's basically same as yours.
Wolfy[drawing]: Yeah, I could tell
Correct
Wolfy[drawing]: I figured you'd use BeautifulSoup
I'm amazed you worked your way around my Hpricot code and
translated it to BeautifulSoup
KomodoKoffee, SELECT code FROM `mytable` WHERE...;
I didn't. I've read the site manually and parsed it.
that might've been easier
KomodoKoffee, UPDATE `mytable` SET code = 'randomblobofcode'
WHERE...;
TML said, that cStringIO and BeautifulSoup don't really fit
together.
What'd you use strio for?
I just name my variables some combo of I and l
check the pycurl part
IllI ?
I don't want to replace the DB record; I want to make a
function that will replace a certain piece of an array (i.e. the
2nd entry) with the result of another, seperate, query returning
the same type of data
All in the PHP, not the DB. The DB remains constant
oh
See, I want it to be replaced conditionally.
Look how far I came with drawing: http://www.between-the-shadows.com/
ehm
it sounds pretty straight forward, just use two separate row
results
Wolfy[drawing]: I see, curl requires a method callback for
writing data
yesh. Which is kinda sucky
But at the end, we only print one array.
I'm actually thinking about writing sendtohost counterpart for
Python
Wolfy[drawing]: http://docs.python.org/lib/httplib-examples.html
Damn.
Basically, I have a DB that holds HTML. This html is used as a
type of "template", for all of the pages on the site. I have a menu
for regular users, and a menu for the admin.
The thing is, they use the same template for everything else.
The only thing I need different is the menu, aarcane.
That is much better looking
And of course, urrlib would offer a higher level, cleaner
approach.
I'm probably better off using that. the pycurl is pretty big
chunk for what I'm doing, anyways
komo they've told you how to do the query at least 3
times
KomodoKoffee, why not just make an admin menu to put in the
database and just use an if to select it instead of the normal menu
?
I think I'm going to have troubles with ffmpeg and detecting
its capabilities.
I already have problems with that.
Because all of the retrieved data is in the form of html
code. All of the data is printed at once.
That doesn't matter
KomodoKoffee, so break it up a bit.
Wolfy[drawing]: Instead, I'm probably going to work out a
FFmpegError exception and raise it if FFmpeg returns a failure
status.
You should still be able to query what you want, instead of
trying to alter your query results in php
Wolfy[drawing]: That's not what I said
how many of you actually use Komodo?
I just use a while loop to run through all of the data
returned.
Wolfy[drawing]: What I said was that they're two incredibly
crufty modules, and using both in the same codebase is a bit of a
mental red flag to me
YEah, I should do that as well... I think you need to look
for "unknown ... (...)"
you want to replace -just- the menu ?
Exactly.
KomodoKoffee, your design mistake then.... put an if inside
the loop to test if the user is an admin, and if so, skip the
regular menu and show the admin menu
Wolfy[drawing]: Not really, just check the return code of the
program and just store all of its stderr output into an
attribute.
Wolfy[drawing]: A bit like if you saw someone using, say, phplib
and phpnuke together in a script
then you should do as aarcane said and put the menu configs in a
separate table and load it based on usertype or however you decide
that
eeep!
Wolfy[drawing]: But that's several orders of magnitude worse,
given the nature of the two languages
Hi. how can I set variables with the loop count in the
variable name in a for loop? That is, $path1, $path2 etc. where 1
and 2 is $i that increases by one for each loop. I can't really do
$path . $i = xxx, can I?
chickcoder, thank you
Wolfy[drawing]: But I don't think it's a coincidence that
BeautifulSoup abbreviates to "BS". ;P
I'm going to scrap pycurl, anyways. I'll replace it with the
httplib.
chickcoder, noone's ever said I'm right before!
Don't.
use an array named $path instead
well it certainly makes sense to me to do it the way you
said
$path[$i] =
ah, right
hehe. #python says the "least acceptable abbrevation for
BeautifulSoup is BSoup"
chickcoder, most people just see it was my idea, and choose
to do it elsehow :P
*shrug*
IT was "quick and dirty, anyways.
BeautifulSoup does what it does really well, but lament the
fact that it has to exist
I think I'll go over the regex to do BS's job
Is there a PEAR library call to parse e-mail address headers
into their sub-components: Like: "Some random name" foo@bar.net
others enclose in '' or even jsut end in ';'
it's pretty rediculous
$c)?2:3;
$outcome = *
this channel is dead
what gives
yea I dunno
yes, but use parernthesis to force precendence
parenthesis even :s
$c ? 2 : 3));
ewww
anyone know alot about fonts? sorry its a lil o.t. just need
to riddle out a font name
there's a search function on pear.php.net
netsplit city!
This was really hard to find on google
http://pear.php.net/package/Mail
jmccaffrey, dont' get cocky with me, i've read and am already
using that package. It doesn't parse the 'To' headers into the
proper parts.
...the hell...?
look up the opentype specification. it's well
documented.
thanks
I have a problem. Anyways, I have a loop, and I have an array
that contains all of the code from the database (the template
code). I want to selectively replace the menu stuff with other
stuff I have. I want to do this only when the `template_id` is 3.
How do I replace just a certain part of an array? (Basically, I
want to replace only when php's data pointer is at a specific
place.
why a template in the db
php is a template language
I dunno. THat's just how I set it up.
in php
What do you mean?
i want to do the same thing, but in php
sure, copy what you just wrote
you can't
echo?
Wolfy[drawing]: Who are you talking to?
So you want php-specific code for that?
yes
echo 'a href="www.targeturl.com"img src="myimage.jpg" ALT="get
out of here"/a';
_
thats it?
Nice call.
Yes.
:-)
i was expecting it to be more like http://us2.php.net/manual/fi/function.imageline.php
thats a gd function to draw a line on a gd image
oktanouc, so which part of the php tutorial do i want
Anyone, help?
php.net/tutorial
umm yeah
been reading that
as you may have noticed
well if you know all the syntax, the only thing you can do is
learn and memorize all the functions as you use them
will solve all your problems
well most
just cause i read it, doesnt mean i always get it
When that fails, then ask here
in my case, i tend to over complicate things
thats why i came
UPDATE `ab_account` SET `password` = 'blah' WHERE (username) IN
('rockya69@tradeweb.net')
i get an error with that query, ONLY when I do it through
mysql_query
when i do it directly to the database i have no
errors
did you echo mysql_error() ?
is there any way to call a DLL from a PHP script?
correction, Directly from a PHP script.
yes. php.net/com
Wolfy[drawing]: okay, thanks!
bah, where is argv in php?
nevermind XD
yes.
i keep capitalizing it
anyone here use any commerce components in sites?
php.net/argv
yea...i am and it doesn't echo anything...
i am also printing the query out...
when i copy and paste it into shell it runs fine o_o
does it say 1 row affected or whatever?
you want mysql_affected_rows
Congrats to Piera and Newbie on the first #php marriage!
???
yea
try dropping the `, i've had trouble out of them
sometimes
UPDATE `ab_account` SET `password` =
'cc9d5a407d47086f39fdd4bd38725bf4' WHERE (username) IN
('rockya69@tradeweb.net')
mysql_affected_rows(): supplied argument is not a valid
MySQL-Link resource in
/var/www/vhosts/iptriple.com/httpdocs/API/index.php on line
583
There was a problem w
whoops...didn't mean to get that last bit :P
dude
it means you aren't connected to the database server at the time of
the query
so you don't actually have a valid MySQL connection
sql looks ok, if a bit weird
i am connected _
domon
one thing you learn is to use the mysql_error()
how are you calling mysql_affected_rows() ?
echo mysql_affected_rows($result); :|
leave out the $result, just call it ()
the argument is optional, and should be the link resource
(connection) if used
ok, it returns -1 :|
ooo lmao
that means last query failed
but it works when i run it manually _
calling it without any arguments now?
uh.. dunno, CLI php might be a different version, or have
different settings
no..not thru php...thru mysql it works
okaay.. through MySQL you don't *have* a link resource
identifier
i know o.O
echo mysql_affected_rows();
i just told you it's -1 _
n00bs teaching n00bs, and both will fall into a pit
.. kay, uh. dunno.
Does anyone have any idea why the http_get function (http://usphp.com/manual/en/function.http-get.php)
is undefined but documented?
Because it relies on PECL component
Wolfy[drawing]: what is PECL?
!+pecl
[PECL] PHP Extension and C Library, the low-level big brother to
PEAR for PHP extensions written in C. http://pecl.php.net
i see. would anyone suggest an alternative function to use?
the reason I ask is that Http::get raises a warning when it gets
a 500 response, i'd like to catch that.
file_get_contents()?
Hello, I'm getting an E_NOTICE when use a constant from an
included file. How should I reference the constant from the
included file so that the notice doesn't occur?
define the constant
The constant is already defined in the included file.
i got rid of the backticks and it still errors out
If you get E_NOTICE, then no, it isn't
Do I have to redefine it in every file?
on line b66/bbr /
how do i specify a timeout when using the http client in
file_get_contents?
Surely that means it's being defined, just in a different
file?
That doesn't contradict *ANYTHING * I've said.
So do I do a define(THEME_DIR,THEME_DIR) in every file?
wha?
Surely that will throw the same error?
php.net/define. Go read
All my constants are centralised in one file.
And then that file is included in every script.
Yes, hang on, I'll get the reference where it says this is
supposed to work.
bYes, hang on, I'll get the reference where it says this is
supposed to work./b
so file_get_contents still pops up a warning when there is an
error!
is there any way to suppress the warnings?
yes.
!+@
[@] The PHP error control operator that suppresses errors
(@foo()), see: http://php.net/operators.errorcontrol
- Don't use it. Think I'm wrong? Ask me about "GO".
http://au2.php.net/manual/en/language.constants.php
"Like superglobals, the scope of a constant is global."
did you've read *ALL* of it? 'cause of what you have showed
me you even define incorrectly.
ergo, if I define a constant in one file, and then include
that file in another file, I should be able to reference the
original constant because it's super.
php-bot: are you a human being? if so, thank you.
XD
no. constant is constant, super is super.
!+php-bot
extra, extra, read all about it, php-bot is it has been said
that php-bot is me, a sad little man with light-speed typing with
nothing better to do than exist on the net drinking coffee and
typing at incredible speed. some even think that I'm God, or
unhelpful
Yes. I've read all the pages on defines, defined, define,
constant, and it was quite lengthy.
how strong is PHP's 'private' in PHP 5+? is there a way to
modify a parent class's private members using a vanilla PHP install
(no PECL)?
not from what you've stated.
What have I shown you so far that was incorrect?
So do I do a define(THEME_DIR,THEME_DIR) in every file?
Yes, that was facetious.
pastebin the code.
Is it possible to send form data(or otherwise call/invoke) a php
file *without* loading it(ie, keeping the current page) in HTML
4.0? :x
ya!
ajax FTW
_
In my file, .config.php I have the line
"define(THEME_DIR,'/home/me/development/project/themes/fashion/');'
I'm rather ignorant when it comes to AJAX. Ah! A link.
Thanks.
last "'" = '"'
which function would be most suitable for removing $foo from the
beginning of $bar ? currently I am doing a fairly convoluted:
substr_replace($bar, "", 0, strlen($foo));
so you didn't read the manuals
np, you should find that to be very easy to use
!+func define
bool define(string constant_name, mixed value,
case_sensitive=true): Define a new constant
yay, got the DDL working...now to get the DDL to return the
right values...
DLL**
[domon]: Um... I see XHTML in the code.. :x
:|
nah
XML
Ah! Derrrr, the problem wasn't the fact that it was in another
file, it was a typo in the original file!
so ... does anyone know whether a parent class's private
members can be modified by the child in PHP 5+?
Hmm... So I'll need to install stuff to use ajax... _
Two bits of information in the one error message was what
confused me!
no, the problem is, that you faild to read the manuals,
therefor you failed to quote the constant.
you shouldn't need to install anything
Thank you Wolfy!
Yes, but I had quoted the constant on every other line in that
file.
Ajax (as a concept) has no backend component - however there
are libraries for a number of different serverside languages (like
PHP) to make issuing Ajax calls easier
I did know I was supposed to do that, just missed that one
line.
the thing i linked ya to is specifically for use w/
php
Mkay. Thanks. I'll check out what w3c has to say about
ajax.
nothing. 'cause "ajax" ain't W3C thingy. It's a cleaning
solution
http://pastie.textmate.org/77491
- why does my first query not work?
[domon]: What's wrong? Sleeping on the work again?
just do username='$username'
doesnt need to be ". $username ."
It really doesn't matter.
Wolfy[drawing]: possibly...i get 0 errors when i run the
query straight thru mysql...and it doesn't tell me any mysql errors
either... (when i put say, echo mysql_error())
[domon]: Is your SQL even correct?
Wolfy[drawing]: ya
Wolfy[drawing]: as i said i get NO ERRORS when i do it through
mysql directly
and it updates and everything :/
[domon]: So what's the problem? BEsides of forgetting to add
something to mysql_affected_rows?
Wolfy[drawing]: the problem is i get an error and the query
doesn't run with php
what error?
it doesn't say
then how do you know you get an error ?
How do you know it's an error?
cause it hits die()
$result = mysql_query($query, $iptriple) or die("There was a
problem with the mysql connection or query on line 571. \nPlease
contact support about this issue.");
[domon]: Update doesn't return anything
i know
my point is, it "dies"
!+mysql_error
Handle SQL Errors! For MySQL, always check if mysql_query()
returned false; if so, print mysql_error(). I.e. $result =
mysql_query($query); if (!$result) { echo $query.''.mysql_error();
exit(1); }
isn't die (__LINE__) better?
hey
here's a strange one
any idea why PHP is now creating folders with "root" as the
owner?
the webserver is running as user 'www' & PHP is compiled as
an apache module
it's running as root?
because it's run as rroot?
nope
when i stat() the folder it says uid of the folder is
0
Then you've missed something in your config
also comes up as 'root' when i check out the folder on the
server
in my apache config?
it's deffo running as 'www'
i can see it in top/ps
Whatever you're doing something is running PHP as root
hmm
__LINE__ doesn't do anything :/
i mean all the httpd workers are running as root
wait. ... _
o.O
is there a function similar to htmlentities that will strip
entities instead?
yep it does nothing
[domon]: hm? did you stick mysql_error in?
Wolfy[drawing]: ya, mysql_error doesn't echo an error
anyways...
it suddenly started working :|
maybe mysql was crashed or something _
[domon]: so your DB was screwed.
mebbe...
anyways...
__LINE__ is a magic constant, like __FILE__
how can I chop the last 2 digits off of a 5 digit
number?
it isn't workin for meh :P
when i put __LINE__ it was just blank :/
was it on line 0?
no
convert it to string and substr it
ok
ive just established it isn't creating the folders as root on the
local filesystem
on an NFS server it creates them as root
an NFS folder even
im trying to decide on a hosting package to cover my own
personal site and possibly a site or two i develop for other
people, and i was just wondering does asp offer any benefits over
php? more or less set on linux hosting but dont wnat to rule out
asp incase it would possibly be of some use in the future
asp is a bigger dog than php
bigger dog?
asp.NET is a lot better than regular original vanilla asp,
but still .. if it's a choice between PHP and ASP, always go the
ASP route
ASP sucks, go with PHP
(you're in a PHP channel, right?
PHP sucks. Go woth Python
Wolfy[drawing]: I'm not going to say 'b*tch' in here ..
Python sucks, go with FORTRAN
Yes, I'd personally say go Python or Perl .. but arguing such
things in channels that are biased by nature is pointless
:-D
my vote goes for Pascal is PHP isn't available
or FORTRAN, yup
What are ASP's advantages or disadvantages over PHP?
you could probably get quite a few results doing a google search
matey
it's not a new deblate
*debate
ASP is framework.
you get good-ol microsoft support
you get community support
biggest feature yeah
One costs. The other doesn't.
if you got a big, sniper will fix it! :P
*bug
not really... ASP is also free.
you want to use HTML files
Wolfy[drawing]: I was talking about support ..
so was I
But I wasn't aware that the product is free either
ASP isn't free.
http://www.apache-asp.org/ -- yes
it is
Even if they release the compilers for it, it isn't free.
You have to be on a Microsoft platform to use it.
What on earth is an ASP compiler?
gooooooooood question :3
Or whatever you call it :-)
I've seen encoder, not compiler
ASP isn't a language, it's just a framework. Available for
several languages.
what kinds of characters would i need to escape to prevent
email injection attacks?
Don't they have an ASP language?
e.g. like SQL injection, but to prevent a hacker from writing
his own headers
Nope. Never have.
e.g. on a contact form
\r | \n in header
fivetwentysix, no, ASP is a set of libraries
The original asp was basically PHP with VB constructs
iirc
how is it called? max exection time ?
You remember incorrectly
never used it, so I don't mind being wrong :-D
fivetwentysix, you can use VBScript, C# or JScript in an ASP
page
Or Perl, with Apache::ASP
ASP was spawned by MS, and it had JScript and VBscript support
natively.
fivetwentysix, default is usualy VBScript but you can specify
what language you use on each page with @Language or some such
construct
don't mix ASP with ASP.NET
Wolfy[drawing], erm, i'm not... ASP can be written with JScript
can't it?
meh, it's been years since i've done ASP, i don't really care
well actually that's not true, i was still working on an ASP
project about 6 months ago
I've only done ASP with VBScript
Ah.
Wolfy[drawing], as have I, but I'm pretty sure you can also
do regular ASP with JScript
Wolfy[drawing], does that | indicate i need to escape pipes too
or just that i need to escape both CR and LF?
yes, you could; But c# has nothing to do with ASP
anyway
Wolfy[drawing], ^^
Wolfy[drawing], so would you suggest i do something like
preg_replace('/\r/', '\\r' .... ?
are you testing cli scripts as root? either that or making
the folders with a cronjob seem a possible
explanation...
I know what it is
sort of
I just realised the folder in question is an NFS share
creating folders on the local filesystem works as normal
thing is, it's been working fine until the last few days
and as far as i recall, nothing has changed with the NFS
set-up...
Woof... What? Why using the PCRE? :o It's a *HEADER*. It
shouldn't contain *ANY* newlines.
Wolfy[drawing], gotcha
Wolfy[drawing], str_replace("\r", '', $value); then
!+nl
Newlines are hidden (not normally visible) control characters
that distinguish the end-of-a-line of text and are different for
each platform as follows: [Windows = \r\n] [*nix & OSX = \n]
[Classic Mac = \r] And can be seen as: [LF (linefeed) = \n, 10d,
0x0A, 0001010b] [CR (carriage return) = \r, 13d, 0x0D,
0001101b]
*ANY* newline characters
Wolfy[drawing], yes i know, i'm doing it for \n as well, didn't
feel like typing out both examples
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