Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. okay was it exactly the same, (did you try mine) explain "didn't work" did the plant explode ?
  2. $shoename = (is_string) $_GET['platename'] should be $shoename = (string) $_GET['platename'] but $shoename = $_GET['platename'] should be fine
  3. and the problem is ? I'll take a shot and say you mean this echo"<td align='center' class='off' onmouseover='this.className='$on' onmouseout='this.className='$off'>";
  4. try this, echo "<table><tr><td>"; echo "<tr><td>testing</td></tr>"; while($row = mysql_fetch_array($result)) { $img = urlencode($row['picture']); $photo = "<a href=\"http://www.website.com/images/items/$img\" target=\"_blank\"><img src\"=http://www.website.com/images/items/$img\" height=\"20%\" width=\"20%\" border=\"0\"></a><br>"; echo $photo; echo "<b>Item #: " . $row['item'] . "</b><br>"; echo "<b>" . $row['desc'] . "</b><br>"; echo "<b>$" . $row['retail'] . ".00</b><br>"; } echo "</td></tr></table>";
  5. Let me see if I have got this right.. YOU wrote some code and say theirs a problem with it getting "stuck", and post the code that is used for the display.. With the details supplied I would have to say its either a HTML/CSS problem or a PHP problem on line .. erm 37!
  6. and the problem is ? EDIT: Unless the you where expecting the same result the reason your not is because your trying to decrypt unencrypted data.. try $data = mc_encrypt("test", "key"); echo "<b>Encrypt:</b> ". $data; echo "<br>"; echo "<br>"; echo "<b>Decrypt:</b> ".mc_decrypt($data, "key");
  7. The only disadvantage I can think of would be a VERY VERY slightly slower as it would run via PHP as well.. but that's ever so slight!
  8. Welcome.. I updated my last post with some extra details also if this is solved can you click Topic solved (bottom left) and of course welcome to PHP Freaks
  9. I don't think you can read from the array like that when using preg_replace, for example '\3'.$month['\1'].'\2' would look for $month['\1'] and not $month['Jan'] I would recommend using a callback, like this <?php for( $i=0; $i<sizeof( $narray ); $i++ ) { $narray[$i] = preg_replace_callback("/(\w{3})-(\d{2})-(\d{4})/", "convertDate", $narray[$i]); } function convertDate($match) { global $month; return $match[3].$month[$match[1]].$match[2]; } ?> EDIT: In your previous code instead of using "$3$1$2" use "\3\1\2"
  10. I think his asking, if you went to a folder that has a index.php and a index.html in it and you just went to that folder (not the file) which one would load by default.. Well that does depend on how apache was configured, best bet is just to try it if your asking is it better to have a index.php or index.html then I always create index.php as it allows me to add code without worrying about if i have a link pointing to index.html
  11. Wow, Maybe you should read back as Daniel has given you solution already.. and example of why what your trying wont work and how to set it up to work.. I think you should create a blank html file and try a few static tests, just so the basics are clear in your head.. Then try the following Then LOOK at what your current output and you should see the solution!
  12. okay a little slow but i wrote a quick example of the using a token <?php session_start(); if(!empty($_POST['data'])) { if($_SESSION['token'] == $_POST['token']) { echo "User submitted: ".$_POST['data']; }else{ echo "Error: invalid Token"; } } $_SESSION['token'] = uniqid("token",true); ?> <form action="" method="post"> <input name="token" type="hidden" value="<?php echo $_SESSION['token'];?>" /> <textarea name="data" cols="50" rows="3"></textarea><br /> <input name="submit" type="submit" value="submit" /> </form>
  13. Solved ? if so please click topic solved (bottem left)
  14. okay think if it this way Your going to echo out a variable ($var) and some StaticText with NO space between them.. echo "$varStaticText"; and you get Nothing because their is no variable called $varStaticText The forum was written by SMF.. but personally I use what ever suites at the time, by default when echoing html I'll use double quotes, but it really does depend on what I'm doing
  15. What do you mean "disable the cookies" do you mean the auto complete ? Just add the attribute autocomplete="off" Also this is NOT a PHP issule
  16. Seams fine to me now. Takes the risk of speaking too soon! nice job; xcoderx for reporting good job; Daniel0 for resolving it
  17. if($solved == true) { echo "Can you click solved bottom left please"; }
  18. I also get the delay on "Report to moderator"
  19. you mean like this ? function test($v = "default") { //do stuff return $v; } echo test(); echo test("testing");
  20. Ok i have just played with the PM's and got a massive delay, i have PM'ed Daniel0, some info (it maybe useful) or unrelated EDIT: still sending EDIT#2: sending complete
  21. Okay this is a design question, for someone who's has over 7,500 posts you should know where to post things by now also for someone who this should be very simple and you should know how to build and use an array. [sOLVED] How to order a array
  22. How does the phone prove its not the browser ? Can you post the error your getting it a screen shot of it ? What browser are you using ? have you tried another browser ? have you scanned for malware ? have you tried the broswer in safe/no addons mode? ir start -> run -> iexplore.exe -extoff As a note this post was created in IE8 in no addons mode as a test.. So you shouldn't have any problems. Also as your the only who seams have this problem.. we have to assume its down to your system as if it was a problem with the site we would have lots of people saying the same thing
  23. the reason for the error is because the first item of the second array is a string, So it will not work in an foreach.. to solve this you can just add a if statement, (here's an example) <?php foreach ($movies as $arey){ foreach( $arey as $list=>$term){ if(is_array($term)){ //if array do foreach foreach ($term as $name=>$detail){ echo "$name = $detail<br />"; } }else{ //if not array then assume its a string and echo it echo "<strong>$term</strong><br />"; } } } ?>
  24. you need to return something from the function.. ie function timex() { $h = rand(1,12); $m = rand(1,60); $s = rand(1,60); return "$h:$m:$s"; //return a string of $h:$m:$s } //also you are don't need to pass anything as you don't use them //so to call the function use //First timing $timex1 = timex(); echo $timex1.'<br>'; EDIT: okay another example function timex2($h1) { $h = rand($h1,12); //random from $h1 to 12 $m = rand(1,60); $s = rand(1,60); return "$h:$m:$s"; //return a string of $h:$m:$s } $timex1 = timex2(5); //passes 5 to $h1 (so gernerates a random hour from 5 to 12) echo $timex1.'<br>';
  25. the i means ignore case can you click topic solved please
×
×
  • 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.