Jump to content

fugix

Members
  • Posts

    1,483
  • Joined

  • Last visited

Posts posted by fugix

  1. Is it possible to validate in javascript? if it is yes, how?

    yes, however part of validation is filtering user information, which can be done in JS but is not recommended. Since javascript can be disabled via browser settings, which disables your validation and allows the user to pass any information that he/she wants and exploits your script to SQL injection...i strongly recommend using php to validate all user input

  2. let me make sure i understand you correctly. You want to have a include file that contains all of your pdf files, and you want to create a way for the script to determine which link to display based on which page you are on?

  3. should be a simple change of the input's background-color, say you have a textbox like so

    <input type="text" id="input_box">

    to change the background color, either use an external stylesheet, or in the head of your document specify css using the <style> tags, so you would have

    <style>
    #input_box { background-color:#eeeeee; }
    </style>

    using whatever color you'd like

  4. to put this very basically, you will want to direct you form action to a php page, then on that page you will grab your text box field

    $email = $_POST['email'];
    $submit = $_POST['continue'];

    then check is your submit button has been clicked, and if the textbox has been filled out.

    if(isset($submit))
    {
       if(!empty($email))
       {
          //proceed from here
       }
    }

    from here you can filter the user input, etc...

  5. first thing, you are trying to call a javascript event using php, I would not recommended this since php is executed on the server and js is executed on the client. The intermixing of the two usually results in unexpected results. Why not add to your jquery code a bit and add an .click event to trigger your functions?

  6. Using a form token is probably the method IMO. See here for more info

    one of the users on that site poses a good point of javascript being disabled, not a big fan of using js for much, just found the article interesting how they did it, OP I would go with kingphillip's method as well

  7. instead of storing an array of id's into your database using serialize, why not create a field for storing your id's, and make it the primary key. If this is the way you would like to do it, your select mysql statement will be valid

  8. as for the select tag displaying the correct option for updating, you can try to use an if statement like so

    <tr> 
    			<td width="100">Machine Status</td>
    			<td>
                    
                    <?php
                    if($cd_status == "New"){?><select name="status" id="status">
    			    <option value="new" selected="selected">New</option>
    			    <option value="used">Used</option>
    		      </select><?php } 
                     else if($cd_status == "Used") {?><select name="status" id="status">
    			    <option value="new" >New</option>
    			    <option value="used" selected="selected">Used</option>
    		      </select><?php } ?>
                    </td>
    			</tr>

     

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