I have an automated email that is sent to my users with a link in the email so they can confirm their email address

Translation2, Zend_Translate, and eZ Component’s Translation component. Can anyone think of any other libraries to localize a website with?

How to check if a users input is just numbers
?*

is_numerice($number);

gg windows “The attempt to power off CHEESE failed”
now i have an uptime of 6 hours and i’ve been online for 10 minutes

http://hashphp.org/pastebin.php?pid=26101
What’s wrong with that? It doesn’t respond when $matches is empty.

hello
I have a website…
and it has a theme…
with a little color changer at the top…
www.supertunaman.com

good for you

i don’t know how to make it go away
i have to edit one of these two files, i know that much.
in fact, i’m pretty sure that I know which it is.

=\

ok

hello, where’s the error, please? http://paste.css-standards.org/22267
syntax error, unexpected T_LOGICAL_AND in

i shall pastebin it’s code. do you think that you could figure it out?

forgot some {}?

http://rafb.net/p/MqGWGk78.html

Anyone know why whenever I change content type with header() the web server still serves a text/html document? WHat could cause that to happen?

if it would help, the images for the little colors are color-blue.png, color-red.png and so on…

81

snoop-: so should I comment it out?
i’m not sure if I want to remove it

understood

snoop-: nope, that’s not it.

comment a few of those out

ok.

up to 95

obert
did you forget the last ?

obert, http://pastebin.com/m1b7721cb

snoop-: it worked, thanks

thx for all the help, if anyone who helped is even still on hehe

Anyone know why whenever I change content type with header() the web server still serves a text/html document? WHat could cause that to happen?

hi I’m looking to fire off another script within a form when a user hits submit, and also pass a variable to this script. I have been looking around but haven’t found much, any help is appreciated

hi all
I am looking for idea to use php and download manager with ie or Firefox

hi

so the php will send info of download links to the download manager

is ther any web site wher you can chk your php Code ?

…Check it?

I will be glad if there is sample or code of php that send links to download manager

Er, what information would you expect PHP to give FF’s download manager that it doesn’t already have?

When i set the location with setlocale(LC_TIME, “nl_NL”); the strftime function still outputs english formatted dates
any idea why?

I want to send the links by php into Download manager
is there code or idea in php how it can be done

Well, the download manager just shows users what they’ve opted to download, and the progress of those downloads.
So… I’m guessing what you want is to have PHP send a file in a manner that prompts the user to download it. In which case you want http://php.net/header
See ‘Content-Disposition’

excky
xctecky

Yes…

thanx

hi

so with header () I can send the links into download manager?

Well, no. Nothing can do that. What you can do is respond to an HTTP request in such a way that the user is prompted to download some data.
Which would then appear in the download manager.

I have a page with 1,5MB intro on the index.php. Intro loads but there is a possibility to skip intro. I have also the code that is a contribution to statistics and its placed under flash object in html code. Does statistic script run if someone skips intro before it loads?

k
thanx matt

is my question understandable?

Does php have a builtin function to flip a boolean var?

How about the negation operator?

Sorry, haven’t used php in ages – care to refresh my memory?

‘!’

Oh, that’s not quite what I meant
I mean to set the variable in question to it’s opposite
Oh wait
$foo = !$foo?
Sorry, I’m tired – thanks mattmcc!

LIES
ALL LIES

Warning: filetype() [function.filetype.php]: Lstat failed for New Notepad++ Document.txt ? O.o

check the bug database. I don’t think this should happen.

MikeSeth the weirdest part is that it recognizes the directory as a file O.o
could that be because of NTFS file system and windows? :/

hi

Greetings. Trying to handle an array of instances of a class with array functions, I get lots of errors ‘Object of class *** could not be converted to string’. Are array functions unable to compare objects by an instance ID, do they only handle simple types?

I have some cars which a want to read/loop through. they all reside in a database. How would you design this? I thought I create a CarManager-class and a Car-Class. The CarManager class loops through the cars and instance the cars. What do you think?
simplified

Not a bad idea, in general. Try to read all cars at once out of the database, and handle them in a kind of “array of Car-instances”.
shift/unshift+push/pop, or even easier, index%count

you mean an array which holds the instances?

