Kniggles's Recent Forum Activity

  • Hi,

    I have go so far as being able to get a player to pick a picture, now i would like to be able to make a transparent hole in it. any ideas please ?

    thank you.

  • Kniggles The page with the button on it is using the http POST protocol to pass the form data with variable name 'name' to the php script. The second code segment is passing the variable 'name' to the php script via the http GET protocol. These are different so they are accessed differently by php. You can either change the request to a post request in Construct or change the php script to recognize the GET variable name as well as the post variable.

    I do not understand,

    The Ajax settings in construct2 are

    Tag

    ""

    URL

    ""

    Data

    ""

    Method

    "POST"

    I can not see another others i can change and this is already set to POST.

  • I'm no expert at php, so I could be horribly wrong, but I think that this

    > if (isset($_GET['user'])) {$user = $_GET['user'];} else {$user = $_POST["name"];}
    if (isset($_GET['count'])) {$count = $_GET['count'];} else {$count = 1;}
    [/code:hcyw75s0]
    
    is where your problem lies for two reasons.
    
    1. Your AJAX request is passing the variable name as a http get variable. However, you are testing whether the get variable called user is set, which it never is. Therefore, it's entering the else block which is setting the user variable to the post variable called name; which it seems would also not be present as you are passing the variable as a get. 
    
    2. This might just be a lacking of understanding of how scoping in php works, but the $user and $count variables are being created in conditional blocks. When these blocks are exited are these variables still in scope?
    

    if I use this code to send the request, From a page with just this button on,

    <form action="TheAPi.php" method="post">
    Name: <input type="text" name="name"><br>
    
    <input type="submit">
    </form>
    [/code:hcyw75s0]
    From a page the output is what i want.
    So i got it down to not sending the post from Construct to the PHP.
    This line i feel is wrong , just not sure how though 
    [code:hcyw75s0]"http://WebsiteForTestting com/Control/TheAPi.php?name="&Variable1[/code:hcyw75s0]
  • Not without more information, are you trying to load player data from your server? What does your php file look like (omitting sensitive information)?

    Hi briggybros,

    <?php
    require_once('TwitterAPIExchange.php');
    /** Set access tokens here - see: https://dev.twitter.com/apps/ **/
    include 'crystals.php';
    $url = "https://api.twitter.com/1.1/statuses/user_timeline.json";
    $requestMethod = "GET";
    if (isset($_GET['user'])) {$user = $_GET['user'];} else {$user = $_POST["name"];}
    if (isset($_GET['count'])) {$count = $_GET['count'];} else {$count = 1;}
    $getfield = "?screen_name=$user&count=$count";
    $twitter = new TwitterAPIExchange($settings);
    $string = json_decode($twitter->setGetfield($getfield)
    ->buildOauth($url, $requestMethod)
    ->performRequest(),$assoc = TRUE);
    if($string["errors"][0]["message"] != "") {echo "<h3>Sorry, there was a problem.</h3><p>Twitter returned the following error message:</p><p><em>".$string[errors][0]["message"]."</em></p>";exit();}
    foreach($string as $items)
        {
            $Alpha = $items['user']['profile_banner_url'];
            $Beta = $items['user']['profile_image_url'];
            $Ceta = $items['user']['name'];
            $Delta = $items['user']['screen_name'];
            $Ebco = $items['user']['description'];
            echo "". $Alpha."|";
            echo "". $Beta."|";
            echo "". $Ceta."|";
            echo "". $Delta."|";
            echo "". $Ebco."|";
        }
    ?>
    [/code:1na4cb9b]
  • Hi I am trying to post " name = Variable1 " to a php file on my server,

    The Php file TheAPi.php works with a simple html post it button, and it also works if I use the form as an Iframe on the layout

    the line i have been working on gos like

    AJAX

    URL=

    [code]"http://WebsiteForTestting com/Control/TheAPi.php?name="&Variable1

    [/code:3npaib2w]

    and all i get back are the default players details.

    any pointers please ?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I dunno all that much about hardware programming. My experience is limited to messing with pin configuration on the Arduino firmware for a Reprap, which is going to be vastly different from interfacing with a modern USB device. If you can't get documentation from the manufacturer, maybe you can find some open source audio software that is able to use your MIDI controller. Then you can read the source and maybe do some creative modification to see how it makes the MIDI controller do what you want. Then, you probably need to make or find some kind of connector library or dll so you can do stuff in Javascript. Then you finally have to tools you need to make your plugin.

    All this is a bit above my level, but I didn't want to leave you hanging.

    thanks again bladedpenguin , its way over the drag n drop stuff that i all most know a bit about as well lol, i have found they make a map for the controller in virtualdj8 and also let you make your own map settings, so will be heading there and see .

  • Do you have a Javascript API for that midi controller? Take a look at the example plugins, which will show you how to create actions, expressions, and conditions. My guess would be that you should start mapping actions and expressions to the things the API allows you to do.

    Thanks for helping bladedpenguin this is part of the reply i got back after asking if there was an API " Unfortunately however we do not have this type of documentation available.

    We have previously published programmers reference guides for other products within the Launch range, these are available on the Novation website, but there is no such documentation relating to the Launchkey Mini. "

    would it be much different from the plug-in for the gamepad ?

  • Hi I am looking to make a plug -in to be able to use a usb midi controller, how do I proceed ?

    thanks,

  • Eventsheets can be copied, but only after all objects, plugins and global variables have been copied..

    names of layers should be the same too ofcourse..

    Thanks, Not as easy as i thought .

  • Hi all,

    Anyone got any tips on how to knit 2 projects together please?

    ie. like the log in script and a platform game demo.

    have tried drag n drop and short of re-writing the new project line by line , layout by layout i do not have much of a clue.

    Thanks.

  • I imagine your column "name" is string and "id" is numeric?

    In this case, try this:

    > $name = $_GET['name'];
    $sql = "SELECT * FROM pits WHERE name='$name'";
    [/code:196bkfxi]
    

    WONDERFULL Ubivis , thank you very much , and thank you again,

    -------------------------------------------------------

    Ajax OUT working

    -------------------------------------------------------

  • I have not worked with PHP for quite a while now, but I doubt that AJAX is sending a POST-Request. I think the correct syntax should be $_GET['name'] instead

    Thank you,

    I have changed the php to read

    $name = $_GET['name'];
    $sql = "SELECT * FROM pits WHERE name=$name "; [/code:15gvjrye]
    
    this duz not compute to wanted output. just keep getting a blank page.
    
    However if i change  it to select from a different column like id , 
    [code:15gvjrye]$id = $_GET['id'];
    $sql = "SELECT * FROM pits WHERE id=$id ";[/code:15gvjrye] 
    and use a URL like " mysite.com/myphps/get.php?id=1"
    
    I get all the data from line 1 or 2 or 3 what ever line i put at "?id= "  {it also works with other columns that hold numbers for data } but not any of the text columns,
    
    is there a setting to stop the php reading and searching text columns ?
Kniggles's avatar

Kniggles

Member since 2 Dec, 2013

None one is following Kniggles yet!

Connect with Kniggles

Trophy Case

  • 10-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies