Jump to content

mikelmao

Members
  • Posts

    106
  • Joined

  • Last visited

    Never

Everything posted by mikelmao

  1. o haha i cant believe it Good to know that 's' doesnt consider whitespaces as character, i should read up some more about regex, thanks for your help, it worked out for me
  2. Hello everyone, Im trying to make a script which reads a certain page and retrieves certain information from that page. Im making an APP for my school and i want it to read the schedule on the website. What im doing right now is the APP recieves info from my web page using JSON, and my web page read's the schedule on my schools website. My problem is that it is not getting the correct output.. This is my script: <?php $navBar = file_get_contents('http://rst-vltn.roczeeland.nl/ovw/frames/navbar.htm'); preg_match('/<option value="(.*)">(.*)<\/option>/i', $navBar, $matches); $weekNumber = $matches[1]; $classNumber = 101; $type = 'c'; $roosterPage = 'http://rst-vltn.roczeeland.nl/ovw/'. $weekNumber .'/'. $type .'/'. $type .'00'. $classNumber .'.htm'; $rooster = file_get_contents($roosterPage); preg_match_all('/<font size="2" face="Arial">(.*)<\/font>/ix', $rooster, $matches2); echo var_dump($matches2); ?> So as you see in the preg_match_all function i want it to return the info between the <font> tags. The website im reading is: http://rst-vltn.roczeeland.nl/ovw/40/c/c00101.htm If you look at the source code there are alot of tables in there and i wont to always get the text between the <font size="2" face="Arial"> tags. With this script the current output is: array(2) { [0]=> array(0) { } [1]=> array(0) { } } Please help out, thanks.. If there is anything unclear, do say so and ill update this post.
  3. this is the form im using: echo '<table>'; echo '<form method="post" enctype="multipart/form-data">'; echo '<tr><td>Title:</td><td><input type="text" name="title" style="width: 450px;"></td></tr>'; echo '</table>'; echo '<table id="imageBoxes">'; echo '<tr><td>Image:</td><td><input type="file" name="image[]" style="width: 450px;"></td></tr>'; echo '</table>'; echo '<table>'; echo '<tr><td colspan=2><a href="javascript:addImageBox()">Add Image Box</a></td></tr>'; echo '<tr><td>Link:</td><td><input type="text" name="link" style="width: 450px;"></td></tr>'; echo '<tr><td>Description:</td><td><textarea name="article" style="width: 450px; height: 200px;"></textarea></td></tr>'; echo '<tr><td colspan=2><input type="submit" value="Submit"></td></tr>'; echo '</form>'; echo '</table>'; And the javascript code add's new boxes to the 'imageBoxes' div...
  4. it isnt a javascript problem (i think). The boxes get added correctly to the page but when i submit my forum and with PHP var_dump the $_FILES var it returns only 1 array while it suppose to return multiple arrays because i added more then 1 box...
  5. Hello, Iv written a small script in JS to add input boxes of the type file to the page.. My problem is when i use multiple of those input boxes and submit the form the $_FILES variable only reads 1 of those boxes.. This is the javascript im using: function addImageBox() { var imageBoxes = document.getElementById("imageBoxes"); var tr = document.createElement("tr"); var td = document.createElement("td"); var td2 = document.createElement("td"); var inputFile = document.createElement("input"); inputFile.setAttribute("type", "file"); inputFile.setAttribute("name", "image[]"); inputFile.setAttribute("style", "width: 450px"); td.appendChild(document.createTextNode("Image")); td2.appendChild(inputFile); tr.appendChild(td); tr.appendChild(td2); imageBoxes.appendChild(tr); } When i add 2 boxes (making it 3 boxes on the page in total) and count the $_FILES var after submiting the form, the count method returns 1, and when i var_dump it only 1 array is in $_FILES. Any idea's? thanks!
  6. Ooo right, i didnt know this.. iv never really made anything using JS but ill look into those 2 methods, thanks.. Would you also know why it doesnt recieve any information in the $_FILES array?
  7. Also: When i var_dump() the $_FILES variable it doesnt show anything if i upload multiple files.. How can i make this work.
  8. Hello, Im trying to add a script to add input boxes by clicking on a link. So far it works but there's one small problem wich is that when you add a new input box by clicking on the link it reset's the rest of the input boxes. The box type is file this is the script im using: document.getElementById("imageBoxes").innerHTML += "<tr><td>Image:<td><td><input type='file' name='image[]' style='width: 450px;'></td></tr>"; EDIT: Screenshot If this isnt clear enough please tell and ill post extra information. Thanks in advance.
  9. Hey, Im really confused about the arcitecture of a plugin system... I want to create one for my CMS project, but have no idea on how they actually work, and what the arcitecture of a plugin system would look like... Could someone help me out?
  10. Hey, How do i (If this is even possible) get the next value in the database using mysql fetch assoc? i use the MySQLi extension... There are 2 colums in the that table. Date and Name.. I need it to display the next date and next name the mysql fetch assoc will get.. this is my script: <?php $today = date("dmY"); $con = new mysqli('******', '****', '*****', '*****'); $getDates = $con->query('SELECT * FROM `trabalho` ORDER BY `data` DESC'); $total = 0; while($trabalho = $getDates->fetch_assoc()) { $thisDate = date("dmY", strtotime($trabalho['data'])); $thisShowDate = date("d/m/Y", strtotime($trabalho['data'])); if($lastDate != $thisDate) { echo '<table border=1 style="border-collapse: collapse; border-style: solid; border-width: 1px;">'; echo '<tr><th>Data</th><th>Name</th><th>test</th></tr>'; } echo '<tr><td>'. $thisShowDate .'</td><td>'. $trabalho['name'] .'</td></tr>'; $total = $total + $trabalho['horas']; if($lastDate != $thisDate) { echo '<tr><td>Total</td><td colspan=2 style="text-align: right">'. $total .'</td></tr>'; echo '</table>'; $total = 0; } $lastDate = date("dmY", strtotime($trabalho['data'])); } But in the last if($lastDate != $thisDate) { the $thisDate variable should be $nextDate, $nextDate is the date of the next column its going to fetch. If you dont know thanks anyways for reading.
  11. So everyone can have a CMS already setup with the click of a button..
  12. Hey everyone, I want to create a new directorie with a bunch of files. Like a skeleton directorie. How can i do this? Please help out. thanks! EXMPL: Let's say someone register's on my official site. After activating his/her account, they get a directorie, and with like 20 PHP Files in it (A whole CMS).. How would i do that?
  13. Hey, I need to make/download a program wich uses an open port. So when i do $fp = @fsockopen($ip, $port, $errno, $errstr, 1); if ($fp) { echo "<b style='color: green'>Online</b>"; } else { echo "<b style='color: red'>Offline</b>"; } it shows onlne. How do i do this? does anyone have a script or a program for this? thanks
  14. isnt there an easy way? like listen2myradio has..
  15. hey peeps. i need to intergrade shoutcast with my website, but i have no idea how i can let shoutcast connect with my website.. any idea's thx
  16. theres nothing with vhost in there. only: apache2.conf conf.d/ envvars httpd.conf mods-available/ mods-enabled/ ports.conf sites-available/ sites-enabled/ test/ i disabled the virtual host settings in apache2.conf tho. cause otherway i get:
  17. VAR: /var/www/: ALSO: Because of this problem pure-ftpd wont work iether.. MySQL will tho
  18. Hello, When i start apache and go my my webpage it says: Forbidden You don't have permission to access / on this server. im starting apache2 but it keeps giving me the error: Does anyone know what the problem could be? Note: /etc/apache2/httpd.conf is emty. i dono why but it is. could this be the problem:O?
  19. never worked with cron jobs. Any examples?
  20. but how do i make it check automaticly if the web is still online?
  21. Hello, Im making a status checker to see if a webserver is online. im using: @fsockopen($l['ip'],80,$errorNumber,$errorMessage,1); but how can i check how much % it has been up since started checking? plz help thx!
×
×
  • 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.