Jump to content

schilly

Members
  • Posts

    870
  • Joined

  • Last visited

    Never

Everything posted by schilly

  1. Is the URL variable populated in the address bar in your browser when you click the link? Your server might not have short tags enabled so you may have to do this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <div> <a href="page2.php?url=<?php echo urlencode("http://mysite.com"); ?>">Link Title</a> </div> </body> </html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <div> <?php echo urldecode($_GET['url']); ?> </div> </body> </html>
  2. $url_clicked was just an example of a possible URL. Just replace it with the link you want if you are not generating the URLs dynamically. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <div> <a href="page2.php?url=<?=urlencode("http://mysite.com")?>">Link Title</a> </div> </body> </html> Then for accessing the URL: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <div> <?=$_GET['url']?> </div> </body> </html>
  3. You only need one for that as the code will always get to that return. If you start writing bigger functions with more code that you want to exit on a certain cases without executing a bunch of code afterwards then you would use multiple returns.
  4. your return is inside the loop so it returns right away. function sum_ages($array){ foreach($array as $key => $value){ $total += $value; } return $total; }
  5. mail($to_address,$subject,$body,"FROM: $from_address\r\n");
  6. All functions have a separate variable scope. You need to either pass them into your function or declare them as globals inside your function. I would recommend passing them into your function like Matthew's example above.
  7. Yea. So $destination_path = "../../../files/123/123/"; // or /home/user/.... cwd gets the current working directory of the script. http://php.net/manual/en/function.getcwd.php
  8. str_replace("<br>", "\n", $content); should work. Are you writing to the file with the <br> in it?
  9. If you want an absolute path then use /home/user/.... whatever. If you want a relative path just use ../../../files/123/123/
  10. <a href="page2.php?url=<?=urlencode($url_clicked)?>">Link Title</a> Then on page2.php just use $_GET['url'] to obtain the url they clicked.
  11. bah. try this. syntax error. <p><?=(!empty($r[8])) ? "<a href=\"" . htmlspecialchars($r[8]) . "\">" . htmlspecialchars($r[1]) . "</a>" : htmlspecialchars($r[1])?><br /> <?=htmlspecialchars($r[2])?><br /> <?=htmlspecialchars($r[3])?><br /> <?=htmlspecialchars($r[4])?><br /> <?=htmlspecialchars($r[5])?><br /> <a href="mailto:<?=htmlspecialchars($r[7])?>"><?=htmlspecialchars($r[7])?></a> </p>
  12. ah right. never thought of doing that. =)
  13. depends what you want to output. you won't write a if/else inside an echo. shows us the full info and what you want filtered based on the db value. i would normally write your statement like: <?php echo '<td class="productbox">'; echo '<h1>' . $product_title . '</h1>'; if(condition) //echo other data if condition is met else dont output it echo '</td>'; ?>
  14. <?= ?> is the same as <?php echo ?> so <?=htmlspecialchars($r[2])?> is just <?php echo htmlspecialchars($r[2]); ?> so if field 8 has a link put in a link, if not dont add the link? <p><?=(!empty(htmlspecialchars($r[8]))) ? "<a href=\"" . htmlspecialchars($r[8]) . "\">" . htmlspecialchars($r[1]) . "</a>" : htmlspecialchars($r[1])?><br /> <?=htmlspecialchars($r[2])?><br /> <?=htmlspecialchars($r[3])?><br /> <?=htmlspecialchars($r[4])?><br /> <?=htmlspecialchars($r[5])?><br /> <a href="mailto:<?=htmlspecialchars($r[7])?>"><?=htmlspecialchars($r[7])?></a> </p> That says if field 8 is not empty output field 1 with the link on it else just output field 1. Let me know if that's not what you meant.
  15. yea already read over the youtube api. they don't have any php examples, just what http headers to send. was hoping to save some time with some example code or pre-built classes.
  16. Ok might have figured out my include issue so I'll guess I'll continue trying Zend out. Anyone else done this before?
  17. Has anyone had any success doing this? I'm not sure if I should try to write this myself or use some kind of framework. I found the Zend Gdata framework (http://framework.zend.com/manual/en/zend.gdata.html) and tried it out but I kept getting error: Warning: include_once() [function.include]: Failed opening '1' for inclusion (include_path='.:/usr/share/pear') I'm assuming it needs to find PEAR which I don't have installed but no where in the Zend docs does it say that it requires PEAR so I'm a little confused. I've never used any of the Zend frameworks so I have no idea if it needs PEAR or not. Anyone have any other methods for doing this? Thx.
  18. so like SELECT DATE_FORMAT('%M',event_date) as month FROM table GROUP BY month ?
  19. SELECT * FROM table WHERE DATE_FORMAT('%m',event_date) = $month_int 01-12 for month codes. If they select events from a certain month just pass in the int value of the month via PHP and display the results. DATE_FORMAT fn: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format
  20. Most of those variables you are using are deprecated as of v.63. https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetExpressCheckout
  21. Nope. I'm wonder what is in $resArray because that has all the info that PayPal sends back about the API call. If there was an error, it will be in there.
  22. Whats the response array give you?
  23. Yes you need to URL encode anything for the PayPal WSPP API.
  24. I use to use two but now I normally just use one as I only need to update one form if changes are needed.
×
×
  • 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.