But it seems that array management with object instances as elements is not completely supported. Looks like array functions only compare numbers or strings.
I wonder if I am able to add a method like “tostring()” to the class to allow PHP comparing the instances, or if I need to use “user defined functions” to compare class instances.
array_diff vs. array_diff_uassoc

but, you think the idea with the carmanager and the car is the correct approach?

__toString()

It may be a good approach; just: PHP is usually a one-time executed script. Cycling through the cars sounds like someone calls the page another time.
Thanks iflyhigh, I’ll go reading about that.

it might be 5.2 only
def 5

ffs

Meh. My script needs to be able to run under PHP 4 too…

why does filetype() recognize .htaccess as file and . and .. as dirs
but everything else doesn’t? :/

What “everything else”?

…everything else… dirs, files…

?

filetype() [function.filetype.php]: Lstat failed for admin (dir)
….

filetype() wil surely check filesystem attributes and see that this object has no attribute “Directory” set, so it must be a file.
The leading “.” is the “hidden” attribute for Linux. Doesn’t work under Windows, of course…

i’m on windows

Under Windows, the “.” is simply part of the file name without any special meaning.
But it is a file.

print !is_dir($dh[4]); gives 1 …
ffs… ‘admin’ is a directory! .

If something starts with a dot, is not related to being a file or a directory.
What does “ffs” mean?
Ah, I imagine…

for f*cks sake

^ channel topic.
Are you sure you check the correct directory? Try to check the full file name (from the root/diskletter).

Anyone know why whenever I change content type with header() the web server still serves a text/html document? WHat could cause that to happen?

Make sure you really use the exact required syntax of the header. With colon, space and correct MIME type.
header(“Content-type: image/png”);
Also, more headers may still corrupt your try.
When the file export failed, and the file would instead contain an error message, it was still correctly flagged as the wanted MIME type, so I had to write it to disk and open it with a text viewer to read the message.

heya
$a = array(‘hede’, ‘hodo’);
unset($a['hede']);
what is wrong guys ?
but unset($a[0]); works :/

nothing is wrong
since ‘hede’ is a value, and not a key, unset() wouldnt do anything on it

how can i make it work?
i can’t use unset($a[0]);

yes you can.

no, i don’t have to use

http://il2.php.net/manual/en/function.array-search.php

array_diff($a, array(‘hede’))

eww, slow.

http://en.wikipedia.org/wiki/Set_theory

what’s the purpose of PHP_EOL ?
anybody?

Gag_H already fixed. Yeah, the directory was wrong

slimjimflim, PHP_ End Of Line.

There are tools which need a specific character at the end of a file, to know that the text ends there (I think Chr(26) was it).

slimjimflim, that would be \n on *nix.

Ah, my mistake.

slimjimflim, it’s a constant because it differs on OS’s.

\n on Linux/Unix, \r\n on Windows, \r on Mac.

jup, indeed.

so it’s just for a function that requires \n to be returned or used otherwise?

echo “test” . PHP_EOL; look in your source.
it’s just a carriage return, but since it differs on platforms, the constant holds the correct one.

The specified CGI application misbehaved by not returning a complete set of HTTP headers. ! how to debug this as long as I see no clear error message

Hello all !

berry__ ya, i understand
ty all

slimjimflim, good.

http://www.google.com/search?q=The+specified+CGI+application+misbehaved+by+not+returning+a+complete+set+of+HTTP+headers&ie=utf-8&oe=utf-8&aq=t&rls=org.debian:en-US:unofficial&client=iceweasel-a

Bye catch you guys later !
Brief introduction, i’m prabhdeep,newbie in php development, find it interesting
i mean, this is cool language to work with
ok bye all !

hi

Hi subj – your question?

wow, twice the IRC for your dollar

*lol*
i am currently have to program javascript – so sorry no question for you at the moment :-)

kuja, hello

dog bless

hi
Give me a job

rza I would like to try to output something more from that php which is producing the error

haha.. okay..

I am tempted.. to say.. something..

I need to go to work soon …

Have a nice day… bye.

hellow
any one knows good php IDE?

tidalbobo, Zend Studio

im currently using phpedit. its kinda ok… but got only syntax hightligting
Is tht wht u r using? Does it have a visual designer?

eclipse ? maybe

!tell tidalbobo about aolbonics

?

wot? aoibonics? wos tht?

take a look on eclipse distro

phpEdit has a lot more features

