Jump to content

talk2toyin

Members
  • Posts

    46
  • Joined

  • Last visited

Posts posted by talk2toyin

  1. Hey developers!

    I am a compete newbie to zf and zf-apigility. I am designing an pplication with zf2 and I have reached a point where I need to design a restful API for the appm this api will allow my users to perform the GET, POST, PUT and DELETE Request Methods on the app. I found how to install the zf-apigility and get it working but, this require I install the zf-apigility in a different folder and setup a virtual host for it.

    This will turn out to be a big problem when I have to specify the path to my application entity(having in mind that I'm using ORM Mapping, Doctrine2) which is in an entirely different folder.

    I am using wamp server and I have both the zf-application folder and zf-apigility folder in the www root directory of my wamp server.

     

    My questions is, is there a better way to have both my zf-application and zf-apigility installed in the same folder and have them mapped out correctly? Keeping in mind that I most definitely want to make use of the zf-apigility admin and postman for testing.

     

    Any help would be much appreciated, thanks in anticipation to a positive response from you guys.

  2. Please, I need some pointers to good resources (videos, books{pdfs}, etc) that a newbie can pick up and learn the in and outs of Zend Framework 2. I have to learn it if I am to live up to expectation and no bring regrets to those who have given me this opportunity. Any advice will be much appreciated. Thanks guys!

  3. I'm trying to use jquery effects for a menu system that lists out archives pulled dynamically from the database. The menu will be like this:

     

    2013>

    . Jan

    . Feb

    . Mar

    . All

     

    2012>

    . Jan

    . Feb

    . Mar

    . All

     

    and so on... The sub links will be hidden when the pages loads and then, on clicking any of the listed year, the sub links(months) are displayed or hidden using the jquery blind effect.

     

    Here's my html:

    <div class='arch'>

    <ul class='nav nav-list'>

    <li class='dropdown arch-dropdown'>

    <a href='#' class='' toggle-dropdown='dropdown'>2013 <span class='caret'></span></a>

    <ul class='arch-menu'>

    <li><a href='#' class='active'>Jan</a></li>

    <li><a href='#' class='active'>Feb</a></li>

    <li><a href='#' class='active'>Mar</a></li>

    </ul>

    </li>

    <li class='dropdown arch-dropdown'>

    <a href='#' class='' toggle-dropdown='dropdown'>2012 <span class='caret'></span></a>

    <ul class='arch-menu'>

    <li><a href='#' class='active'>Jan</a></li>

    <li><a href='#' class='active'>Feb</a></li>

    <li><a href='#' class='active'>Mar</a></li>

    </ul>

    </li>

    </ul>

    </div>

     

    I'm using Bootstrap for my HTML and CSS. Sorry if there are any mistakes in my html code, i had to type with my phone, off hand.

     

    My JQuery:

    $(document).function({

    $(".arch-dropdown").click(function() {

    $(".arch-menu").toggle("blind", 500);

    });

    });

     

    but the above code only makes the whole sub-links of all the listed archives toggle. I can't seem to get it to work for only which was clicked. Thanks in advance.

  4. Hi gurus! I'm currently working on my website and I have ecountered this warning message "SCREAM: Error suppression ignored for

    Warning: mysqli::query(): Couldn't fetch mysqli in C:\wamp\www\Entourage\class_func.php on line 55".

     

    Here's a function I created "class_func.php":

    <?php

    /***connect to the database***/

    $mysqli = new mysqli("localhost","root","","test");

    if($mysqli->connect_errno) {

    echo "Error: Connection To The Server Failed. " . ($mysqli->connect_errno) . $mysqli->connect_error;

    }

    /***End***/

    $err = array();//set an array to hold all the errors that might be generated during login

    /***Create a function that will handle the Login Form***/

    function checkLogin() {

    global $err;//declare the error array as global so it is available everywhere

    global $mysqli;//declare the connection as global so it is available everywhere

    for($i=0; $i<func_num_args(); $i++) { //get the number of arguments supplied(username & password)

    $data[$i] = trim(htmlentities(strip_tags(func_get_arg($i))));//using a for loop, format these arguments

    }

    /**Search the users table if user exists**/

    //my line 55 $res = $mysqli->query("SELECT * FROM users WHERE user_name = '$data[0]' AND user_pass = '$data[1]'");

    echo "Error Executing Query: " . ($mysqli->connect_errno) . $mysqli->connect_error;

    $num = $res->num_rows;

    if($num < 1) {//if no user found

    /* close result set */

    $res->close();

    $err[] = "-Invalid Username and/or Password!";

    } else {

    //fetch the result set

    $obj = $res->fetch_object();

    /***Assign the result sets to sessions***/

    $_SESSION['user_name'] = $obj->user_name;

    $_SESSION['user_id'] = $obj->user_id;

    $logged = "Logged In";//set admin status to logged in

    $update = $mysqli->query("UPDATE users

    SET user_status = '$logged'

    WHERE user_id = '{$_SESSION[user_id]}' && user_name = '{$_SESSION['user_name']}'");

    /* close result set */

    if($obj->user_level == "Admin") {

    $update->close();

    $res->close();

    header('location:admin_page.php');

    exit();

    }

    else {

    $update->close();

    $res->close();

    header('location:members_page.php');

    exit();

    }

    }

    }

    /***End of checkLogin function***/

    ?>

     

    And this is my page "index.php" that calls this function:

    <?php

     

    include "class_func.php";

     

    if(isset($_POST['login']) && $_POST['login'] == "Continue >>") {//if the login button has been clicked

    /***Check to see if the user clicked the submit button without typing in any data***/

    if(empty($_POST['username']) || empty($_POST['password'])) {

    $err[] = "-Both Fields are Required Please!";

    }

    /***End***/

    else {

     

    //assign user inputs to variables

    $username = $_POST['username'];

    $password = $_POST['password'];

    //call the checkLogin function to validate input

    checkLogin($username, $password);

    }

    }

     

    ?>

    Just like u can see, my form variables are username and password. Any help much appreciated

  5. Hi! Please my wamp server was working fine until last night before I went to bed. Suprisingly, this afternoon I tried doing some work and noticed the WAMP icon not turning GREEN, instead it stays BROWN. If I try to acces my localhost and phpmyadmin, I get an this error: Server Error in Application "DEFAULT WEB SITE" and an http Error 404.0 - Not Found. I uninstalled it, re-installed an still get the same error.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.