« first day (876 days earlier)      last day (4054 days later) » 

12:04 AM
wow, not cool man
 
user895378
Hmm ... what am I supposed to do with a flag from a user I already have on my ignore list and know to be constantly pestering people?
 
@rdlowrey ;-)
 
omg this computer take forever to restart
@PeeHaa if only I could afford to replace this computer...
 
@DaveRandom What about selling your body?
 
user895378
Or stripping cars.
 
12:11 AM
Or both!
 
user895378
Or just stripping.
 
ffs
 
lol
 
user895378
You could always steal copper wiring out of homes that are under construction. The price of copper is up these days :)
 
user895378
12:12 AM
And I hear the black market value on young blond children is high to quite high right now.
 
:D
 
Err... I shall pretend I didn't read that
Anyway, I believe the value of orange people is quite high as well
:-P
 
lolo
 
Is this a common $object instanceof className for traits?:
 
user895378
rofl
 
12:17 AM
if ( isset( class_uses($object)['ScraperNodeTrait'] ) ) {
 
user895378
There's always a market for us. Willy Wonka pays quite well for Oompa-Loompa labor and from time to time MTV decides to run a show featuring a group of "orangies" (our term).
 
@hakre isset() doesn't work with expressions
 
but with arrays.
 
@rdlowrey Do you have the drink Tango in the US?
 
user895378
yes.
 
12:19 AM
@hakre I wouldn't thought that would work but I could be wrong, I thought it only worked with vars
 
user895378
I'd expect it to work in 5.4 because of the array dereferencing, but I could be wrong
 
exactly but apart from that, isn't there something like instanceof that work for traits?
 
@rdlowrey There was an advertising campaign many years ago (here) about "You know when you've been Tangoed" and all the people were orange, maybe you could get a job doing that?
 
user895378
Doesn't instanceof itself work for traits?
 
Passive aggressive insults don't work very well when you explain them first
 
12:20 AM
@rdlowrey no, that didn't work
 
user895378
hehe
 
I'll assign a fake-interface on those now
 
codepad.viper-7.com/MJR1vM <-- I totally didn't think that would work
 
@DaveRandom yes, it works but in the end it's a comparison against a string.
I do not like that much.
I do it now with some interface
It's not that I normally use traits, but for that library I do.
 
@hakre Generally if I've ever used traits it's in combination with an interface anyway. I've only ever used them to provide a "default implementation" for an interface
 
user1251600
12:35 AM
hey, anyone know anything interesting in PHP
 
@BottleofMilk Well, it's indeed good that PHP is synchronous and not asynchronous, or you'd get way too many problems.
Well, I think so anyway.
@BottleOfMilk how many years of PHP experience have you had?
 
user1251600
Well, maybe let's say 3.
 
@BottleOfMilk you know any other programming languages?
 
user1251600
erm, no.
 
user1251600
I'm just simple web design - 101% web dev.
 
12:37 AM
yep, same here. Though I have scraped a toenail in C and C++
and a smidgen of Java here and there
 
@DaveRandom I only use the interface to assing a type
 
user1251600
I like your word smidgen
 
user1251600
:D
 
thanks
 
Who's going mental with the stars?
 
12:38 AM
dunno
 
Because I overload DOMNode classes with register node class, I can not have my own DomNode to extend from
 
user1251600
I am.
 
 
For some reason, Server-Sent Events don't work for me. Anyone else have the same problem?
 
Please stop, or I will kill you. In the nicest possible way.
 
12:39 AM
what?
 
user1251600
anyway, I've gotta go now. See you later think123.
 
@think123 The starring of things (not you :-P)
@hakre I don't quite get how you can sensibly extend any of DOM because it's so strict about the owner document
 
@DaveRandom Yes, what do you want to know?
Let me compile a short example.
 
I am intrigued...
@think123 codez?
Oh, I forgot I can clear stars
 
@DaveRandom eval.in/12314
class ExtendDocument extends DOMDocument {}

$doc = new DOMDocument();
$doc->loadXML('<root/>');
$root = $doc->documentElement;
$doc->registerNodeClass('DOMDocument', 'ExtendDocument');
echo get_class($root->ownerDocument), "\n";
unset($doc); # <- unset
echo get_class($root->ownerDocument), "\n";
 
12:45 AM
that's pretty counter intuitive, took me a minute to wrap my head around that one
Specifically the unset()
 
You can also instantiate ExtendDocument directly.
class ExtendDocument extends DOMDocument
{
    public function __construct($version = null, $encoding = null)
    {
        parent::__construct($version, $encoding);
        $this->registerNodeClass('DOMDocument', 'ExtendDocument');
    }
}

$doc = new ExtendDocument();
$doc->loadXML('<root/>');
$root = $doc->documentElement;
echo get_class($root->ownerDocument), "\n";
unset($doc); # <- unset
echo get_class($root->ownerDocument), "\n";
 
@hakre Well that's kinda obvious :-P it was the registerNodeClass() magic I wasn't aware of. Somehow I've just never noticed it
 
yes, but you can not register for DOMNode and then everything that extends from DOMNode would have your class.
Therefore I have MyNode, MyDocument, MyElement, MyAttr and each of those uses a MyNodeTrait and implements a MyNodeType now.
 
I am now desperately trying to remember what it was I was doing when I wished I could extend the DOM :-P
 
these diagrams are cool
 
1:00 AM
Ok then amazing people of the PHP world, im still looking for some ideas for some amazing features to add to a chat application
 
@Connor chat-roulette mode
 
@hakre its more of a live support chat for customer service
 
@Connor this is the chat app I use jitsi.org/Main/Features check out its features and see if any you think you can add.
 
ok Thanks
 
1:08 AM
@Connor then it needs a big red button a customer can press whenever suitable.
 
@hakre and that button does what
 
@Connor it gives the customer a good feeling.
 
@hakre Nice!
 
@Connor it's not one of those support chats, that randomly message the person while they are browsing the site? Those are annoying, however it can be a great way to meet new people.
 
Lol
> I took a perfectly good 10-year-old table-based website and made it look exactly the same using CSS. And billed 200 hours for it.
 
1:22 AM
@crypticツ you may need to get out more
 
Hey, anyone here know Yii?
I just tried it out and want to ask a question. I want to use included schema mysql scripts to create tables for provided database. Is there some way I am missing that it will create the tables, or I have to do it by phpmyadmin?
 
ive just changed this $images = glob("{$dirname}*.png"); to this $images = glob("{$dirname}*.png", "{$dirname}*.jpg"); and im getting a error expects parameter 2 to be long,
any ideas?
 
maybe try glob("{$dirname}*.{png,jpg}")
 
Did you maybe try reading the manual page for glob()? You can't just make argument lists up as you go along, you have to use the functions as they are defined ;-)
Also IIRC you can't do what you want with glob(), the glibc glob just doesn't support it, I'm sure we had this debate in here once
I suggest $images = array_merge(glob("{$dirname}*.png"), glob("{$dirname}*.jpg"));
 
@DaveRandom Thanks, That Works!
 
1:38 AM
Does there are ways to zipping files with PHP?
 
@Connor It does, but it's O(4n) (I think) - it might be better to opendir() and preg_match() but I don't know if the PCRE overhead might lose anything you would gain from that, it depends how many files are in the directory
To be fair, chances are it isn't going to matter unless you have a few hundred files in the directory
 
:8179144
When I write:
<?php
$zip = new ZipArchive;
if ($zip->open('test.zip') === TRUE) {
$zip->addFile('../php/rate.txt', 'newname.txt');
$zip->close();
echo 'ok';
} else {
echo 'failed';
}
?>
I get error said: "Fatal error: Class 'ZipArchive' not found"
 
Oh, then the Zip extension is not available on your PHP instance. You need to enable it in php.ini
There's also PclZip, which is a userland Zip implementation, I used it once and it worked well, although the API is a bit sucky
Having said that, the ZipArchive API is a bit sucky as well
 
@DaveRandom Ok, Thanks for the advice
 
1:58 AM
@DaveRandom You're right. It sucks. Have to enable it on website.. :(
 
Good evening, i dont know if anyone can help (been asking a fair bit the last couple of days) but, if i am sending PUT and DELETE http methods using Ajax, is there a reason why the php file on the server is recieving them as OPTIONS?
 
@Vade Because the webserver is set up wrong
@ThomasGeorge That's the big thing the PclZip has going for it, it is more portable because it's a userland implementation.
 
hmm k ill speak to the tech support, its only when using ajax though as using Postman in chrome its fine
 
@Vade That is a bit weird then, are you inspecting $_SERVER['REQUEST_METHOD'] to determine this?
 
yeah
i have a variable assigned to request_method and then i switch on it, i only allow certain methods on certain urls,
 
2:07 AM
Hmm, I wonder if you are actually sending the PUT/DELETE method requests then, it maybe that they are not getting sent right, the webserver then responds with "method not allowed" (forget the response code) and the client correctly sends an OPTIONS request to see what is allowed
make sure you are specifying the request method in upper case
RFC2616 states that methods are case sensitive, they are often implemented as not case sensitive but they might be pickier over potentially harmful methods like PUT and DELETE
 
Anyone also use python?
Is there something like PEP8 program in PHP?
(i.e: in python I can do "pep8 my_script.py", and it will show me everything considered as not good, to many indentation or whatever)
 
@goFrendiAsgard You mean like JSLint?
(for JS)
 
Yes, but for PHP
 
how do i format code is it [code] ?
 
IDEs are generally quite good at that sort of thing, but not off the top of my head
@Vade Inline code is done with backticks and multiline blocks are done in a message on their own with a 4 space indent
like the markdown on the main site
for multiline blocks you can press the "fixed font" button that will appear when you paste them in the box
 
2:12 AM
For now, I'm using this: http://beta.phpformatter.com/
But iti is just a beautifier. I feel it is easy to write messy (unreadable) code in PHP.
IDE (such as eclipse) do good, but not absolutely good.
 
ok cool, well i just tried to double check my ajax function with delete, and it worked! well it deleted it from the server as expected, how ever for some reason it still returned a 405 Options not supported in the dev console
 
@Vade Weird, I would get Wireshark out and inspect the raw request/responses and see what's actually being exchanged
191
Q: Is there a static code analyzer [like Lint] for PHP files?

eswaldIs there a static code analyzer for PHP files? The binary itself can check for syntax errors, but I'm looking for something that does more, like unused variable assignments, arrays that are assigned into without being initialized first, and possibly code style warnings. Open-source programs wou...

 
and now PUT is working also, but there is still some OPTIONS being fired, the thing as its for uni i can hack in a bit of code that doesnt do anything with options as a request, as long as GET, POST, PUT and DELETE Work then i am happy
 
user895378
405 means "Method not allowed" ... are you sure the DELETE worked like you thought? Are you using a real server or something someone came up with themselves?
 
@DaveRandom: great, thanks :)
 
