logs archiveIRC Archive / Freenode / #php / 2006 / May / 27 / 1
kynes
AsadR : I just wanted to split the project at my hand to pieces..
AsadR
kynes: so the PHP code that checks shouldn't display any HTML, just make it run the code and then redirect
if you really really wnat it to show some HTML before redirecting.. then use JavaScript or the HTML META REFRESH tag
kynes
okay can you give a really short example?
endra
hey
php header(Location) isn't redirecting
zircu
endra: of course not, that is an invalid header calls
s/s//
AsadR
header("Location: newpage.php");
kynes: google for HTML META REFRESH tag
itrebal
the RFC requires an absolute URL in the Location header
AsadR
YGBSM.
blank_
hey guys
         

zircu
meta refresh should only be used if you have no other way to redirect
blank_
what's the function that lists the php info ?
phpinfo(); ?
zircu
blank_: yea
AsadR
itrebal: guess then you'll have to construct it from $_SERVER values
itrebal
AsadR: thats what you'd do, yea
blank_
zircu, thanks, and it automatically prints the information right, I don't have to do echo phpinfo(); or do i
itrebal
but if i followed the RFC i'd do my own hredirect() function to do it for me
blank_
zircu, ?
AsadR
though i can't imagine why they'd say that in the RFC..
BigE
blank_: TIAS.
blank_
BigE, eh? TIAS?
BigE
!tell blank_ about TIAS
Jymmm
!+tias
php-bot
[TIAS] Try It And See. If you want to know if or how something works, try it first.
blank_
BigE, I'm having problems with my server, what I'm asking is so that I can test it, if it doesn't work, how would I know if that's the typical behaviour?
itrebal
AsadR: it makes sense, how should the browser know where to go to? that could get messy (though 90% of all browsers support it)
BigE
blank_: Well... if you see a page with information about PHP, then it's working.
Jymmm
heh
blank_
BigE, Nevermind...
crypt0
hello, how can i validate in javascript a html element named foo[], i need this name to make an array...
         

