hmm im trying to half-ass tidy up this old php4 piece of shit site that i dont really care about too much if i

is there a separate channel for the development of php itself or can stuff like that just be discussed here?
uis there a separate channel for the development of php webhosting itself or can stuff like that just be discussed here?/u

and sorry ari-_-e, i have no idea

ari-_-e: you would want to contact the mailing list for that kind of stuff

Sno, ok, thanks

ari-_-e: http://us3.php.net/mailing-lists.php check that out and go to the Internals list

okee, thanks

hmm… im trying to half-ass tidy up this old php4 piece of shit site that i dont really care about too much… if i make a Base class which has a Base-DBConnect property, that the other classes extend from… Should I also make a Base-User property (User being ab object with all
roles/permissions/user details etc) which other objects can extend from as well? or is it better to have User a seperate object?
just wondering what's more common practise
to have the User object inherited into every class, or to have every page load a seperate standalone user object for use in the page.

Sno http://discuss.pastebin.com/d3901e129 does it make any sense to have the class?

I don't see anything

ugh
http://discuss.pastebin.com/d4901e129
i have to manually type in urls because this is on a different computer… dedicated irc machine

lol
there is no real common practice with that
its basically do what you think is best

so does it really make any sense to have the class or am i doing something right?

give me a sec

'postgresql',

hey all

If that's some PEAR package, you'd have better luck in #pear

DB Error: not found

wb j2daosh

!+pear

lol

Sno ok thanks

your still here?
we have to get lives

hmm…where'd the bot go?

you are missing a few { } go find where to put them

j2daosh this is a dedicated irc machine. it's on 24/7

ok.. thanks

Sno i'm not missing any. why do you say that?

ok thanks

you are go find them

well since i already know you, what is that thing called that people put on their site to stop people from brute forcing logins? it makes you verify characters in an image

CAPTCHA

missing 3

Sno oh the tabs in front of the second bit are just because i pasted it from a different file and was too lazy to remove them
j2daosh check out http://www.recaptcha.net

know of a good tutorial on that?
lol one step ahead of me… i like that

Google probably knows of several

so you mean that $_SESSION[user_id] has {}
and you should be using "" or '' in $_SESSION[user_id]

It's not missing any {}… it would be borked if it were
oho
that might be doing it

does it make sense to have the class in there though?
i mean, technically i could just put a while in a while xD

you got a nested looping query in there
might cause some resource issues
ok restate that
it WILL cause resource issues
nested queries bad
nested looping queries worse

:P then how do you suggest that i accomplish what this does without doing that?

hrm
let me open my handy notepad++

go ahead

ok the short answer is do a while in a while
long answer is figure out another way to do this

crap, i have to install libraries and stuff

I'm trying to run a mysql thing but it won't run and I want to output the error. I'm assuming I should be using a php function to do this?

i don't know how to do taht yet

lol yea
you need a quick captcha?
http://captchas.net/

j2daosh recaptcha shouldn't require you to install libraries

its a remote system

well i signed up at the link he gave me

j2daosh you copy one file over and read their documentation

but i have to "Download the reCAPTCHA Library, extract recaptchalib.php in the directory where you your forms live."

it's really very self-explanatory and you basically require_once the recaptchalib.php
yup

but i dont know where my forms live lol.

its possible to do it in one query

j2daosh where are your forms based out of?

how do i append an array to another one in php?

do i put them in the main site directory? or am i supposed to drop taht in like the cgi-bin directory thing?

$array1[].append($array2)?

lol no
array_merge()
http://php.net/array_merge

i'm fairly certain there is a way to do so, but i never thought about it

my forms are all in the main site directory (www/files_are_here)

cool.

j2daosh so put recaptchalib.php into www

oh, ok

$result=$connection-query($query) .

i think i can manage that lol
oh… duh

What is $connection?

sno i'm wondering how i managed to write those two bits of code so poorly. the rest of my site is rather sexy and refined

its just like any other .php file i have made… god i feel dumb now

TML, that's my new mysqli(blahblabhablh) connection.

$result = mysql_query($query) or die("bA fatal php mysql web hosting error occured/b.\nbr /Query: " . $query . "br /\nError: (" . mysql_errno() . ") " . mysql_error());
its late?

php.net/mysqli-error

yea that
worry
thought you were talking about mysql
lol

Sno, what mysql command am I looking at to put that into one query?

well
its still joining technically
but you just don't request any info

oh. but that won't separate it based on category :-
it'll just make it one huge list of rows

hrm

$result=$connection-query("INSERT INTO sip (id,name,host,nat,context,mailbox,qualify,username) VALUES(NULL,'$username','dynamic',$nat,'$username','$extension',$nat,'$username'") Why is that receiving: You have an error in your sql syntax blah near
'';

the reason why this is messy code is because its difficult situation

