w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Error in SQL syntax regarding insert function and POST functions
if your $sent_to or $sent_by becomes empty then it will fail. Based on your SQL string you posted it seems $sent_to is empty, either check to make sure this value exist or put single quotes around the value so you can pass an empty value to the database,

Categories : PHP

Insert POST data to table and POST array to seperate table
See if this helps: UPDATE: Since OP's original code does not give correct value for $GroupID, this is one way to resolve that: (this is based on the assumption that OP needs different values for GroupID for each insert queries) $GroupID_arr = Array(); $rows = $stmt->fetchAll(); foreach($rows as $row) { $GroupID_arr[] = $row['newGroupID']; } if ($stmt = $mysqli->prepare("INSERT into table2 (GroupID, item_number, item_description, pack) VALUES (?, ?, ?, ?)")){ foreach($_POST['item'] as $i => $item) { // since item, description and pack are multi-dimensional arrays, // this is how you reference them $item = $_POST['item'][$i]; $description = $_POST['description'][$i]; $pack = $_POST['pack'][$i]; $GroupID = $GroupID_arr[$i];

Categories : PHP

Can Page Post Multiple Times Silently
That would really depend on the actual browser, but I have yet to see one doing something like that (in fact, doing so would be dangerous, e.g. in the context of some online ordering service for example). However, such things can happen by accident rather easily. Sometimes people aren't aware of multiple clicks, because they don't notice a first click triggering anything. It might happen that a browser doesn't immediately show any loading action/activity, especially with unstable connections. Also it's possible that due to some hardware problem (broken mouse button) multiple clicks are executed, despite only clicking once. Just to be sure, I'd simply add some minimal JavaScript code to the form: On submit, disable the submit button and also avoid further attempts to send the form (interc

Categories : Dotnet

Large python JSON post request times out
It seems that the time required for the response is greater than the default timeout. Try giving the timeout in the response, content = httplib2.Http().request( uri="http://%s:%s/json" % (host, port), method='POST', headers=headers, body=json_string , timeout=100 ) (set the time as required) or u can set a socket timeout large enough to bring the response import socket timeout = 100 (set the time as required) socket. setdefaulttimeout(timeout)

Categories : Python

MVC - Insert post data into database
Your ViewModel has a Company and User. You need to match the entity with the database table entity when inserting. Try doing this: [HttpPost] public ActionResult Create(MyViewModel model) { if (ModelState.IsValid) { db.users.Add(model.User); db.SaveChanges(); return RedirectToAction("Index"); } return View(model); } Inserting into a table with a foreign key should just be like any other insert. Assuming you have a database row for the company, it should run without a error. User user = new User { Id_Company = 1 } db.users.Add(user); db.SaveChanges();

Categories : C#

SQL Server: Post Insert Pre Commit Trigger
See what documentation says about AFTER TRIGGER. AFTER specifies that the DML trigger is fired only when all operations specified in the triggering SQL statement have executed successfully. You can easily write an AFTER trigger, but you cannot use it to control what happens just before transaction gets committed. There may be an explicit transaction which stays open until e.g. 'manually' rolled back or committed.

Categories : Sql Server

Insert All Post Data into MySQL Database
INSERT INTO area_retreat VALUES (?, ?, ...) -- however, you have to match ALL columns as shown in the database. If you have an auto increment ID, you will need to provide NULL for that column in the proper column order.

Categories : PHP

Using foreach for sql insert from dynamic post array
That's because you create your SQL-statement inside your foreach loop. I would also suggest using input arrays (like $_POST['txtStoreID'][0] and so on...) to make things easier. In your case, I assume the fields in your $_POST-array are named something like this: txtStoreID_1. // First, create array for all results $res_arr = array(); // Load array with all results foreach ($_POST as $key=>$value) { $tmp_name = explode('_',$key,2); $pri_key = $tmp_name[1]; // number $sec_key = $tmp_name[0]; // name if (!is_array($res_arr[$pri_key])) { $res_arr[$pri_key] = array(); } // This creates for example: $res_arr['1']['txtStoreID'] containing 'Store_31' $res_arr[$pri_key][$sec_key] = $value; } // Next, create insert statements foreach ($res_arr as $data) {

