mshadow's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Members
Active Posts:
37 (0.06 per day)
Joined:
03-July 12
Profile Views:
753
Last Active:
User is offline Nov 10 2013 01:23 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   mshadow has not set their status

Posts I've Made

  1. In Topic: ajax post sends empty string

    Posted 29 Mar 2013

    View Postandrewsw, on 29 March 2013 - 12:00 PM, said:

    The purpose of ajax is that you can send data to a PHP script (among other things). The PHP script would examine this data, and return some other data, that you can intercept and do something with, such as insert values into the current page.

    Currently, when your request is successful, you are ignoring any returned data and, completely separate from your original request, attempting to load the page capture.php.

    You need to clarify:

    If you just want to post data to a PHP script, and display the page that this script creates, then don't use ajax: just use a standard HTML-form and POST data;
    If you want to use ajax, so that you can post some data, and do something with the data that the PHP returns, then re-read the docs for jQuery-ajax.



    the purpose of catch.php is that when it gets the inputs its comapres it with the inputs in database for login.....but due to this error it is unable to do so
  2. In Topic: div working like an iframe

    Posted 25 Dec 2012

    hi guys,

    <div id="apDiv1"><a href="#">first link</a></div>
    


    now using jquery i am able to load a php page "two.php" in the div....but when i click the links in two.php it redirects to a different page which is supposed to happen. so i want to make my div work like an iframe......
  3. In Topic: div working like an iframe

    Posted 21 Dec 2012

    View PostKruithne, on 02 November 2012 - 07:16 AM, said:

    Hello mshadow,

    Quick question: Why? Why do you want a DIV to work like an IFRAME?

    Now, as I am here to help, not to question, on with the code! For this we need to delve into some Javascript and to make things a lot easier and cross-browser compatible I will be using jQuery as well.

    Let's assume the code below is your DIV in which will act like an IFRAME.

    <div id="magicBox"></div>
    


    Now we need need a Javascript function that we can trigger to render content inside this thing. (Don't forget to include the jQuery library)

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
    <script type="text/javascript">
    	function OpenPage(url)
    	{
    		$.get(url, function(response)
    		{
    			$('#magicBox').html(response);
    		});
    	}
    </script>
    


    Now all we need to do is call OpenPage(page) and it shall do it's magic.

    <a href="#" onclick="OpenPage('anotherPage.html');">Go to my other page..</a>
    


    Please keep in mind that the function is restricted by the same origin policy therefore the page must be under the same protocol/domain/port etc.


    it opened a php page in the div.....but when the linked in the php page was clicked .......it redirected to a different page.......
  4. In Topic: passing php strings to javascript function

    Posted 29 Oct 2012

    View PostAtli, on 29 October 2012 - 02:18 PM, said:

    Keep in mind that HTML tag attributes are separated by spaces. If the entire attribute value is not enclosed in quote marks, the very first space encountered will be read as the separator between that attribute and the next attribute, even if that space happens to be inside quote marks.

    Put simply, this is fine:
    <a onclick=x('word')>
    
    


    This, on the other hand, is not:
    <a onclick=x('two words')>
    
    

    The space acts as a separator, causing "words" to be read as part of the next attribute, not as a part of the "onclick" attribute. As a result, you end up with a syntax error, and the whole thing is ignored.

    To moral of this story: Always enclose attribute values in quotes.
    <a onclick="x('two words')">
    
    



    Also, you can't use "new" as a variable name. It's a keyword.

    yes,got it....
    THANKYOU
  5. In Topic: error in php explode

    Posted 22 Sep 2012

    View PostCTphpnwb, on 22 September 2012 - 08:15 AM, said:

    Replace line breaks with your delimiter. In this case, semicolons.

    i tried that by str_replace("/n",";",$data)
    but the lines were separated by two semicolons
    ;;

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Click here to e-mail me

Friends

mshadow hasn't added any friends yet.

Comments

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