2:17 AM
the 405 is returned by me after a switch statment examining the request_method
 
user895378
In a PHP script behind a webserver or by your webserver?
 
@Vade You may need to explicitly set header('HTTP/1.1 200 OK'); - what web server are you using?
Oh actually that ^^ is a good point as well
from the way you were talking I assumed this was invoking a PHP script - is it?
 
yeah i have a htaccess which directs url to a php file
on the webserver
dont laugh at this code
 
user895378
So what webserver is in front of PHP?
 
case "PUT":
//get the name and vno
$name = urldecode($this->paths[1]);
$vno = urldecode($this->paths[2]);
//get the data
$data = json_decode(file_get_contents('php://input'));
//we need to do some sanity checks to make sure that the user has added the correct information.
//data check to make sure there is some....
if(is_null($data))
$this->ReturnErrorHeader(CODE_400.' Data missing');
//check for data, Name is grabbed from the url.
if(!isset($data->code) || !isset($data->versionInfo))
$this->ReturnErrorHeader(CODE_400.' not all data passed');
 
user895378
2:19 AM
Apache?
 
what you mean what i am firing the ajax from? yeah its an Apache server on my localhost
 
OK well you need to do more than that, Apache only passes GET, POST and HEAD through to PHP without a whole bunch of messing about
 
