session variable saved properly, user redirected, session variable is used to display a message to the user, then unset, print_r proves it is unset, however the db session table shows it still being there….any clue why?

gwhite, then something is wrong with your browser. sessions are only temporary blazer1, simplemachines forum, phpBB (at your own risk)

i closed it and restarted it and had no other browsers open and it still said my variable was set to 5

I created a extension to mysqli and use that for session handling, this extension is just a __destruct that does the session_write_close

until i cleared cookies in firefox

im using phpbb, its dreadful!

Is there a way to make $obj=’foo’; $sub=’bar’; $xml-$obj[$sub] = $val; Access the element of the array instead of a character in $obj?

gwhite, are you setting an actual cookie then? blazer1, try SMF (simple machines forum)

sweet, thanks man

Ktron, do you mean $xml-{$obj}[$sub] ?

erisco, let me try it

what if i have opera open just for php coding that way i can restart that while keeping firefox open for my normal web surfing? sessions should still be cleared when i reload opera even tho another browser is open since it’s not the same browser right?

Ktron, what I gave you will translate to $xml-foo[’bar’]

erisco well the sessions are acting like cookies but im not formally doing a set cookie. just session functions that use a cookie type file to store the sessid

gwhite, sessions are generally remembered via cookie, yes gwhite, but browsers recognize session cookies as temporary only

well opera wont try to use the same cookies i created with firefox right

erisco, then yes, that’s exactly what I was looking for… I tried $xml-${obj}[$sub] but that didn’t work, obviously because I was ‘grouping’ the wrong bit

and your problems are solved

erisco, You’re the man erisco, thanks

Ktron, no problem

im just worried ill forget to take out the code that calls session_destroy in certain php files and screw up my application

gwhite, just make a completely separate file solely for that purpose of clearing your session

i’ll still have to include it

gwhite, no you won’t… you type the address into your browser

so ill have to put huge comments next it it like // !!!!!! DELLLLLLEEETE MEEEE ah! ok ill try that are you sure that will delete the session even for another page and does that file have to reside in the same folder as my project or anywhere?

gwhite, absolutely not

cool ill try it

gwhite, session_start(); and session_destroy(); purely communicate with the server gwhite, well I shouldn’t say purely, they do send headers, but your objective is to destroy the session sitting on the server. Then the browser’s cookie won’t matter whatsoever

cool, and i wont have to restart the browser which would be great

erisco, with smf, there seems to be no api for me to register users using my own form on my site? or is there and im blind? blind i tell ya!

blazer1, well I would read the docs. I am not any SMF wiz. In any case users are registered by POST data and it doesn’t matter where it comes from

hello

blazer1, all you should need to do is send that POST data to the file that registers the user. Right? coldsteal, hello

okay so im trying to do mail() and its not working its not compleating and i dont know what the error is i dont get one

too true, however … i would first want to store some data in my DB before sending it off to smf

coldsteal, does anything else execute after the mail() call?

anyone have much experience with using the db2 functions in php? i’m able to db2_connect, but most of the useful stuff just returns null

blazer1, that is done easily enough is it not?

ummm … i could use the header relocation …

if i do `if(mail…){}..else{}` the else works

but would $_POST still pick up those vars?

coldsteal, so the mail() is returning false… let me look at the docs.

or do i need to change all $_POST to $_REQUEST? in smf

blazer1, I see what you are saying. However never forget that you can just as easily include() the SMF file that registers the user blazer1, just precede that with whatever means you have of storing the user in the database.

oh haha of course

is there something like mysql_error() for mail well mail()

doesnt mail return something?

no

coldsteal, do you have a mail server setup?

mail() just hands it off to the system mailer. Look in your MTA’s logfiles to see what happened.

yes i have postfix

coldsteal, what is happening is that PHP is trying to tell your mail server to send that mail but the mail server is failing to do so

5 -0400 (EDT). how can i reformat it to unix

ill look

coldsteal, mail() is returning false Juxt, you mean a timestamp? strtotime()

hehe that worked

Juxt, awesome. strtotime() will understand just about any time format… which is great. Just realize that it isn’t a speedy function either I need to stop solving problems. It is making this channel too quiet

and realise that it is not to blame if the date is ambiguis

henke37… and how does what you said relate to anything? Did I miss something?

hello can anyone here me/

is 01/02/03 in January, February or in Mars?

erisco if session_destroy() doesnt delete any session variables or unset the sesion cookie is it truly enough to destroy a session in the way you said or should i add more stuff to this like unset($_SESSION)

strtotime can’t know for sure, nor can you

henke37, strtotime() only deals with Earth henke37, once PHP goes galactic I am sure strtotime() will expand.

right now i just created a file called kill_session.php and only put session_start(); session_destroy(); in it

