1. Post #1361
    Gold Member
    loony383's Avatar
    June 2007
    738 Posts
    position:absolute, maybe?
    That worked great to position it, how can I change what it's relative to? Or perhaps have a drop-down effect.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  2. Post #1362
    Gold Member
    Dennab
    January 2012
    1,137 Posts
    umm no im not using a fucking template this is all coded from scratch. I'll try and follow up on these suggestions. This is pretty much my second day working with PHP so.
    Not too late to start with ruby ;)
    Reply With Quote Edit / Delete United States Show Events Agree Agree x 1 (list)

  3. Post #1363
    jung3o's Avatar
    October 2011
    2,123 Posts
    Code:
    <?php 
    mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
    mysql_select_db("$db_name")or die("cannot select DB");
    if ( isset ( $_POST['Submit'] ) ) //If submit is hit
    {
    $name = $_POST['name'];  
    $category = $_POST['category'];  
    $class = $_POST['class'];  
    $level = $_POST['level'];  
    $bind = $_POST['bind'];  
    $tier = $_POST['tier'];  
    $trade = $_POST['trade'];  
    $ilvl = $_POST['ilvl'];  
    $amod = $_POST['amod'];  
    $xdmg = $_POST['xdmg'];  
    $description = $_POST['description'];  
    $description2 = $_POST['description2'];  
    $description3 = $_POST['description3'];  
    $sprice = $_POST['sprice'];  
    $bprice = $_POST['bprice'];  
    $percent = $_POST['percent'];  
    $source = $_POST['source'];  
    $tnail = $_POST['tnail'];  
    $result=MYSQL_QUERY("INSERT INTO items (name, category, class, level, bind, tier, trade, ilvl, amod, xdmg, description, description2, description3, sprice, bprice, percent, source, tnail)".
    "VALUES ( '$name', '$category', '$class', '$level', '$bind', '$tier', '$trade', '$ilvl', '$amod', '$xdmg', '$description', '$description2', '$description3', '$sprice', '$bprice', '$percent', '$source', '$tnail' )")or die( "<p><span style=\"color: red;\">Unable to select table</span></p>");
    mysql_close();
    //confirm
    echo "<p><span style=\"color: red;\">Thank You; your comments have been entered in my database. DO NOT REFRESH THE PAGE or data will be sent again.</span></p>"; 
    }
    else
    {
    // close php so we can put in our code
    ?>
    Why the hell won't this submit to my database?
    have you echo'd any of them to test if they all have string?

    for the () before VALUES
    you need (`blah`,`blah`)
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  4. Post #1364
    Gold Member
    Bomber9900's Avatar
    December 2008
    2,848 Posts
    i tried dummy values but it wont connect to the table.
    This is so confusing.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  5. Post #1365
    Gold Member
    toaster468's Avatar
    January 2010
    3,241 Posts
    Bomber I hope you realize your variables are in quotes
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  6. Post #1366
    Gold Member
    Bomber9900's Avatar
    December 2008
    2,848 Posts
    -snip-
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  7. Post #1367
    Gold Member
    loony383's Avatar
    June 2007
    738 Posts
    Run a die() on the sql statement and then try and run it in an client such as Heidi SQL to see what happens
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  8. Post #1368
    Gold Member
    Alcapwne's Avatar
    May 2010
    3,514 Posts
    can anyone make sense of this please? am i meant to edit the file to suit my own joystick or does the script do that automatically?

    http://code.google.com/p/javascript-...pt/joystick.js
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  9. Post #1369
    Gold Member
    Shortyish's Avatar
    August 2008
    3,040 Posts
    not exactly sure if this goes here, but anyway
    i made a website and now i obviously want to put it on the internet
    is webhosting required or do i just need to buy a domain? i'm pretty new to this kind of stuff
    Reply With Quote Edit / Delete Windows Vista United States Show Events

  10. Post #1370
    jung3o's Avatar
    October 2011
    2,123 Posts
    webhosting is required and you need to either get a free domain or buy one.

    free co.cc or dot.tk (frees are frowned upon)

    any free web/domains are frowned upon
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  11. Post #1371
    Upload Images
    kragmars102's Avatar
    April 2011
    731 Posts
    not exactly sure if this goes here, but anyway
    i made a website and now i obviously want to put it on the internet
    is webhosting required or do i just need to buy a domain? i'm pretty new to this kind of stuff
    People around here like to buy their domains from http://namecheap.com you should buy your shared hosting depending on your location, for e.g if you are in America there will be limitless options. I'm in Australia and found this company to be promising http://www.netvirtue.com.au/economy-hosting
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  12. Post #1372
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    snip wrong thread
    Reply With Quote Edit / Delete Mac Australia Show Events

  13. Post #1373
    Gold Member
    Bomber9900's Avatar
    December 2008
    2,848 Posts
    Right so quick php question. I've managed to sort most of my issues through trial and error but this isn't really an issue more of a how would I achieve this style thing.

    Right so here it goes.
    Say a user clicks on the link and it sends them to domain/db.php?category=1

    I have three categories in the database, how would I get the database page only to show whats listed for the specific category link the user clicks on?
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  14. Post #1374
    Upload Images
    kragmars102's Avatar
    April 2011
    731 Posts
    Right so quick php question. I've managed to sort most of my issues through trial and error but this isn't really an issue more of a how would I achieve this style thing.

    Right so here it goes.
    Say a user clicks on the link and it sends them to domain/db.php?category=1

    I have three categories in the database, how would I get the database page only to show whats listed for the specific category link the user clicks on?
    I'm not sure if this is what you meant.

    Code:
    mysql_query("SELECT * FROM table WHERE category=''.@$_GET['category'].''");
    Not that you shouldn't directly use $_GET in the database, it's just to give you an idea.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  15. Post #1375
    Gold Member
    Bomber9900's Avatar
    December 2008
    2,848 Posts
    Ahh so I was on the right track. I think I can nail it soon.

    Edited:

    Nevermind, i'm completely fucking lost.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  16. Post #1376
    Upload Images
    kragmars102's Avatar
    April 2011
    731 Posts
    Ahh so I was on the right track. I think I can nail it soon.

    Edited:

    Nevermind, i'm completely fucking lost.
    If you have steam i'm willing to lend a hand, private message me your steam name if you're interested.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events Winner Winner x 1Friendly Friendly x 1 (list)

  17. Post #1377
    MitchvW's Avatar
    September 2011
    1,489 Posts
    Making a php test in class.

    So we have to make a php file that uses fopen to read a file.
    Then we have to read out the price of the book and display it.
    And after that we have to calculate the tax on a book, HOW IS THIS EVEN POSSIBLE USING FOPEN/FREAD/ANY OTHER F THING?!

    Code:
    Handboek HTML5
    10.25
    PHP5
    31.25
    Ajax
    15.25
    The text file.

    Code:
    <?php
    	$myFile = "artbestand.txt";
    	$test = fopen("$myFile", "r");
    	$theData = fread($test, filesize($myFile));
    	fclose($test);
    	echo $theData;
    ?>
    And my current code.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  18. Post #1378
    Upload Images
    kragmars102's Avatar
    April 2011
    731 Posts
    Making a php test in class.

    So we have to make a php file that uses fopen to read a file.
    Then we have to read out the price of the book and display it.
    And after that we have to calculate the tax on a book, HOW IS THIS EVEN POSSIBLE USING FOPEN/FREAD/ANY OTHER F THING?!

    Code:
    Handboek HTML5
    10.25
    PHP5
    31.25
    Ajax
    15.25
    The text file.

    Code:
    <?php
    	$myFile = "artbestand.txt";
    	$test = fopen("$myFile", "r");
    	$theData = fread($test, filesize($myFile));
    	fclose($test);
    	echo $theData;
    ?>
    And my current code.
    Using text files to store data such as that is retarted, should be in a database. However, you're best approach would be using
    Code:
    $array = explode('\n',$theData);
    That should return each new line into an array which you can then use.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  19. Post #1379
    MitchvW's Avatar
    September 2011
    1,489 Posts
    Using text files to store data such as that is retarted, should be in a database. However, you're best approach would be using
    Code:
    $array = explode('\n',$theData);
    That should return each new line into an array which you can then use.
    Yeah tell that to this retard of a teacher.

    I currently got some array things going on
    Code:
    <?php
     $file_handle = fopen("artbestand.txt", "r");
    $lines = array();
    
    while (!feof($file_handle)) 
    {
    print_r($lines);
    $line = fgets($file_handle);
    if(!empty($line))
    $lines[] = $line;
    }
    
    fclose($file_handle);
    ?>
    And it outputs this
    Code:
    Array ( ) Array ( [0] => Handboek HTML5 ) Array ( [0] => Handboek HTML5 [1] => 10.25 ) Array ( [0] => Handboek HTML5 [1] => 10.25 [2] => PHP5 ) Array ( [0] => Handboek HTML5 [1] => 10.25 [2] => PHP5 [3] => 31.25 ) Array ( [0] => Handboek HTML5 [1] => 10.25 [2] => PHP5 [3] => 31.25 [4] => Ajax ) Array ( [0] => Handboek HTML5 [1] => 10.25 [2] => PHP5 [3] => 31.25 [4] => Ajax [5] => 15.25 )
    Edited:

    Well fuck it class is over and the last result I got is that PHP 5 is the most expensive book, no prices and no tax.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  20. Post #1380
    Meow :3
    Ac!dL3ak's Avatar
    July 2005
    6,079 Posts
    I'm not sure if this is what you meant.

    Code:
    mysql_query("SELECT * FROM table WHERE category=''.@$_GET['category'].''");
    Not that you shouldn't directly use $_GET in the database, it's just to give you an idea.
    I disagree with this; you should never use @, it suppresses ALL error, warning, and info messages- if you call a function using it, any function that function calls won't give an error or a warning. Plus, you should be handling the case yourself- if it doesn't exist, you should give an error.

    Edited:

    $fd = fopen("artbestand.txt","r");
    $books = array();
    
    while(!feof($fd)) {
    $books[fgets($fd)] = fgets($fd);
    }
    print_r($book);
    

    maybe?
    Reply With Quote Edit / Delete Linux United Kingdom Show Events Agree Agree x 1 (list)

  21. Post #1381
    Gold Member
    Crhem van der B's Avatar
    January 2010
    1,691 Posts
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  22. Post #1382
    Meow :3
    Ac!dL3ak's Avatar
    July 2005
    6,079 Posts
    What's the user table as defined in db/schema.rb?
    Reply With Quote Edit / Delete Linux United Kingdom Show Events

  23. Post #1383
    Gold Member
    Crhem van der B's Avatar
    January 2010
    1,691 Posts
    What's the user table as defined in db/schema.rb?
    Code:
      create_table "users", :force => true do |t|
        t.string   "name"
        t.text     "password"
        t.text     "pin"
        t.datetime "created_at", :null => false
        t.datetime "updated_at", :null => false
        t.text     "salt"
      end
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 1 (list)

  24. Post #1384
    MitchvW's Avatar
    September 2011
    1,489 Posts
    Does anyone know how to run a PHP function using a href?
    I'm trying to make a clear all messages link that uses the readMessages() method.

    I've tried things like <a href="readMessages();"> Mark all messages read </a> but that won't work
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Funny Funny x 2Dumb Dumb x 2 (list)

  25. Post #1385
    Gold Member
    Kirth's Avatar
    July 2009
    429 Posts
    Ha hahaha ha! Oh.. you're serious? You'd either be doing something like this: <a href="read_messages.php">Mark al horses as read</a> with read_messages calling said function. Or, the more sensible way: an AJAX call.
    Reply With Quote Edit / Delete Windows 7 Belgium Show Events

  26. Post #1386
    MitchvW's Avatar
    September 2011
    1,489 Posts
    Ha hahaha ha! Oh.. you're serious? You'd either be doing something like this: <a href="read_messages.php">Mark al horses as read</a> with read_messages calling said function. Or, the more sensible way: an AJAX call.
    Fuck it I never work with HTML.
    And I don't want to make like 30 different php files, I just want it to be a bit more compact you know.
    Ofcourse I could make it refer to a new page and use the method there, but that will result in my message system having like 20 pages instead of 3.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Dumb Dumb x 1 (list)

  27. Post #1387
    Gold Member
    Crhem van der B's Avatar
    January 2010
    1,691 Posts
    Fuck it I never work with HTML.
    And I don't want to make like 30 different php files, I just want it to be a bit more compact you know.
    Ofcourse I could make it refer to a new page and use the method there, but that will result in my message system having like 20 pages instead of 3.
    Uhhh... What? Do you even understand what you're doing?
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 2 (list)

  28. Post #1388
    Gold Member
    StinkyJoe's Avatar
    June 2006
    2,196 Posts
    Using text files to store data such as that is retarted, should be in a database. However, you're best approach would be using
    Code:
    $array = explode('\n',$theData);
    That should return each new line into an array which you can then use.

    Code:
    $lines = file('filename.txt')
    In your example, the newline sequence needs to be enclosed in double quotes, too, otherwise it's taken literally:

    '\n' -> literal backslash followed by an n character
    "\n" -> newline character
    Reply With Quote Edit / Delete Linux Portugal Show Events

  29. Post #1389
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    788 Posts
    Code:
    echo'
    <a href="http://'.htmlspecialchars($listap['SiteId']).'" target="new">
    ';
    Shows as

    Code:
    <a href="http:// tuxedogaming.com/" target="new">
    Adding an extra space after http:// and breaking the link.
    Why and how to fix it?

    Fixed it by doing

    Code:
    $siteid = htmlspecialchars($listap['SiteId']);
    echo'
    <div class="userprofileextra"><a href="http://'.$siteid.'" target="new">
    ';
    But still wanna know why it adds that extra space.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  30. Post #1390
    -Kesil-'s Avatar
    February 2012
    87 Posts
    Having a google page, facebook page, myspace page (not a personal profile) may require some fancy means of customization.
    Facebook handles this with iframes and "privileged/approved" sites.
    I'm not sure what google does but I'm sure it wants to allow for some of the same level of customization.
    Facebook became dangerous at one point due to its allowable customization.


    I came to ask, what security issues are there? (I just need a list)
    Javascript/iframes that bumps a person out of Facebook and onto another page.
    Javascript that steals data associated with your current personal page display.
    Can you guys think of anything else that may raise concern?
    Reply With Quote Edit / Delete Mac United States Show Events

  31. Post #1391
    Gold Member

    July 2007
    166 Posts
    Has anyone here used or is currently using http://x10premium.com/?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  32. Post #1392
    Gold Member
    Dennab
    January 2012
    1,137 Posts
    Has anyone here used or is currently using http://x10premium.com/?
    I'm friends with a lot of current and former x10 staff and I can personally say they are awesome people
    Reply With Quote Edit / Delete Mac United States Show Events

  33. Post #1393
    Gold Member

    July 2007
    166 Posts
    Was just kinda curious because a friend of mine was saying that he thinks its some sort of scam, I signed up for a free host just to kinda test it but I couldn't log into the control panel. Also the testimonials on their front page all lead to dead links.

    Nevermind the control panel works but you might want to inform them of the dead links on their front page makes it kinda suspicious.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  34. Post #1394
    Gold Member
    jetboy's Avatar
    January 2009
    2,264 Posts
    Does anyone use ArchLinux in a production environment? People on the Arch forum say it's not a good idea due to upgrades commonly fucking your system up, but I've used Arch for about 8 months (Desktop use) and haven't had anything break due to an upgrade.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  35. Post #1395
    Gold Member
    Dennab
    January 2012
    1,137 Posts
    Does anyone use ArchLinux in a production environment? People on the Arch forum say it's not a good idea due to upgrades commonly fucking your system up, but I've used Arch for about 8 months (Desktop use) and haven't had anything break due to an upgrade.
    Been running Arch on my VPS for almost two months and I can't say the experience hasn't been anything but awesome. You usually won't fuck your system up if you check arch's update news so as long as you have a way to read the feed you should be golden.
    Reply With Quote Edit / Delete Mac United States Show Events Agree Agree x 1Friendly Friendly x 1 (list)

  36. Post #1396
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    Does anyone use ArchLinux in a production environment? People on the Arch forum say it's not a good idea due to upgrades commonly fucking your system up, but I've used Arch for about 8 months (Desktop use) and haven't had anything break due to an upgrade.
    don't even bother on openvz or on any other virtualization platform that runs a shared kernel
    Reply With Quote Edit / Delete Mac Australia Show Events Disagree Disagree x 1 (list)

  37. Post #1397
    Dennab
    February 2012
    2,299 Posts
    Right, I was originally asked by my web dev teacher to redo a church website, I declined and he asked another member of my class.
    I saw that he was struggling with the design slightly, so I did the initial design for the site while he did the back-end work.
    As you can imagine he has sat back and done sod all, he turns up to meetings with the client, offers input, but ultimately doesn't do anything. This isn't my project so how can I tactfully pack in work on it?

    Its a non-paid job too. All I originally did was make a quick page to show how it would look, it snowballed from there.

    I might add that he doesn't go to my college any more, should I just give him a zip with the site in it and database dumps and cut all ties?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  38. Post #1398
    Funquisition Daily Founder
    Bandit Kitteh's Avatar
    September 2009
    326 Posts
    Has anyone here used or is currently using http://x10premium.com/?
    I have and am currently waiting for my services to end with them. It's a great web host, but as far as the back end such as ssh access goes, not so great seeing as it is shared hosting, you will get the input and error logs spamming your console nonstop if somebody screws with anything.

    My first choice for web hosting, but I highly suggest hosting it yourself on a VPS or other server. Much more convenient.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  39. Post #1399
    Gold Member
    Bomber9900's Avatar
    December 2008
    2,848 Posts
    I'm having an issue.
    My html submission form is completely correct, nothing is wrong with it.
    However

    Code:
    $subcateory = $_POST['subcategory'];
    $class_id = $_POST['class_id'];
    These two always come up undefined, yet all the other indexs posted from the html page work fine.
    Why is this?
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  40. Post #1400
    Gold Member
    wizard`'s Avatar
    August 2009
    938 Posts
    I'm having an issue.
    My html submission form is completely correct, nothing is wrong with it.
    However

    Code:
    $subcateory = $_POST['subcategory'];
    $class_id = $_POST['class_id'];
    These two always come up undefined, yet all the other indexs posted from the html page work fine.
    Why is this?
    well for one is $subcateory actually meant to be $subcategory ? Could it just be that you are calling it spelt correctly but it is building as the incorrect spelling? Not sure about the $class_id, post the code where you are calling it
    Reply With Quote Edit / Delete Windows XP Australia Show Events