Jump to content

rv20

Members
  • Posts

    105
  • Joined

  • Last visited

    Never

Posts posted by rv20

  1. Well first obvioulsy AJAX is async js + php usually.

     

    I had the wise idea of validating login and signup forms through AJAX which works great and i can have any errors displayed without doing a form reload, i then realised i don't need AJAX but can just use plain js with an onclick and innerthtml again without having to reload the page if say a form field is invalid like a blank field, i can then display, "please enter your email etc".

     

    But after having looking at quite a lot of source code i don't see this method of validating any more it must all be AJAX or having the php scirpt validate and hence rhaving to reload the page.

     

    Would you use AJAX, js or php for this?

  2. I used to use dreamweaver but always find myself going back to notepad, So can you recommend the best html editor out there.  I know of phped which i think can do html as well but i want something much more lite than that

  3. So i woud imagine youtube uses ajax for it's video comments, why do the comments not always display an equal number (pageination) sometimes you will click next and see maybe 5 comments then 10 comments then 2 comments, this happens quite a lot. Often is will display an equal amount though.

     

    I can't see that server load would mess it up, and how can it be badly coded it's a simple select from db then set a pointer of the current record position then get the next or previouss depending on what is asked for .........

  4. Mootools has an ajax demo which i can use but it is a bit advanced for me to customise.

     

    Basically the demo lets you hard code 1 x form ID to POST and 1 x output element to send the response to(in this case a div). This works well but if you want multiple forms on the one page then you really have to know the ins and out's of the Mootools js to edit this. This post here describes how to do it,

     

    http://forum.mootools.net/topic.php?id=4243

     

    they say add a class to each form on your page and give it the same class name ( i think) so i tried this and it didn't work.

     

    I guess you would either need to have done this already or be prepared to look through the whole thing.

     

    Here is the original demo,

     

    http://demos.mootools.net/Form.Send

     

    So i hope someone can help.

  5. It's not as simple as having an SSL certificate and what not.

     

    The first major thing you would run into would be having an agreement with all of the major credit card companies.  (Having a credit card number is useless unless you charge it through Visa and get the money transferred to you [Visa just being an example].)

     

    You could probably use some kind of company like restaurants use.  I'm sure there's a company somewhere with some kind of API that would allow you to charge credit cards.  There will still be a charge though, and this is where the main problem comes into play.

     

    Security.  If you get a database full of emails stolen, it's a big deal, but if you get a database full of credit cards stolen that's a lot bigger deal.

     

    In some countries (like the USA for example), there are also certain security specifications you must meet to be able to legally store credit card numbers (in full) on your server.  I don't remember any of the specifications though.

     

     

     

     

    So, unless you really want to put a ton of effort into this, I must suggest using some kind of gateway, be it Paypal or someone else.

     

    Yes you are totally right, it would be to much unless you were at least a medium sized business witha good rep. But really what i thought in the first place.

  6. know how to htacess and htpsword to protect folders,

     

    AuthName "Restricted Area" 
    AuthType Basic 
    AuthUserFile /server/htdocs/.htpasswd 
    AuthGroupFile /dev/null 
    require valid-user

     

    for exmaple.

     

    If you have a directory in say /server/htdocs/mypage/

     

    and you want to allow access to certain files in /mypage but you also have an htacess file in the root directory /server/htdocs,

     

    then how do you do that???  confused!  ???

  7. As far as i remember the name attr is being phased out for xHTML, does it matter if you use the same name for both name and ID like

    <input type = "text" name = "t1" id ="t1" />

     

    When you POST it's the "name" that is posted not the ID?

     

    But when you getelementbyid it's the id??

     

    how about if you do,

     

    document.forms[name/id].elements[name/id].name

     

    would that be name or id?? ???

  8. I am using a standard ajax script(i think) so i send a query string to a php script and if i add a

     

    alert(http_request.responseText);

     

    at that section of the ajax js code i get 2 exact same responses.  hence the request to the php is called twice, everything else works apart from this. Any ideas what woud cause this?

     

    There is nothing is the code that i have done that makes it call it twice, well nothing obvious.

     

  9. PHP -

    echo 'redirect_url';
    

     

    JavaScript -

    window.location.href = ajax.responseText;
    

     

    I know what your doing but would you regard this as a good way of doing things it just seems that it is,

     

    1) messy

    2) novice

    3) More overhead

    4) possible secuirty holes

     

    ??

     

    maybe not.

  10. If you are running to a php script through ajax well i have just discovered that you can't redirect from within the script, if you do say a

     

    header("location: index.php"); 

     

    then what happens is that the index.php source is (in my case) injected into the page i am using ajax from, which makes sense as that is how ajax works!

     

    So i guess there is no way to switch from ajax back to http while in the middle of a php script that ajax is communicating with.

     

    I know i can parse the ajax response from within the JS and use something like,

     

    window.location = parsed response;

     

    but this seems really messy and almost novice like and plus it exposes some of your code.

     

    Any ideas?

  11. Sessions use a cookie (by default) to store a session id, which the server then uses to reference data stored for the identified session (stored in the server's temp directory by default).

     

    The cookie is lost when the browser is closed, which means that it will no longer be passed back to the server on subsequent visits, and the data is no longer associated with the user.  The data is lost after a configurable period of time, I seem to recall that 60 minutes is the default.

     

    When you say you "ran it independently of the first one", were you using the CLI or a browser?  Sessions do not apply to CLI scripts.

     

    Just the browser, i just opened a new brower then 127.0.0.1/test2.php etc....hmm  so bit confused about sessions Vs cookies, am i right in saying both are actually cookies but session cookies are stored on the server side whereas setcookie cookies are stored client side? 

     

    Can i just completely forget about sessions and use setcookie instead, seems as though setcookie is the better option??

  12. So i created a script with,

     

    //test1.php

    session_start();

    $_SESSION['user'] = "joe2";

     

    then another script and ran it independently of the first one

     

    //test2.php

     

    echo $_SESSION['user'];

     

    i thought that test2.php would have the session data from test1.php

     

     

    so how do sessions work, also are they erased as soon as the brower closes?

  13. I have 3 input fields wich are posted to a php script, now variety of conditions could happen,

     

    field 1 could be blank

    flield 2 couldbe blank

    field 3 could be blank

    all 3 could be blank

    1 & 2 coulld be blank

    2 & 3 blank etc etc

     

    or instead of blank they could have disallowed charcters.

     

    Now i want to verify with php and not js, so i could make many IF / ELSEIF statements and build a final string that is send back, but this is a lot of code and messy is there a better shorter way of doing it?

     

    I could post back and say, there are errors please try again but i want to point out an exact list of all errors which means checking everthing.

  14. I am trying to work out if one of my checkboxes is checked or not, the CB is inside a form called "myform" if that makes a difference and the checkboxes ID = "check_terms" - oh and the function name is also check_terms so i didn't make a mistake.

     

    so i tried,

     

    function check_terms(){
    
    if (document.check_terms.checked == false){
    alert('test');
    }
    
    }

     

    didn't seem to work after clickig submit, i then tried,

     

    function check_terms(){
    
    if (document.getElementById('check_terms').checked == false){
    alert('test');
    }
    
    }

     

    You may have to add a forms['myform'] or something in there somwhere i couldn't get it,

     

     

    Should you use document.getelementbyID...... or just document."elementname"..... 

     

    or is it window.document.elementname.....

     

    confused!

  15. I have seen some great sites build in WP it really does away with the need to design sites as there are so many templates, am i right in saying that you could just do away with  dreamweaver and all the other web designer software IDE's, even php and all the scripting languages and just learn WP. I mena what is the point if is all setut for you?

  16. Spent ages on this, appreciate some help, it works great in IE but all jumbled up in FF, I am trynig to create a sign-up form using divs and inline styles, although i can "port" the styles to a SS later,

     

     <div style="width:400px;height:20px;">
        <input style="float:right;height:15px;" id="username_sign" type="text" name="username_sign" />
        <div style="width:180px;height:20px;"> Username: </div>
      </div>
      <div style="width:400px;height:20px;">
        <input style="float:right;height:15px;" id="username_sign1" type="text" name="username_sign1" />
        <div style="width:180px;height:20px;"> Password: </div>
      </div>
      <div style="width:400px;height:20px;">
        <input style="float:right;height:15px;" id="username_sign2" type="text" name="username_sign2" />
        <div style="width:180px;height:20px;"> Confirm Password: </div>
      </div>
      <div style="width:400px;height:20px;">
        <input style="float:right;height:15px;" id="username_sign3" type="text" name="username_sign3" />
        <div style="width:180px;height:20px;"> E-mail </div>
      </div>
      

     

     

  17. Trying to align a label or just text) inforont of two textobxes but the textboxes are not aligned with each other, any ideas,

    <form method='post' action="login.php">
    <label for "uname">Name:</label>
    <input type="text" name="uname" size="16" />
    
    <label for "pword">Password:</label>
    <input type="text" name="pword" size="16" />
    
    <input type="submit" name="submit" value="login" />
    </form>

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