3 Replies - 336 Views - Last Post: 19 December 2013 - 10:22 AM

#1 typhlosion  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 109
  • Joined: 09-December 13

creating a php file from a cms type input form

Posted 18 December 2013 - 05:07 AM

hi, first of all I will explain what I am doing as I understand this question is a bit open.

I would like a to build a CMS type system where the user will directly edit the page, for example click a heading and edit the text that will automatically update the site. This will be achieved with a jQuery ajax function:

var JQUERY_AJAX = function(url, p_data, new_con){
	$.ajax({
		url:url,
		type:"POST",
		data:p_data,
		beforeSend:function(){
			$("#loading").show();
		},
		success:function(html){
			$("#success_content").html(html);
			$("#success_container").animate({
				opacity:"1",
			},500);
		}
	});
}

//UPDATE

$(document).on("change",".cms_run_update",function(e){
  var update_this_field = $(this).attr('data-');
  var data = "action=update" +
			 "&cms_category_color=" + newBgColor +
			 "&cms_category_id=" + $(this).attr("data-categoryid");
  JQUERY_AJAX("post_functions.php", data);
});



Once the user has completed their edit I would like a "front end" page to be created that is just plain HTML.

Basically the website that I am building works on a single html page "index.html" and when a link is clicked it will load new content with jQuery ajax and php/sql and I will be using htaccess mod rewrite to write out good urls for google.

But my question is, is it a good idea to create a html file like I said if so how do I go about doing it?

View Posttyphlosion, on 18 December 2013 - 05:03 AM, said:

var JQUERY_AJAX = function(url, p_data, new_con){
	$.ajax({
		url:url,
		type:"POST",
		data:p_data,
		beforeSend:function(){
			$("#loading").show();
		},
		success:function(html){
			$("#success_content").html(html);
			$("#success_container").animate({
				opacity:"1",
			},500);
		}
	});
}

//UPDATE

$(document).on("change",".cms_run_update",function(e){
  var update_this_field = $(this).attr('data-');
  var data = "action=update" +
			 "&cms_category_color=" + newBgColor +
			 "&cms_category_id=" + $(this).attr("data-categoryid");
  JQUERY_AJAX("post_functions.php", data);
});


yes i know this code doesnt work as well... still working on it XD

Is This A Good Question/Topic? 0
  • +

Replies To: creating a php file from a cms type input form

#2 AfterBurner66  Icon User is offline

  • D.I.C Head

Reputation: 16
  • View blog
  • Posts: 116
  • Joined: 02-August 08

Re: creating a php file from a cms type input form

Posted 19 December 2013 - 09:26 AM

I think that you must elaborate more on that. When you say a CMS type system that a user can directly edit portions of the site what exactly do you mean by that? What is the site that will be edited and what is that you want be created?
Was This Post Helpful? 0
  • +
  • -

#3 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5395
  • View blog
  • Posts: 27,389
  • Joined: 10-May 07

Re: creating a php file from a cms type input form

Posted 19 December 2013 - 09:43 AM

Because php creates dynamic content, I don't see a reason to dynamically create php files.
Was This Post Helpful? 0
  • +
  • -

#4 typhlosion  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 109
  • Joined: 09-December 13

Re: creating a php file from a cms type input form

Posted 19 December 2013 - 10:22 AM

Sorry I should have explained this a bit better.

First of all forget you ever see the code I uploaded that is hideous code i must have been drunk or something lol

Also forget this question completely I have just realized how silly it is ...

Basically i am building a library type structure at the moment for jQuery AJAX which is basically object orientated.

Its a CMS system that works by using "data-" attributes such as data-table, data-column, data-value, and data-id to allow for functionality such as inline edits that update while they are being changed....and so on

there is to much to explain, I should wait until I have a real coding program sorry.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1