anyone familiar with cURL here?

:/
it is possible though
mysql can do alot of things that most people don't expect it to do

My guess would be that you failed to escape one of those values

TML, what do you mean?

there should be some info on the mysql docs examples

empty variables?

If $username was the string "'foo'", for example, you would have "… VALUES(NULL, ''foo'', …"
That would be a parse error

I'll take a look and ask in #mysql. I don't see exactly how I'd manage to return the information separate enough that I could split it up into different modules, though….
It's really intended to be displayed in different tables

I know

You almost certainly can do what you need by learning how to use GROUP BY

OH RIGHT!!!
that is it
damn its 2am

i insterted the php code into my site but its not showing the captcha… is there something else i'm supposed to be doing?

I should go do sleep

$result=$connection-query("INSERT INTO sip (id,name,host,nat,context,mailbox,qualify,username) VALUES(NULL,$username,'dynamic',$nat,$username,$extension,$nat,$username"); TML, that still shows the same error.

lol

j2daosh you read the documentation?

thanks for reminding me j2daosh
I do
its how you become a great programmer

*sigh*

thanks for what?

php docs = god
mysql docs = jesus
lol

php.net/mysqli-escape-string

yeah i am reading the docs now… its talking about the recaptcha_get_html function and the other ones… but its not telling me if i should be using them. it seems like they are just explaining how it works in the code they told me to paste in my site…

j2daosh http://recaptcha.net/plugins/php
read the quickstart
i literally copy/paste my code from there every time and just add in the keys
might i get an example from you of how i might split up mysql results using GROUP BY into different tables? keeping in mind that i have 2 table styles, a thin one and a thick one that's specified in the modules table

give me a few min and I'll try to figure it out

thats exactly what i did, but it didn't show the image on the site… it fails me logining in though

oh, lol
j2daosh you put the keys in? both?

oops, nevermind
my browser was caching the site

lol

god i hate when that happens

i had to disable the squid cache on my firewall box for dev. it was sucking as well

lol
that must have been fun

Instead of running 2 queries, you'd look at each row as you were "printing" to decide whether it belongs in the table you're currently printing, or not.

HAHAHA I just realized that you had limits for each category
*sigh*
hrm

that works even if, say, the user has two tables from the same category with different limits, different order by's, etc?

one odd thing though… its showing the captcha image hosting above my html forms on the page… i put the code below those though… does php on an .html page supercede the html code?

No, if you want to change the query itself, you'll have to do a different query

Ah. That's why I did it how it is, then.
because this way the user can create a certain number of modules (up to a limit, say 6) on the page with whatever his heart desires, no?
except for maybe the limit, was thinking of capping that at either 10 or 25 rows per table

oh right now I remember
this is the classic nested query problem
this will take 2 queries

which means it has a classic nested query solution? right?

not really
the first query will build the second query

what's what's happening… no?

that or your stuck
well
never mind
I'll figure it out
lol

i know i'm a pain in the ass, but really, i'm worth it!

your worth it?

Sno, damn straight.

"you're", not "your".

too tired
3am

lol

give me a break
long day and problems with girlfriend

None of which are excuses to get sloppy with your spelling

so what's new?
lol

no but the interenet is!

rarely do i not have problems with women.

all the womenz love me

far too confusing

lol

just accept my invitation to a nice dinner and be happy with it.
lol
the problem is that they all have jobs which seem to consume their lives except for when i'm working

anyone familiar with cURL here?

every day, at the exact hours that i work)

I think KairuMaiku is right it has to be nested

Just ask your question, if someone can help, they will

its because of the limit
it it wasn't for the limiit it would work

if i were to get rid of the limit?
oh wait
nevermind
i'm not getting rid of that

yea then it would just spew them out
yea exactly

i don't need a user fetching 6,000,000 rows every time they view the index page

it would spew them out in order! but yea
lol
so you got 1 + number of modules queries on your hands
I am sure you could design the DB in a way
to do it in one query
but its too much work

is it too much work if i ask you about it in say, 12 hours?


ass

???

do your own work

that's a subtitle format y'know
lol i'm just kidding

I'm gonna go to sleep
3am is time programming make no sense nor does english

indubitaly.

its been good talking to you

you too. thanks for your help

I forgot how nice #php was
I'll be sure to come back soon

with my unescapable curse of loops in loops it feels like a rollercoaster

lol
fine ask me in 12 hours
night

ok, odd problem

?

using IE, i can pass the recaptcha correctly and login… with firefox, i can't

noscript?

ahh
that could be it
ill check

c/could be/is

nope, its set to allow

you know i don't know why i did that, because i don't understand how to use the /// system to correct mistakes
j2daosh on both your site and recaptcha.net?

im not sure about the recaptcha.net, ill check that too

just use s where you put c.
lol

ahh ok

???

i have noscript gobally allowed and still dont work

