Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. Why not parse it before you run it through htmlentities ??? That would make this about 10 times easier on you. Or if it is already entitied then do a html_entity_decode on it before running it through the preg_match function.
  2. Then give me the exact string you are trying to get out, or modify it to fit your needs. The above should give you a good idea how to modify it. If it is not echoing anything, it is not finding any matches. Simple as that.
  3. <?php $string = '<a href="http://linkhere" style="font-size:15px;">'; preg_match('~<a href="(.+?)" style="font-size:15px;">~si', $string, $matches); echo $matches[1]; ?>
  4. Which PHP-Editor do you think is the best? A topic devoted to this. Read up and figure out which one you want to try.
  5. You are using backticks (`) around values. You need to use single quotes (') around them.
  6. <?php $string = "(090316211923BP05000013912345678090316A4510.9511N01548.2855E000.02119239.890010000000L000000)"; list($first, $second) = explode("N", $string); list(, $data1) = explode("A", $first); list($data2) = explode("E", $second); echo "Data1: {$data1} and Data2: {$data2}<br />"; ?> explode and list.
  7. If on localhost, you have to use a SMTP server. If on a server you should contact your host and ask them. Your code, with a quick glance, seems fine.
  8. ob_flush and or flush This only works on certain browsers. Look at the links for usage.
  9. You cannot use WHERE in an insert statement (without a sql select statement that is). MySQL Insert INTO
  10. <?php $string = "test <script > function () { } </script> other text text of more. <script type=\"text/javascript\"> var test=1; function test() { }test </script> more text ok"; echo preg_replace('~<script(.+?)</script>~si', " ", $string); ?>
  11. It is running each time is my guess. mysql_query("UPDATE noticias SET lista_emails='".$row['lista_emails']."$email;' WHERE id=1"); You are updating the same id each time. My bet is the last email is the one that gets posted. If you want to append (or concat) the emails to that field, you will need to do something a bit different. MySQL Concat mysql_query("UPDATE noticias SET lista_emails=CONCAT(`lista_emails`, '".$row['lista_emails']."$email;') WHERE id=1"); See if that was what you were after.
  12. How many rows are in the subscritores table? It will only loop for how many rows are returned. Start there and make sure there is more than 1 row. Try running the SQL through phpMyAdmin, and see what returns.
  13. Post your full code.
  14. Variables Variable. It is not really used too often, cause an array does it more efficient. To grasp the concept, the extra $ tells it to dynamically assign the variable of the contents of the variable to that. So Since $name = "John"; $$name = "blah"; sets $John to be "blah". If you want to read more on it, search php variables variable. I would not go too deep into it, as it is inefficient and really has few (if any) "practical" uses. Arrays basically do this with associative indexes and is way more efficient.
  15. if(strtotime("{$byear}-{$bmonth}-{$bday}") > 12299040000) Or if(mktime(0,0,0,$bmonth, $bday, $byear) > 12299040000) Both should work, if not the second one should definately work. But why are you checking against a hard coded time code? That should be dynamic as well.
  16. mysql, mysql_query mysql_fetch_assoc I take it you know how to make sql statements. If not take that part to the MySQL Help forum on this site and they can help you. Read through the user manual for how to properly utilize those functions to pull data from a MySQL database.
  17. There is a table called "read" in it is a threadid, userid If the user has viewed the thread, a row is added to that table for the thread. If not then it is considered "new". That is the gist of it.
  18. Do you have error reporting turned on, on the index page? If not add this to the top of that page: ini_set("error_reporting", E_ALL); ini_set("display_errors", 1); And see what error comes up.
  19. $sql2="SELECT * FROM ID_Table WHERE Job_ID IN (SELECT Job_ID FROM Job_ID WHERE Job_ID=$Job_ID1)"; $result3 = mysql_query($sql2) or die ("Couldn't execute query."); while ($row3=mysql_fetch_array($result3)){ $Skill_ID[]=$row3['Skill_ID']; $Weight[]=$row3['Weight']; } echo "<pre>"; print_r($Skill_ID); print_r($Weight); echo "</pre>"; echo "The first skill returned is {$Skill_ID[0]}<br />"; echo "The first weight returned is " . $Weight[0] . "<br />"; array I would read up on arrays and their usage, as it is imperative to know how to use them for sql etc.
  20. It does not get called automatically. The connect function gets called when $db->query is ran if there is no database handle. If you were to try to $db->select it would throw an error that no database connection is present. The quick_connect is to be called by you, if you want to. I am confused as to why they would not auto-connect the db in the constructor, but alas I did not code that class. They also suppress (@ before function) errors, which is not really "suggested" instead display_errors should be turned off on any production servers.
  21. The script creator could have had that function which would have called ini_set. It is better, however, to change it in .htaccess or more preferably php.ini.
  22. Only showing the first fix, you can do the rest: $updatenews= mysql_query("UPDATE thebusinesstycoon SET news = CONCAT(news, '<br />$date:You have changed $oldname\'s name to $c1<br /><hr />') WHERE `username` = '$logged[username]'") You need to escape single quotes when used inside mysql values, as above $oldname's should be $oldname\'s.
  23. Shared hosting is meant for small sites. Any image hosting site is going to need space and bandwidth and connections to beat. You are going to have to dish out money or monitor the images dished out. If you want the site to pay, add ad's and or ask for donations.
  24. You do not even need a site. You just need to make a .html form that has the same input names etc then send the content to that page. However, most sites tend to take measures to prevent this, so yea. It may or may not work. If it does curl would be an alternative to send headers and referrers and store sessions/cookies.
×
×
  • 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.