Search Results

Search found 65997 results on 2640 pages for 'custom post type'.

Page 88/2640 | < Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >

  • Is it possible for the Subversion Apache module to serve html files with an html content-type without using the svn:mime-type property?

    - by Martin Pain
    I am aware that if you set the svn:mime-type Subversion property on a .html file to text/html then when viewing the file in a browser through the Subversion module in Apache httpd it will be served with a Content-Type: text/html header, enabling the browser to render it as HTML rather than plain text. However, I am looking for a way to do this without using the svn:mime-type property. I'm aware that you can configure your svn client to automatically add the property - this is not what I want, as I do not want to ensure all users have these settings. I'm also aware that I could create a pre-commit hook that rejects the commit if the properties are not set, in order to force users to set the property - I might fall back to that, but I'm looking for something less intrusive. I'm also aware that I could use a post-commit hook to add the properties automatically on the server-side. I'd rather not do that (as users then have to update immediately after their commit, and it's not trivial to write) - I'm looking for a better alternative. Perhaps something with rewrite rules in the Apache server?

    Read the article

  • org.apache.commons.httpclient.NameValuePair in post method

    - by pushkins
    I'm writing some code like : PostMethod p = new PostMethod(someurl); ... NameValuePair[] data = { new NameValuePair("name1", "somevalue1"), new NameValuePair("var[3][1]", "10") }; try { hc.executeMethod(p); } ... And that's what I get, when I look at my post in Wireshark: POST /someurl HTTP/1.1 ... type=var&ship%5B3%5D%5B1%5D=10 %5B means [, %5D- ] So the problem is how I can get square brackets in my post?

    Read the article

  • How to render a POST and make it show up on another page

    - by stack5914
    I'm trying to create a marketplace website similar to craigslist. I created a form according to the Django tutorial "Working with forms", but I don't know how to render information I got from the POST forms. I want to make information(subject,price...etc) that I got from POST show up on another page like this. http://bakersfield.craigslist.org/atq/3375938126.html and, I want the "Subject"(please look at form.py) of this product(eg.1960 French Chair) to show up on another page like this. http://bakersfield.craigslist.org/ata/ } Can I get some advice to handle submitted information? Here's present codes. I'll appreciate all your answers and helps. <-! Here's my codes -- ?forms.py from django import forms class SellForm(forms.Form): subject = forms.CharField(max_length=100) price = forms.CharField(max_length=100) condition = forms.CharField(max_length=100) email = forms.EmailField() body = forms.TextField() ?views.py from django.shortcuts import render, render_to_response from django.http import HttpResponseRedirect from site1.forms import SellForm def sell(request): if request.method =="POST": form =SellForm(request.POST) if form.is_valid(): subject = form.cleaned_data['subject'] price = form.cleaned_data['price'] condition = form.cleaned_data['condition'] email = form.cleaned_data['email'] body = form.cleaned_data['body'] return HttpResponseRedirect('/books/') else: form=SellForm() render(request, 'sell.html',{'form':form,}) ?urls.py from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^sechand/$','site1.views.sell'), url(r'^admin/', include(admin.site.urls)), ) ?sell.html <form action = "/sell/" method = "post">{% csrf_token%} {{ form.as_p }} <input type = "submit" value="Submit" /> </form>

    Read the article

  • Define keyref selector based on element type in XPath

    - by Robert Sirre
    Let's say I have an XML file that will look like this: <a> <b d="value1"/> <c d="value2"/> </a> In the XSD file that defines the structure of this XML file I defined the elements by name 'b' and 'c' to be of the same type (and the type requires attribute 'd'). Let's say that I want to make a keyReference of all elements of the type that both 'b' and 'c' are, is there any way in XPath to do this? At the definition of the type of 'a' I would expect something like this: <xs:keyref name="myReferenceName" refer="keyToReferTo"> <xs:selector xpath="[@type='typenameof elements b and c?']"/> <xs:field xpath="@d"/> </xs:keyref> Is something like this possible, or is XPath, even in the XSD, schema-unaware?

    Read the article

  • Not able to send POST request through jQuery Ajax

    - by Amit
    Hi, I was trying to send an ajax request as POST request. But when i verified it on httpFox on firefox, the request is sent as GET. I tried pbht $.ajax() and $.post(). Many had a query regarding the same and had missed the "type" in $.ajax(), but even if i mention the type as "POST", the request will be of type GET. Here is my code: $('.test').click(function(){ alert("clicked"); $.ajax({ type: "POST", url: "www.testsite.com", data: "name=John&location=Boston", success: function(msg){ alert( "Data Saved: " + msg ); } }); }); Any idea why it happens?

    Read the article

  • Change post permalink structure on WordPress to use custom taxonomy

    - by TiuTalk
    Hi there! I want to change the post permalink schema on my WordPress 3.0-beta1 to use my new custom taxonomy. Today I can use /%category%/%postname%/ and the /my-category/my-post/ URL, that's nice but I need to use another taxonomy instead "category" one. I tried to use /%acervo%/%postname%/ but my URLs came with %acervo% on the URL instead the name of the "Acevo" (my taxonomy name) wich the post belongs to. I found something related to WP_Rewrite but without sucess...

    Read the article

  • Why NOT use POST method here?

    - by Camran
    I have a classifieds website. In the main page (index) I have several form fields which the user may or may not fill in, in order to specify a detailed search of classifieds. Ex: Category: Cars Price from: 3000 Price to: 10000 Color: Red Area: California The forms' action is set to a php page: <form action='query_sql.php' method='post'> In query_sql.php I fetch the variables like this: category=$_POST['category']; etc etc... Then query MySql: $query="SELECT........WHERE category='$category' etc etc.... $results = mysql_query($query); Then I simply display the results of the query to the user by creating a table which is filled in dynamically depending on the results set. However, according to an answer by Col. Shrapnel in my previous Q I shouldn't use POST here: http://stackoverflow.com/questions/3004754/how-to-hide-url-from-users-when-submitting-this-form The reason I use post is simply to hide the "one-page-word-document" long URL in the browsers adress bar. I am very confused, is it okay to use POST or not? It is working fine both when I use GET or POST now... And it is already on a production server... Btw, in the linked question, I wasn't referring to make URL invisible (or hide it) I just wanted it too look better (which I have accomplished with mod_rewrite). UPDATE: If I use GET, then how should I make the url better looking (beautiful)? Check this previous Q out: http://stackoverflow.com/questions/3000524/how-to-make-this-very-long-url-appear-short

    Read the article

  • How to send XML and other post parameters via cURL in PHP

    - by tomaszs
    Hello. I've used code below to send XML to my REST API. $xml_string_data contains proper XML, and it is passed well to mypi.php: //set POST variables $url = 'http://www.server.cu/mypi.php'; $fields = array( 'data'=>urlencode($xml_string_data) ); //url-ify the data for the POST $fields_string = ""; foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } rtrim($fields_string,'&'); echo $fields_string; //open connection $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch,CURLOPT_POST,count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string); curl_setopt($ch,CURLOPT_HTTPHEADER,array ( "Expect: " )); //execute post $result = @curl_exec($ch); But when I've added other field: $fields = array( 'method' => "methodGoPay", 'data'=>urlencode($xml_string_data) ); It stopped to work. On the mypi.php I don't recieve any more POST parameters at all! Could you you please tell me what to do to send XML and other post parameters in one cURL request? Please don't suggest using any libraries, I wan't to acomplish it in plain PHP.

    Read the article

  • Delphi set Panel visible after post

    - by Daan Kleijngeld
    this is my code: if DRelatiebeheer.ContactpersoonID.Post = Action then KJSMDBGrid1.RefreshData; KJPanel4.Visible := true; my question is how can i set the panel on visible when the post is succesfully ended. I dont know how to fix it, tried many ways but didn't find a solution for the problem. I think the code doesn't work, because i put it invisible on the OnGetCellParams event. And I only want to set the last panel visible when the information is posted procedure TFRelatiebeheer.KJSMDBGrid1GetCellParams(Sender: TObject); begin if DRelatiebeheer.ACCID.AsInteger <= 0 then KJPanel3.Visible := false; KJPanel4.Visible := false; else begin KJPanel3.Visible := true; end; this is my OnGetCellParams event, this is the other procedure TFRelatiebeheer.SaveCancel(Sender: TObject); begin if (DRelatiebeheer.CID.State in [dsEdit, dsInsert]) then DRelatiebeheer.CID.Post; DRelatiebeheer.AID.Post; if DRelatiebeheer.CID.Post = Action then KJSMDBGrid1.RefreshData; KJPanel4.Visible := true; end;

    Read the article

  • Heroku: Postgres type operator error after migrating DB from MySQL

    - by sevennineteen
    This is a follow-up to a question I'd asked earlier which phrased this as more of a programming problem than a database problem. http://stackoverflow.com/questions/2935985/postgres-error-with-sinatra-haml-datamapper-on-heroku I believe the problem has been isolated to the storage of the ID column in Heroku's Postgres database after running db:push. In short, my app runs properly on my original MySQL database, but throws Postgres errors on Heroku when executing any query on the ID column, which seems to have been stored in Postgres as TEXT even though it is stored as INT in MySQL. My question is why the ID column is being created as INT in Postgres on the data transfer to Heroku, and whether there's any way for me to prevent this. Here's the output from a heroku console session which demonstrates the issue: Ruby console for myapp.heroku.com >> Post.first.title => "Welcome to First!" >> Post.first.title.class => String >> Post.first.id => 1 >> Post.first.id.class => Fixnum >> Post[1] PostgresError: ERROR: operator does not exist: text = integer LINE 1: ...", "title", "created_at" FROM "posts" WHERE ("id" = 1) ORDER... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. Query: SELECT "id", "name", "email", "url", "title", "created_at" FROM "posts" WHERE ("id" = 1) ORDER BY "id" LIMIT 1 Thanks!

    Read the article

  • GRUB reporting wrong partition type

    - by plok
    It all started when I had to replace one of the disks that the software RAID 1 on this machine currently uses. From that moment on I have not been able to boot to the Windows XP that is installed on the fourth hard drive, /dev/sdd. I am almost positive that the problem is related not to Windows but to GRUB, as if I unplug all the other hard drives so that the Windows XP disk is now /dev/sda it boots with no problem. The problem seems to be that GRUB detects a wrong partition type, which I understand suggest that something is really messed up. This is what I get when I try to follow the steps that until now had worked like a charm: grub> map (hd0) (hd3) grub> map (hd3) (hd0) grub> root (hd3,0) Filesystem type is ext2fs, partition type 0xfd 0xfd? That doesn't make sense. /dev/sdb and sdc are 0xfd (Linux raid), but not /dev/sdd: edel:~# fdisk -l [...] Disk /dev/sdd: 250.0 GB, 250059350016 bytes 255 heads, 63 sectors/track, 30401 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00048d89 Device Boot Start End Blocks Id System /dev/sdd1 * 1 30400 244187968+ 7 HPFS/NTFS edel:/boot/grub# cat device.map (hd0) /dev/sda (hd1) /dev/sdb (hd2) /dev/sdc (hd3) /dev/sdd I have been trying to work this out for hours, to no avail. Can anyone point me in the right direction?

    Read the article

  • post object to wcf rest service

    - by gleasonomicon
    I'm using the WCF Rest service application project template in visual studio. I'm just learning about REST, and I was wondering how I would post a SampleItem object to the following method: [WebInvoke(UriTemplate = "", Method = "POST")] public SampleItem Create(SampleItem instance) { // TODO: Add the new instance of SampleItem to the collection throw new NotImplementedException(); } I get the general concepts of gets for the purposes of grabbing data, but I'm not sure how I would post the object in code (or just through a browser for testing) to the service.

    Read the article

  • Send and receive Array as GET/POST using querystring

    - by Vanwaril
    I've got the following code, but it doesn't seem to work: var post_req = { array: [ [ { param1: 'something', param2: 123 } ], [ ], [ ], [ { param2: 'something', param4: 1234, param1: 'hello' } ] ] }; var data_send = querystring.stringify(post_req); var request = client.request('POST', '/', headers); request.end(data_send); and if( req.method == 'POST' ) { req.addListener('data', function(chunk) { POST = querystring.parse(chunk); console.log(POST); } } I end up with 5 sub-arrays, corresponding to the 5 parameters in the objects but with extra '][' characters in their names: { array: [ { '][param1': 'something' } , { '][param2': '123' } , { '][param2': 'something' } , { '][param4': '1234' } , { '][param1': 'hello' } ] }

    Read the article

  • error handling with .post()

    - by meo
    I have to modify a project written by someone else. Because the code is a mess i can't really change this $.post() (or replace it by $.ajax()). What i need to do, is to know if the post returns something else then json and return it. $.post('balbal.html', json, function(data) { ... my coude ... }, 'json') I can see the post response i the console.log. Is there a simple way to retrieve it?

    Read the article

  • AutoMapper determine what to map based on generic type

    - by Daz Lewis
    Hi, Is there a way to provide AutoMapper with just a source and based on the specified mapping for the type of that source automatically determine what to map to? So for example I have a type of Foo and I always want it mapped to Bar but at runtime my code can receive any one of a number of generic types. public T Add(T entity) { //List of mappings var mapList = new Dictionary<Type, Type> { {typeof (Foo), typeof (Bar)} {typeof (Widget), typeof (Sprocket)} }; //Based on the type of T determine what we map to...somehow! var t = mapList[entity.GetType()]; //What goes in ?? to ensure var in the case of Foo will be a Bar? var destination = AutoMapper.Mapper.Map<T, ??>(entity); } Any help is much appreciated.

    Read the article

  • WPML is not detecting Wordpress custom post types

    - by janoChen
    I learned how to make custom post types with the following tutorial: http://sixrevisions.com/wordpress/wordpress-custom-post-types-guide/ It basically consist in adding this code to function.php: add_action( 'init', 'create_events' ); function create_events() { $labels = array( 'name' => _x('Events', 'post type general name'), 'singular_name' => _x('Event', 'post type singular name'), 'add_new' => _x('Add New', 'Event'), 'add_new_item' => __('Add New Event'), 'edit_item' => __('Edit Event'), 'new_item' => __('New Event'), 'view_item' => __('View Event'), 'search_items' => __('Search Events'), 'not_found' => __('No Events found'), 'not_found_in_trash' => __('No Events found in Trash'), 'parent_item_colon' => '' ); $supports = array('title', 'editor', 'custom-fields', 'revisions', 'excerpt'); register_post_type( 'event', array( 'labels' => $labels, 'public' => true, 'supports' => $supports ) ); } The WPML plugin help you to translate posts to different langauges. But this option doesn't appear in the custom post types. Any suggestions?

    Read the article

  • Create new Array of parameter type

    - by pimvdb
    I'm trying to create a function to parse out all values in a multidimensional Array with all but one dimension given. The details are not relevant, but for this function I need to return an one-dimensional Array containing values of the same type the original multidimensional Array has. To pass any Array with any dimension to my function, I declared the type of this parameter as Array. However, how would I create a new Array of that specific type (e.g. Integer)? Currently I have the following code: Function GetRow(ByVal arr As Array) As Array Dim result As (...) 'This should be Integer() if arr contains Integers, etc. Return result End Function How do I declare the type of result to make it having the same type of values as arr? New Array is not possible as it is declared MustInherit. Thanks a lot.

    Read the article

  • PHP CURL sending POST to Django app issue

    - by Felipe Pelá
    This code in PHP sends a HTTP POST to a Django app using CURL lib. I need that this code sends POST but redirect to the page in the same submit. Like a simple form does. The PHP Code: $c = curl_init(); curl_setopt($c, CURLOPT_FOLLOWLOCATION, true); curl_setopt($c, CURLOPT_URL, "http://www.xxx.com"); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_POSTFIELDS, 'Var='.$var); curl_exec($c); curl_close ($c); In this case, the PHP is sending the HTTP POST, but is not redirecting to the page. He is printing the result. My URL still .php and not a django/url/ I need be redirected to the django URL with the Post like a simple form in HTML does. Any Idea? Thanks.

    Read the article

  • php to translate GET request to POST request

    - by DennyHalim
    i have a hosted script somewhere that only accept POST request. example, some.hosted/script.php how can i setup another simple php that can accept GET request and then POST it to the hosted script. so that i can put up a link like this: other.site/post2hostedscript.php?postthis=data and then it POST postthis=data to the hosted script. tnx

    Read the article

  • Wordpress Hack : Post Child ?

    - by uwiuw
    hi, everybody, i want to ask about post child. I know in wordpress there only pages childer (correct me if i'm wrong). So, how about post id ? how we code solution to make a a post support a child ? i remember some shorcode like , but i forgot where and what is it ?

    Read the article

< Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >