Jump to content

pauleth

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Everything posted by pauleth

  1. You guys are the best! That worked perfectly. Thank you!!!!
  2. Hey folks, I am trying to write a regular expression that will remove any html formating from a body of text and just leave the text in place. For example: <p><img src="img.jpg" alt="">This is the text that I want.</p> Will become, This is the text that I want. Does anyone have any suggestions on how I can accomplish this with regular expressions? I figure that I need to write an expression with ereg_replace() that removes the html brackets, '<' and '>', and also removes any text between the brackets... Thanks in advance for your suggestions.
  3. Sweet, I got it to work with the relative path. Thanks!
  4. No, I haven't tried yet. I'm actually at work right now, so it's hard for me to work on this stuff - so I thought I'd just get as much info as possible before I worked on it later. Thanks for the response.
  5. Do you need to provide an absolute path for this function to work, or can you include a path relative to where the script resides? For example, if I have the php script in a directory called mySite, and I have a directory in mySite called images, can I reference a file in the images directory as: $image = "images/myFile.jpg"; if (!file_exists($image)) { $error = "File does not exist!"; } Thanks in advance for your input.
  6. Hey Daniel, thanks a lot for the quick response. I tried to do some reading on the order or precedence online, but it was giving me a headache, haha. If the code looks okay to you, then I'll just keep it the way it is.
  7. Hey folks, So I am hoping to find a little help with logical operators. I have this code: if (empty($roll_id) || (!empty($manufacturer) AND !empty($iso))) { //////////////// CODE GOES HERE //////////////// } I want it to work like this... If Condition 1 is TRUE OR Condition 2 is TRUE, then... Condition 1 being: empty($roll_id) Condition 2 being: !empty($manufacturer) AND !empty($iso) The code actually appears to work the way I want it to, but I'm not very familiar with order of precedence, and I was wondering if there is a better way to write it. Thanks for your assistance.
  8. Thanks for the responses! I have used Smarty a little and I definitely like it. I think it's probably the way to go using one of those templating systems, but I was hoping I could be lazy and avoid learning one...
  9. Hey folks, just looking for some suggestions and recommendations on the best way to mix PHP and HTML, while effectively keeping presentation and logic separate. Do you tend to use more PHP tags in HTML blocks, or use PHP with echo to generate HTML output. How about templates such as Smarty? Thanks in advance.
  10. It looks like you have a period before the equal sign...
  11. Well, you could just forego installing the client portion, and install the server instead. Also, it may help to post the exact errors you are getting during the installation... But I agree about going with MySQL and staying away from Access...
  12. Also, it helps to post what the actual HTML output is from source when it is malfunctioning...
  13. I don't actually understand what you're saying... Could you elaborate a little bit?
  14. I don't think what you are trying to accomplish is that difficult, but your post sounds like you're pretty much asking the folks here to write the script for you. I agree that you should either find an open source package, or spend some time learning a little more about PHP and figure it out on your own... The actual database side isn't that hard, and if you did go with a sessions approach, you could set up something pretty straightforward to authenticate users and store particular session variables depending on who is logging in...
  15. The 'login' in /index.php?login and the 'register' in /index.php?register are referring to variables that are submitted to the script via the URL. They are not different pages, but just variables that are sent to the script at index.php for processing. So you might see /index.php?login=true&username=pauleth. When the script receives this, it defines two variables with those values. Here is an example: $login = $_GET['login']; // get the value stored in login in the URL $user = $_GET['username']; // get the value stored in username in the URL Now we have a variable called $login that contains the value 'true', and a variable called $user that contains the value 'pauleth'. You may have entire portions of your script that are only executed if a variable holds a particular value. Hence, someone who is actually logged into a site may see something quite different than an unregistered guest, such as a welcome message like: "Welcome back, pauleth!" I hope that helps...
  16. Yeah, dude, it's probably much easier than you think. Sessions are such a critical part of PHP, so they made it as intuitive, yet functional as possible. I agree - either read the man page on it, or find a website with a tutorial...
  17. If I get this right, you don't want people to be able to directly access restricted pages just by typing the URL into the address bar, right? In my opinion, the best way to address that issue is to use sessions. If a user has a valid session and the necessary credentials they will be able to access that page. If they just type in the URL without first authenticating and invoking a session, then you can use a handler to deny them access to the page. With regards to your question about having an error page that has the same look 'n' feel as the rest of your site, I know there are definitely ways to do it. I haven't done anything to that effect myself, but I know that you can use error handlers that allow you to create a standardized error page that fits in with the rest of your site. You may even be able to make those configurations in your web server platform (in my case, I use Apache).
  18. Maybe I'm a retard, but I don't see where you actually defined the $price array.
  19. There's definitely no reason why you can't pass values to another script via an HTML anchor tag, and use PHP GET to extract the values from the URL. That method can get pretty messy though...
  20. I wasn't saying that the database language is used to authenticate the user, but that the FTP server uses the database as a backend in its authentication.
  21. Have you looked into using an FTP server such as ProFTPD, which allows you to use a MySQL backend to authenticate users, rather than going the PHP route? http://www.castaglia.org/proftpd/doc/contrib/ProFTPD-mini-HOWTO-SQL.html
  22. Yeah I agree with the other posters that you should avoid storing sensitive data on the client machine. They have programs that are designed to go through cookies and expose username/password combos. Storing that sensitive information in a database instead is a good way to go about it. There is a nice PEAR extension that handles user authentication with a database backend for storing credentials...
  23. It looks like the database is expecting a binary value of 1 or 0, and is receiving a string value. I agree that you should explicitly set the value to binary 1 or 0 in your PHP depending on whether or not it meets a particular condition, before inserting it into the DB...
  24. Yeah, I think PHP and MySQL would be a good way to go - especially since you're going to be storing information about the 10 participants over the course of several weeks (I assume). MySQL is a very efficient way to store data that can be manipulated/calculated on, and then stored in its new state. I agree that you should probably learn the basics of PHP/MySQL before launching into this - but, I don't think it will take you very long to get to a point where you can write the script(s) yourself.
  25. I completely agree with IKMYER - for what you are trying to do, sessions definitely seem the way to go...
×
×
  • 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.