Jump to content

lihman

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

lihman's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I need to scan a page for certain words. If the page has those words, then i want to perform a certain action and if not, then a different action. However, I don't need all of the words to be present on the page, just one of them. How would I do that? For example, if the words that I wanted to look for are: Green Blue Red and $result contained: The blue cat was big. I want if(preg_match..... to say yes even though red and green weren't present. Would I use preg_match or preg_match_all or something else? I basically need like an 'OR' between the terms I am looking for in $result.
  2. Why don't you try running that through this string and see what happens: Sorry, i didn't see that post. I only looked at what Crayon Violent had written. So I stand corrected. #\[.*?\]# will work Thanks for clearing it up MrAdam
  3. Sorry, if u thought I meant it that way. I meant to say that I have tested my solution and it does work. So it is solved for sure. Many of the solutions above may work, but I have not tested them so i cannot say for sure. Actually, upon testing #\[.*\]# , what Crayon Violent and MrAdam have said, I would say it is not recommended. I say this because it will also remove what comes before the brackets. ex. fri[hello]day will become "day". If that does not affect you, then feel free to use it. Upon using (\\[.*?\\]) , you will get "friday" Just throwing it out there
  4. I believe that the starter isn't interested in this thread anymore. I have tested my code and it works for me. Therefore, I request a mod to place a [solved] in the topic name. Thank you PS: Sorry for double posting. Just bringing it into the views of the mods
  5. $option_title = preg_replace('(\\[.*?\\])', '', $option_title); That should work for you
  6. Actually, the loop does a lot of things so I can't just use that code. Is it possible for the javascript code to get the value of a php variable and assign it to the 'var i' ?
  7. I have a loop where I want to echo out a number that changes each time it loops. However, instead of writing a new number each time, I want the same number to change. How can i do that? ex: $i=0; while($i<=10) { echo $i; $i++; } Instead of that outputing: 012345678910 I want the same number to change. Like it is 0, and then it changes to 1, then changes to 2, etc. How can i do that?
  8. Can someone please move this to regex?
  9. Try this: Make a new file called action.php and in it place the following code: <?php if((!empty($_POST['title'])) && (!empty($_POST['text']))){ INSERT INTO HERE WHATEVER IS IN success.php (excluding <?php and ?>) ; } else { INSERT INTO HERE WHATEVER IS IN failed.php (excluding <?php and ?>) ; } ?> Change the code on the form to this: <form method="POST" action="action.php"> Maybe you should try that
  10. I need to use regex with php/cURL. In order to explain what I need, I will use examples. $url = "http://www.domain.com/list/"; ^^Displays a table: <table> <tr> <td>Name</td><td>Number</td> </tr> <tr> <td><a href="name/10455/">Lihman</a></td><td>2,654</td> </tr> </table> I need a regex function that will scan that table in the page and look for anything larger than 2,000 and then get the link from the Name column. It then needs to take the second half of the link after the 'name/' part and keep the 10455/. I then need to use those numbers to change the value of $url. So it would then be: $url = "http://www.domain.com/find/10455"; If that doesn't work somehow, the second alternative would be to write the name (in this case:'Lihman') to a txt file since the number beside it is larger than 2,000.
  11. Can a mod please move this topic into that sub-forum? I'll be even more specific to what I need if that makes changes to the script: <table> <tr> <td>Name</td> <td>Age</td> </tr> <tr> <td><a href="1025.html">Lihman</a></td> <td>50</td> </tr> <td><a href="5245.html">Waynewex</a></td> <td>25</td> </tr> </table> I then need to make a php/cURL script that will change the $url to lihman.html or waynewex.html depending on the age. Example (not a real script): if { $age > 35; $url = "http://localhost/" . [WHATEVER COMES BETWEEN href=""]; } Therefore, $url would equal http://localhost/1025.html.
  12. Ok, I'll make it a bit more clear. IF there's a table like this: <table> <tr> <td>Name</td> <td>Age</td> </tr> <tr> <td>Lihman</td> <td>25</td> </tr> <td>Waynewex</td> <td>25</td> </tr> </table> I need a php script that can read that and somehow assign variables to "Lihman" and "25". However, I cannot make any changes to the table. So I was thinking maybe $name[0] would equal "Lihman" and $name[1] would equal "Waynewex". I am using this with php/cURL and the table will keep changing so I can't just make it so that $name[0] will always equal "Lihman" which is why i need the script to read from the table.
  13. I need to use PHP to read from an HTML table and assign specific columns/cells into arrays. Example of Table: <table width="100%" cellspacing="2" cellpadding="1"> <tr> <td class="box_header" width="50" align="center">Rank</td> <td class="box_header" width="150" align="center">Username</td> <td class="box_header" width="100" align="center">Gold</td> <td class="box_header" width="100" align="center">Army Size</td> <td class="box_header" width="75" align="center">Level</td> <td class="box_header" width="75" align="center">Race</td> </tr> <tr> <td class="box_content" colspan="6" align="center">Currently viewing page 851 of 4086</td> </tr> <tr> <td class="box_content" colspan="3"> <a href="userlist.dt?session=&mode=attack&page=850">Previous</a> </td> <td class="box_content" colspan="3" align="right"> <a href="userlist.dt?session=&mode=attack&page=852">Next</a> </td> </tr> <tr> <td class="box_content" align="center">42,501</td> <td class="box_content"><a href="/viewprofile.dt?session=&id=1045135">Helyanwe</a></td> <td class="box_content" align="center">413,694,847</td> <td class="box_content" align="center">109,695</td> <td class="box_content" align="center">55</td> <td class="box_content" align="center"><img src="/images/raceicons/2.gif" alt="Undead"></td> </tr> <tr> <td class="box_content" align="center">42,502</td> <td class="box_content"><a href="/viewprofile.dt?session=&id=1171592">white_knight2000</a></td> <td class="box_content" align="center">233,555,927</td> <td class="box_content" align="center">30,356</td> <td class="box_content" align="center">55</td> <td class="box_content" align="center"><img src="/images/raceicons/3.gif" alt="Goblins"></td> </tr> <tr> <td class="box_content" align="center">42,503</td> <td class="box_content"><a href="/viewprofile.dt?session=&id=1143368">BreKo2</a></td> <td class="box_content" align="center">19,753,118</td> <td class="box_content" align="center">62,698</td> <td class="box_content" align="center">55</td> <td class="box_content" align="center"><img src="/images/raceicons/1.gif" alt="Humans"></td> </tr> The thing is that the content in the cells keeps changing so I need to be able to use it as variables/arrays. for example: $row4[2] can display 413,694,847. (I went 4 rows down and 3 columns to the right) How can I make this work?
  14. Thanks for the help I guess. I've looked around and couldn't find anything. Is there any way at all to submit that button in the code above that anybody knows about? Like incorporating some javascript into the php file?
×
×
  • 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.