Jump to content

dabaR

Members
  • Posts

    189
  • Joined

  • Last visited

Everything posted by dabaR

  1. I think http://ca2.php.net/substr is what you are looking for.
  2. I think what you should take from this (alongside the very important points Ignace is bringing up), is that to troubleshoot something not showing up properly on a web page, you gotta read its source. And when you can't see the error right there when reading the source, copy and paste it into a syntax highlighting editor. That really helps. Talk to you later! p.s. Seriously look into what Ignace is saying, because it is important.
  3. I think you will be happy to hear about http://ca3.php.net/manual/en/function.fgetcsv.php
  4. Pagination is the word.
  5. The href's " is not closed.
  6. Can you show the HTML that produces? The HTML that is not displaying correctly in your browser.
  7. No worries. OK, Looks like the HTML for the table is printed, are you saying it is not showing up on the page? Remove that var_dump() line you added, and post the HTML source of the page here.
  8. There are many ways, here's one: $password = rand(0,9) . rand(0,9) . $password_22_chars_long;
  9. Do you know what it means to read the source of a Web page? Like, right click -> view source or something like that in Internet Explorer, and ctrl-u in Firefox.
  10. It could I think be several reasons. Can you add error_reporting(E_ALL); to the top of the upload.php script? That might give you the error.
  11. replace the echo I added with var_dump(get_defined_vars()); Then read the source of the page that is sent to your browser, reading all the defined variables. Find the ones that are not as you expected. If you can't figure out the error yourself, post the html source of the page here.
  12. Hi there. You would like to have a button on a webpage, which makes the web server ping the machine from which the button is being pressed?
  13. Does this print out "Hello there!"? <?php $error = null; if(isset($_POST['submit'])){ // Search form // Do the search query here first: require_once ('../mysql_connect.php'); // Santize Post code and team supported. (Santitize both, never use trim or other similar functions when santizing input.) if ( mysql_real_escape_string( $_POST['team_name']) ) { // Select every column from the table where conditions match: $query = "SELECT * FROM teams WHERE team_name LIKE '%" . $_POST['team_name'] . "%'"; $result = mysql_query($query) or trigger_error("Query: $query\n<br />MySQL Error: ".mysql_error()); $_SESSION['indexsearch_result'] = array(); while($row = mysql_fetch_array($result)){ $_SESSION['indexsearch_result'] = $row; } } else { // Save error as string, so we can use it how we wish later. $error = '<center><p><font color ="red">Team Name contains either; one or more invalid characters, or too many/too little characters.</font></p></center>'; } } if(!isset($_SESSION['indexsearch_result']) || $error != null){ // No Search or errors echo(($error != null)? $error : ""); }else{ echo(' <table width="600" height="100" border="0" /> <thead> <tr> <th scope="col">Team Name</th> <th scope="col">Fixture List URL</th> </tr> </thead>'); echo(' <tbody> <tr> <td>'.$_SESSION['indexsearch_result']['team_name'].'</td> <td><a target="_blank" href="'.$_SESSION['indexsearch_result']['url'].'>Fixtures</a></td> </tr> </tbody> </table>'); // End echoing result. } echo 'Hello there!'; ?>
  14. Yes, that sounds kosher. Especially because I am not Jewish, and have just a vague idea what kosher is. You will be able to make an array of arrays, or two-dimensional array as geeks call it.
  15. One emailed PDF per city?
  16. as in http://php.net/array_merge ?
  17. prefix all session keys with new_app_, e.g. $_SESSION['new_app_user_id'] = 123;
  18. There's a quote on line 12.
  19. I don't get any errors when I compile it here.
  20. OK, let's try this: put echo 'the code that defines the function runs right after this'; on a line right before the function passchanger() { setVisibility('passChanged', 'inline'); } This I think will illustrate my point.
  21. No, I saw that in your first post. I meant, is the function defined in a part of the code that does not get executed because $_SERVER['REQUEST_METHOD'] == 'POST' ?
  22. Oh, is it in the else case of the if ('POST' == $_SERVER['REQUEST_METHOD']) ?
  23. Reference: http://php.net/manual/en/function.function-exists.php , http://ca2.php.net/manual/en/function.include.php
  24. Whether you use a database or not, this part is the same. Please give me a scenario of how it would work with as many details as you can.
×
×
  • 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.