Jump to content

AyKay47

Members
  • Posts

    3,281
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by AyKay47

  1. When debugging javascript, I tend to use alerts each step to make sure that every level works correctly before moving on.

    There are also browser Developer tools available to debug front-end code: such as FF's firebug and Chrome's Dev Tools.

  2. Ah, you are not escaping the double quotes that you use for the style attribute..

    Change to:

     

    $("ul#wall").prepend("<li style=\"display: none;\">"+message_wall+"</li>");
    $("ul#wall li:first").fadeIn();

     

    or wrap it in single quotes:

     

    $("ul#wall").prepend('<li style="display: none;">'+message_wall+'</li>');
    $("ul#wall li:first").fadeIn();

  3. This:

     

    <script type="text/javascript">
            $(document).ready(function(){
            $("form#submit_wall").submit(function() {
            
            var message_wall = $('#message_wall').val();
            
           $.ajax({
            type: "POST",
            url: "insert.php",
            data: "message_wall="+ message_wall,
            success: function(){
                alert("success!");
            }
            });
            return false;
            });
    });
            </script>

     

    should most certainly work.

    If it doesn't, make sure that the path leading to insert.php is correct.

     

    Edit: Now it works?

  4. What do you mean by "it's not working"? What exactly is happening.

    As far as I can tell, the switch is fine, although I can tell you right now that the query won't work when it's built, because you are mixing PHP functions into the query without concatenation.

  5. 1. You have ended the <head> tag before the javascript code.

     

    2. Does anything happen at all when you submit the form?

     

    3. use .val() instead of .attr('value') when grabbing field values.

     

    4. Have you debugged this at all to make sure that the request is even being sent?

     

    $.ajax({
            type: "POST",
            url: "insert.php",
            data: "message_wall="+ message_wall,
            success: function(){
                alert("success!");
            }

  6. My understanding is that it’s values will be automatically assigned to the keys as follows:

     

    1

    [1] 2

    [2] 3

    [3] 4

    [4] 5

     

    value one would be assigned to index 0

     

    I am wondering what happens in that second part of the multidimensional array

     

    Code: [select]

    ‘a’ => array(‘b’ => 1, ‘c’)

     

    How would the value c be accessed?

     

    Read Kickens reply further, he answers this question.

    Value 'c' would be assigned to the first available numeric key, which in this instance is 0.

    To access 'c' you would use:

     

    $array['a'][0];

  7. Place this code at the top of the page.

     

    echo "<pre>";
    print_r($_POST);
    echo "</pre>";

     

    This will display the $_POST values being submitted to the page via form.

    My guess is that one or more of the post values you are trying to access as arrays are in fact strings.

  8. I did enter the code provided by PFM into the contact.php code.  Then, I filled in and submitted the form.  Then, I checked my email and received the following:

     

    New Comments Received...

     

    Name:

    Zipcode:

    Phone:

    Email:

    Message:

     

    website.com

     

    PFM's code has nothing to do with the email.

    It will output data on contact.php when the form is submitted.

    What does contact.php look like in your browser when you submit the form.

  9. well i have a problem... i have a website running and anyone can get to the admin control panel login page by going to "mywebsite.com/admin" how can i hide this or change it so that they cant get to it unless they know it...?

     

    If it requires a login, what is the issue?

     

    problem 2... when u visit my website... its shows in the url the path of the file for example... "mywebsite.com/register.php" when on the register page or like "mywebsite.com/sells.php" if on the sells page... how can i hide it so that only my website name is showing and not the path of the file?

     

    This isn't really a good idea as this would not be SEO friendly for crawling etc.

    Typically people hide the extension of the page to:

     

    1. Add an extra layer of security

     

    2. To create "Pretty URLS".

     

    To do the above, look into .htaccess and mod_rewrite

  10. make sure the form action

    action="http://p11.hostingprod.com/@Website.com/php/contact.php" 

    is correct, since you are getting blank values where the variable values should be, I suspect that the form is failing to send the data to the correct file.

×
×
  • 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.