Jump to content

bruce080

Members
  • Posts

    36
  • Joined

  • Last visited

    Never

Everything posted by bruce080

  1. How do I fix this problem?
  2. If I force my browser to refresh the page, the values show up correctly. This means that my linux webserver is caching the values?
  3. register_globals Off Off session.cookie_path / / session.cookie_domain no value no value
  4. I have started to notice that a session variable I am using is acting rather odd. Sometimes it will work correctly and give me the value that it should have, but other times it will give me a value that it used to have. The session variable/php script works correctly 100% of the time on my local testing apache server, but when I move it from my windows box to our linux webserver, it seems to act irregularly. To narrow down the problem, my first question is, Is it possible that a $_SESSION variable could retrieve a previous value? Assuming that the answer to that question is no, then it must be an issue with my code.
  5. Ahh yes, I was under the assumption that a group could be the owner of a file. This makes more sense. Thank you.
  6. I need help removing some write-protected files. On the linux machine, I am a member of the group "www-data" and am trying to remove files from the the directory named "customer_care". The file permissions for this directory is below: sbruce@msa1:/var/www$ ls-l drwxr-xr-x 9 www-data www-data 4096 2009-09-25 11:19 customer_care My group is the owner of the directory, but yet I am running into permissions errors when trying to remove files (the file permissions are the same). Is there a problem with o=rwx and g=r-x? Do the group permissions also have to be rwx even though the group is the owner of the directory? Thanks, Steven
  7. Is there a way to verify that an Alert() happened?
  8. Sure, try the link above and use explode with "," as the string to separate the cat variables, (or ", " if there is going to be a space after the commas). Perhaps the following code might work? <?php $catArray = explode(",", $_GET['cat']); $query = "SELECT prod_name FROM products WHERE cat IN('$catArray[0]','$catArray[1]','$catArray[2]');" ?> EDIT: Nevermind, I forgot about the special character thing posted above.
  9. Ya, I agree with cleibesouza. If the form's method is "post", you need to use _POST to retrieve the information. If it is "get", then you need to use _GET to retrieve the information. Information sent from a form with the GET method is visible to everyone (it will be displayed in the browser's address bar) and has limits on the amount of information to send (max. 100 characters). On the other hand, POST is invisible to the user and has no limit on the amount of information to send.
  10. Yep, no problem. Don't forget to mark the post as solved by using the button on the bottom of the page.
  11. Try switching to _GET and post the results. I would like to know if the full last name is getting passed to the server.
  12. You have to use double quotes for variables. Single quotes will print the variable name, not the value. <?php $result = count($song) - 1; for ($i=0; $i<=$result; $i++) { echo '<tr> <td width="480" height="30">' . $song["$i"] . '</td> <td width="70" height="30">' . filesize($file["$i"]) . ' bytes</td> <td width="30" height="30"><a href="' . $file["$i"] . '" target="_blank"><img src="/artists/download.png" width="21" height="21" border="0"></a></td> </tr>'; } ?>
  13. This page was helpful to me. http://www.tonymarston.net/php-mysql/pagination.html
  14. Sure, there is a way to do it, but it would be easier to do it the other way. If it is the first user, don't add a comma before it, and if it is not the first user, add a comma before it. <?php $select = mysql_query("SELECT * FROM `users` WHERE `online` > '".$timenow."' ORDER by `username`"); $counter=0; while ($info = mysql_fetch_object($select)){ if ($counter==0) { echo "<a href='profile.php?user=$info->id'>$info->username</a>"; } else { echo ", <a href='profile.php?user=$info->id'>$info->username</a>"; } $counter++; } ?>
  15. Here is an entire birthday function if that is helpful also. function birthday ($birthday) { list($year,$month,$day) = explode("-",$birthday); $year_diff = date("Y") - $year; $month_diff = date("m") - $month; $day_diff = date("d") - $day; if ($month_diff < 0) $year_diff--; elseif (($month_diff==0) && ($day_diff < 0)) $year_diff--; return $year_diff; } echo birthday("1980-07-02"); found at this link: http://snipplr.com/view/1357/calculate-age/
  16. I agree with the above post, but perhaps the following code might also help. $year_diff = date("Y") - 1976; echo $year_diff; //will display 33
  17. Well, I've included a link below to an article that I found useful with regards to this topic. I hope someone corrects me if I'm wrong, but from what I can tell, it is not possible to do what you are asking. You can however open the current page in a new window first, and then execute the redirect. http://www.webmasterworld.com/forum88/9053.htm I've also heard people mention other crazy methods including executing the popup code just before the header and then using output buffering, but I have not tried to get this to work and don't know how to do it. Hope this helps, Steven
  18. $sql = "SELECT phonenumber, contactname, emailaddress FROM families WHERE buildingid='$building';"
  19. Okay, this error means that your SQL query is failing. Try the following code. The "or die(mysql_error())" will tell us what the problem is. $sql = "SELECT phonenumber FROM families WHERE buildingid='$building';"; $result = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_array($result)) { $number=$row['phonenumber']; } echo "$number";
  20. There was a slight error with the quotes I used in the query statement of my code. It is fixed below. $result = mysql_query("SELECT phonenumber FROM families WHERE buildingid='$building';"); while($row = mysql_fetch_array($result)) { $number=$row['phonenumber']; } echo "$number";
  21. Again, you are still being slightly vague, but if there will only be one result, this will work. $result = mysql_query("SELECT phonenumber FROM families WHERE buildingid='"$building";"); while($row = mysql_fetch_array($result)) { $number=$row['phonenumber']; } echo "$number";
  22. I think you might need to provide more information. If I am reading your post correctly, you want to display all the phone numbers that correspond to a particular building from the 'families' table. Try the following sql statement if that is correct. SELECT phonenumber FROM families WHERE buildings='<building name>';
  23. Well, you could try: $html = <td valign=\"top\"><h2>Apples</h2></td> $regex = "/(<([\w]+)[^>]*>)*(.*?)(<\/\\2>)/"; preg_match_all($regex, $html, $matches, PREG_SET_ORDER); $i=0; foreach ($matches as $val) { $name[$i] = $val[3]; $i++; } Where the name array would be an array of all the products and you just have to specify which lines of the program have the product lines listed or the following if the tags <td valign=\"top\"><h2> will always be there: $html = <td valign=\"top\"><h2>Apples</h2></td> $regex = "/(^<td valign=\"top\"><h2>)(.*?)(<\/h2><\/td>)/"; preg_match_all($regex, $html, $matches, PREG_SET_ORDER); $i=0; foreach ($matches as $val) { $name[$i] = $val[2]; $i++; }
  24. Thanks <input type="hidden" /> was the ticket.
  25. I currently have a form that consists of two select (drop-down menu) elements and a button. It currently submits the two variables "Product" and "Subsystem" just fine. However, I'd like it to submit a third variable without creating a form element for it. ie. I don't want to have a third drop-down menu or text box visible to the user. Is it possible to do this? Thanks in advance, Steven
×
×
  • 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.