user895378
I would first disable the .htaccess file you're using and try something like this:
 
user895378
telnet myhost.com 80

DELETE /some_resource HTTP/1.1
Host: myhost.com
 
it's ages since I set that up though, can't even remember how to do it
 
user895378
2:19 AM
And see what you get from your actual webserver.
 
@rdlowrey DELETE is a 1.1 method :-P
 
user895378
Is it? lol
 
Yeh, 1.0 only defined GET POST and HEAD IIRC
 
how do i make it work as a REST without the .htaccess?
 
user895378
What a loaded question that is ...
 
2:20 AM
this is my .htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* api.php/$0 [L]
this was what i used to try and learn how to do it
 
user895378
I don't mean to scare you away from REST via PHP but after struggling for the last two years I decided it would be easier to write my own webserver in PHP than to use PHP behind another webserver for creating REST APIs because PHP's HTTP abstractions are so poor. And that's not easy. So that's my opinion of PHP's usefulness for REST ...
 
$ curl -Iv -X DELETE http://example.com/curl/delete/file
 
Oh yeh that's right, you do it with Script
@Vade ^^
 
Its for a uni assignment thats due 10 monday morning. everything works and the docs are written etc, but i am picky and like little things like this to work as i want
 
RewriteEngine On
RewriteCond %{REQUEST_METHOD} =DELETE [NC,OR]
RewriteCond %{REQUEST_URI} \.del$
RewriteRule .* delete.php
 
