Jump to content

MarcusZ

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Everything posted by MarcusZ

  1. The backslashes are there because I get the html code from a form. Automatically the backslashes appear before the " in order to make the query work correctly. My php code is now working, thanks!
  2. Hi I need to remove the \ but it doesn't work.... $therow = str_replace("'\'", "", $therow);
  3. It was not possible to delete the reversed backslashes - they are still there in the browser. How shall I change the regex to adapt after the reversed backslashes? I believe they are treated as " " and ' '. Thank you.
  4. I now see the problem: <td class=\"start_no\">(1)</td> I'll try to solve it myself by deleting all the reversed backslashes.
  5. it doesn't echo anything...
  6. Thank you very much for your replies. I now understand that functions are "isolated" from the main program. What if I would like to return multiple variables from a function. Is an array the only solution in that case? Are functions and methods equivalent?
  7. Hi I need help with parsing the data in the table cell. <td class="start_no">(1)</td> My regex isn't working.... $therow = '<td class="start_no">(1)</td>'; preg_match("'<td class=\"start_no\">(.*?)</td>'si", $therow, $startnr); echo $startnr[1];
  8. I solved it myself. The vairables outside the function aren't avalible inside the function unless you set them in a parameter. table($table); function table($table){ $shorttable = strstr($table, "</tr>"); } Is it possible to make all variables avalible inside the function without setting them as a parameter?
  9. Hi, I have some problems with my code which does not work when it is inside a function. When i test the same code "outside" the function it works fine. Any ideas? $shorttable = strstr($table, "</tr>"); I have checked that the function is runned, since it echoes some text. But it the strstr() function does not work in the function. table(); function table(){ $shorttable = strstr($table, "</tr>"); } Very strange. thanks
  10. Hi, I need som help with a regex to get specific cells in a table, and print them in a "text table": cell 1,1 - cell 1,3 - cell 1,5 cell 2,1 - cell 2,3 - cell 2,5 and so on..... This is how a row in the table looks like: <tr class="start" id="start_44712"> <td class="start_no">(1)</td> <td class="club_or_flag_logo"><img alt="" border="0" src="http://logoprovider.equipe.nu/logos/svrf/532b3197b9a2a0ef5222205a9b7820b2.png?width=48&height=48&strategy=logo&bg=ffffff&id=1853" /></td> <td class="starttime">09:00</td> <td class="club"><a name="start_44712"></a><strong><a href="http://online.equipe.nu/sv-SE/riders/13730/starts">Marie Andersen</a></strong><span>Eklunda RF</span><span class="pimp_my_ride"></span></td> <td class="pedigree"><strong><a href="http://online.equipe.nu/sv-SE/horses/16881/starts">Karina Lihmskov</a></strong><span>Blue Hors Don Romantic - Temple Wind</span><span>Vibeke Kjellerup</span></td> <td class="start_no">354</td> </tr> The cells I want to fetch are: (1) - 09:00 - Marie Andersen - Eklunda RF - Karina Lihmskov and so on... The rest of the tables rows are formatted in the same way. Is it too complicated to code this? Thanks
  11. Hello, I don't know if this is the right category to place this topic. However, I need som guidence with a project. From this website: http://online.equipe.nu/sv-SE/class_sections/1953/starts I need to fetch relevant information, such as the bolded and the starting numbers, and put it in a simple text file or something. It's very tiresome to copy it into an word-dokument and delete the irrelevant stuff. Any ideas how to proceed? Thank you very much!
  12. Hello, I don't know if this is the right category to place this topic. However, I need som guidence with a project. From this website: http://online.equipe.nu/sv-SE/class_sections/1953/starts I need to fetch relevant information, such as the bolded and the starting numbers, and put it in a simple text file or something. It's very tiresome to copy it into an word-dokument and delete the irrelevant stuff. Any ideas how to proceed? Thank you very much!
  13. Thank you for your answer. That is the problem, all the new data isn't ordered correctly. I have a column with the timestamp, is it possible to make it standard order in the table for all new data as well?
  14. Hello, I have two questions about phpmyadmin.com . First of all it loads very slowly in my browser, is there a way to speed things up? Is it possible to set a standard order in the table, because my tables are all in very strange orders? thanks
  15. I need some help with this one. Works fine when it's not a function but now something has happened. send($reply); function send($text) { global $text; $url = "http://www.example.com"; $text = nl2br($text); $text = str_replace("<br />","%0A",$text); $text = rawurlencode($text); $replyres = file_get_contents($url . "&text=" . $text); }
  16. Thank you for your reply. I now noticed that the code was placed in a non-working function which I removed and it's all working now. Thank you again!
  17. I need some help with this code. I want to insert a couple of values to an array and then transfer them to a string seperated with commas. $nr = 0604040404; $beginr = substr($nr,0,2); $mdate = 14; $arr = array("DAG" . $mdate, "SMS"); if(!$beginr==07){ $arr = array_push($arr, "Utland"); } $groups = implode(",",$arr); The result of this code is an empty string($groups). Thanks
  18. I'm having problem with echoing swedish characters: $string = 'ÅÄÖ'; echo $string; The result is squares with questionmarks. ��� How shall I solve it?
  19. I solved it myself. The error message was something like: couldn't find $mdate coloumn. But this code is working now: $result = mysql_query("SELECT * FROM `reply` WHERE `id`='$date'", $con);
  20. Hi. I was wondering how to use WHERE and a variable in a query. I get an error message with this code: $result = mysql_query('SELECT * FROM `reply` WHERE `id`=$date', $con); Thanks
  21. I think that I've solved it now, I don't know how but it works now. thanks for your help
  22. Thank you for your reply. However, the problem remains. I still don't manage to save the data to the db. I'm very new to this, so the problem might be that I have done a wrong/bad setup or something. This file is published on my filehost, and it should be contacted by another sever with data, which should be passed on and saved to myphpadmin.com. Am I missing something? Is that all I need to do? I havn't installed anything.
  23. Please help I'm quite new to this. I don't get an error message. but when I run a test the database on myphpadmin doesn't recieve the new data. I've checked that the connection is right. mysql_select_db("smsinfo", $con); $sql = "INSERT INTO `smsinfo`.`history` ( `time` , `number` , `sms` , `price` , `smssent` ) VALUES (NOW(),$nr,$sms,$tariff,1"; mysql_query( $sql, $con); $affected = mysql_affected_rows($con); mysql_close($con); echo 'Vi har nu tagit emot ditt SMS! ' . $affected . '!';
  24. thank you very much, used the second alternative. I need to do some reading on global and (&$sms, $delete_txt)
  25. Hi! This script is supposed to shorten the sms-message to only a number. The function is not executed when running the script which gives me the same string that I inserted. What do I do wrong? <?php $sms = 'sunds nv1b 5'; function deleteSMS($delete_txt) { $sms = str_replace($delete_txt, '',$sms); } deleteSMS('sunds'); deleteSMS('nv1b'); deleteSMS(' '); echo $sms; ?>
×
×
  • 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.