Mahadeva
crypt0: #javascript
crypt0
in php...
zircu
crypt0: how to validate an element in javascript in php?
mattmcc
crypt0: Reference it using an array subscript in JS, rather than an object property.
crypt0: formobject['foo[]'] instead of formobject.foo[]
crypt0
sorry for my english i'm venezuelan, i try to explain...
kynes
AsadR : are you saying that I should do the redirection with HTML META REFRESH
Jymmm
mattmcc you tried at least =)
mattmcc: Here's a present for your efforts... http://sperone.free.fr/extraz11.htm
kynes
AsadR : cause I see that it is just able to do that
AsadR : session info won't be lost?
crypt0
i named some html elements foo[], and when submit this created a foo array in php....
Jymmm
mattmcc (work safe)
mattmcc
kynes: You seem to be missing some information about how sessions work.
crypt0
the problem is when y try to validate in javascript, y cant validate an element called foo[] because '[]' are reserved...
mattmcc
crypt0: formobject['foo[]'] instead of formobject.foo[]
zircu
crypt0: do what mattmcc said or access the element via its ID
y?
AsadR
kynes: if your php session id is being stored in a cookie, it won't be lost due to the refresh
crypt0
ok, thx..
AsadR
kynes: instead of a refresh, why don't you make the user press a button to continue or something
zircu
zircu: the second to last letter of the alphabet or sometimes meaning in aolbonics.. why
Tresnar
Why is zircu talking to zircu?
AsadR
Noble blood?
He refers to himself in third person too, i bet
Rewt`
how do I override the max upload file size in php?
zircu
i was hoping someone else would define 'y' like 'u' is defined
nanotec
how do you make sessions expire after X about of time?
of inactivity
;\
zircu
Rewt`: in the php.ini or equiv
nanotec: ditto
Rewt`
prefer to do it for the one file only
ini_set or something
zircu
Rewt`: you can't use ini_set, it is to late for that
nanotec
zircu well my site is hosted from a web hosting company, so i dont think thats an optionf or me
heh
BigE
Rewt`: You can't... by the time that command is processed, the file is already received.
Rewt`
can I overwrite it in .htaccess then?
zircu
nanotec/Rewt`, if .htaccess is enabled you can do it there
BigE
Should be able to, yes.
AsadR
Rewt`: do you want to increase or decrease the size?
Rewt`
increase
zircu
of course BigE's 'should' is a big question
nanotec
yes i have .htaccess
Rewt`
thiking of this in htaccess
php_value upload_max_filesize 30M
php_value post_max_size 30M
zircu
Rewt`: you will want more post_max_size, there is overhead in POST data when doing uploads
Rewt`
well, there's overhead
as the majority of the files will be ~10 megs
zircu
but yeah, that is what you want
if .htaccess is enabled and you are allowed to do that in .htacces
SoulPropagatio1
How do you do mathematical parentheses? E.g. (($a+$b)/$c)^($d*10)
zircu
SoulPropagation: i dont know how to answer that since you aleady have parans
Jymmm
SoulPropagation like your example, but ^ isn't powerof in php
SoulPropagation
Right, that's what it would be in non-php
How would I translate that to php?
Jymmm
zircu
Jymmm?
Jymmm
zircu: Leave a message at the beeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep
zircu
zircu: the soul of ##php :)
I think my last message just would confuse people
SoulPropagation
I still don't get how to do parentheses
Jymmm
last, first, and any in between.
SoulPropagation
Because nobody told me
zircu
SoulPropagation: your ^ complicates how to do parens since there is no straight forward way to do ^ in php
SoulPropagation: (1+2) * 5, php will use parens first then equations, a standard logical evaluation
s/equations/mathmetical operators/
Jymmm
SoulPropagation: IT's standard algebraic notation, if you have any more issues after this try #math instead. $results = pow((($a+$b)/$c),($d*10));
zircu
$a+$b first, then divide that by $c... take $d * 10 and use that as the power of.
assuming the language you are using has ^ == power of
Jymmm: to simple make it you do
caffinated
^ is not 'to the power of' in php
SoulPropagation
Oh, I tried it before and it didn't seem to like my parens
zircu
caffinated: it was assume the expression was in a language other than php, implying power of
SoulPropagation
It was pseudocode
zircu
SoulPropagation: and you used ^ as power of? right?
SoulPropagation
yes
Lemme try it, hold on
zircu
SoulPropagation: use Jymmm's solution
Silliman
when i look a scripts reading a file i often see it reading small parts of it in a while loop but i dont understand why what do you gain with this way?
at*
Zule|BBL
There isn't any, to my knowledge, unless you're dumping the variable out straight away. Ie, reading it in to echo it out somewhere else, to the browser.
zircu
dumping the var directly makes less sense
Silliman
file(), file_get_contents() even fread($file, filesize($file))
Stormchaser
(Action) bytes Zule
zircu
Silliman: what kind of loop.. while (!feof($fp) { $s = fgets($fp); echo $s;
errr
there is no phpnuke room on this server with anyone in it, would anyone happen to know of a server with an active phpnuke room?
Zule|BBL
What was that for? :D
zircu
file_get_contents is your best option
Jymmm
Zule|BBL: Stormchaser is horny
Stormchaser
Zule: hungry like a wolf
zircu
(Action) steps back
Zule|BBL
Mmm, horny
Stormchaser
o.O
Silliman
zircu, like while (!feof($handle)) { $contents .= fread($handle, 8192); }
Narusegawa
is it possible to maintain $_POST while redirecting?
Zule|BBL
Then there isn't really a benefit to that. I think its basically just because file_get_contents didn't exist, and... neither did filesize obviously :D
Silliman
Narusegawa, you can serilaize it
zircu
Silliman: yeah that doesn't make sense, just use file_get_contents, it takes advantage of OS memory mapping when reading files
if available
Silliman
serialize even
Stormchaser
Narusegawa: you can stuff it into $_SESSION
Silliman
zircu, k :)
Stormchaser, and if he redirects to sites outside his?
Narusegawa
figured i'd have to do that, at first i thought it was the ob_start() that was killing my arrays
Stormchaser
Silliman: cURL
Narusegawa
Silliman: its all internal site stuff
Stormchaser
Hum... Okay... there is some other way...
Silliman
Narusegawa, then just use sessions
Stormchaser
!+sentohost
!+sendtohost
php-bot
http://mmcc.cx/sendtohost
surfdue
i need multi coders
:P
Stormchaser
you need what?
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 next »