Jump to content

shamuraq

Members
  • Posts

    140
  • Joined

  • Last visited

Everything posted by shamuraq

  1. my bad... so any suggestions? A friend told me i need to convert the whole php file into a string in another file. Its still unclear for me....
  2. hi guys... I'm trying to convert my php files into pdf using HTMLtoPDF but i cannot find anyways to manipulate my php into html since the only way php is parsed is through the browser. Any suggestions?
  3. Sorry guys.... i figured it out already...
  4. Hi Guys... [scenario]: I tied my filenames to my index.php using this script: <?php $id=$_GET['id']; $f=$_GET['f']; if (is_null($id)==true) { $fname="s_index.php"; } else { $fname="s_".$id.".php"; } if (is_null($f)==true) { $king="KO"; } else { $fname=$f."/".$fname; } ?> so that the accessed page(eg. s_01.php) will end up as index.php?id=01 [Question] How do i query the actual filename(eg. s_01.php) and the true path? I tried using: <?php $currentFile = $_SERVER["PHP_SELF"]; $parts = Explode('/', $currentFile); echo $parts[count($parts) - 1]; ?> but it keeps giving "index.php" instead of the actual filename(eg. s_01.php).... Any suggestion? Thanx in advance guys....
  5. he's probably worried on some patent leak... LoLxxx
  6. thanx guys.... Actually i was hoping to see a "safe" loop method. (while) seems to slow the browser parsing... Nonetheless i truly verily appreciate the response of the pros helping slow begginer like me... Cheers...
  7. Hi guys, my script is as follow: $a = rand(1,9); $b = rand(1,9); How do i make sure $b is not smaller than $a? How do i make sure they dun hv the same value? Thanx in advance...
  8. i think i see the rationality behind your script Ken... I'll give it a try...
  9. I'm trying to understand urs Ken... Problem is both the values are randomised so there's no way to tell if the starting integer is odd or even. Whereas urs started by taking it as even. How do i manipulate your script to cater to randomised value?
  10. Hi Cosizzle... i used your codes and inserted into my script; scary. my localhost took sometyme to respond and only part of the script echo out. Script goes like this: <? $a = rand(1000,9999); $b= $a + rand(13,49); $total = 0; $even = 0; echo "How many even numbers are there between $a and $b?"; while($a<$b || $a%2 ==0){ $even++; } $f1 = $even + rand(0,10); $f2 = $even + rand(0,11); $f3 = $even + rand(0,12); ?> <table width="36%" border="0" cellpadding="0" cellspacing="3"> <tr> <td><? echo "A) $even";?></td> <td><? echo "B) $f1";?></td> </tr> <tr> <td><? echo "C) $f2";?></td> <td><? echo "D) $f3";?></td> </tr> </table> </td>
  11. Hi guys, I manage to use '%' to differentiate odd or even numbers. Problem is how do i count no. of odd or even numbers between say, 2408 and 2531? Thanx in advance...
  12. nonetheless u guys rock. I really appreciate it man.
  13. Still doesn't work... I'm really am sorry guys... I'm just a bit slow... Pls bear with me...
  14. when i tried the syntax from KingPhillip, same result: $array = str_split($x1); echo $array;
  15. btw wildteen88, i tried your: for($i = 0, $j = strlen($string); $i < $j; $i++) { echo $string{$i}; } it doesn't work. just blank screen my code goes : <? $x1 = rand(1001,9999); for($i = 0, $j = strlen($x1); $i < $j; $i++) { echo $x1{$i}; } ?> Anything wrong?
  16. Some math equation randomiser i need for a 3rd grader class... you know where they can learn about numbers with the position of ones, tens, hundreds and thousands. The class is a charitable cause for orphans and low income families. Since its a continuous effort i just need a script so that i can just print it on the run... Thanx again m8...
  17. so does that mean i can split them and store them as individual integer. Eg, 54321 into $a, $b,$c, $d, $e? Where $a = 5; $b = 4 etc...
  18. Hi there, Anyone knows how i can split say eg, 5432 into 5, 4, 3 ,2? The explode() function still needs a delimiter to split meaning i would loose something. I need to split without losing anything.... Thanx in advance...
  19. What is the whole function of this script? Just cross checking with database? U are using database right?
  20. this is what i intend to do... Now i know how to randomise number of image from a single image I also know how to randomise the alphabet with the number of alphabets from the number of image produced. I just dun know how to tie them together to produce the question. [attachment deleted by admin]
  21. ur right. so how do i isolate each image reflected as a var?
  22. Hi ppl, For this script: <? $rand = rand(); for ($e=0; $e<$rand; $e++){ echo '<img src = "www.mydomain.com/image.gif"/>; } How so i store the images into arrays so that i may use "count" and reflect a number of randomised name for each image to be written on top of each image?
  23. Anything whiteboikyle? Keep me posted on what the solution is ya. Might be useful since i'm a newbie...
×
×
  • 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.