Speak proper English.

checked eclipse.

emacs has a *lot* more features

haha

i am using phpedit right now
its ok. got sysntx higlighting. debuging etc. but i also like to have a visual developer.

i have my own editor

something i can use to develop my pages visually.

xD dreamweaver

Own editor? what is that?

doesn’t really makes sense for php *imho* but here are Dreamweaver and Delphi for PHP

thank you. i will give them a try and see.
i am developing an issuetracker for my workplace. its , as you might have guessed, written in PHP.
this is the first time i have worked using PHP. so im still looking around for available tools

I am trying to dump my databases and recreate them on my new server, but every time i attempt an export/import with phpmyadmin, i get a huge error message

which one ?

tr3k check the compatibility (mysql versions)

k

or your file size that shouldn’t exceeed 2Mo

hi

easiest way to find mysql version?

is it possible to change a value in php.ini file?
upload_max_filesize and post_max_size

look at the phpmyadmin front page
and like a0gara said – size matters :-)

\damn, one is 4 and one is 5
any way i can get around this?

give a try

you export from 5 to 4?

should work

a0gara where would be php.ini file?

but you’ll maybe have to split your export

here are some problems with mysql 5 – like TEXT fields are not allowed to have a default value any more

i couldnt find it though

you’re on which OS ?

nah, other way
4 to 5

eeh right

check the phpinfo() output – first section
bbl

Anyone know why whenever I change content type with header() the web server still serves a text/html document? WHat could cause that to happen?

a0gara OS means

your system

Ev0x_, the web server is set to do that. contact its admin.

a0gara Linux web190.opentransfer.com 2.6.19.2-UP

anyway, ou’ll be able to specify the content-Type with header() too

I am the admin its my web server and its a fresh install.
huh? header() is what im trying to do

try /etc/apache[version]/

output buffering on?

in php or apache?

a0gara sorry? i didnt got u

MikeSeth?

in PHP. If OB is off, and you use header() in the wrong place, it wont be sent

cd /etc/apache/ ou /etc/php/ …

so what changed from mysql 4 to 5 syntax wise that makes this import not work

header() is used right under php and theres no other headers sent

i talked french ^^… go to /etc/apache or /etc/php/

a0gara alright
hehe

mistery

lol

output_buffering = 4096

Hi all I want get yahoo address book details through my application i am using php .Any idea

in /etc/php/…./php.ini

yea?….

on debians …

wtf are you talking about?

is there a function in php that will get the first four characters INCLUDING whitespace?

no matter

i know of the function substr()
but that does not work in this instance because i need to test if something is equal to “var “
with the space at the end
or is what i am trying to do not possible ?

preg_match_all and regexp ‘/.^{4}\s/’

contains
http://php.net/manual/en/function.strcspn.php

sorry i made a mistake … regexp is ‘/^.{4}\s*/’

Hi I’m trying to create a custom form…
function subdomainwizard_nameform() {
$form['user_name'] = array(

t(‘Subdomain Name’),

‘textfield’,

t(‘Please enter your subdomain.’),

);

!+pastebin

Submit your text to http://hashphp.org/pastebin or http://cpp.sourceforge.net or http://pastebin.ca then tell us the URL and a summary of the problem. Don’t flood by pasting in the
channel.

$form['submit'] = array(

’submit’,

t(‘Submit’)

);
return $form;
}

great! i think ive about got it working, am just using the extra param $matches to return the matching variable although i wish it could just return one as a string instead of an array, oh well :P
hm i think that just counts the first four characters, i need to compare the first four characters

http://pastebin.ca/649655

since when does substr() not count whitespace?

This form works great for typing in some text and it returning it. I’m trying to get it to create a subdomain, I have the variables and the execution, just not sure how to get them all working together with this form

i do not know, but it won’t compare it for me,

then you must have not used it properly

i was using substr($str, 0, 4) on a variable that looked like “var “

invinceable:

echo ‘#’ . substr( ‘var ‘, 0, 4 ) . ‘#’; // works fine for me

try to get “var ” from “var an more content” with substr() ..

the goal was the first 4 characters

and enjoy
+ whitespaces

hm, maybe it has something to do with my function, would creating multiple switch() statements within a foreach loop create a problem? i can verify that the first switch() function is working
but im not sure about this one

