Jump to content

tleisher

Members
  • Posts

    88
  • Joined

  • Last visited

    Never

Everything posted by tleisher

  1. Here's the full code. It works great in Firefox but doesnt work at all (In fact, the things that are set by css to "collapse" are there, so is collapse not a valid tag in IE? [code=php:0] <html> <head> <title>Order</title> <script type="text/javascript"> function USA() { document.getElementById('USA').style.display = 'block'; document.getElementById('c').style.display = 'none'; } function Canada() { document.getElementById('USA').style.display = 'none'; document.getElementById('c').style.display = 'block'; } function show(row) { document.getElementById(row).style.visibility = 'visible'; alert("AHH!!"); } function hide(row) { document.getElementById(row).style.visibility = 'collapse'; alert("AHH!!"); } </script> <style type="text/css"> .name { border: 2px solid white; padding: 10px; width: 550px; } #c { display: none; } #private { visibility: collapse; } #priv_p { visibility: collapse; } #vent_slots { visibility: collapse; } #hltv_slots { visibility: collapse; } </style> </head> <body bgcolor="#000000" text="#FFFFFF"> <center><b><font size="+2">Order</font></b></center><br> <br> <form action="submit.php" method="post"> Personal Information:<br /> <div class="name"> <table border="0" cellspacing="0" cellpadding="0" width="600"> <tr><td width="50%">Last Name*:</td><td width="50%"><input type="text" name="last"></td></tr> <tr><td width="50%">First Name*:</td><td width="50%"><input type="text" name="first"></td></tr> <tr><td width="50%">E-mail address*:</td><td width="50%"><input type="text" name="email"></td></tr> <tr><td width="50%">Street Address*:</td><td width="50%"><input type="text" name="street"></td></tr> <tr><td width="50%">Country*:</td><td width="50%"><select name="country"><option onClick="USA();" selected>USA</option><option onClick="Canada();">Canada</option></select></td></tr> <tr><td width="50%">City*:</td><td width="50%"><input type="text" name="city"></td></tr> <tr><td width="50%">State*:</td><td width="50%"> <div id="c"><select name="state_canada"><option value="default">-Select Province-</option><option value="AB">Alberta</option><option value="BC">British Columbia</option><option value="MB">Manitoba</option><option value="NB">New Brunswick</option><option value="NL">Newfoundland and Labrador</option><option value="NS">Nova Scotia</option><option value="NU">Nunavut</option><option value="NT">N.W.T.</option><option value="ON">Ontario</option><option value="PE">Prince Edward Island</option><option value="QC">Quebec</option><option value="SK">Saskatchewan</option><option value="YT">Yukon</option></select></div> <div id="USA"><select name="state_usa"><option value="default">-Select-</option><option value="AL">Alabama</option><option value="AK">Alaska</option><option value="AZ">Arizona</option><option value="AR">Arkansas</option><option value="CA">California</option><option value="CO">Colorado</option><option value="CT">Connecticut</option><option value="DE">Delaware</option><option value="DC">District Of Columbia</option><option value="FL">Florida</option><option value="GA">Georgia</option><option value="HI">Hawaii</option><option value="ID">Idaho</option><option value="IL">Illinois</option><option value="IN">Indiana</option><option value="IA">Iowa</option><option value="KS">Kansas</option><option value="KY">Kentucky</option><option value="LA">Louisiana</option><option value="ME">Maine</option><option value="MD">Maryland</option><option value="MA">Massachusetts</option><option value="MI">Michigan</option><option value="MN">Minnesota</option><option value="MS">Mississippi</option><option value="MO">Missouri</option><option value="MT">Montana</option><option value="NE">Nebraska</option><option value="NV">Nevada</option><option value="NH">New Hampshire</option><option value="NJ">New Jersey</option><option value="NM">New Mexico</option><option value="NY">New York</option><option value="NC">North Carolina</option><option value="ND">North Dakota</option><option value="OH">Ohio</option><option value="OK">Oklahoma</option><option value="OR">Oregon</option><option value="PA">Pennsylvania</option><option value="RI">Rhode Island</option><option value="SC">South Carolina</option><option value="SD">South Dakota</option><option value="TN">Tennessee</option><option value="TX">Texas</option><option value="UT">Utah</option><option value="VT">Vermont</option><option value="VA">Virginia</option><option value="WA">Washington</option><option value="WV">West Virginia</option><option value="WI">Wisconsin</option><option value="WY">Wyoming</option><option value="PR">Puerto Rico</option><option value="VI">Virgin Island</option><option value="MP">Northern Mariana Islands</option><option value="GU">Guam</option><option value="AS">American Samoa</option><option value="PW">Palau</option></select></div> </td></tr> <tr><td width="50%">Postal/Zip Code*:</td><td width="50%"><input type="text" name="postal"></td></tr> <tr><td width="50%">Telephone number*:</td><td width="50%"><input type="text" name="phone"></td></tr></table> </div><br> <br> Server information<br /> <div class="name"><table border="0" cellspacing="0" cellpadding="0" width="600"> <tr><td width="50%">Game: </td><td width="50%"> <select name="game"> <option>Half-Life</option> <option>Unreal Tournament (Coming Soon)</option> <option>Quake (Coming Soon)</option></select></td></tr> <tr id="mod_halflife"><td width="50%">Mod: </td><td width="50%"><select name="mod"> <option>Counter-Strike 1.6</option> <option>Condition-Zero</option> <option>Day Of Defeat 1.6</option> <option>Team Fortress</option> <option>Counter-Strike: Source</option> <option>Day Of Deafeat: Source</option></select></td></tr> <tr><td width="50%">Type: </td><td width="50%"><select name="type"> <option onClick="show('public'); hide('priv_p'); hide('private');">Public</option> <option onClick="show('private'); show('priv_p'); hide('public');">Private</option></select></td></tr> <tr id="priv_p"><td width="50%">Password*: </td><td width="50%"><input type="text" name="priv_pass"></td></tr> <tr id="private"><td width="50%">Slots ($1.50/Slot): </td><td width="50%"><select name="slots"><option>10</option><option>11</option><option>12</option><option>13</option><option>14</option><option>15</option><option>16</option></select></td></tr> <tr id="public"><td width="50%">Slots ($2.00/Slot): </td><td width="50%"><select name="slots"><option>10</option><option>11</option><option>12</option><option>13</option><option>14</option><option>15</option><option>16</option><option>17</option><option>18</option><option>19</option><option>20</option><option>21</option><option>22</option><option>23</option><option>24</option><option>25</option><option>26</option><option>27</option><option>28</option><option>29</option><option>30</option><option>31</option><option>32</option></select></td></tr> <tr><td width="50%">Location:</td><td width="50%"> <select name="location"> <option>New York</option> <option>Texas (Coming Soon)</option> <option>California (Coming Soon)</option></select></td></tr> <tr><td width="50%">Ventrilo:</td><td width="50%"> <select name="vent"><option onClick="show('vent_slots');">Yes</option><option selected onClick="hide('vent_slots');">No</option></select></td></tr> <tr id="vent_slots"><td width="50%">Slots ($.50 Per Slot):</td><td width="50%"> <select name="vent_slots"> <option>10</option> <option>20</option> <option>50</option> <option>100</option> <option>200</option></select></td></tr> <tr><td width="50%">HLTV:</td><td width="50%"> <select name="hltv"> <option onClick="show('hltv_slots');">Yes</option><option selected onClick="hide('hltv_slots');">No</option> </select></td></tr> <tr id="hltv_slots"><td width="50%">Slots:</td><td width="50%"> <select name="hltv_slots"> <option value="20">15 (FREE)</option> <option value="50">50 ($5)</option> <option value="100">100 ($10)</option> <option value="200">200 ($20)</option> </select></td></tr> <tr><td width="50%">Rcon Password:</td><td width="50%"> <input type="text" name="rconpass"></td></tr> <tr><td width="50%">FTP Username:</td><td width="50%"> <input type="text" name="username"></td></tr> <tr><td width="50%">FTP Password:</td><td width="50%"> <input type="text" name="password"></td></tr> <tr><td width="50%">Sales Person: </td><td width="50%"><input type="text" name="salesperson"></td></tr> <tr><td width="50%">Coupon Code (Optional):</td><td width="50%"> <input type="text" name="coupon"></td></tr> <tr><td width="50%">Term:</td><td width="50%"> <select name="term"> <option value="1">Monthly - No Discount</option> <option value=".95">3 Months - 5%</option> <option value=".9">6 Months - 10%</option> <option value=".8">12 Months - 20%</option> </select></td></tr></table> <br> Comments: <br /> <textarea name="comments"></textarea><br> <br> <textarea name="ToS" rows="25" cols="65">Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....Terms of Service go here.....</textarea> <br /> <input type="checkbox" name="Signed_ToS"> I have read and agree to the Terms of Service<br> </div> <br>For Fruad Protection, we have logged your IP as: <?php echo $_SERVER['REMOTE_ADDR']; ?><br><br> <input type="submit" value="Submit!"> <br> <br> </form> [/code]
  2. I do on my actual page, thought I pasted that too. It doesnt do anything at all, even if I use it on other elements also.
  3. [code] function show(elem) { document.getElementById(elem).style.visibility = 'visible'; } function hide(elem) { document.getElementById(elem).style.visibility = 'hidden'; }  <tr><td width="50%">Type: </td><td width="50%"><select name="type"><option onClick="show('public'); hide('priv_p'); hide('private');">Public</option><option onClick="show('private'); show('priv_p'); hide('public');">Private</option></select></td></tr> <tr id="priv_p"><td width="50%">Password: </td></tr> <tr id="private"><td width="50%">Private</td></tr> [/code] It's supposed to make one tr disappear and the other appear, but it doesn't work. It doesn't do anything at all.
  4. When you do a query, you're actually getting a reference to the results, you then have to process those results like so: $id = mysql_query($qid) or die("could not get id from mysql"); $query = mysql_fetch_array($id); $ticketNumber = $query["id"]; echo "Ticket Number: " . $ticketNumber;
  5. Create a new file, in the first line of this file put this: AddType application/x-httpd-php5 .php Save the file as ".htaccess" without the quotes, upload it to the directory that your script is in. You now have PHP 5.1.4 :) Enjoy SimpleXML.
  6. mysql_query("SELECT `bid` FROM `table` WHERE `uid` = '7' AND `rid` = '1'") or die(mysql_error());
  7. ORDER BY needs a column to order from, you may be able to do ORDER BY `name` but Im not sure if it would work, give it a shot and find out.
  8. for ($i = 1; $i <= $total_count; $i++) {       // Do stuff here }
  9. Yeah, the only thing I can think of is that your form isnt posting the information right... try this: if(!$username) { echo "Heres your problem"; } and see if that line echos, if so, your form isnt posting the data to your new page.
  10. echo "<tr><td><a href=\"http://www.test.com/" . $item_name . ".html\">Download</a></td></tr>";
  11. Try echo'ing $sql and see what you get, also, are you sure that your form name is "username"? Lastly, are you setting a SESSION variable to username also? In some version of php a session variable can be used as a regular variable, so if $_SESSION["username"] isnt set, then $username would be set to nothing.
  12. Use usort(), and create a function like this: function sort($a, $b) {     if(strlen($a) > strlen($b))     {           $a = 1;     }     else     {           $a = -1     } }
  13. Replace the word York with $team, and if you want numerous dynamic teams I would use a mysql database to store the information.
  14. Or you could also do: echo "<a href='"" . $var . "\">Link</a>";
  15. session_start(); Is that at the top of your file? Also, have you tried echoing the $_SESSION variables? One thing you may want to try is renaming the session info, I think its php 4 that allows session names to be used in the same way as normal variables, so $username and $_SESSION["username"] are the same thing, which is a bad way of programming and stumped me for a while as well.
  16. Alright, as a fun side project I wanted to create a search engine for my gaming website.. where you can put in keywords and it'll search through various games and artlces and give you the results with a relevancy percent. Now I dont want to use google because that would take the fun out of programming it. I had the origional idea just to try to match up the keywords in the titles/categories of the games/articles, and if there were no matches subtract a letter from the end of the keyword and try it again, if the full word matches then each time it attempts it adds 1 to a counter, at the end the counter is divided by the number of results that it matched, so if there was 1 result from a 50% of the letters of a keyword you would get a 50% relevance. But then I started to think, why not have users/writers type in keywords, and use a keyword engine that way? In that sense do something like allow a user to enter a new keyword for the article and in a database have each keyword link to the ID of another article like so: Keyword ID | Keyword | Article ID 1 | metroid | 3 2 | prime | 3 3 | zelda | 1 4 | princess | 1 and so on, then when they search, search the keyword table for the matching keywords and return a link to the article, do this for each keyword. Now eventually theres going to be a lot of articles/games listed, probably in the millions eventually. Do you think this way, or the other way is going to be more efficient/fast? Which way do you think would yield the best results and how do you think I should go about making the relevancy part? Thanks in advance, and please don't say "just use google" that would take the fun out of programming :)
  17. Hmm, you know that might not even work because the entire while loop will be finished by the time the page loads, so you wont see things appear on screen you'll just see them on there already. The only way to do this may be through AJAX.
  18. You can do it with Javascript and the DOM, it's not something that PHP can do it on it's own... PHP is a preprocessing language (IE: It processes before the server is finished) You could add a javascript line to your code that calls a function, say, email()... then it might look like this: [code] function email(email, username) { var myVar = document.getElementById("email"); var txt = document.createTextNode("Successfully emailed " + username + " at the email " + email + "!"); myVar.appendChild(txt); } [/code] Then have: <div id="email"></div> in your HTML and it should show up there. I'm somewhat new to javascript, but if you look up Javascript, the DOM, and appendChild() you'll find what you need. Lastly in you're PHP code just call the function, giving it the username and email in your while loop.. so at the end of the loop after the email has been sent do the following: echo "email(".$email.",".$username.");"; that should call email(email, username); and start the function.
  19. Make sure your CHMOD settings are set to at least 666.
  20. Upgrade to PHP5 and use php.net/simpleXML
  21. Best bet is just to set a certain time limit and unset() the session after that time is up...a session stays active until the browser is closed.
  22. Would it be faster to do it that way or just to use a normalized table with active and inactive letters/numbers?
  23. Im looking for any tutorials, articles, etc on coding things for large user databases... I'm designing a website thats going to have a lot of users sign up for it and I'd like to make it run fast if there were 2.5-3 million users registered, now Im not saying there will be but if I can get it to run fast for that many users, running for a smaller amount should be easy. So, any tips, tuorials, articles, etc?
  24. Stress testing this with 100,000 users, it slows down slightly some more.. the whole thing loads in about 2 seconds but still. I'm thinking that a better way to do this would be to create a new table called Alphabet, then when someone goes to the members page it'll query that table to see something like this: ID - Letter - Active 1 - A - 1 2 - B - 0 3 - C - 1 Etc.. then if its equal to 1, make a link, if not make the text... this would speed things up extremely well but is it the most efficient way to do something when designing for a large user base?
×
×
  • 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.