DoxramosPS's Profile User Rating: -----

Reputation: 4 Apprentice
Group:
Active Members
Active Posts:
174 (0.24 per day)
Joined:
07-October 12
Profile Views:
1,574
Last Active:
User is offline Sep 12 2014 07:36 AM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Linux
Favorite Browser:
Chrome
Favorite Processor:
AMD
Favorite Gaming Platform:
Playstation
Your Car:
Ford
Dream Kudos:
0

Latest Visitors

Icon   DoxramosPS has not set their status

Posts I've Made

  1. In Topic: Ampersand Explosion!

    Posted 12 Sep 2014

    Nothing is wrong with using $_GET. viewPosts.php is not a real page inside of the site itself. Includes/viewPosts.php is but it's only a function to build the entire page. Htaccess is set up to where if the page doesn't exist then it includes a loader.php file which pull functions depending on the request_uri. So here I need to get viewPosts.php?id=1&page=6 to return to the page as viewPosts.php so that the loader knows to load up includes/viewPost.php
  2. In Topic: Ajax/PHP Functions

    Posted 1 Aug 2014

    A bit it does. Kind of how my Connect Function can be used within any source of code. Just haven't gotten everything down. I figured why not work on the project as I learn and maybe I can end up making something useful in the long haul.
  3. In Topic: Ajax/PHP Functions

    Posted 1 Aug 2014

    Just updating that I've got it working. Ajax is my new pain to learn haha.
    My new JS Code is
    	var postData = $('form[name="Insert"]').serializeArray();
        var formURL = $("#Insert").attr("action");
        $.ajax(
        {
            url : formURL,
            type: "POST",
            data : postData,
            success:function(data, textStatus, jqXHR)
            {
                alert(data);
            },
            error: function(jqXHR, textStatus, errorThrown)
            {
    			alert("Something Went Wrong. Please Try again later.");
            }
        });
    
    

    Followed by the PHP
    include_once('../functions.d/hook.php');
    			if(isset($_POST['do'])) 
    			{
    				switch ($_POST['do'])
    					{
    					case 'Insert':
    					$Dox->CreateUser();
    					break;
    					}
    				}
    
    

    And within that form I added
    <input name="do" value="Insert" type="hidden">
    
    

    Thanks for the advice in it all astonecipher.
    I'm not sure what you mean by my class method being tightly coupled however.
    Still just a forum taught guy trying to learn all he can. :)
  4. In Topic: Ajax/PHP Functions

    Posted 1 Aug 2014

    It's just ripped right from my function where I'm preparing the query so that I can view what it's recieving, so far I have it now executing the case statement; just not the actual post data
    var postData = $("#Insert").serializeArray();
        var formURL = $("#Insert").attr("action");
        $.ajax(
        {
            url : "test.php",
            type: "POST",
            data : "do=Insert",
            success:function(data, textStatus, jqXHR)
            {
                alert(data);
            },
            error: function(jqXHR, textStatus, errorThrown)
            {
            }
        });
    
    

    Doing it that way makes the only post the do insert so now I'm going to try to get the other posts to pass as well. I tried
    data2 : postData,
    success:function(data, data2, textStatus, jqXHR)
    
    

    That was unfortunately a no go, but it's getting closer, And thanks for the tip. I'll look into firebug.
  5. In Topic: Ajax/PHP Functions

    Posted 1 Aug 2014

    What I've found on Ajax so far is
    var postData = $("#Insert").serializeArray();
        var formURL = $("#Insert").attr("action");
        $.ajax(
        {
            url : formURL,
            type: "POST",
            data : postData,
            success:function(data, textStatus, jqXHR)
            {
                alert(data);
            },
            error: function(jqXHR, textStatus, errorThrown)
            {
            }
        });
    
    

    and then for the actual PHP I have
    include_once('../functions.d/hook.php');
    			if(isset($_POST['Insert'])) {
    			$uname = $_POST['name'] ?:'';
    			$email = $_POST['email'] ?:'';
    			$password = MD5($_POST['password']) ?:'';
    			$permissions = 1 ?:'';
    			echo $uname;
    			}
    
    

    If I remove the if(isset($_POST['INSERT'])) then it echos the username, but with the isset in place it then displays the raw html in the alert box.

My Information

Member Title:
D.I.C Head
Age:
27 years old
Birthday:
May 16, 1987
Gender:
Location:
Seattle
Interests:
PHP, C++, Gaming
Full Name:
Morgan Green
Years Programming:
2
Programming Languages:
PHP, SQL, Javascript, C++, C#

Contact Information

E-mail:
Private
Website URL:
Website URL  http://www.doxramos.org

Friends

DoxramosPS hasn't added any friends yet.

Comments

DoxramosPS has no profile comments yet. Why not say hello?