Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. Yeah - obviously you can't count on the user to enter the data correctly. If you look at his original regular expression it looks like he's tried to put in that flexibility but being unsuccessful.
  2. Again need to see the code. No reason why it would do that ordinarily.
  3. Have a bash at it and if you get stuck, get the help here...
  4. Well you now have an array containing all of the functions captured. What have you tried so far?
  5. Also if the browser does block the session cookie, normally it's passed through the URL instead.
  6. This works: $string = "(232) 555-5555"; if (preg_match('/^\(?\d{3}\)?[-\.\s]?\d{3}[-\.\s]?\d{4}$/', $string)) { echo "successful."; }else{ echo "not successful"; } From what I could gather of yours the brackets are optional and the two gaps could be either a space, hypon or dot? Examples: (111) 111 1111 (111)-1111111 (111)111.1111 111-111-1111 111.111.1111 111 111 1111
  7. if (!preg_match('/[\d]+/', $text)) { print 'No digits!'; }
  8. Sorry but.. http://lmgtfy.com/?q=php+cron+tutorial
  9. If this is supposed to display Australia on the map, then it's not working as you can only have 1 onload call... onload="showAddress('<?php echo $map_address; ?>')" Use instead: <body onload="initialize(); showAddress('<?php echo $map_address; ?>');" onunload="GUnload();">
  10. Links? Examples? I can only assume they're printing out the media player after the page has loaded, with JavaScript...
  11. Try this.. $str = "tester('test string')"; preg_match_all('/[a-zA-Z_][\w]+\([^\)]+\);/', $str, $matches); print_r($matches); You should be able to convert it to preg_replace if you need to, I just didn't understand what you were trying to do before...
  12. These are nothing to do with PHP, these are simply HTML comments. There may be times when PHP software outputs them, but they'll usually only serve as comments to make the source clearer. There is another use for them though, which does follow a similar syntax to the code you provided; IE conditionals. For example: <!--[if IE 5]>This is internet explorer 5<![endif]--> These tags allow you to create content just for [specific versions of] Internet Explorer. Most commonly used to include an extra stylesheet specific to IE's needs..
  13. http://www.google.com/coop/cse/
  14. Why not show us all the code? It could be something as simple as a missing: session_start();
  15. What exactly doesn't work with it? Do you get any errors?
  16. Me too - personally the whole bidding for work thing is a little too much hassle. Far prefer applying for work posted on here or waiting for someone to contact me.
  17. Would that not suggest then that possibily the die() function is being called? Try switching it for: die("mysql error: " . mysql_error());
  18. You'll need to send the topic value through every link. Like this or something... <a href="nextpage.php?topic=<?php echo $_GET['topic']; ?>">...</a>
  19. you don't "echo" out the image. Replace: header('Content-Type:' . ' $Type'); $FileFormat = str_replace($Search, $Replacement, $Type); $FileFormat = "image" . $FileFormat; echo $FileFormat($CompiledImage); imagedestroy($CompiledImage); With: header('Content-Type:' . ' $Type'); preg_match('/(png|jpeg|gif|bmp)/', $Type, $match); $function_name = 'image' . $match[1]; $function_name($im); imagedestroy($im); Not tested. An it's a little messy, there's a good possibility I'm making it more complex than it needs to be!
  20. Untested... $source = __something__; preg_match_all('/<a href="lyrics\.php\?id=([\d]+)">([\w\s"\'-]+)<\/a>/i', $source, $link_matches); foreach ($link_matches as $key => $match) { $links[] = array( 'id' => $match[1], 'title' => $match[2], ); } By the way that will find link's with obscure names like.. "Artist's"_-_Name - though I doubt there is any!
  21. Try... <?php echo "<td class=\"{$class1}\">"; echo $info["Descript1a"] . '<br />'; echo $info["Descript1b"] . '<br />'; echo $info["Descript1c"] . '<br />'; echo $info["Descript1d"] . '<br />'; ?> <!-- Col 2 --> Which 'descript' field do you mean? If it's (for example) 'Descript1a' you can use: echo str_replace('$', '& #36;', $info["Descript1a"]) . '<br />'; Or to apply to them all you could use something like: foreach ($info as $key => $val) { $info[$key] = str_replace('$', '& #36;', $val); } Edit: The html entities shouldn't have a space after the ampersand though!
  22. ... Or just use PHP's md5 function?? $query = " INSERT into Users (lastname, firstname, email, user_type, username, password) VALUES('".$_POST['lname']."', '".$_POST['fname']."', '".$_POST['email']."', 'sell', '".$_POST['username']."', '".md5($_POST['password'])."') ";
  23. Try... $query = " INSERT into Users (lastname, firstname, email, user_type, username, password) VALUES('".$_POST['lname']."', '".$_POST['fname']."', '".$_POST['email']."', 'sell', '".$_POST['username']."', md5('".$_POST['password']."')) ";
  24. Looks to me like it's trying to change directory to the parent directory of the current / relative directory.
×
×
  • 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.