but yes .. if the goal is to get only 1 whitespace substr is better

This would be the variables I need in that form that need to be executed… since this script will contain some secure info should I use this form to activate this script somewhere else? http://www.zubrag.com/forum/index.php/topic,223.0.html

Hi
Can you help me with abstract class ?
It’s like “virtual” in C++ ?

well, if by virtual you mean the exact opposite, yes
an abstract class is a prototype. It can not be used in the code. Other classes must be derived from it.

MikeSeth, ok, i see
MikeSeth, what’s the php’s alternative of c++’s virtual ?
MikeSeth, not prototype

an abstract class prescribes that all methods in it are implemented in a subclass. If you derive a class from an abstract class and dont fill in some of the methods, the code will refuse to run

(after user logged in) a user sees a mask where he can value different entries, for example films. So there is film1, film2 and so on in rows and in the colums he can give points (for example from 1 to 10) for different properties of the film like qualitiy, creativity, special effects and so
on.

MikeSeth, good

since PHP does not do binding the same way C++ does, there’s no “analogue”

Or do you know something similar that I could adapt?

MikeSeth, then, it’s not like virtual

www.google.com
(lol)

no better answer

Mace[work]: I already tried, what keywords would you suggest?

‘im a prat’

errr, abstract is like virtual in C#, dunno about C++

Shrike|work, C# is limited like php ?

limited?

who’s ?

Akira

shhhh

you need a ranking script?

Shrike|work, you say C# virtual is like php

he needs someone to hold his hand !

Shrike|work, and php contain only abstract
Shrike|work, not a true alternative of “virtual”
Shrike|work, if i understand the explanation of MikeSeth

a virtual method in C# is the same as an abstract method in PHP

Shrike|work, ok

hmm maybe… but do you know something?

Shrike|work, php’s “abstract” is a good alternative to c++’s “virtual” ?
Shrike|work, how to implement in the mother class the function and abstract this function ?

What I mean is, even if the channel did support scripts who would know of one that’s free-to-use with no commercial license that specifically requires a user to log in and then allow them to rank movies in the way you “specified”? If you want it that specific learn how to code
yourself..

Shrike|work

i don’t know how the C++ implementation works

Mace[work]: I don’t understand your first “sentence” its incomplete? By the way I don’t need the login process…. I already have that

akira, what exactly are you trying to do?

then you’re looking for a ranking script.

Shrike|work, i’ve two classes

Mace[work]: yes oko

Shrike|work, Mother and Child
Shrike|work, in mother, i’ve generate_widget() and generate_label(). These function is called by generate() membre function.

ok…

Shrike|work, i would like, in the child class, to redifine and rewrite generate_widget()

in PHP you just override the parent method by redefining it

Shrike|work, and make the function Mother’s generate() calls Child’s generate_widget() (the new function)
Shrike|work, all function in php are virtual ?

yeah, because it’s called from the context of the child

Shrike|work, ok…
Shrike|work, i’m writing a little test to see
Shrike|work, i’ll post it in pastebin, wait a little moment

ok

The specified CGI application misbehaved by not returning a complete set of HTTP headers. ! how to debug this as long as I see no clear error messages even if I modify the file to echo “something”; in the first line

when I search for ranking script I always get those page ranking scripts, could you recommend other search keywords?

poll

hmm poll gives other results which does not fit too… its not really a poll what I need

Shrike|work, it’s work…
http://pastebin.ca/649677
a href=”http://pastebin.ca/649677″http://pastebin.ca/649677/a

Talus_Laptop envia-me o ficheiro outra vez

