Jump to content

ManiacDan

Staff Alumni
  • Posts

    2,604
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by ManiacDan

  1. We don't have a profanity filter on these boards because we trust our members to not act like children. Clearly some need to be watched. This thread is closed and OP has been placed on the watch list.
  2. The error comes from the fact that $this->member['avatar_size'] does not contain a lowercase 'x'. That line you posted simply takes $this->member['avatar_size'], and says "the item before the x is the width, and the item after the x is the height." It assumes an x will be there, producing two items.
  3. You need a friends table, yes. It will link two userIDs and probably have a "friends since" field, maybe even a "relationshipType" field for relatives and partners.
  4. Ok I'm glad you did this when you're first learning, because: never ever use eval() ever. Now that that's out of the way: <?php # Set text/plain instead of text/html header('Content-type: text/html'); $html = file_get_contents("page.html"); # Function that gets and prints all enviroment variables function loop(){ $string = ''; foreach ($_SERVER as $name=>$value ) { $string .= "$name: $value\n"; } return $string; } # Prints the contents of page.html and replaces ---insert--- with number of hits echo str_replace('---insert---', nl2br(loop()), $html); ?> I've altered your loop() function to return a string, rather than echoing directly. I've also used the nl2br function to change the newlines in loop()'s output to HTML line breaks. Since your assignment specifies not using HTML in PHP, I didn't want to stick a "<br>" in that output. I think removed your seriously dangerous eval() line and replaced it with a safer and saner str_replace. -Dan
  5. Most of them just use google ads, which do that for you. An "impression" is just whether or not you showed the ad. If you show it, count it in the database or whatever. Outbound clicks are harder, you need an intermediary page that accepts their click, records it, and then forwards them to where they're going.
  6. "Name Server" should be "1and1 name server" then you'll have another option where you can set the IP address for your domain. The 1and1 help file has more.
  7. You can set the name servers? That's not the right word. Ok, this is what happens: The domain registrars maintain databases of "this domain points to this IP." Those database form the domain name service. There are master DNS servers and regional ones, you don't really need to know how that network is set up. When a user types "www.yoursite.com" into his browser, his computer checks the local DNS server to determine what IP he should use. So what you need to do is edit where the domain name resolves (or "points") to. If you're editing something that says "DNS Server" you're probably editing where your computer looks for new addresses.
  8. There wouldn't be anything about DNS at the VPS service. You're renting a domain name from DomainNamesInc. You're renting a VPS with 7 IPs from VPSInc. You need to call DomainNamesInc and say "please route my domain name to this IP which points to my VPSInc server."
  9. Do you already own a domain?
  10. Call the people you bought the domain from, they're the ones who handle the routing to your IP.
  11. $value in your bottom loop is another array. You have to foreach through it or use implode() or something to get the values out. Attempting to echo an array just prints "Array".
  12. We have to stop giving this poor girl such horrible ideas.
  13. You totally shouldn't do it...but you could. You should have seen my face when I was trying to debug a perl module and realized that the window was too narrow to show me the "unless" clauses off on the right side of the lines. I was so confused.
  14. Pika, you may be interested to learn that the && can be used as a quick shorthand IF: strpos($off, ';') !== FALSE && $off = substr( $off, strpos( $off, ";" ) + 1 ); It's sloppy and perl-like and will cause any code reviewers to punch you, but it's valid. I think it's fun.
  15. That doesn't work for me, am I missing some ironic joke?
  16. That code is definitely the problem, I just ran your code with and without it: php > $offer = array('Free 3 Year On-Site Warranty'); php > php > if ( isset( $offer[ 0 ] ) ) php > { php { $off = strip_tags( $offer[ 0 ] ); php { $off = substr( $off, strpos( $off, ";" ) + 1 ); php { $off = str_replace("'", "", $off ); php { $off = trim( $off ); php { } else { php { $off = "0"; php { } php > php > echo $off; ree 3 Year On-Site Warranty php > php > php > php > $offer = array('Free 3 Year On-Site Warranty'); php > php > if ( isset( $offer[ 0 ] ) ) php > { php { $off = strip_tags( $offer[ 0 ] ); php { //$off = substr( $off, strpos( $off, ";" ) + 1 ); php { $off = str_replace("'", "", $off ); php { $off = trim( $off ); php { } else { php { $off = "0"; php { } php > php > echo $off; Free 3 Year On-Site Warranty See?
  17. $off = substr( $off, strpos( $off, ";" ) + 1 ); If there is no ';' in $off, that line will trim the first letter off $off.
  18. It's probably breaking in the middle of your tag. Insert newlines yourself, don't rely on wordwrap.
  19. The most ironic thing is that the proper name for that symbol in both countries is an octothorpe Can't help you on international mac keyboards. Good luck.
  20. You can't really do that, HTML tables are drawn row by row. You could try to pivot the result set so that it goes in the order: 1,4,7,2,5,8,3,6,9. You could also print three tables side by side. Most sites just do what you're already doing: display is left-to-right and then top-to-bottom. It cuts down on scrolling as well.
  21. PHP vars start with dollar signs, I type that punctuation symbol more than the period on some days. It would destroy me to switch to a keyboard where it was moved. Seriously, I had one of those when I started work here, I sat down, looked at it, and went to amazon.
  22. Seriously, I can't even use these keyboards because the delete/home/end keys are wrong, I'd go insane if the dollar sign moved to the other side of the board.
  23. and single- and double-quotes aren't on the same key!
  24. When I hit shift+the button above tab I get ~. Do you have a different keyboard layout than en_us? Your profile doesn't have a location. The ¬ symbol is used a lot in formal logic, it's the "not" symbol in logical languages like Fitch. I don't know of any use for "broken pipe" other than "sometimes text terminals use that instead of a real pipe so you can tell it's not a lowercase L"
  25. You can also just use usort
×
×
  • 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.