erisco, my example is a date that has been passed, in all of the possible interpertions

but maybe i should also loop through $_SESSION and unset everything in it too

henke37, I was just having fun with your typo

or maybe i shouldnt so i dont have to retype form fields? not having to retype form fields yet still killing the session would be ideal for testing

gwhite, $_SESSION is only a copy of the session information. Unsetting it is useless… session_destroy() already takes care of deleting the true session data

how do i see what header was sent when I did a curl_exec() ?

ok thanks erisco you have made my life a lot easier once again

gwhite, if you only want to kill certain things then yes, unset them one by one manually. Do not use session_destroy(). At the end of execution $_SESSION is read and overwrites the old stored data

you should tour the country teaching php for crazy high fees

eyeRmonkey, check php.net, I know there is a function for it

i know. i have it. it’s just not returning anything $header = curl_getinfo($ch, CURLINFO_HEADER_OUT);

eyeRmonkey, are you on 5.1.3 or above?

5.1.6

if I’m running scripts locally and each script hsa a different cookie name will they still retain the same $_SESSION info I set?

eyeRmonkey, did you actually get the page you requested for?

i just session_destroy wouldnt make it so i have to retype form fields. i use webdev’s ‘populate form fields’ button but it only fills it out about 96% right so i still end up having to type some

engaged, sessions work server-wide. It doesn’t matter where the script is so long as it is the same server serving it

k

gwhite, yup, that is a good reason to save some information then Just unset what you need.

erisco, i’m fairly sure I did. there was html returned. I’m trying to get the header that was sent by CURL, not the received header

hey if u are to write your own forum script, what would be the big deal in it?

erisco save some how

its pretty straight forward isnt it?

Is there a way I can modify the PHP source to send an e-mail on all PHP errors? I know I can do it internally, only if it’s not a parse / code error.

Coming up with the name.

engaged, I am not sure if there are issues with sessions and CGI but I do not think so

Install your own error handler

blazer1, just time consuming

i see

That won’t work for critial PHP errors

but when u look at these existing forums, the code base is huge what exactly are they doing?

SubFreeze, you will have to work with the php engine itself

erisco, any other ideas?

eyeRmonkey, did you actually get the page you requested for?

If I have a class with a static property, and I extend that class, then when one of the parent class’ (static) methods is called on the subclass, the parent’s version of that variable is accessed instead

I was thinking that, myself. I’m sure someone else has done it before, any ideas on what a good google search would be?

blazer1, just bells and whistles

i c

Is there something like a ‘virtual’ keyword in PHP?

subfreeze, http://www.php.net/manual/en/ref.errorfunc.php

blazer1, making a simple forum is not hard, no. Many people do not choose to simply because there are already options out there

erisco, yes.

so if i want a very simple forum, extra simple (like a facebook wall thing) … and i want to very easily integrate into my site, im better off writing my own?

Those work for everything except PHP code errors. I want code errors to also send e-mails.

Twey, I am unsure of your problem… can you play it out in a simple example on pastebin?

subferze, then erisco is right, you’d have to modify the php engine itself

blazer1, if you have the time to do it. Another option is to “hack” an already existing forum

I’ve changed the code into while loop but it still gives me the same error

SubFreeze, I have not heard of any extensions allowing what you want to do… if you know C feel free to write away though Murdoc, can you pastebin it again please?

k

Looks like I get to jump into my C boots, kinda dusty, though

SubFreeze, as are mine

i wouldnt know where to begin im sure in between the logic and display theres an api

erisco, http://pastebin.ca/682934

they use templating surely dont they?

I can — just a moment

screw it, im writing my own

ing

atleast that way i can use it in other sites i create easily

Murdoc, you are still iterating over an array that does not exist. count() returns the size of the array, but your array indexes start at 0. Therefore you should have while($i $num_rows - 1) {

erisco, assuming that curl_getinfo($ch, CURLINFO_HEADER_OUT); …. is there any other way to get the header sent by CURL

eyeRmonkey, I will look

ok thanks

erisco, awesome. thanks.

eyeRmonkey, what does CURLINFO_HEADER_SIZE return?

http://rafb.net/p/17cMbw42.html

erisco, 11589 erisco, it’s obviously there. i just can’t get to it

eyeRmonkey, I am not sure what to say. What header are you looking for specifically/ Twey, I have never seen static classes like that. Hrm. Let me toy with that Twey, I don’t understand how that code even manages to work

erisco, it’s for debugging purposes. my request isn’t going through properly and i need to see what’s going on behind the scenes

Why?

eyeRmonkey, that makes sense. Will CURLINFO_HTTP_CODE help?

it worked when i cleard my logs i ran out of space lol

Oops, I made an error

erisco, a little. but a full read out would be ideal.

$b should be self