User Profile

Collapse

Profile Sidebar

Collapse
tarek01
tarek01
Last Activity: Jan 6 '11, 02:30 AM
Joined: Feb 19 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • tarek01
    replied to Process form validations above web root?
    in PHP
    I have header redirects in the PHP form validator to return to the public area, which is why I thought a security breech isn't possible.

    Is this what you are suggesting?

    PUBLIC PAGE
    Code:
    <?php include("/path_above_root/scripts/formvalidation.php"); ?>
    
    <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <input type="text"
    ...
    See more | Go to post

    Leave a comment:


  • tarek01
    started a topic Process form validations above web root?
    in PHP

    Process form validations above web root?

    Hi. I'd like to add security to user form processing by placing the PHP validation scripts ABOVE the root to prevent direct access.

    The following form example would be placed at the www root level, but it's unable to call a script one level higher.

    HTML
    Code:
    <form method="post" action="../scripts/formvalidation.php">
    <input type="text" />
    </form>
    ...
    See more | Go to post

  • Dormilich, you're right! That works!! I must've clicked too fast before the javascript finished loading. I checked it in FF and IE, and it works perfectly.

    I left this code as is:
    parentForm = selection.form;


    You da man, Dorm!
    See more | Go to post

    Leave a comment:


  • Dormilich, I tried that, but it doesn't work.
    See more | Go to post

    Leave a comment:


  • How can I pass the element name into a function?

    Hi,

    I made a function whereby clicking a radio button will show a hidden radio button sub-group, and when it's unchecked, the radio button sub-group hides again and all the radios in the sub-group are made unchecked.

    The problem is I don't know how to pass the 3rd parameter, 'custom' in this example, into the function.

    HTML:
    Code:
    <input type="radio" name="product" value="standard"
    ...
    See more | Go to post

  • @Dormilich: That's odd. I viewed it in 3 different environments to check consistency. Windows Vista with Firefox 3.6 and IE7, and also a Mac with Firefox 3.6, and all 3 show the site appearing instantly, after about 1 second of lag.

    @chathura: I'm aware the container DIV can be hidden beforehand, but this site doesn't seem to be using that technique, and I would be reluctant to use that method myself.

    I've never seen a site,...
    See more | Go to post

    Leave a comment:


  • tarek01
    replied to Can PHP detect page load or image load?
    in PHP
    Thanks, Dormilich. It didn't seem like it was possible after thoroughly researching this for some time now on the internet.
    See more | Go to post

    Leave a comment:


  • tarek01
    started a topic Can a web page be made to appear instantly?

    Can a web page be made to appear instantly?

    Can a web page be made to appear in one shot, without seeing bits and pieces appear one after another? I realize this could be detrimental, especially for slow connections, but there are times when the load isn't that great, and a random order of page load can detract from a certain intended effect or purpose.

    Here's an example: http://www.dermatiquelaserandskin.com

    The page appears all together. I just can't figure out...
    See more | Go to post

  • tarek01
    started a topic Can PHP detect page load or image load?
    in PHP

    Can PHP detect page load or image load?

    I know this can be done with JavaScript, but can PHP detect when a page finishes loading? Once it has confirmed the page is loaded, it would execute an event.

    What about detecting when an image has finished loading? Is that possible?

    Thanks in advance.
    See more | Go to post

  • I finally figured out what the purpose of the * symbol was for when I stumbled upon this in the script:
    Code:
    $sql_statements = split('\;\*', $sql_file);
    for ($i = 0; $i < count($sql_statements) - 1; $i++) {
    	if (!mysql_query($sql_statements[$i], $connection)) {
    		$msg="Failed to submit the query: ".$sql_statements[$i];
    		return false;
    	}
    }
    The coder used the split function...
    See more | Go to post

    Leave a comment:


  • tarek01
    replied to What does the "<<<" symbol mean?
    in PHP
    I finally figured out what the purpose of the * symbol was for when I stumbled upon this in the script:
    Code:
    $sql_statements = split('\;\*', $sql_file);
    for ($i = 0; $i < count($sql_statements) - 1; $i++) {
    	if (!mysql_query($sql_statements[$i], $connection)) {
    		$msg="Failed to submit the query: ".$sql_statements[$i];
    		return false;
    	}
    }
    The coder used the split function...
    See more | Go to post

    Leave a comment:


  • Why does asterisk appear at the END of a statement???

    This was taken from a working model. Inside the heredoc (<<<) an asterisk appears at the end of each MySQL statement after the semicolon (lines 4 and 10). The actual script contains several statements and it appears after each one, so it's unlikely it was unintentional. Does anyone know its function or purpose?

    Code:
    <?php
    
    $sql_file=<<<SQL_FILE
    DROP TABLE IF EXISTS `table_name`;*
    CREATE TABLE
    ...
    See more | Go to post

  • tarek01
    replied to What does the "<<<" symbol mean?
    in PHP
    @Markus: Very cool! Never heard or seen the heredoc syntax before. Gotta love your friendly neighborhood forum. Thanks!

    @Atli: Yes, this script was taken out of a working model and it's very likely the asterisk was placed intentionally as it was made by smarties over at PHP Jabbers.
    See more | Go to post

    Leave a comment:


  • tarek01
    started a topic What does the "<<<" symbol mean?
    in PHP

    What does the "<<<" symbol mean?

    I understand the following script is for building a database table in MySQL, but does anyone know what are the functions of the <<< in line 3 and * in lines 4 & 10?

    Code:
    <?php
    
    $sql_file=<<<SQL_FILE
    DROP TABLE IF EXISTS `table_name`;*
    CREATE TABLE IF NOT EXISTS `table_name` (
      `id` int(11) NOT NULL auto_increment,
      `name` varchar(250) default NULL,
      `address` varchar(250)
    ...
    See more | Go to post
No activity results to display
Show More
Working...