Jump to content

nethnet

Members
  • Posts

    284
  • Joined

  • Last visited

About nethnet

  • Birthday 08/27/1988

Contact Methods

  • AIM
    comprisedpuma
  • MSN
    webmaster@nethnet.com
  • Website URL
    http://www.nethnet.com
  • Yahoo
    betrayed_series

Profile Information

  • Gender
    Male
  • Location
    Philadelphia, PA, USA

nethnet's Achievements

Member

Member (2/5)

0

Reputation

  1. Life has once again given me the opportunity to return to my passion of coding with PHP, and as such, I have found my way back home to these forums I'm excited to become involved here again, and hopefully I'll run into a lot of familiar faces along the way!
  2. Yes, you can use file handling functions as long as allow_url_fopen is enabled on your system.
  3. There are a few different ways to achieve this, each with their own pros and cons depending on what you want to do with the file. If you are just looking to grab the OUTPUT of the PHP script, I would recommend using fopen() to open the file, and then readfile() to load the output of the file into a variable. This, also, assumed that you have allow_url_fopen enabled on your system.
  4. Use the explode() function. <?php $string = "TOM||PAUL||HARRIS"; $array = explode("||", $string); echo $array[0]; // Echoes "TOM" ?>
  5. As Adam has said, you can only access the values of $row while you are within your loop.. trying to do so outside of that scope will produce null then the array is, at that point, null. You could try building a second array of just these "place" values that you obtain inside the loop, which will then persist outside of its scope.
  6. The time() function returns the current UNIX timestamp, which is the amount of seconds since the Unix Epoch (January 1st, 1970 0:00:00 GMT). The date() function formats a date in the way specified. As you have used, "w" will return the numerical representation of the day of the week. By default, the date() function uses the current date and time for the return value, so using date("w") and date("w", time()) will return the exact same thing. If, however, you wanted to know the day of the week exactly 100 days from now, you could use a combination of the two functions to do so: <?php $timestamp = time(); $onehundreddays = 60 * 60 * 24 * 100; // The amount of seconds in 100 days $finaltime = $timestamp + $onehundreddays; echo "In one hundred days, it will be " . date("l", $finaltime); ?> As you can see, UNIX timestamps become very useful when you want to manipulate dates or calculate spans of time between two dates. The second parameter of the date() function is entirely optional, and will default to the current timestamp, so putting the current value of time() in it is redundant and unnecessary. I hope that helps your understanding of these two functions.
  7. switch($_GET["b"]=="true") This is improper syntax, use this instead: switch($_GET['b'])
  8. Elaborate on this please. What do you mean exactly when you say you want to check a text box for an imbedded file? A text box will contain a string.. are you meaning to check for a filepath on your server?
  9. Give us a few lines of code above and below that, with line numbers, as well as the exact error messages again.
  10. I'm just going to take a stab in the dark here and say that what you want to do with the !empty() conditionals should use the boolean && instead. If you used the way you had, your conditional would evaluate to TRUE as long as ANY of those fields were not empty. It looks to me like a registration script of some kind, so the natural assumption is that you would only want the conditional to be TRUE as long as NONE of the fields were empty, in which case you would use && instead of ||.
  11. For the next link, change the if statement to this: if ($page < $total_pages) { The previous link shows on all pages of results, even page 1?
  12. Could you clarify what exactly you are trying to do? I mean, are you trying to implement a similar way of passing data in your own URLs like this, and then extract certain bits of it on your pages? Or are you literally taking a string that is a URL (abc.com) and trying to extract certain bits of information from it? Sorry if this seems like a stupid question, I'm just not entirely sure which of these you are trying to accomplish.
  13. Just change the OR to AND. This will return rows that match ALL of the criteria, instead of ANY of the criteria.
  14. Chances are if your server isn't allowing PHP files, it isn't allowing other technologies that would do this as well, such as CGI or ASP. You will have to check with your web host to see what kinds of files they allow.
  15. "public" is a keyword used in conjunction with class methods. Since these functions aren't part of a class, just get rid of the word "public" and it should work fine.
×
×
  • 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.