Tag Archives: post

$_POST, $_GET, $_REQUEST What's the difference?

Questions: I am bit confusing about these super global variable ($_POST, $_GET, $_REQUEST ) in php. I want to know which scenario do I need to use these variable in php and what are the main differences these three stand for ? Answers:

form with post method stops working when php extension is off

Questions: On my site I use htaccess url rewriting to remove php extensions completly from php files. Php extension gets removed completly, /file.php maps to /file. My problem is that php forms with POST method stop working when remove php rule is active. I am using : action=”<?php echo $_SERVER[“PHP_SELF”]?>” in action attribute of forms.… Read More »

WordPress popular posts without using plugins

Questions: I’m working on a site trying to get a popular posts section on it. I’ve tried plugins but they require wp_head() and that destroys the jCarousel that I have on the site. I’ve implemented the code to getPostViews with the following in functions.php: function getPostViews($postID){ $count_key = ‘post_views_count’; $count = get_post_meta($postID, $count_key, true); if($count==”){… Read More »

How to issue HTTP POST request?

Questions: curl -F ‘access_token=…’ \ -F ‘message=Hello, Arjun. I like this new API.’ \ https://graph.facebook.com/arjun/feed The documentation says I need to issue one to publish to the wall. Answers:

How to pass custom type array to Postgres function

Questions: I have a custom type CREATE TYPE mytype as (id uuid, amount numeric(13,4)); I want to pass it to a function with the following signature: CREATE FUNCTION myschema.myfunction(id uuid, mytypes mytype[]) RETURNS BOOLEAN AS… How can I call this in postgres query and inevitably from PHP? Answers:

PHP and Postgres: catching errors?

Questions: How should I prepare the code if it something fails? With try-catch statement or? function delete_question ( $question_id ) { $dbconn = pg_connect(“host=localhost port=5432 dbname=heoa user=heoa password=123”); // removes questions and its dependencies: answers and tags $result = pg_query_params ( $dbconn, ‘DELETE FROM questions WHERE question_id = $1’, array ( $question_id ) ); Answers:

POST/Redirect throws a `Connection was reset` browser error

Questions: I’m building a one-page checkout for a customer of ours. This checkout is supposed to contain all forms for credentials, shipment and payment. Editing previously entered values should also be possible. This is all going fine except for one thing. My page is built of multiple includes: credentials shipment payment In each of these… Read More »

Want to use both GET and POST methods

Questions: I know result page that uses GET method can be bookmarked while the one using POST cannot be. I also know about the restrictions of the GET methods. Now suppose I want to build a search engine which by default uses GET allowing users to bookmark but when the length of the search phrase… Read More »