Categories : PHP

Insert an ad within a Wordpress post loop display
this will loop thru your posts, and every 4th iteration, it will display an ad right before the post $count = 1; while (have_posts()) { if ($count % 4 > 0) { the_post(); } else { //display the ad //put your ad code here //then start a new row in your grid and display the post the_post(); } $count++; }

Categories : Wordpress

Android: send post params, file, and text in one Http Post Request
Take a look at what I use in my apps: In my ServerController.class: AsyncTask to POST/GET calls private final int GET = 0; private final int POST = 1; private class ServerRequestTask extends AsyncTask<Void, Void, Void> { private URL requestUrl; private int request_type; private Map<String, String> parameters; private JSONObject json_parameters; private boolean showDialog; public ServerRequestTask(URL requestUrl, int request_type, Map<String, String> parameters, boolean showDialog) { this.requestUrl = requestUrl; this.request_type = request_type; this.parameters = parameters; this.showDialog = showDialog; } public ServerRequestTask(URL requestUrl, int request_type, JSONObject json_parameters, boolean s

Categories : Android

post and trigger a php file in server using jquery ajax post method
Try this it is working $.ajax({ type: "POST", url: "http://localhost/export/some.php", data: { dataString: "hi" }, cache: false, success: function(data){ alert(data); this.openDestinationURL(); } }); here is the php file <?php header('Content-Type: application/excel'); header('Content-Disposition: attachment; filename="sample.csv"'); $data =$_POST["dataString"]; $fp = fopen('php://output', 'w');//set the path fputcsv($fp, $data); fclose($fp); ?>

Categories : PHP

PHP pick up post input text fields and post images in two arrays?
First of all, give your submit button a name like <input name="submit" type="submit"> Then change if (isset($_POST) === true && isset($_FILES) === true) to if( isset( $_POST['submit'] ) ) { // ... } Also notice, you have 'att12' => $_POST['att12']); but you don't have a 12th input, instead, your last input is <input type="text" name="att11"> So, you should add another <input type="text" name="att12"> Finally, I don't know what you are trying to do but it doesn't look good to me.

Categories : PHP

HTML-form does not post back anymore after post with content-disposition
Well, the problem was something of my own. On the page a script was loaded which disabled all submit buttons after they where pressed to prevent multiple post backs. So no weird feature of bug, but a own made problem.

Categories : PHP

jQuery post request interrupted: Only half of post parameters arrive
In order to find our more about what is happening, why not properly code you ajax request using jQuery's ajax function. Use all the callback functions to track what happened to your call or what came back? The element type is set to POST and the element data carries whatever object structure { ... } you like. $.ajax({ url : "save.php", type : "POST", data : { "ajax_call" : "SOME_CUSTOM_AJAX_REQUEST_REFERENCE", "data1" : data1, "data2" : data2, "data2" : data2, "dataN" : dataN }, //dataType : "html", contentType: "text/html; charset=utf-8", dataType : "json", contentType: "application/json; charset=utf-8", beforeSend: function () { //alert('before send...'); }, dataFilter: function () { //alert('dat

Categories : PHP

SQL Query to select post title & post ID from a particular category from wordpress table
Here's one I've used. You probably need to change (or remove) the post_type condition. tt.taxonomy would probably be "category" in your case (sorry, not near a database to confirm). SELECT p.ID , p.post_title FROM wp_posts p JOIN wp_postmeta pm on pm.post_id = p.id LEFT JOIN wp_term_relationships tr ON p.ID = tr.object_id LEFT JOIN wp_term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id LEFT JOIN wp_terms t on tt.term_id = t.term_id WHERE p.post_status = 'publish' AND p.post_type = 'event' AND tt.taxonomy = 'event_type' AND t.slug = 'atelier' If you're running it from within WordPress you should use the $wpdb table names / prefix as a best practice. This one's for running standalone.

Categories : Wordpress

How to make wordpress post design in two column layout post type
$count = 0; <?php if (have_posts()) : while (have_posts()) : the_post(); ?> // this is your loop if($count == 2){ // here is the condition that when the count comes to 2 it will break th e line echo '</div><div class="right">'; $count = 0; } echo $post->post_content(); // printing the content of post $count++; <?php endwhile; endif; ?>

Categories : PHP

Django Test Client post() returns 302 despite error on view's post()
It's not totally clear why you're getting a redirect, but if you want to follow it you need to tell RequestClient to follow redirects - per the documentation: If you set follow to True the client will follow any redirects and a redirect_chain attribute will be set in the response object containing tuples of the intermediate urls and status codes. So your test code should look like: python response = client.post("/app/mymodel/create/", follow=True) It'd be worth checking the request chain to see where exactly it was routed.

Categories : Python

when adding post in wordpress the post coming on the top of the page not below the content where i wanted
The actual problem of the post coming on the top of the page is published date. The new post comes on the top and old posts below of it, I just changed the published date of old post into new date in posts settings. Its done now, the post(content) which i wanted on the top of the page.

Categories : HTML

Wordpress post counter button giving undefined Ajax POST
You need to first localize your script then enqueue it. To to the it's best to start of with registering your script as such: wp_register_script('like_post', get_template_directory_uri().'/js/post-like.js', array('jquery'), '1.0', 1 ); wp_localize_script('like_post', 'ajax_var', array( 'url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('ajax-nonce') )); wp_enqueue_script('like_post');

Categories : PHP

Handle a POST response with RestKit that is not mapped to the POST object
You can convert the source object into a dictionary and send that instead. Then the response data will naturally be mapped into a dictionary. This should be a minimal change to your mappings and a small change to the other code (using KVC dictionaryWithValuesForKeys:).

Categories : IOS

Align post Icon font and Post date properly
Instead of vertical-align: top; vertical-align: middle; /* or try with baseline */ https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align

Categories : HTML

distinction between post parameter and post verb in restful queries?
There's no such thing as "GET parameters" and "POST parameters". They are only colloquially called so and that leads to confusion. HTTP specifies several verbs for requests, which are basically the first thing in the HTTP request: GET /foo/bar/baz ... further HTTP headers ... The GET here could also be POST, PUT, DELETE or a number of less frequently used verbs. These don't have any specific meaning per se, but their use and desired behavior is specified. URLs can contain query parameters, e.g.: example.com/foo?bar=baz. ?bar=baz here are query parameters. These are colloquially incorrectly called "GET parameters". The HTTP request may also contain body data. E.g.: POST /foo/bar/baz ... quix=42&farble=gorg The last line here is the body data, colloquially incorrectly called "P

Categories : Jquery

How to get post info, when user visits a post page in WordPress?
You can use is_home() to check if it's home page or not. And you can use get_permalink and get_the_title to get link and post title Try this: if (!is_home()) { echo 'a user visited the page <a href="' . get_permalink() . '">' . get_the_title() . '</a>'; }

Categories : PHP

Retrieving post thumbnail url from a post array with foreach loop
you must use follow to get the thumbnail of the features image <?php echo get_the_post_thumbnail($client_id); ?> it is already answered here look at here

Categories : PHP

How to find user ids who have liked a post or commented on a post on my facebook page?
This is much easier than you think. The key is getting the post_id from the stream object. SELECT user_id FROM like WHERE post_id IN( SELECT post_id FROM stream WHERE source_id=YOUR PAGE ID) What we are doing here is grabbing all of the posts on your page and then querying the like table for users that liked those posts. The call for comments is almost identical except the column you are looking for is fromid instead of user_id SELECT fromid FROM comment WHERE post_id IN( SELECT post_id FROM stream WHERE source_id=YOUR PAGE ID)

Categories : Facebook

sending https post request with post data using spring web
I use Spring Integration to send http POST and GET http://static.springsource.org/spring-integration/reference/html/http.html The request-factory bean need to be configured to allow self-signed certificates. I use the following wiring to declare apacheHttpsRequestFactory to be used by http Spring Integration endpoints. The httpClient bean can be injected to other Spring Beans and used to send http requests: @Autowired private HttpClient httpClient; Here is the fragment of spring-intefration-context.xml: <!-- HTTPS connection to trust self signed certificates --> <bean id="sslSocketFactory" class="org.apache.http.conn.ssl.SSLSocketFactory"> <constructor-arg name="trustStrategy"> <bean class="org.apache.http.conn.ssl.TrustSelfSignedStrategy" /> &l

Categories : Java

how to display custom post type post's title on page
Well, there are two ways this function will fail (i.e. do nothing): If the first if block is ignored then the second if block will not do anything (I believe it will actually show a notice, because $movie would not be defined). If is_page() does not evaluate to true then nothing will be done in any case. If you know anything about programming then this should be obvious. So, either you have no idea what you are doing, or I am misunderstanding something here.

Categories : PHP

Categories and Post Tags are disable when adding custom post
I have change your code .Please use this code.. add_action('init','create_custom_posttype'); function create_custom_posttype(){ $labels = array( 'name' => __( 'Custom Posts' ), //- general name for the post type, usually plural. The same as, and overridden by $post_type_object->label 'singular_name' => __( 'Custom Post' ), //- name for one object of this post type. Defaults to value of name 'menu_name' => __( 'Custom Post Menu Name' ), //- the menu name text. This string is the name to give menu items. Defaults to value of name 'all_items' => __( 'Custom Post All Items' ), //- the all items text used in the menu. Default is the Name label 'add_new' => __('Add

Categories : PHP

How to load a url in html div and post data through http post method?
First create an simple container to display whats retuned. Then use jquery $.post() method : //Empty container div <div id="container"></div> $.post('ajax/test.html', { secParam: "<%=secParam%>" }, function(data) { $('#container').html(data); }); I would recommend you not to use jsp scriptlets if that's what i see here.

Categories : Javascript

$.post with serialize doesn't send post variables and values
hi can you please try this in your jquery code $(".calc").submit(function(event) { event.preventDefault(); $.post( 'process.php', $(".calc :input").serialize(), function( data ) { $(".result").append(data); } ); });

Categories : PHP

javascript, ajax, PHP insert onSubmit not working...POST not set
add type option as post to your ajax since you are retriving the value as post...default is get.. $.ajax({ url: url, data: { id : id }, type: "POST", //<---here .... and make sure the id of logbook_box is different and not 1 all the time and change this $id = isset($_POST['id']); //this return either true or false. so your $id is either 0 or 1 try this $id = isset($_POST['id'])?$_POST['id']:""; //or $_POST['id'];

Categories : PHP

jQuery.post: I can't post more than one time unless I refresh the page
Try using the syntax like this : $("#fix<?php echo $error['id'] ?>").live('click',function(){ ..... }); $("#unfix<?php echo $error['id'] ?>").live('click',function(){ ..... }); Because when you click for the first time, you are replacing the html code dynamically, so for the next time, when you click that dynamically generated html code will not be noticed, so you have to use .live function. REFER

Categories : Javascript

Two $.post requests one after the other.Second $.post request doesn't get executed
$.post() is an abbreviated form of the $.ajax() structure. I usually prefer to use the $.ajax() structure because: It's easier to see if I've missed anything I can more easily add additional params, such as asynch: false, When new to ajax I found it considerably easier to troubleshoot this structure In your case, you might find your problem easier to solve in a $.ajax() structure, since it would be easier to see that a second ajax call (that depends on the outcome of a first ajax call) must happen in the success function of the first ajax call. Here is a standalone example (too bad jsFiddle cannot handle ajax...): TESTER.PHP <html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="

Categories : Ajax

Create a blog post from content in another post type
Two options: 1) Use the Shortcode API And in your cross-post you'd add the shortcode [crosspost id="POST-ID"]. Where POST-ID corresponds to the numeric ID of the other post (post type). Instead of ID, the title could be used, see the function get_page_by_title. Create your own plugin for this. Add a sample shortcode from the Codex and use the function get_post to get the contents of the cross-post. 2) Use Advanced Custom Fields plugin With it, adding meta boxes with custom fields is a breeze. And it has a Post Object field that's basically a Cross Post functionality.

Categories : Wordpress

post variable containing XML data to a web-server using POST in iPhone
If by "specify XML for a variable" you mean send an XML string as part of multipart/form-data, then it's easy. You just have to append your XML string to your request body like you do, but additionaly encapsulate it between boundaries and add a content header. NSURL *remoteURL = [NSURL URLWithString:@"http://someurl"]; NSMutableURLRequest *imageRequest = [[NSMutableURLRequest alloc] initWithURL:remoteURL]; //A unique string that will be repeated as a separator NSString *boundary = @"14737809831466499882746641449"; //this is important so the webserver knows that you're sending multipart/form-data NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary]; [imageRequest addValue:contentType forHTTPHeaderField: @"Content-Type"]; NSMutableData *body =

Categories : Iphone

post viewmodel with IList to controller post method
For anything but simple CRUD apps, it's bad form to accept view models for [HttpPost] methods. ViewModels are for viewing, not for posting. Instead, try: [HttpPost] public ActionResult SubmitMaintenance(IList<MyMaintenance> myMaintenanceList) { //Validate and then send to database }

Categories : Asp Net Mvc

How to get most recent commented post above new submitted post in Wordpress?
Give it a try works perfect for me what it is doing query get the all the posts with a left jon with comments table so when a post has comment them=n it also has the comment_date if no comments posted on the post then in result set it will be null so i have merged the comment_date with post_date so which post has the greater date (for comment_date or post_date) it will first and so on SELECT p.*, (CASE WHEN c.comment_date IS NULL THEN p.`post_date` ELSE c.comment_date END) order_column FROM `wp_posts` p LEFT JOIN `wp_comments` c ON (p.ID = c.`comment_post_ID` ) WHERE p.post_type='post' AND p.post_status='publish' GROUP BY p.ID ORDER BY order_column DESC For displaying the posts you have to first get the results by defining the WP's global variable for the database interaction i.e

Categories : Mysql

Php error "Undefined variable:post" when using "get_post_thumbnail_id($post->ID)"
My guess would be that this code is in a function, like so: function doSomething($someparams) { // ... $fotoer_recent_thumb = // ..... // ... } In this case, $post does not exist in this scope, and must be imported by adding the following line inside your function: global $post; Alternatively, and more cleanly, pass it as a parameter.

Categories : PHP

Wordpress custom post type return 'post'
get_post_type() function is to get post type of specific post. So, you need to pass argument as post id or a post object to get type of specific post. If you use it without argument it will print default post type which is 'post'.

Categories : PHP

JQuery $.post, PHP returns blank POST variables
You did not even call the function checkForm() method so I am not sure how your code works but I used $(document).ready(function() The following is the script: $(document).ready(function() { $("#rchar").submit(function(event){ alert("hahahaha"); var request; // abort any pending request if (request) { request.abort(); } // setup some local variables var $form = $(this); // let's select and cache all the fields var $inputs = $form.find("input, select, button, textarea"); // serialize the data in the form var serializedData = $form.serialize(); // fire off the request to /form.php request = $.ajax({ url: 'postregister.php', type: "POST", data:

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.