aO|work|should, yes, but i don’t know why it’s not work in my big source code :-(

Akira, the keyword ’self’ can be used to exclusively refer to the class which a method is defined in

Shrike|work, not this ?
Shrike|work, not $this ?

$this is subject to the calling context

err i read it work’s *nod*

hi guys, i got a problem that gives me headache.. http://pastebin.com/m5bf199da – maybe someone got an Idea? :/

asprins work for me

^^

Shrike|work, it’s better to use self in my example ?

what is troubling you with that post ?

hi

akira, in your example you would use self to refer to the method defined in the parent, and $this to refer to the child

i wrote it in the comments; i’m trying to do an ldap_connect() , it works when i specify as adress ldap.server.com, but it does not work when i specify as adress ldaps://ldap.server.com – but the Server is running on SSL so i have to use the ldaps
protocoll..

Shrike|work, my goal is to refer to the last defined function, in the child and in the futur childs
Shrike|work, if i create a child of Child, i would like this is uses the last generate_widget()
Shrike|work, from generate() (undefined in the child of child, but defined in the Mother

well $this will go up the object graph looking for the method
from furthest child to parent

Shrike|work, ok, then, i will use $this
Shrike|work, because, i’m interested by “virtual” functions like c++

What is this virtual function you speak of?

ahhh
EFNet is garbage

Nomark, http://www.java2s.com/Code/Cpp/Class/Virtualfunctionsinterfaceclass.htm

cheers

Nomark, http://www.deitel.com/articles/cplusplus_tutorials/20060225/virtualBaseClass/index.html
Nomark, a href=”http://www.deitel.com/articles/cplusplus_tutorials/20060225/virtualBaseClass/index.html”http://www.deitel.com/articles/cplusplus_tutorials/20060225/virtualBaseClass/index.html/a

is hungry.

true.

Yeah !!!
Gooooood !!!!

then you must eat!

Thanks for your help !!!

ok that was kinda weird

does anyone know how to count back from a string? im studying this darn substr() function and cannot figure it out, i have a variable like
“person_”
and i want everything back that last character
*everything except that last character

string trim ( string $str [, string $charlist] )

im thinking that there is an easy fix i am just looking over
great! thanks
i think ill just use rtrim($str, “_”)

invinceable, read php.net/substr there is an example that does just that

yeah im using substr() and am looking at it right now except they are just getting the last character
which is what i already have done
i just need to trim that last character

invinceable, look harder
$rest = substr(“abcdef”, 0, -1); // returns “abcde”

i see, thank you very much, rtrim does the same thing though i think :P is one faster ?

rtrim does not do the same thing, in the case that it ends in multiple _’s rtrim will remove all

oh i see

and rtrim is probably slower as it looks at the contents of the string

hi all, I am using php 5.2.0 here and having some trouble to enable JPEG support on GD. I specify the –with-jpeg and –with-jpeg-dir=/usr (configure/make/make install) and I still don’t have JPEG support
any ideas? Call to undefined function imagecreatefromjpeg()
the GIF and PNG support are enabled when looking the phpinfo()

ocZio, are you using shared GD?

it comes with php in ext/gd/libgd/

hmm, there is an option to use another GD lib not in PHP and that will make the –with-jpeg have no effect, but if you use the GD included with php and you still get that then make sure that its finding your libjpeg
check the config.log and see what it says about it

ok I will
configure:33799: checking for the location of libjpeg
and also there are entries about “-ljpeg” linking one
o_o!

Hmm.. If I was making a CGI script in PHP, for use on a web server..
Am I able to see the client’s data they’re sending through the socket?

Maxdamantus, through the socket?

Yes.. You know what a socket is?

ocZio, did it link or not?
Maxdamantus, yes, but the client generally does not use a socket (unless you mean the TCP stuff) to talk to php

Yes, I mean the TCP Stuff.

ldd /usr/local/apache2/php/bin/php
gives me

/usr/lib/libjpeg.so.62 (0xb7d2d000)

Maxdamantus, you just see $_GET/$_POST/$_COOKIE etc, and its no different

I guess what I’d be looking for is the data the server is telling PHP.

Maxdamantus, the only think i’m aware of that the CGI does not see (that the module does) is the HTTP Auth stuff

‘ning

ocZio, can you pastebin the the few lines aroung the GD and jpeg stuff in the config.log

in a function like string htmlentities ( string $string [, int $quote_style [, string $charset [, bool $double_encode]]] ) can i use htmlentities($string,0) to use double encode?

ofc

edman007, wrong.
Wait, nvm.

lol

when i use htmlentities() im getting weird &asirc; in my output anyone know about this?

Actually, you are wrong.
It doesn’t store the GET and POST data. :P
You have to do it manually.

sounds like UTF8 gone wrong somewhere

Maxdamantus, no, it does see that, if its configured anyways

test=hello%20world

I’m trying to build a form here http://pastebin.ca/649698 , what I can’t seem to figure out is how to make it so a subdomain in cPanel is created based off the submitted variable. I know the exact location of the file that needs to be executed and the
variables to put in for the username and password, just not sure how to integrate this with the form

Configured?
It’s just a CGI script..

im not using UTF-8 at least its not the default

hello

oops i mean Nomikos

got an example url?

http://phpfi.com/254873 – that my download system, how can i make that to support resume download ?

Maxdamantus, well i know that you do not have to parse $_SERVER['QUERY_STRING'] just because its CGI

the lines I pasted on the channel

in a sec, still debugging

also, if you do start using UTF8, you don’t need htmlentities() anymore, just maybe htmlspecialchars()

are the only lines , before OR after that line there is nothing about jpeg

ocZio, but you never showed the yes/no anwsers…

hi
Some scripts make a cache of SQL queries. What do you think about it?

SettlerX, let the DB do it as it knows when they are invalidated

That sounds simply wonderful

SettlerX, plus the DB can store it in RAM, you can’t really do that with PHP

unless you’re absolutely mental

http://www.php.net/memcache

there isnt any yes/no
thats the whole line

Nomikos, ok, so PHP can store it in the RAM, but the DB is still better as PHP can’t check if its invalidated without checking with the DB which would mean you don’t use the cache
ocZio, do you have the full configure line? maybe you have conflicting things in it

never used it myself, but apparently it’s working pretty well for livejournal, slashdot, wikipedia..

if you want I can put THE whole config.log you will see there isnt any yes/no
cat config.log | grep yes = 0 result

http://www.danga.com/memcached/users.bml

anyway I just RECOMPILED from scratch php
and it seems to work
now I jabe JPG support
-jabe+have

I thought about storing serialized array (fetched from query) in a file.

I wonder if anyone can offer me the benefit of some of their experience. I have a php script that reads a file through to the browser, a pretty standard idiom. Im not usually an IE user but most of the users of this page will be so im having to make it work in IE. the “Open” behaviour for the
open/save dialog seems to be “losing” the downloaded file before it executes the application to open it.

can you give link

Nomikos, for a site where the load on the DB must be reduced i can see not using the DB for the cache and having your php servers keep the cache, but for the vast majority thats way more code then you need to and its only a very minor reduction in load to the MySQL server

se we can see?
anyway thank you for your support

I cannot, internal/coporate

oh

i can pastebin various parts of the code though

optiz0r, pastebin all the headers the file in question sends
optiz0r, use the Live HTTP headers firefox extension to get them

I’m guessing it’s to do with Transfer-Encoding: Chunked or somesuch

Transfer-encoding/Content-type/Content-length/Content-disposition and a few others can cause it

http://rafb.net/p/saYo3720.html
forgive me this is slow as hell. draconian firewall leading me to be rdc over ssh through http =/

optiz0r, header(“Content-Disposition: attachment; filename=\”".basename($file_path).”\”;”);
that makes it download

yup
clicking open should make IE save it somewhere then pass that filename to whatever app is supposed to open it, right?

optiz0r, maybe header(“Content-Length: “.@filesize($file_path)); is wrong? like i said, show the headers as you receive them, not how you send them

clicking “save” works fine
it also works fine in firefox
This is a problem ive never encountered in about 7 years of php dev

optiz0r, do you have a packet sniffer? maybe you can get the headers that way

*wonders if he’s technically allowed to use one of them on this network*

for Firefox, try the webdeveloper extension

careful with those. I got kicked out of a community college a few years ago because of one.

Unless you do fu with browser detection it should get the same headers as IE

freakin’ overzealous admins.

cbpye, … uh why?

cbpye, i run em all the time at my school and they don’t know/care

thats not going to help me, because it works fine in firefox

but i think the IT guys at by school are stupid :P

this was in 2000, overzealous admin and one of the instructors hated me somethin’ fierce.

you want to see what headers IE gets, they should be the same as FF gets, it can help to troubleshoot the issue

its obviously some form of bug in either IE or php

any excuse was good enough for that bastard.

lets check firebug then

anyways, I hate to ask something like this (what with the technical level of the current discussion), but if I declare a variable using global in one function, it’s accessible throughout the project, right?
(haven’t looked at PHP in some 3 years, just finished being warped by an introductory Java course)

http://rafb.net/p/7g45NR88.html

not automatically inside other functions, I think you want to reread what it’s meant to do
IE has been known to be finicky about capitals, see if Content-Disposition makes a difference (instead of content-disposition)

cbpye, the global keyword is functionally equivlent to $var = &$GLOBALS['var']; so anything that works like that will work, and for your question that means that $GLOBALS['var'] was never defined

*nod*

nojoy
oh hang on, they were capitalised, it seems firebug renders them poorly

optiz0r, header(“Content-Transfer-Encoding: binary”); is that even possible? i don’t think its possiblt to make PHP use anything but chunked (except with an apache extension that catches the output)

to be honest, im not sure. im “maintaining” some old code. I’ve never used that line before
lets try removing it

i have a download file system make with readfile() , but that no support resume downloads, and can cause some load, have another way ?
i think that can be work with virtual() but i alrealy try, and i cannt

MalMen, use fopen()/fseek()/fread() if you want to support resume downloads

tried using fopen/fread/echo/fclose ?

hmm
that my script http://phpfi.com/254873
hmmm
fseek ?
let me see

ctype_digit(0) returns false… anyone know why?

can we just revisit one of my basic assumptions. when you click “open” in the browsers download thing, the *browser* downloads it to disk somewhere, not the application?

MalMen, resume downloads work because the client sends a starting byte, you need to seek to that place and then start reading the file
optiz0r, what application? the browser is one, is that what your talking about?

cause input should be a string … and that integer 0 is interpreted as NULL

if its a pdf, acrobat reader or whatever

aO|work|should well its returning false on *any* integer… i just tried 123

then…. $fx = fopen(“$filesdir/$var[2]“, ‘r’); fseek($);
$fx , ?
edman007 you know what is the var send by browser ?

you should use is_numeric() instead of ctype_fdigit

optiz0r, PHP should send the right headers and recommend that its downloaded, what the browser actually does varies, but if you say its an attachment the browser should offer to save the file

is there a function that checks both?

MalMen, lemme check…

just checking that say the browser doesnt give the url to acrobat

cause ctype_fdigit expected to be used like this ctype_fdigit(‘1045′);

aO|work|should yea i understand that now

is_nemerci() check both

aO|work|should but im using it to check for integers… i dont want decimal points, its for input validation

edman007 $_SERVER['HTTP_RANGE'] ?
gooogle.com/codesearch rullez

use a regexp or simply use number_format()

MalMen, yea probably, you might need to send an extra header as well to tell the browser that you accepted the range request
uMalMen, yea probably, you might need to send an extra header as well to tell the browser that you accepted the range request/u

header(“Accept-Ranges: bytes”);
i think
i am looking for a example
http://www.google.com/codesearch?hl=en&q=+lang:php+download+fseek+show:BVtr_lTPNUI:rB3YzKLX5_8vsue5xdkEA&sa=N&cd=1&ct=rc&cs_p=http://freshmeat.net/redir/drakecms/68188/url_tgz/drake_0.2.7_alpha_rev1133.tar.gz&cs_f=includes/download.php#a0

optiz0r, it varies by plugin, adobe may be an exception as i know it can embed into the browser, it may actually ignore your download

ooh very true, lets try a non pdf

optiz0r, if you say its an application/octet-stream instead of pdf then IE will not find anything to handle it

just tried a text file
notepad loudly proclaimed file cblah\tempinternetfiles\blah\file.txt did not exist and asked if i would like to create it

maybe capture the headers that are sent when you download the file directly, and try to recreate those with PHP?

could do, i’ll try that one after lunch though :p
\o/
who wants to bet wireshark is going to want a reboot

hmm
theres livehttpheaders extension for firefox also

how does php “play” a file i wonder..

Mace[work], he said through php and play in the browser

Mace[work]: well, Quicktime does most of the work :-p but at first it would only play the first 60 KB and ignore the rest

how is it done through php i wonder
it’s outputted html

Okay fellas. So I’m having this issue with special characters like ‘ í ‘. If I use FF it shows it proberly but when I open my page in IE it gets coded. I read something about utf8_encode() however if I do that it certainly works in IE but then it gets coded in FF. What do I do?

thanks for your help guys, ill have another play after lunch i think

[Liquidor]: send correct headers

Mace[work]: ehr, no, Content-Type headers set to audio/mpg, only read in the mp3 file, echo it and exit

html or php headers?

so php was used to set the headers and output the html

Mace[work]: there is no html, only mp3 binary

oh i see
fair enough
still only sending headers though :P

http headers, yes :-)

[Liquidor], the HTTP Content-type header should mention the character set

Yes I know

“should”

Okay is it too much to ask then…. Uhm if I would want to be able to use a character like í in both FF and IE, what content-type am I looking for then?

text/html; Charset: UTF8 I think
ehr, Content-Type: text/html; charset=utf-8
datta one
That should display anything from umlauts to Chinese/Arabic/Cyrillic and whatnot

UTF8 isn’t good for symbols though

And you won’t need htmlentities() much, either; just htmlspecialchars() to display untrusted input

http://reputation.mygamesonline.org/?r=Xavius&n=Shízzy works in FF but not in IE :-/

Well, you do need a font that supports the characters you want to display, other than that it should work for most stuff.. what symbols do you mean?

Using Verdana
if I use utf8_encode() in the file I request by AJAX it’ll work with IE but then it won’t with FF

[Liquidor], you must have used it wrong, because its not UTF-8

[Liquidor]: my previous comment was for Mace[work] btw; try adding a header with the content type I pasted above?

i mean lots of symbols that i don’t have time to fetch

?

[Liquidor]: Can you set the Character Encoding in IE on the fly like you can with FF?
[Liquidor]: the first one, at the top of the php file

[Liquidor], that part is right, but the text needs to be encoded to UTF-8 and it does not appear that you did that

and a chracter set defines what you can use in a font type. not the other way round (unless the font doesn’t have a character which is fairly rare with mainstream fonts)

echo $_GET["n"] —- = Sh?zzy

Hmkay, I thought UTF8 supports pretty much anything out there *shrug* I’ve been wrong before..

to be fair i only noticed the limitations on a specialist surveying site
i strip out all random symbols as a rule now though

edman007, in what way? with utf8_encode() ?

i don’t like the black question mark it shows
it’s fugly and very noticeable and cba checking each site’s content heh

[Liquidor], $_GET needs to be encoded to utf8

is there an WAP / WML irc
someone that knows? I’m lost

edman007 w. utf8_encode() I assume?

Hmm, I’ve done some data entry systems for an international company, with franchises from Ireland to Dubai, so had to accept a lot of weird stuff :-)

[Liquidor], that, or use a function that gives you more control and lets you specify the input

is there some WAP ircchannel

edman007 I’m not able to do that unfortunately (2nd part)

[Liquidor], do you have mb_convert_encoding() on your server?

I read from an external database which I got no access to

how do you check irc channels ?

just join them, and see if you’re operator or if there were already other people

It’s a free web host, how do I check? phpinfo() ?

#wap seems pretty deserted however

okey
hmm

[Liquidor], echo htmlspecialchars(mb_convert_encoding($_GET['n'], ‘UTF-8′, ‘ISO-8859-1′));

it should be something on that..
do someone here know WAP

This is crazy. I don’t get it… how come it works with FF but not IE? I mean.. It’s PHP. Shouldn’t that be server-side and not client-side relevant? :-/

[Liquidor], thats how you should output it if you know the input to be ISO-8859-1 as it is

i thought wap died already

[Liquidor], you have firefox configured to ignore the character set

hahaha rza.. very funny NOT

with all the iPhones out there?

[Liquidor], it does not show correctly on firefox here

oh
uhm

hmm dont new mobile phones ship with normal web browsers?

nothing is normal

okay okay let’s try from the bottom. Let’s say I got an html file, a php file and that’s pretty much it. What do I need to set for the special characters to be shown proberly in both browsers? Is it by html or pvp?
php*

[Liquidor]: what you set with PHP header() should override the HTML Meta tags

[Liquidor], you need PHP to tell the browser what encoding your webpage uses, and that encoding should support all the characters you plan on using
and the web page must be encoded how you say it is

does iPhone ship with a Wap browser?
are they smoking crack at Apple?
dropping 3G support and implementing a wap browser?

no idea tbh, but there’s definitely a browser in there, and mobile browsers prefer WAP

[Liquidor], right now your headers say its UTF-8 but its clearly only works when the browser decodes it as ISO-8859-1

And yes, they probably *do* smoke a lot of crack at Apple, why? :-)

*
To prove that you're not a bot, enter this code
Anti-Spam Image

Comments are closed.