user895378
2:23 AM
<-- hates apache
 
@hakre Does that work?
 
I wish you all a good night.
@DaveRandom yes it does
 
Night night
 
user895378
<-- hates php's HTTP abstractions
 
user895378
@hakre later
 
2:24 AM
<?php
/**
 * delete script
 *
 * $ curl -Iv -X DELETE example.com/curl/delete/file
 */
if ($_SERVER['REQUEST_METHOD'] !== 'DELETE') {
    header('Method not allowed', 405);
    exit;
}
$basepath = __DIR__;
$file = basename($_SERVER['REQUEST_URI']);
$path = $basepath . '/' . $file;
$exists = file_exists($path);
if (!$exists) {
    header($_SERVER['SERVER_PROTOCOL'] . ' 204 No Content'); // HTTP/1.1 ...
    exit;
}
$success = unlink($path);
if ($success) {
    printf("Deleted %s\n", $file);
it's really akward
 
@DaveRandom sorry bud, where does the code from that link go? in the htaccess or something else?
# All GET requests go here
Script GET /cgi-bin/search

# A CGI PUT handler
Script PUT /~bob/put.cgi
 
but it works
 
@hakre ill take a look.
 
@Vade server config, virtual host, directory - so somewhere in httpd.conf or one of its children. But @hakre has provided (apparently) a rewrite based solution
Man, Apache sucks big swollen cojones
 
oh i didnt see that
 
user895378
2:26 AM
Worth repeating:
 
user895378
16 secs ago, by DaveRandom
Man, Apache sucks big swollen cojones
 
well i do have access to a IIS server provided by the uni but i couldnt work out the web.config file to make it work!
 
user895378
lol I doubt IIS is better
 
I really really want the Apache project to be saved. I have a certain soft spot for it. But it needs a complete ground up rewrite, and the result, arguably, wouldn't be Apache any more.
 
user895378
In the end it's probably easier for people just to use nginx than rewrite the whole thing :)
 
2:28 AM
I have good feelings for apache :)
 
right well thanks for all your help, really appreciate how easily you guys give help on this chat. the kids will be waking up in roughly 4 hours so time to get some sleep
thanks again, good night
 
@hakre #goingToBedFail
@Vade I hear that one, enjoy
I am on small child duty in the morning actually and could equally do with departing
see you fine gentlemen on the morrow
 
user895378
@DaveRandom have a good one!
 
just found a bug, needs fixing.
 
user895378
can't ... sleep ... just ... one ... more ... bugfix.
 
2:34 AM
@rdlowrey it's 9:34 pm
why would you go to sleep?
 
user895378
I'm not that old. Was relating to @hakre's situation.
 
ohhhhh
 
