Jump to content

JJBlaha

Members
  • Posts

    55
  • Joined

  • Last visited

    Never

Everything posted by JJBlaha

  1. The get variables are undefined if they are in the included file on the main site (www.domain.com/main/index.php) but they work perfectly on the regular subdomain file (sub.domain.com/index.php). The code used in every case was the exact same, the only difference is that it is either included or is not.
  2. If i put <?php echo $_GET['content']; ?> in the included file nothing shows, but if it put it in the original file it does show. It seems it matters that it is included for some reason.
  3. Possibly important piece of information: index.php is on a subdomain, like sub.domain.com, and is including the file www.domain.com/main/index.php I know the file is being included, because it outputs con is, but the variable is not working.
  4. If i put it in main/index.php (the inlcuded one) I get Array ( ) 1 If i put it in index.php i get Array ( [content] => blahblah )
  5. The problem is this. index.php is this <? include('main/index.php'); ?> main/index.php is this $content = $_GET['content']; echo "con is $content"; when i put in index.php?content=blahblah It echos 'con is', but if i change index.php to what main/index.php is, it con is blahblah. Anyone know why?
  6. Thanks alot for both replies, they were very helpful  :)
  7. This is the basic layout.  $connection holds your database info, tell if if you need to know what that looks like. [code]<table><tr><th>1</th><th>2</th><th>3</th></tr> <? $sql = "select * from table"; $result = mysql_query($sql, $connection) while ($Array = @mysql_fetch_array($result)){ // things in here are repeated for every row $thing= $Array['thing']; $thing2= $Array['thing2']; $thing3= $Array['thing3']; echo "<tr><td>$thing</td><td>$thing2</td><td>$thing3</td></tr>"; } ?> </table>[/code]
  8. I have a list of prices, all the numbered prices start with a  $ sign and some are words.  For example my list might look like $25 $9 Free $5.29 $42323 $0.79 Best Offer I want to sort this list so that the lowest price is on top, then all of the words are at the bottom.  With the default mysql sort (order by price ASC) the list is sorted like this: $0.79 $25 $42323 $5.29 $9 Best Offer Free i want it to be sorted like this: $0.79 $5.29 $9 $25 $42323 Best Offer Free
  9. i forgot to include my database file! doh! thanks alot, it works perfectly now.
  10. Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in ....(path) SELECT user, SUM(rating) AS total FROM articles GROUP BY user ORDER BY total DESC LIMIT 10
  11. it isnt table, it is articles something else is causing the problem
  12. i get Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in ... [code] $s = "SELECT user, SUM(rating) AS total FROM table GROUP BY user ORDER BY total DESC LIMIT 10"; $r = mysql_query($s, $conn); while ($Array = @mysql_fetch_array($r)) { $total = $Array['total']; $rating = $Array['rating']; $user = $Array['user']; echo "$user ($total)<br />"; } [/code]
  13. I have a database that is set up with username, articleid, rating.  the rating is a number.  i want to list the username with the highest total ratings for all articles with their name and the totaled number.  How do I accomplish this?
  14. Your changes still do not work for pre IE7.  If I use the template I may have the user dowload FF or IE7 before they can view the page, or just wait until IE7 is more prevalent. As it is now it works in IE7, but not previous versions, and of course FireFox. As for the technique I had an idea of how to do it and am in the process of expierimenting to get it to work.
  15. I am trying to resize an image before it is uploaded.  If I only have [code] $uploadedfile = $imagefile; $src = imagecreatefromjpeg($uploadedfile); list($width,$height)=getimagesize($uploadedfile); $newwidth=600; $newheight=($height/$width)*600; ...rest of code [/code] It works, but only if the width exceeds 600px.  If i try to do this [code] $uploadedfile = $imagefile; $src = imagecreatefromjpeg($uploadedfile); list($width,$height)=getimagesize($uploadedfile); if($width > 600) { $newwidth=600; $newheight=($height/$width)*600; ) else { if($height > 600) { $newheight=600; $newwidth=($width/$height)*600; ) } [/code] I get an error and the page does not load.  Any ideas?
  16. View [url=http://www.summonersonline.com/a/]this page[/url] in firefox.  Then view it in IE.  I want it to work like it does in firefox in IE, but cannot figure out how to do it, any suggestions? Make sure you resize the window to very large and very small to get what it is supposed to be doing.
  17. could you give me an example of how that might look? i have never used substr or strstr before.
  18. I want to have a user input their website, and if they do not put http:// before it, i want the script to add it.  If they did put it, then i want it unchanged.  For example an input of www.phpfreaks.com should output as http://www.phpfreaks.com.  Anyone know how to do this?
  19. I want to make a tree that takes data from my database to make it.  I have been using [url=http://www.dhtmlgoodies.com/scripts/folder-tree-static/folder-tree-static.html]this script[/url] to do it.  It works fine, but takes several seconds to load.  Is there a way to make it so it doesn't load the next part of the tree until you click it instead of it loading everything at the beginning and creating the tree?
  20. [quote author=Destruction link=topic=117485.msg479333#msg479333 date=1165356585] IE can set image/jpeg as image/pjpeg so you'll need to add that to the allowed list.  This is noted in the php.net manual documentation. Hope this helps, Dest [/quote] worked perfectly thanks :)
  21. This script works perfectly in Firefox, but outputs Could Not Copy, Wrong Filetype (imagename) in Internet Explorer [code] if(!empty($imagefile)) { if ($_FILES['imagefile']['type'] == "image/gif" || $_FILES['imagefile']['type'] == "image/jpg" || $_FILES['imagefile']['type'] == "image/jpeg" ){ copy ($_FILES['imagefile']['tmp_name'], "images/userimages/".$_FILES['imagefile']['name']) or die ("Could not copy");       echo ""; echo "Name: ".$_FILES['imagefile']['name'].""; echo "Size: ".$_FILES['imagefile']['size'].""; echo "Type: ".$_FILES['imagefile']['type'].""; echo "Copy Done...."; } else { echo ""; echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['name'].")"; } } [/code] Any idea why?
  22. Thanks that worked beautifully :) If i had chosen something other than read such as r121 i would not have had to do that?
  23. MySQL Error: UPDATE privatemessages SET read = '1' WHERE id='7' You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read = '1' WHERE id='7'' at line 1 is what i get.
×
×
  • 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.