Jump to content

systemick

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Everything posted by systemick

  1. This would work: if($result=file_get_contents("http://www.example.com")) { // handle good case } else { // treat error }
  2. HuggieBear is right. You need to do some work for yourself. I suggest you start with the PHP functions strpos and strstr
  3. Your query should be something like this $query = "select * from people where [column] = \"%$trimmed%\" order by firstName" Replace column with the name of the column you are searching on.
  4. You can treat a string as an array in php. Try this $word = 'superman'; print 'first letter = '.$word[0];
  5. You would need to pull the word out of the database then test it for the letters. If you had asked for letters 1,3&4 you would do somehting like this if ($secret_word[0] == 's' && $secret_word[2] == 'p' && $secret_word[3] == 'e') { <Do something> }
  6. Try something like this $new_test = array(); foreach($test as $key=>$value) { if (strpos($value, 'test') !== FALSE) { $new_test[$key] = str_replace($value, 'hello', 'test'); } else { $new_test[$key] = $value; } }
  7. Put a closing </option> tag after 'Please Select A Security Question' and remove the last </option> tag and see if that works
  8. What I always do with SQL is print it out in the browser then paste it into my mysql client. I use a shell but i believe you can do this with PHPMyAdmin too. Doing this usually gives an error message which can then be used to diagnose the problem.
  9. You would then need to use the stripslashes function to remove them: http://www.php.net/manual/en/function.stripslashes.php
  10. $result = mysql_query("SELECT MAX(idnum) as id from ready_aclassft"); $row = mysql_fetch_row ($result ); echo $row['id'];
  11. I'm not clear what you are trying to do here. Are you trying to send a file to a remote server or simply to write a file onto the file system on which your web server is located? ?I'm not clear why you need to use an editor to write this file?
  12. The mysql_real_escape_string function will prevent sql injection. The only other thing I would add is that you don't need the first 2 lines of code. You could just write $check = mysql_query("SELECT email FROM users WHERE email = '".mysql_real_escape_string($_POST['mail'])."'")
  13. Being a fan of Drupal I always use Drupal & Ubercart. Drupal has a bit of a steep learning curve but once you get into it its a great app
  14. When you say you want to validate the html, what do you mean exactly?
  15. You don't say if the timestamps are unix timestamps. If they are and you wanted the number between 6AM and 12PM today the sql would be: "select count(*) from event where event_time >= unix_timestamp('2010-08-06 06:00:00') and event time <= unix_timestamp('2010-08-06 12:00:00')
  16. Before you output the html for the table simply insert $counter = 0;
  17. Take a look at the usort function here: http://www.php.net/manual/en/function.usort.php You could define a function function compare ($array1, $array2) { if (array1['discount'] < array2['discount']) { return -1; } else if (array1['discount'] > array2['discount']) { return 1; } else { return 0; } } then pass the name of this function as the 2nd argument to usort
  18. I use Fedora 12 and on my machine they are located in /var/lib/mysql but on a different OS they will be in a different place. my.cnf is the main mysql config file and the location should be listed in there. On Linux it is usually located in the /etc directory. If all else fails try searching your machine for a file or directory that is the same as the name of one of your databases.
  19. What error do you see when you run the script?
  20. Could you give a little more detail about what you have done and the problems you are having. How are you querying the database. Do you have any PHP code that you could put on here.
  21. If you are using the 'mail' command you can use the -r option. Type man mail at the command line to see more information
  22. I'd agree that the LAMP stack works pretty much on any server and that Centos works pretty well if all you need to do is serve PHP pages. There is one thing that I would say about Centos though. It can be difficult to install software on Centos sometimes because the packages quite often only exist for Fedora and Ubuntu. I have just set up a web application that needed to use a piece of third party software that is not widely available. Installing this software on my Fedora development box was easy but I tried for a whole day to install it on the live Centos server without success. Eventually I gave up and asked the hosting company to set uf a different server with Fedora on it.
  23. I'd highly recommend the tutorial at : http://svnbook.red-bean.com/en/1.1/index.html I don't use Netbeans but I'm sure that if you goggle Netbeans Subversion tutorial you will find something
  24. systemick

    IDE

    Apologies for posting in the wrong place and thanks for the link. I'm going to take a look at Netbeans
  25. systemick

    IDE

    Please forgive me if this has come up before. I searched and couldn't find anything. Could anyone recommend a decent free IDE for coding PHP. I'm on Linux and have always used Kate but now I have upgraded to Fedora 12 the latest version has some major changes and I'm no longer happy with it.
×
×
  • 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.