user895378
Was that the techstars thing?
 
Evening!
 
user895378
There are few things in the world more soul-crushing than repeatedly refactoring working code for days trying to fix the design and getting nowhere.
 
2:36 AM
@rdlowrey agreed
i've done that so many times i've lost count
 
user895378
I've been going over and over the same couple of classes for three days. They worked just fine before.
 
user895378
But I know the design isn't right and I can't move on until it is.
 
user895378
Otherwise the rate of WTFs/minute during review will be off the charts.
 
@rdlowrey which is, as everyone knows, the only true measure of code quality
 
user895378
We hold this truth to be self-evident.
 
2:40 AM
that all code is not created equal
in the eyes of donald knuth
 
user895378
But that some code is endowed with certain unalienable OO-ness by its creator.
 
and some with unreadable enterprisey-ness
 
user895378
see, you did get something out of 8th grade history class :)
 
@rdlowrey **from reading wikipedia on the internetz
 
user895378
Nothing like wikipedia to reinforce just how bad the American public education system really is.
 
@PeeHaa this error is becoming more and more "popular".
 
Yeah switching from mysql_* to mysqli_* is a damn hard job. Renaming shit full stop and stuff :(
 
lol
okay, now off to bed
cu laters
 
later @hakre
 
user895378
You know what's depressing? Despite all our best efforts, the close vote review queue just keeps on growing ...
 
user895378
3:08 AM
Never underestimate the power of stupid people in large numbers ...
 
@rdlowrey indeededly
 
@PeeHaa hi
 
@Eugene hey
 
gaaaah
one of my laptop's fans went bananas :( Now it's like typing on a fridge
 
3:27 AM
@Ocramius better than it breaking and overheating :D
 
@Lusitanian already opened it twice and did some cleanup. I think the fan is just broken...
ordered a new one, but it takes 20 days for it to arrive here o_o
which will drive me crazy in the next days :|
 
20 days?
 
Where's it shipping from? USA?
 
ya
because asus wants 50 bucks for a frikking fan otherwise :\
 
3:56 AM
hello room
can any1 answer this question?
0
Q: i am recieving a notice in php while trying to calculate the value of a variable

user2057047this is php code snippet to check a form <?php include_once("includes/form_functions.php"); $var1 = 0; $var2 = 0; $var3 = 0; $var4 = 0; if(isset($_POST['submit'])) // checks if submit button is clicked of form { if(isset($_POST['rdvar1'])) { $var5 = $_POST["rdvar1"]; ...

 
4:29 AM
Hello guys can anyone tell me can i convert image to bytes Array in php and save this bytes in database?? what will be the data type for storing byte array in db??
Hello can anyone help plz?
 
5:00 AM
@Droid28 - You need BLOB data type to store images into db
But I will suggest you to store it into a filesystem & just save the image path or key to db
@Rommel Hello
 
@Rikesh Okay thanks
 
> Our stack is a combination of all that’s bright and shiny right now; we use MongoDB and Redis for storage, Scala and Akka to create a highly concurrent service tier exposing our engine to client applications via JSON, and Rails, iOS, Android and Windows Phone to take that data and produce amazing, native experiences for both web and mobile devices.
AUGHHHHHHHHH
@rdlowrey or someone, please share my misery in reading that above quote
 
@Rikesh hey can u plz tell me how to convert http image url into bytes plz??
@Rikesh s24.postimage.org/f5rcj18s5/chrysanthemum.jpg for example this image want to convert in bytes?? how can i do that?
plz help
 
5:18 AM
that recent spike in reviews created, could it be contributed / correlated to Close all the typo questions activities? — gnat 2 days ago
plausible
 
5:30 AM
(also this whole "election" thing happening, which may or may not tend to affect flagging and so on)
 
lol
 
5:52 AM
does anyone knows what happened to Gaaks.com ?
 
6:08 AM
what is that
 
7:01 AM
http://www.downforeveryoneorjustme.com/Gaaks.com
IT LOOKS LIKE ITS DOWN
anyone is a curl ninja?
 
 
1 hour later…
8:25 AM
Anyone here has any experience with browser extensions?
 
10:31 AM
@igorw you are welcome. I can hook you up with videos and material about DCI if you want to dig in further. Or you can just buy the book "Lean Architecture" which explains it in detail. I've talked about this a lot with beberlei but we still have a couple of open questions so another educated mind wouldnt hurt
 
morning
 
10:55 AM
good mornings
 
Ron
11:20 AM
I have RewriteRule that sends everypage to redirect.php.
redirect.php echo $_GET['mi'];
I entered myweb.com/blabla?mi=3

redirect.php doesnt show anything (it should echo 3)... any idea why?
 
what's in the var_dump($_SERVER) ?
 
Ron
*removed for security reason
what line do u need?
["REQUEST_METHOD"]=> string(3) "GET" ["REQUEST_URI"]=> string(25) "/schedule-manager?mi=3567" ["SCRIPT_FILENAME"]=> string(38) "/home/dinbrca/public_html/redirect.php" ["SCRIPT_NAME"]=> string(13) "/redirect.php"
["QUERY_STRING"]=> string(0) ""
 
well ... you are doing it wrong
 
Ron
I guess I need to forward the querystring in my RewriteRule..
Whats wrong?
 
try QSA flag
 
Ron
11:33 AM
tried didnt do anything
 
well you're not passing a querystring to PHP in the end.
 
Ron
in the htaccess?
 
Anonymous
visited 133 days, 99 consecutive
 
Anyone knows Slim framework? I am just not able to get rid of 404/500 error.
 
Ron
thats my htaccess:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .+ redirect.php [QSA,L]
RewriteRule ^(.*)\.(?!js|css|png)([^.]*)$ redirect.php [QSA,L]

what do I need to add so it will pass the querystring?
 
11:41 AM
0
A: Getting user's hometown info

Maisa UusivuoriMy hometown in Finland is Pori. Why is it always put to a form Björneborg which is a rare Swedish name of this town? I must check it every time I´updating... Boring... In my iPhone I even can´t correct it. Where does this Björneborg come from? Is is Pori. It has 80.000 inhabitants. Only a 3 % spe...

^LOL
 
0
Q: overriding url rewriting for $_GET variables

Phil Faceplant YoungI have a page in my admin system with the following path: http://192.168.1.253/xxxxxx/admin/view/news-items/issue/3 I am trying to rewrite it so that it directs to: http://192.168.1.253/xxxxxx/admin/view/news-items.php?issue=3 However I cannot seem to make it work, as the page displ...

@Alexander nice find
 
@hakre for real?
I can't stop laughing
 
yeah it's very funny. This apple software must be of very bad quality.
 
Ron
"By default, the query string is passed through unchanged." but it doesnt..
 
 
1 hour later…
12:49 PM
hi guise
 
This has a point:
14
Q: Stack Overflow technology makes me write bad answers

Your Common SenseToday I had some time and felt like writing a relatively good answer on Stack Overflow, explaining both the underlying mechanisms and good practices, unlike usual declarative answers in a "do that" style. It took me like an hour of time. $50 if I were free lance. It'll bring me nothing but 3-5 o...

 
@Gordon re your comment to stackoverflow.com/questions/15322401/… slightly OT but why the link via internet archive instead of direct?
 
@Crisp because the direct link is dead by now
 
dead? it's still there afaics
that's what had me wondering though, worth bearing in mind if I ever end up with any of their articles I have in my bookmarks disappearing into the ether
 
@Crisp hmm, weird. I just tried it now and it works. When I tried ten minutes ago it would give me an error. I noticed that behavior several times with that site
 
1:06 PM
ah, that explains it, I recall it being slow to load last time I visited a couple of weeks back
 
@Crisp wayback machine is a great way to protect against link rot. but its also a single point of failure of course when the rotten link is the wayback machine
 
@Gordon true enough
 
@Pekka웃 Nothing new though
We all know that StackOverflow sucks by design
 
hehehe
 
@NikiC the irony of it all is that he apparently thinks writing a long and detailed post on Meta would be different than what he is complaining about. It's not like anything's going to change because of his post.
 
1:10 PM
At least I personally highly doubt that StackExchange is actually interested in high-quality answers
If it were, things would look much different from what they are now
 
I like the idea of taxonomizing™ questions though. it would make searching easier if I could simply click "how to parse HTML" and then dig into more specialized versions.
 
> Warning: Participation in PHPRO.ORG polls may incorrectly lead you to believe your opinions matter.
4
 
Hahahaha, I just read a tweet about the barcamp happening in my town this weekend. It says: "In a perfect world no one would need to explain how a barcamp works because everyone would know how it works."
The irony is: in a perfect world this particular barcamp would not exist
they have knitting sessions there
2
and its not a knitting barcamp, just to make sure. its a tech and social media barcamp.
I attended the first or second one. they didnt have knitting sessions back then but I already felt the sessions to be incredibly shallow.
 
1:25 PM
can anyone please have a look on this question?
http://stackoverflow.com/questions/15322269/php-form-redirection-to-other-page-and-receiving-the-values/15322290?noredirect=1#comment21634068_15322290
it was suggested by Crois that use
$values['txtUserName'] = 'some user name'; $values['txtUserEmail'] = 'user email'; to make them as array
but i know that $_POST is itself an array
will header location post all the values of form to the new page so that those can be extracted there?
 
@user2057047 he put the values into the URL so they are accessible from $_GET then. header location will not post anything. it's a response send back to the client instructing it to switch to that location, which will be done via GET
@user2057047 on a side note the question is a dupe
 
@Gordon Why you said that?
 
@user2057047 because it has been asked before
 
111k rep doesn't come alone
 
dupe = duplicate
@Gordon
$values['txtUserName'] = 'name';
$values['txtUserEmail'] = 'email';
header('Location: other_page.php?'.http_build_query($values );
 
1:35 PM
5 mins ago, by Gordon
@user2057047 he put the values into the URL so they are accessible from $_GET then. header location will not post anything. it's a response send back to the client instructing it to switch to that location, which will be done via GET
 
and in the same manner i can add more values... is this right?
 
@user2057047 yes, but it will be a GET request
 
ohh.. that means on the page where it is being redirected i have to recieve the values using get method..
 
@user2057047 yes
 
okie.. :) thankx..
 
1:37 PM
@user2057047 you are welcome
 
i know that there is one more method of transferring values using session variables... for that i have to open session on the page i m transferring.. but that would be difficult if i m transferring form back for validation on the same page..
@Gordon if i have already save this txtUserName to a php variable named $username and i want to use instead of txtUserName then how will this code be affected??
$values['txtUserName'] = 'name';
 
@user2057047 don't do that unless you really need to make it stateful
 
@Gordon i want to do that cuz i have other fields which checked numbers using if else and based on that finally updated the related variable.. so in this case if i pick values from form that would be wrong values... or i again add if else to this posting array cade
@Alexander this is why i want to do it... above
 
@user2057047 above method is fine
 
@Alexander let me show you with an example
 
1:47 PM
i am not a fan of using the session uselessly
 
@Alexander suppose i have a set of radio buttons having values 10, 20, 50 and other.. This other has a textfield associated to it.. means if user select other then he enters data into this other field.. if user slect "other radio" and i use above method and send radio button value.. there will be no value since user has selected text field inside that set of radio and the value is not of radio but of text field
@Alexander I m talking about this...
if i have already save this txtUserName to a php variable named $username and i want to use instead of txtUserName then how will this code be affected??
$values['txtUserName'] = 'name';
means i do not want to send form values to another page... instead i want to send fully validated variables and all final values generated after all if else conditions
 
2:02 PM
anyone know if infoq.com/presentations/nicholson-php-jvm ever took off? projectzero.org gives me an error. so i guess it didnt
 
2:28 PM
Monrings
 
good mornings
 
Nokia is releasing the 301 soon -- a brick (feature) phone with some smartphone capabilities: conversations.nokia.com/2013/02/25/…
Needs to be charged 1 a month!
The only problem is that it doesn't have WiFi and only 3G

Does anyone know any similar phones, but with WiFi as well?
 
I love how @NikiC holds the Top Answerer öast 30 days with only 3 answers
 

« first day (876 days earlier)      last day (4054 days later) »