is anyone familliar with NSSBoard?

j2daosh what is it doing / not doing?

it is supposed to create a table in my database, but it does not

DARKGirl just ask your question.
ah

instead, it gives me error

what error?

it fails to login with my recaptcha error message in firefox, but works perfectly in IE

mysql_fetch_assoc(): supplied argument is not a valid mysql result resource in …/logon_user.php on line 21

j2daosh what's the error message

im actually not using it for its forum capabilities, but its username/password login capabilities

the one i made for it ("you entered the words wrong.")
what is the mysql query your performing?

means what it says. you entered the words wrong. link me to the page

…it looks VERY promising, if I can get it to operate properly
mysql_fetch_assoc()
oh wait, you mean the code

might be a good idea

well, lets see…
if($row = mysql_fetch_assoc($result)) {
but I know what its not doing
its not creating a table in my database for some reason

is it code from nssboard ?

aye

ok dark… what is the mysq query your doing

i dont understand 'query'

your code you just postd is just saying "if i have rows returned, do this

are you a real girl DARKGirl?

some poeple still not use db absttraction layer ? at least for mysql/msqli …

The question of the centruy.

lol

Yes

superb answer.

heh

query would be something like, $query = "SELECT * FROM 'test'";

lets see

or whatever variable you named it

$ss-Destroy();
$ss-Open()
$_Session['logged_in'] = true;
etc, etc, etc
and then an else statment

why are you pasting those things?

echo "Unknown username or password"
because j2daosh wanted to know what the rest of the code was
and mind you,

paste the code in www.pastebin.com and then show us the link

j2daosh doesn't matter horribly because it's under $1000 usually :P

yeah, paste it

in addition to the mysql error, I am receiving unknown username and password

j2daosh i'd have to have him web design 20+ pages to bust a couple grand.

it sounds like you've brokened the intertron.

erp that was meant for /msg lol

badly. and may need to buy a new one

lol i know

http://pastebin.com/d6b586df2
there it is

ok, gimme a sec

after line 19, put echo $sql; exit;
then you'll see the sql being sent. try and run it in your phpMyAdmin or mysql or sqlyog.
lawl!

would it be a bad idea for me to boot my comp into ms-dos 3.0?

never used mysql_unbuffered_query() before. weird.

um
I DO NOT have phpmyadmin
I do have navicat though

well try that. see what its querying.
hmm should have session_start(); at the top of the page i think?!

im telling you

might be in the config.php

its querying nothing!
theres nothing to query

do you know that from echo'ing the $sql?
if not, do it.

fine, fine
moment please

nein!

well if it shouldn't be doing a sql query, you shouldn't be asking it to see if there are rows

EoN that would be proper if she used "moment mal"
not "moment please"
:P

lol

SELECT id,username,email,realname FROM developer_user WHERE username='test' AND password='38200006543e005b94ab316e87f72921' LIMIT 1

j2daosh you sure you don't have js disabled somewhere or something?

there you have it

im pretty sure i haven't, but i may have some whacked extension that is messed up

brb, need some drink

but if it was me, it would work for you
and i thought you said it wasn't working for you

j2daosh it isn't.
it is working on their non-js version though

Just out of curiousity for you Linux developers, what text editor do most of you use for php development?

ok good, as long as it aint just me
textpad

disable js in noscript for both your site and recaptcha.net and refresh and try

i did

ed is leet.
j2daosh works on that version?

Not windows :P

i even cleared the cache, then closed the browser and retied
oh, *nix, vim
vi Improved

most people will say that emacs wins. it really fails.

I was hoping for a GTK app. I'm using gedit which gets the job done pretty well.

complete with color syntax and all

try ed. even though it's straight out of 1979 (literally, the first editor), i'm a lot faster at it than a regular editor :P

back

Aptana works nicely on *nix too

ok, DARKGirl, i'm kind of a newb when it comes to php, but what are you trying to do with line 19?
it looks like this is your login page…
or your login.php rather

why yes it is
you are exactly right!
that is my goal

ok, so your doing your $_POST, md5'ing yourpass, and then your attempting to check against the DB to see if its a valid user right?

aye

ok, quick question. Why are you using LIMIT 1? technically, there should only be 1

don't use limit 1
because then if it matches 2, your system isn't secure ; )

boo

whats the diff between mysql_query() and mysql_unbuffered_query()?
who in here uses Firefox?
not you KairuMaiku, we already know it dont work with you :P
and also, doesn't session_start() destory and recreate a session?

dunno
me
aww
no
!+enter

run the query in your query runner
and see the results.
ERGH hergggh erggh

dangit!!! what the hell am i doing wrong with this thing
s/hell/heck
sorry

change mysql_unbuffered_query( to mysql_query(

whats the diff between the 2 EoN?

i've never seen the unbuffered one in my life
hahaha

lol
eon, you use firefox?

momento

are you itailian or something?
s/itailian/italian
not enough coffee tonight
speaking of qhich… ill be back in a sec

yep, i sure do
there is no other browser

ok the query did nothing

Salut Flash_ouille
hi!

hello
hi uu uu
is anybody in there

Ive tried to run the query but I receive the same error

Is there a php function for auto-generating a random password?

md5(time())
Trim length as you see fit.

Salut Demon`
Salut JTyler
Salut BankHead

what is the error?

I need to list the result of a "while" do you how to do it? i need to get my result $result= list of the while's result
Salut speed|89

thanks.. interesting idea..

Salut Nexcet

lots of errors

no.
copy the sql query, paste it in your MYSQL (phpmyadmin, or hwatever you use)
run the query direectly on mysql. and tell me the result.
it wont give you an error about session destroy etc, because mysql knows nothing about the session.. you're only pasting the SELECT statement, not the php

i dont understand 'query' do you mean my entire php code?

SELECT id,username,email,realname FROM developer_user WHERE username='test' AND password='38200006543e005b94ab316e87f72921' LIMIT 1
php passes that exact text to MySQL. mysql says 'ok thank you, heres the result'. what we're doing here, is removing php from the picture, and seeing if your mysql query is correct. so go into navicat, and paste that query (somewhere will allow you to write/paste sql)
lawl!

ah ha!
Table 'developer.developer_user' doesn't exist
did you see the error?

sure did
there we have it
it would appear the table developer.developer_user doesnt exist

but thats what i said in the beginning! :-(

lawl!
you did not say that at all
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in …/logon_user.php on line 21
i dont see anything about a table there.

but i did

at least we've esetablished one thing, you're DEFINITELY a girl.

I said that the install did not work at all
i was told to create an empty database with no tables

ahhh ok. do that.

ok, what did i miss?

ahahaha!

the install was supposed to create the tables
but it did not :-(

what was the messages it gave when you ran it?
failing that, i suggest you buy some 'my little ponys'
and dress them in various outfits

the error you saw

lol
YaY!
:P
you there dark?

i am

ok, i have been gone for the last 20-30 minutes so i need to get up to speed. have you tried putting an echo in front of your $sql and then copying that line of output off the page and running it thru a query analyzer
?

yes

and did it give you anything?

and i get 'Table 'developer.developer_user' doesn't exist'

ok, then you need to create the table
and/or the database

developer_user is the table, yes?

what are you using for mysql? phpadmin or mysql administrator tools
yes

im using navicat

DB = developer | DB_Table = developer_user

also most mass hosting admin panels apply a 'prefix' to mysql databases
usually the username
so if the hosting machine is running something like ensim or directadmin

that is also correct

keep that in mind
usually it's the username of the database owner

i get hosted thru siteground and they make me prepend my db's with my username

eh

ok

i have a half dozen different colos that are all configured differently :x

so when i make db requests, i have to refer to it as $database="username_website";

ill add it

lol i started prefixing my databases with my username way back during like plesk 3

"website" being what i call my DB
well i used wamp up till i bought my hosted domain. it was much easier in those days
but i didn't have the bandwidth for it

ok i'm off to bed all
ciao

later man

Adding prefixes to your database tables is stupid. Any host will give you your own DB- you won't have to share it.

MarkR42 we're talking about db names.

Oh I see

and usernames

DB names could be anything of course
I had a project where THere were 100 sites each with their own DB, the DBs obviously had to be named sensibly

MarkR42 but the chance of multiple users wanting the db name "forums" on a server hosting 2,000 people is high

Right, so the sysadmin needs to choose the db names
Or at least, not allow sharing

MarkR42 hard to do when the users are the ones who create the databases, no?

salut a vous!

well if the site owner is the DB admin and he aint friends with the 200 + other admins on the hosted server, obviously there will be DB conflicts

cPanel, Plesk, DirectAdmin are all set up so that the users create their own databases, but they're all prefixed by their username

I see. I hate those things.

MarkR42 good thing I didn't mention Interworx then! You can't hate that

brb, lightning just stuck my building

I've no idea what that is

Control panel. Very nice.

But if it's a control-panel-to-manage Apache-and-mysql, I can guarantee it sucks

Not quite as nice as my company's custom solution, but nice indeed.
MarkR42 you can manage Apache and MySQL, but to an extent. It more or less is a total system management bit for hosting companies to set up users with.

exactly

The problem I find is that a) They have awful security holes b) They bastardise every package they touch so that it can't now be configured in the conventional way any more

my hosting company uses cpanel

but like i said. i still prefer my company's custom solution. we can manage all of that and billing from a shell

Also, c) Idiot users think that screen-scraping them with e.g. curl is a really good idea

MarkR42 obviously you haven't used interworx

Maybe it's very good

It's good enough to the point where someone running centos can install the latest version of php via yum
Or likewise with freebsd and ports
or compile it on their own, if they're so inclined
it has its own packages for all the internal stuff so you can't screw with it unless you remove those

cpanel held back the php5 roll out by years.
single handedly

how so?

they didn't release it in /scripts

i was using perl when all that happened i guess

meaning that whatever unbelievably high % of sites on the net using cPanel couldn't use php 5 :P

because cpanel only worked on php4, so lazy/fkwit web hosts didnt want to go to php5 which they couldnt run cpanel with

EoN has to do with migration stuff

but in the past month or so, cpanel has become php5 compatible.. probably because the php4 End Of Life has been announced.
cpanel need their backs whipped with a hammer.
true. its a bit of both i reckon

hmmm.

no host wants to migrate a server
let alone hundreds :P
been there done that.

my cpanel has 5.0.5….

does anyone know of a good (or at least moderately acceptable) video conferencing solution that could be used for an online classroom environment ?

and has for atleast 3 monthes…

j2daosh was in beta for a while

i know that was seriously off topic.

hi

i think php 5 came w/ cP 11 beta
don't remember. like i said, i don't use it often :P
ok i'm really off to bed now
gnite

i've determined that 90%+ of the apps sourceforge are awful.
that or their search system is highly inefficient.

lol
i always thought the interface is not crash hot

man
I just wrote a long ass question, and as I was writing it, I found the solutin :P
it was like, 4 lines :P

does php send any identifying user agents or something?
with fopen wrappers

TehSausage, why don't you find out?
Or shall I?

then again, it could be my server blocking it XD
because it doesnt give a certain header

You can ask it to send one, but it doesn't send a UA string by default

fopen("http://somehost:80/somepage"); right?

yeah, i think i know why
i'll put myself on the proxy allow list

im using cpanel x
yeah i know, that was like so 20 minutes ago but what can i say. I love stormy weather.
lol and he aint even here anymore
or well

connect to [127.0.0.1] from localhost [127.0.0.1] 49536
GET /somepage HTTP/1.0
localhost:1337
That's all it sends.
GET and Host

okay, looks like the slow backup will work as long as my ip doesnt change half way XD

hi. whats the easiest way to have php send email on a local testing server? server is ubuntu with lamp stack. do i need to setup a mail server?

Hi, how do I save an image from a url resource? (url resource containing GD code to create image)

install a mail server such as exim and a mail user agent such as kmail. Configure the exim to deliver mail for some fake domain locally. Send mail to that fake domain from PHP, and pick itup in a local user spool with your mail user agent (e.g. kmail, thunderbird)
If it's simply an image that already exists, you could load it into a local file with copy(). No GD is necessary. This of course assumes fopen wrappers are enabeld.
e.g. copy('http://some.server/something.jpg', '/local/writable/path/something.jpg');

oki, im taking a zzz and ill finish (hopefully) the code tomorrow

MarkR42 I might have a syntax problem, do you mind if I show you a quick pastebin?

well, later today

MarkR42, thanks. And how do I tell php about the mail server? The only ini settings i know are for sendmail and SMTP, the latter of which is Win32 only i think?

You don't need to configure PHP for this. It will use the installed MTA. You need to configure your local MTA to accept messages for a fake domain (e.g. test.fake)
Then you can mail youruser@test.fake

MTA?

and it should drop into your local mailbox where you can pick it up with the MUA of your choice

MarkR42 I create the image using php - header is set to : header("Content-Type:image/png")

mail transfer agent?

MTA = message transfer agent, MUA = mail user agent (e.g. interactive email program)

MarkR42 in a seperate file called imageCreate.php

cool - i will give it a whirl. thanks mr.

If you want a hint, the Ubunutu standard MTA is exim. You can apt-get install exim4, then dpkg-reconfigure exim4-config

well, the one time it seems to be working, flush() stops working XD

nice! thanks

Use any mail program you like as long as it can read from a local user mailbox
I know kmail and thunderbird works

thunderbird will do fine of evolution doesnt work

I think evolution has the option of reading a local mailbox too

Warning: fopen(imageCreate.php?color=blue) [function.fopen]: failed to open stream: No such file or directory in /var/www/public_html/test/mail_mime2.php on line 6 http://pastebin.com/m275a41be
Is it possible to dynamically create an image in one php file, then in another file, save it to disk, and then mail it as an attachment?

You don't need to use two .PHP files for what you're trying to do
Put the relevant parts into functions and call them from a single page

MarkR42, but I want to re-use the imageCreate.php file to display the dynamic image in parts of a site, then mail the image when needed

kekeke

Put the relevant functionality into a function then, include the file with the function and call it.

in parts of the site, then when I need, make the image into an attachment (might not have to save the file to HDD, just think it would be easier)

Making HTTP calls to your own pages is pointless

did you see my pastebin?
http://pastebin.com/m275a41be

Yes. However, the standard mechanism of code reuse is: 1. Put the stuff into a function 2. Put the function into an include 3. Call the function as necessary

Does any1 know what the name of the background of required text fields in CSS is called?

I should think it's the same as non-required ones

actually
i think its just e-mail
e-mail and aim
do u know the names of those in CSS?

There is no specific CSS selector which selects based on the function of a text field.
CSS does not include those kinds of semantics (yet)

can i show u my code?

Yes but only if you stop calling me "u"

MarkR42 is it possible to save an image from imageCreate.php ?

Type in English please

sorry
lol

And don't "lol" either
It makes you smell like an AOL user

lol

I hate AOL

Of course, but don't do it. Instead put it into a function.

There's nothing in our channel guidelines that prohibits someone from saying "lol"

I didn't say it was in the channel guidelines, did I?

Then judge their speech elsewhere.

Alright go here http://23663.darkstargamers.com/phpBB2/profile.php?mode=register&agreed=true

Though…
php-bot: tell duckhunt about typing english
That's for the "u"

thats what the highlighted text box
is i want to change
and here is the CSS
http://pastebin.com/d7230a099

free shared hosting 3 sending my entire phpbb database uncompressed over http

Examine phpbb's code to determine what classes / styles it uses and/or add the appropriate ones as necessary. We don't support phpbb anyway
Black on black is not normally considered good for usability

no thats fine but the bright yellow with white color font
You cant see what you type

I imagine you are getting problems from a browser extension changing the colours of your page.
Disable *ALL* browser extensions and try again
And if it's a specific browser extension (e.g. Google toolbar, yahoo), read that extension's documentation
This is severely off-topic for ##php anyway

MarkR42 Can you suggest a way to turn the output of the imageCreate.php file into an imagefile?
MarkR42 without using functions?

Yes, rewrite it as a function and call the function
No, rewrite it as a function and call the function
THe only sensible, logical way of reusing PHP code within an app is by putting it in a function in an incldue file, including it and calling the function

MarkR42 how do I put a function call in a tag like img src="php function_1(); ?" /

On no account should you be making HTTP calls to your own pages, it's not only pointless, but complicated and more resource intensive.

thanks it ended up being Mozilla

Make another page which you can reference from an image tag which calls the same function

MarkR42, i went through the exim4 install. what kind of account should i be adding in thunderbird? standard email / unix mailspool? pop3?

I doubt it. I expect it's a browser extension
unix mailspool
Disable ALL browser extensions, and try again
I'm sure you'll find it is one of those

MarkR42 ok, I will be back then soon

is there a way i can check the presence of an ftp server on a certain domain?

FTP servers don't run on domains, they run on hosts.

or hosts, rather
sorry

On a given *host* you can check for the presence of one, yes

can you show me how?

I expect there's a PEAR module you can use to connect and retrieve the banner. Or you could just connect with fsockopen and read the banner yourself if you know a little about the FTP protocol. If you want to actually connect, you'll need a username and password, then you can use the fopen
wrappers.

And no, I can't show you how, but there are some ideas.

dont want to connect, just want to know to see if my ftp server hasnt fallen over

Oh, so it's a system monitoring application. Consider using something like nagios instead.

yes
okay ill have a look, thanks for your help

MarkR42, works great - thanks mate.

So you can ssend yourself messages from PHP and read them locally? Cool. I think that's a good dev environment

MarkR42, havent done it via php yet. i need to make the validation in my script a bit more relaxed as it wont accept user@localhost

does firefox automatically try to parse xml files with rss version="2.0"? my rss generator generates good xml according to w3, but when i replace the root node of "foo" with "rss version=\"2.0\"" i no longer get output and my rss feed aggregator doesn't show any listings.

MarkR42, just for testing obvioulsy

maybe should ask in #firefox

You can configure the local mail name as whatever you want, and accept messages for other domains too.

it's a tangent question to… does $this-xml-createElement("rss version=\"2.0\""); break the createElement function in any way? i don't get any output.. no errors, nothing.

Do you have all errors and warnings enabled?
That sounds like an invalid name for an element

$this-xml-createElement('foo') works fine.. everything's there.
yeah, it's set to display E_ALL

Last time I checked, the DOM libraries actually did let you create invalid names of elements etc

hm

I just tried calling createElement with a similar invalid name, got a Uncaught exception 'DOMException' with message 'Invalid Character Error'

hm.

Is $this-xml definitely a DOMDocument ?
Or is it some other third party class?

yeah. i'm using xampp for the first time due to an issue with another package needing a version of mysql i don't have installed.. maybe xampp's being goofy.
$this-xml = new DomDocument('1.0');

Calling createElement with something which isn't a valid element name should throw an exception. It does on mine (5.2.1 CLI)

hmm.
i'll try the cli

can someone please look over a script I've done and give me a few tips on how I Should do things better? it would really be appricated…

huh. ran it through the cli (5.2.3) and i got no output.

No exceptions?

nope

$xml = new DomDocument(); $xml-appendChild($xml-createElement("not valid=innit"));
And it threw an exception

changing "rss version=\"2.0\"" to "rss" gave me the correct output.
no exception on that..
wtf.
hm

Are you absolutely sure that you were running with all error logging, reporting etc

i'll double check.
maybe this xampp thing is wonky

Try just doing throw new Exception("test");
Perhaps the exception is being thrown but not output

ini_set('error_reporting', E_ALL); ini_set('display_errors', TRUE) or 1 or ON.. still nada.
hm.

kuja, hello

nothing in the apache logs, either.

Is there some flag which makes an unhandled exception silently exit?
Have you tried just throwing an exception from the php CLI?

i'll try that now.

Incidentally, I just tried php -r 'throw new Exception("hi");' and it threw an exception then crashed PHP

hah

hi all

Figured it out. $foo = $this-xml-createElement("rss"); $foo-setAttribute("version", "2.0");
still can't figure out why no exception was thrown.

what library is "recommended" adodb or the one from pear?

doesnt crash in 5.2.0

Hey folks
I'm a php hobbyist and I'm having trouble with a crap CRM app that I'm editing
Basically, I can't find their API docs (LiveArticle) and I'm just trying to edit a class
I am at the right place in the code, but it keeps saying that my class doesn't have a custom metho
*method
is there some new way of making methods for a class, besides inserting "function blah() {}" inside the class definition???

no

can anyone tell me what is the best option for going to use a database library for php? adodb? pear? creole? propel?

thx - I'll recheck my code for starters…. :-)

BUT! classes can inherit methods
bemson, check the classes definition

understood - but this one isn't being extended from another class

for extend or similar
^^

ok
I didn't create the class, just trying to modify it

well then remember you candefine a function inside a function
like include() a file that holds function definitions

I'll try that too - isn't the same-named function the one invoked at instantiation?

either that one or __construct

And isn't there another name for that function now…
exactly

^^
also __destruct respectively

I'll make a construct function then, and see where that get sme

hm

thanks much noimnot

not supported in PHP4 tho
yer welcome

laterz!

If I use LGPL library and my project use GPL licence, should I include LGPL licence too?

if you care talk to a lawyer or read the license
it's all so fucked in the meantime….
i use the NPL (Nihil public license)
"nihilo ex nihil"

"nihil novi"?

meh?

i use the PMMF license

thx again noimnot - I'm good (nuff) now
later folks!

it used to be known as the "Pay me or I'll send some Romanian thugs to cut your ears off" license, but that was too long.

hey guys is it possble to make a form with a get request return a address like /this+is+my+search ?!
with mod_rewrite

yes, also without mod_rewrite

uhh sweett how ?

you either use the 404 forward handler, split the request uri and set a $_GET variable yourself, then incldue your site
or just read the man of mod_rewrite

hmm i know
but it is a form that is submitted
and it auto prdouces ?query=

oh
tried having no name for the fields?

know all the other stuff
its stil making the ?=

then no
read the rfc

okay

also that has nothing to do with mod_rewrite
it is client side

okay :/
solution could be make a default handler
that is redirecting with the parameter S

use mod_rewrite to rewrite the url
+

ye iknow

remove the get parameter names could work

time wise could i use = to compare 2 times in the format "11:42"?

kevingruscoe, no

How would i go about comparing 2 times like that then?

but str_replace(":","",$time1)=str_replace(":","",$time2);
or explode(":",$time); and compare 2 arrays
your choice

Hello how can I select a row from a MySQL-table like this? $sql_get_userdata = mysql_query("SELECT * FROM users WHERE MD5(user_id) = '" . $_SESSION['adtrader_se']['auth'] . "'"); (note: MD5(user_id)) Hope u understand what I mean…

copyninja, #mysql

noimnot, it's kinda dead in there but okay thanks

there is a reason for this
to many people with ridiculous requests i take it

hi

noimnot, say what?

to many people with ridiculous requests i take it

I don't understand what you mean.

people that are just to lazy to think asking stuff they could answer themselfs

Generally speaking, people will store the MD5 hash and then compare against that, rather than what you appear to be doing which is storing the unhashed value and hashing every time for comparison

noimnot, If you assume someone could answer a pretty easy question (like mine) which would take about 30 seconds of their time, why not just simply ask before you start digging the net for answers? But anyways thank you for your time.

help!
I am attempting to use POST vars with a curl script

Yeah, It's usually done that way (ie with passwords). But I assume there must also be a way to do the viceversa.

copyninja, there is no reason to do it "viceversa"

but some of the data I am submitting comes from a select that allows multiple forms, how do fix the postvars to accommodate the multiple part
multiple selects*

It's not normal for a database to implement the MD5 algorithm.

FYI, please be more specific

php.net/faq.html

what is "a select that allows mutliple forms"?

I assume not.

sorry - hardly any sleep… I will try to be more coherent

Thank you. I will find a different way to solve it then.

select mulitple

I am using cURL, and need to post to a page. I am acting as if I am the form. The form I am pretending to submit from has a multiple select… I need to know how to fill out the post vars for cURL to submit

oh, so you mean multiple values, k
you are TEH FORM man!

php.net/faq.html

apparently var_name=single_value doesn't work

on oracle how can i insert a blob to longraw field?
with php

TML - that doesn't help, thanks though

FYI, find out how the browser is supposed to send multiple post values..

A doubt about SSL. I am going to prepare a website in SSL. There I am going to show a page with FORM. There the use will have to enter confidential information and the form will submit to the server. My server is Apache with PHP. I do not know how to make the FORM page to be shown and get
form datas securely? Somebody help please….

How can I make this work? function a($x) { function inner() {print $x} }; a("test");

there are no websites in SSL
SSL is not a markup language

correct.
How can I make this work? function a($x) { function inner() {print $x}; inner(); }; a("test");

wam, why are you repeating yourself?

function inner($x)

I corrected myself.

i was about to say something, not i feel obligated not to; so you learn something

That's not possible.

Then you can't do it

I'm creating PDO emulator (because MySQL driver is disabled on ByetHost) based on MySQLi. However, is PDOStatement a child of PDO?

Note that there's really not such a thing as an "inner function" in PHP anyways.

wam, function inner() { global $x; echo $x; }

I wanted to avoid making it global. But when that's the only way :/ Thanks.

you don't need that funciton in function construct
wam, meh

That won't work unless it's inserted into the global scope by a()

wam, use classes

sure? I have a sorter for usort.

function a() { function b() { var_dump("B has been created"); } } a(); b();
Note how calling the a() function creates the b() function in the global scope…that's because there's really only one scope in PHP

I need a sorter for usort and I find it difficult to call the sorter function when it's inside a class. It's just more convenient so.

Use a callback

with usort?

Yes
php.net/callback will show you how to create a callback that calls a method on an object
!+func usort

Sort an array by values using a user-defined comparison function

"bool usort ( array &$array, callback $cmp_function )"
See how the second argument is of type "callback"?

I see…

php.net/callback will show you how to create and use callbacks

I'm in a class, which is only used static.

php.net/callback
Read it
It will answer your question
As an aside, this is a great example of why you should ask your real question instead of asking how to do something that you assume is the answer to your real question.

So what does this help? I could use a method in my static class. But that wasn't my question. My question was, how could I pass another variable into the sorter method. Because php obviously doesn't support namespaces, this is non-trivial.
and as noimnot said, $global looks as the only way out.

somebody please answer to my question too.

It's not clear to me how namespaces would help you here, but *shrug*

If function inner() was inside the namespace of function a(), it would also share the parameters given to a(). Like in nearly all advanced languages.

hello, guys! is there a function for the complete separation line to the array?

Uh…no, in neither C++ nor C# does sharing a namespace mean they share internal variables.
The what?

my question on php
i need parse string to array

Do you really think, c++ or c# are advanced?

I most certainly do
Sounds like you need a basic tutorial in how SSL works. Maybe plug "how ssl works" into Google and start reading.
php.net/explode or php.net/preg-split

they build on deprecated libraries with deprecated access methods and lean on defined behaviour because they have to to be compatible with the old crap.

I think you're confusing C# for something else.

Really? How did microsoft implement c#? 80% of the libraries are the old ones from the '90s. When no real OOO was implemented.

As for calling things "deprecated", "old" and "deprecated" are different words. Don't use one when you mean the other. C++ is not deprecated.
You're mistaken.

i want split without delimeters, for example string "abcd" to array {'a','b','c','d'}

You would agree, if you knew ruby or python or so.

php.net/string-split
I know both Ruby and Python

then you know how easy it can be.

The majority of C#'s libraries were completely built from scratch for the whole .net runtime

I ready already much info, but now I am going to startup. There I get this doubt how to render the form (in SSL/non-SSL).
?

What do you mean "how to render the form"?
If you're asking whether the form needs to be sent over SSL, the answer is "only if the form contains something you want encrypted over-the-wire"
If it's just HTML with no sensitive information, there's no (technical) reason to send it over SSL

hello
do you know some good courses on the iinternet for learning php

php.net/manual
!tell pomp about getting started

thank you for that web site

 Best Web Hosting | Best Hosting

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

Leave a Comment

You must be logged in to post a comment.


Blog Tags:

Similar posts: