Jump to content

ucffool

Members
  • Posts

    100
  • Joined

  • Last visited

Everything posted by ucffool

  1. Ah the period, where have you been all my life... concatenation for the win.
  2. I'm going to have to recommend my book (in sig), mainly because I couldn't find anything out there like it, so I made it to 'fill the void'. Easy to carry around, covers the majority of commonly used functions, and always explains in plain english the 'how' of a function, with lots of useful examples. http://www.phpreferencebook.com
  3. If you just want the list of contents, use scandir(). It will sort it alphabetically in ascending order by default, or with an optional flag set, in descending order.
  4. $array = array('page'=>'config_detail', 'app'=>$_GET['app'], 'config'=>$config_id_ex[$x]); $querystring = http_build_query($array); $print .= "<td>"; $print .= "<a href='main.php?$querystring'>" .$config_name_ex[$x]. "</a>"; $print .= "</td>";
  5. $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; That will allow you to send HTML mail, then simply make your message: $message = 'Go to: <a href="http://localhost/rental.html">http://localhost/rental.html</a>' . 'You have being assigned a new case';
  6. HTML code uses <option SELECTED> to mark the option you want to be shown by default. XHTML code uses <option selected='selected'> to do it.
  7. Use the database to store the NAME of the file for that user, then just serve up the saved file.
  8. I suppose I used the term simply too loosely. It's a pain in the butt, but as you show, possible. I haven't done it myself before, so I'd have to run some testing on the code to see. However, I know that POST has a larger limit thank GET, but trying it this way, can you send the data through GET? $array = (); $array['variablename'] = 'value'; // Do this for each bit of info you need to send along $querystring = http_build_query($array); // creates a URL-encoded string header(Location: 'http://www.example.com/catchme.php$querystring');
  9. Simply have the form POST to the other page, which processes the information, then POSTS it back to your page. Here is one page with an example.
  10. It all has to do with the PHP.ini configuration file. From the PHP manual: So your code should be written as follows: <?php session_start(); $counter++; print ($counter); $_SESSION['counter'] = $counter; ?>
  11. On low server load, I don't see a problem with doing it that way, just more complicated than my suggestion. I suppose the question is whether SELECT * FROM table and SELECT * FROM table WHERE approved=1 vary much in their execution time. Considering that that query is going to be run the most frequently for the site, you would want it to be the fastest.
  12. store the $array in a session, back in the database, pass it through GET... really depends on how you want to use it.
  13. If it is always first and last, Then it is even simpler by doing: $array = ('one', 'two', 'three', 'four'); $firstvalue = array_shift($array); // Remove first entry in the array and return it, reindex array $array[] = 'newvalue'; /* The array would now look like: Array { [0] => two [1] => three [2] => four [3] => newvalue } */
  14. I'm by no means a mod_rewrite expert, but I think you can't have logic like you are expecting within mod_rewrite rules. You have to tell it how to breakdown /something/else/elseagain/yup into the appropriate file. It doesn't have the capacity to guess that if you add another /something it would be the color.
  15. Your code is using globals, which are turned off. your script is the issue, not sessions in php5. we would need to see that to even begin to help.
  16. For the second part, it is grabbing the name of the file from the GET variable. Are you passing this properly (probably not because the login script is getting in the way)? In other words, for the download page, assuming download.php, the URL bar should be showing http:///xxxxx.com/download.php?name=filenamegoeshere My guess is you need to have the login page, after verification, pass the querystring on to the next page through GET, or even by POST and change the download.php file to $_POST instead of $_GET.
  17. This may help: http://fightingforalostcause.net/misc/2006/compare-email-regex.php
  18. For both of them, in line 4 you forgot a $, it should be: $string = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)', '<a href="\\1">\\1</a>', $replace); your second regex i need to work on more, I can't figure a good way yet.
  19. It is publicly linked when you send the email to someone. Even basic security (require a password to be entered that you check against a variable in a separate file on the server). To answer question #1, I would simply add a column to the database called 'approved' with a default value of 0, and the page, when getting the info to display on the page, queries SELECT * FROM table WHERE approved=1 Then you have another page for administrators to go to that shows the items that have NOT been approved (=0) and allows you to click a link that updates the database for the entry, updating it to 1.
  20. defining a variable inside of a function makes it available within that function. defining a variable outside of a function makes it available within a function ONLY IF you pass that variable to the function (in the parenthesis after the function's name)
  21. Which value do you want removed? Using array_splice($array, offset [, length] [, replacement]) you can easily pull off an entry in an array and replace with some other value. Are you trying to remove the [0] and then put in a new value at the end of the array?
  22. Your sitemap should only point to /jobs.php and then hopefully the links will go from there for google. However, the reason people use mod_rewrite to change it to a pretty URL (/jobs/1 for page 1, for example) is so they could then include each page in their sitemap so everyone indexes everything. I'd have to double-check the sitemaps rules to confirm, but I'm pretty sure you are in the hands of the bot once it is on page 1 without any further changes.
  23. go to server.com/index and it should try and grab /index.php
  24. Can't argue with that, better by design rather than by force.
×
×
  • 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.