Viewing file: getContent.php (1.29 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php //dont forget to add ampersand to the end of the string. $myFile = file("profile.txt"); $length = sizeof($myFile); for($i=0;$i<($length);$i++){ $myString .= $myFile[$i]; } $mytext = $myString . "&"; $strlen = strlen($mytext); $counter = 0; while($counter < $strlen) { $piece = substr($mytext, $counter, 1); if($piece=="&") { $px = $x; $x = $counter; $counter2 = 0; $lenofcur = $counter - $px; while($counter2 < $lenofcur) { $piece2 = substr($mytext,$oldnum2,1); if($piece2=="=") { $y = $oldnum2; $rightl = $x - $y - 1; if($morethenone==true) { $leftl = $y - $px - 1; $fp = substr($mytext, $px +1, $leftl); } else { $leftl = $y - $px; $fp = substr($mytext, $px, $leftl); $morethenone = true; } $sp = substr($mytext, $y+1, $rightl); if($fp=="name") { $name = $sp; } if($fp=="title") { $title = $sp; } if($fp=="age") { $age = $sp; } if($fp=="email") { $email = $sp; } if($fp=="country") { $country = $sp; } if($fp=="state") { $state = $sp; } if($fp=="ocupation") { $ocupation = $sp; } if($fp=="template") { $template = $sp; } } $counter2++; $oldnum2++; } } $counter++; }
?>
|