Jump to content

justsomeguy

Moderator
  • Posts

    31,575
  • Joined

  • Last visited

  • Days Won

    77

Everything posted by justsomeguy

  1. The second code will work, but they refer to two different things. IDs work like this: #stylename{ ...}<a id="stylename"></a> Classes work like this: .stylename{ ...}<a class="stylename"></a> Theoretically, with an ID, you are only supposed to have one element on the page that has that ID. But in practice, most browsers will apply the style to all elements with that ID.
  2. justsomeguy

    Center

    In that screenshot it looks like the div on the right is too high, either add a <br> after the top div or giv some more margin.Also, you don't need to make images or banners to fit in 800x600. You can make a banner that will display correctly for both 800 wide or 1600 wide, it will just display less of the image for smaller sizes (but won't scroll). <div style="width: 100%; height: 80px; background-image:url(path/to/image); background-position: center center; background-repeat: no-repeat;"> </div> This will create a div and apply your banner as the background image. It will center the background image in the div (i.e. the center of the image, however big it is, will be in the center of the div). So you can make a large banner, but keep the name smaller than 800px, and center it. On either side of the name you can just put some artwork. If they only see 800px, then they see the name and nothing else. If they are on a larger resolution, then the banner will expand out on either side to show the artwork on the sides, but the title will still be centered.
  3. Just a quick point on this. Most of the time it is not a bug (IE just doesn't support a lot), a lot of the time it's because the CSS spec does not specifically say exactly what to do in every situation, so browser vendors do it how they want or how they think it should be done. Not everyone agrees.
  4. That code will print the page (File -> Print, send it to the printer). If you want to create the page, then that's another story.You need to write a SQL query to get the recordset, loop through the recordset, and display the data however you want, in a table or list or whatever.You need to figure out the requirements of what you want the report to look like, and then make it look like that.
  5. You could create a script or something that runs every hour. You can use Windows Task Scheduler to schedule it to run once an hour. It can check all the dates for all the pages and images, and if any of them were changed in the last hour, it could send out emails to everyone. That's probably the easiest way. If you actually want a popup box to appear on their screen when this happens, then you will need to use the Windows Messenger API to send out those messages, and you would need a language like C++ or something in .NET that would be able to use the API.You can also just create a page that says when the last update was, and the users can check the page as often as they want (or have the page auto-refresh).
  6. You need to put another text box next to the price text box I would assume, and then put a total text box down at the bottom. You have a table in the code, but then everything is in only 1 cell in the table. Use <tr> and <td> to create rows and cells in the table, and put each product on one row. Put the different text boxes and dropdowns in the cells, and then you can put a quantity on the end.You need to add a javascript function that multiplies all the quantities by the prices, and adds them up to calculate total cost. Have that function execute whenever either a dropdown is changed or a quantity is changed. You will also want to disable the price text field so that the user can't change the value.
  7. justsomeguy

    SQL Help needed

    OK, well you don't get one row like that, but you can build it yourself. You will make a query to the database, and get back a bunch of rows, and you can output everything in the same row. I'll give the example in PHP. But this is the query: SELECT * FROM tblText ORDER BY label This will give you a lot of rows. Then you need to loop through the result set, and output the row for each label. When the label changes, you start a new row (for the new label). This is how in PHP: <?php$result = mysql_query("SELECT * FROM tblText ORDER BY label");$last_label = "";while ($row = mysql_fetch_assoc($result)){ if ($row['label'] != $last_label) { echo "<br>"; // new row echo $row['label']; // print the label $last_label = $row['label']; //keep track of the last label } echo $row['text']; // print the text on the row}?> Of course you need some extra formatting in there (spaces between the text, or an html table, whatever), but that's the basic info.
  8. justsomeguy

    Form Problem.

    No problem.I'm not sure what you mean about uploading, I think you're using Dreamweaver to connect and transfer for you though. If you want to use a different FTP client, it will probably be more reliable. I can recommend CoreFTP or FileZilla.
  9. justsomeguy

    Form Problem.

    If you uploaded it, it should have changed. Try uploading again, and look at the size of the source and destination to make sure they are identical, maybe it went to the wrong place last time.Also try emptying your browser cache, IE is notorious for insisting on using the cache and refusing to get an updated page. I don't have much experience with Firefox, but Opera seems good about getting a new copy if I'm insistent enough.Also, I didn't know you wanted a 1-line text field. You can replace the text area with this if you only need 1 line: <input type="text" name="textarea" size="40" id="reason">
  10. c.f. this post: http://w3schools.invisionzone.com/index.ph...indpost&p=19329When I posted reply #11, I received a db error when it tried to send the other guy an email. It did post my message. I didn't copy and paste the message, but it was a SQL syntax error saying it couldn't understand this:t be able to edit this \\n\ challengeIf you see the code in the post, there are some escaped single quotes that probably messed up the SQL statement, I would assume.
  11. There was a database error when it tried to email you to notify about the reply apparently, so this should send another email.
  12. OK, well if you're getting the correct ID then it doesn't matter how it's getting retrieved, as long as it is.I found the problem, the query to select the challenge that was clicked on was not using the ID that was passed to it, it was always getting the first challenge that the user was in (probably copied and pasted the SQL statement that lists all the challenges). I also cleaned up the code and reformatted it so it's a little easier to read. // edits challengesfunction editChallenges($user){ global $bordercolor1, $tablebg1, $submit, $cid, $decline, $idc, $matchdate, $matchreplay, $mapused, $personwon, $deletethis; echo "<table align='center' border='1' cellspacing='0' cellpadding='0' bordercolor='{$bordercolor1}' width='500'> <tr><td background='{$tablebg1}' class='main' align='center'><b>Edit Challenges</b></td></tr>"; if($decline) { echo "<script language='javascript'> if(!confirm('Do really want to decline? You won\'t be able to edit this \\n\ challenge after you decline.')) { window.location = 'console.php?p=EditChallenges&cid={$idc}' } </script>"; $query = "UPDATE challanges SET declined = '{$user}' WHERE id = '{$idc}'"; mysql_query($query) or die(mysql_error()); echo "<script language=\"Javascript\"> alert(\"Success!\"); window.location.href = 'console.php'; </script>"; } if($submit) { $query = "UPDATE challanges SET date = '{$matchdate}', replay = '{$matchreplay}', map = '{$mapused}', winner = '{$personwon}' WHERE id = '{$idc}'"; mysql_query($query) or die(mysql_error()); echo "<script language=\"Javascript\"> alert(\"Success!\"); window.location.href = 'console.php'; </script>"; } if($deletethis) { deleteStuff("challanges", $idc, 112188); } if ($cid == "") { echo "<tr><td class='small'><br> <blockquote> This is where you can edit your challenges. If no challenges are shown that means no one has challenged you <b>OR</b> you have declined from a challange making you unable to now edit it. <br><br>"; $query = "SELECT * FROM challanges WHERE (challanger = '{$user}' OR challanged = '{$user}') AND declined != '{$user}' ORDER BY id DESC"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_assoc($result)) { echo "<a href='console.php?p=EditChallenges&cid={$row['id']}'>{$row['challanger']} vs. {$row['challanged']}</a> - {$row['date']}<br>"; } echo " </blockquote> </td></tr> "; } else { $query = "SELECT * FROM challanges WHERE id={$cid}"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_assoc($result); if ($row['declined'] == "") { $wannadecline = "<center><input type='submit' name='decline' value='Decline' class='lp'></center><br>"; $wannadelete = ""; } else { $wannadelete = "<center><input type='submit' name='deletethis' value='Delete' class='lp'></center><br>"; $wannadecline = ""; } echo "<tr><td class='small'><form action='console.php?p=EditChallenges&cid={$row['id']}' method='post'> <blockquote><br> <center><b>{$row['challanger']}</b> vs. <b>{$row['challanged']}</b></center><br><br> <input type='hidden' name='idc' value='{$row['id']}'> <b>Date:</b> <input type='text' name='matchdate' value='{$row['date']}' class='textarea'><br> <b>Map:</b> <input type='text' name='mapused' value='{$row['map']}' class='textarea'><br> <b>Winner:</b> <input type='text' name='personwon' value='{$row['winner']}' class='textarea'><br> <b>Replay:</b> <input type='text' name='matchreplay' value='{$row['replay']}' class='textarea'><br><br> {$wannadelete} {$wannadecline} <center><input type='submit' name='submit' value='Submit' class='lp'></center> </form> </td></tr>"; } echo "</table>";}// end editChallenges
  13. justsomeguy

    Form Problem.

    You can do that with a little javascript. <input type="radio" name="CVreference" value="other" onclick="jump_to_element('reason')">Other<br><textarea id="reason" rows="3" cols="40"></textarea><script type="text/javascript">function jump_to_element(elId){ document.getElementById(elId).focus();}</script> Notice here that the textarea has an id ("reason"), which is used by the javascript function getElementById. That function gets the name "reason" from the "onclick" in the radio button. Let me know if that's confusing.
  14. justsomeguy

    Form Problem.

    You need to add a "value" to each of the radio buttons. This entire list needs to be reformatted. All the radio buttons need the same "name" attribute, but each one needs a different "value" attribute. Like this: <input type="radio" name="CVreference" value="something">Something<br><input type="radio" name="CVreference" value="another">Another<br><input type="radio" name="CVreference" value="other">Other<br> Notice that they all have the same "name", and that the "value" is different for each. Then in the PHP page, when you get the value of the radio button from $_POST, it will equal the value of whatever they chose.The way you have it set up now, none of the radio buttons have a name at all, and some have a value and some have an id.Edit: I'm retarded, they do all have a name. But they each need a value, delete the ids.
  15. There's still something missing, which might be the problem. In the edit challenges function, you have a list of global variables at the top. One of the global variables is $cid, which is the id number of the challenge that was clicked on. But I don't see the section where $cid is being saved from the previous page (when you click on it). I see it getting passed along to the next page, but I don't see it being retrieved anywhere. Do a search in the console.php page, and search for $cid. Look for a line where you see $cid on the left side of the equals:$cid = xxxxxor something similar. Or maybe a function call likegetvalue("cid", $cid);Another thing you can do to verify that $cid is actually storing a value is echo $cid right after the function starts. After the global line in the editchallenges function, write this: echo "<script type=\"text/javascript\">alert(\"cid: {$cid}\");</script>"; Click on one of the links and make sure the value matches what you see in the address bar. If the address bar says "console.php?p=EditChallenges&cid=13", then the value of cid you see should also be 13.
  16. Well, the CID is unique. The code you originally gave doesn't get the CID though, it is using a global variable. Post the console.php or whichever section gets the CID, it might be overwritten by something else, or it might not be getting retrieved correctly in the first place.
  17. Also, if this is running online, a link would be helpful, or also just post the generated HTML. Verify that each link ID is actually different.
  18. I need more info, what happens when you try it? What do you mean it doesn't work.This is an easy problem, it's not complex. You want to click on a link with an ID in the querystring, and load some information about the ID on the next page. There 3 parts to this problem.The first one is the database. You need an ID column that is unique (I assume you have that set up correctly).The second one is the page to output all of the items, where you click. That's like this: $result = mysql_query("SELECT id, name FROM items ORDER BY id ASC");while ($row = mysql_fetch_assoc($result)){ echo "<a href=\"page.php?id={$row['id']}\">{$row['name']}</a><br>";} The third one is the lookup page that receives the ID and displays the item. That's like this: $id = $_GET['id'];$row = mysql_fetch_assoc(mysql_query("SELECT * FROM items WHERE id={$id}"));echo $row['name'] . " " . $row['info'] . "<br>"; //etc Your original problem stated that you always get the info for id2, meaning that you are either outputting id2 for all links, or you always set the id to id2 before you get the info.Post what code you are using now, and detail what the problem is (and any error messages) and I'll do what I can.
  19. You didn't actually say what the problem was. There aren't any details about which DDL commands, what the program does, what tables you are creating, what specifically you do that causes an error, or what the error is.Also, I think people tend to react negatively when you say your request is urgent. It's not urgent to us, it's urgent to you, I think people tend to brush those things off.
  20. justsomeguy

    SQL Help

    Sure man, you can do whatever you want. But it will take two queries (one for the first sum and one for the second).Select Sum(Amount) from table where RDate between '01-07-2006' and '08-07-2006'Select Sum(Amount) from table where RDate between '09-07-2006' and '20-07-2006'Is there some reason you need them both in the same query?
  21. There are several differences between postgreSQL and MySQL, but most of them are relatively minor things that most people don't get involved with, like triggers and views. The newest versions of MySQL have added a lot of the features that were missing. The different databases also handle different data sizes better or worse, but there are people on both sides who will argue which one is better. Both of them are free, both are open source, both of them are fast, both of them are stable. There's little difference to which one you use in most situations, if you are using a database wrapper like Pear or something you build yourself you can basically switch between them without having to change your code.And yes, PHP also supports postgres:http://us2.php.net/manual/en/ref.pgsql.phpAlso, that link above that is pro-postgreSQL is obviously biased: Calling your competition a hack and using the punctuation "!?!" anywhere tells you that these guys are out to pimp postgres. In all actuality, you can pretty much use whichever one your server supports (or flip a coin if you want) and not see much of a difference, unless maybe you're building the next amazon.com or something. BTW, I think both amazon and yahoo use PHP/MySQL.Edit: here's a comparison of the two:http://www.databasejournal.com/features/my...cle.php/3288951I'm not sure about Amazon, but I know that places like Google, Slashdot, LiveJournal, etc use MySQL. Here is their customer list:http://www.mysql.com/customers/And here it is for postgres:http://www.postgresql.org/about/usersI think this is funny:LAMP (Linux/Apache/Middleware(Perl,PHP,Python,Ruby)/PostgreSQLApparently now the 'M' is middleware, and the 'P' is postgres. I thought it was Linux/Apache/MySQL/PHP.
  22. justsomeguy

    query problem

    Well you're just selecting tblRating.Count, you aren't calculating it. You are calculating RatingCount by adding up the the number of times you see AIM_ACHIEV.RATING.I took the liberty to format this thing, all the inline inner joins make it difficult to read. And there are a lot of parentheses in there you don't need. What are you trying to do, get the number of times each distinct description appears? SELECT DISTINCT tblRating.Description, Count(AIM_ACHIEV.RATING) AS RatingCount, tblRating.CountFROM ( AIM INNER JOIN ( ( ( ( AIM_ACHIEV INNER JOIN AIM_OBJ_DELIV ON AIM_ACHIEV.OUTPUT_ID = AIM_OBJ_DELIV.ID ) INNER JOIN tblRating ON AIM_ACHIEV.RATING = tblRating.Rating ) INNER JOIN AIM_OBJ ON AIM_OBJ_DELIV.STRATEGY_ID = AIM_OBJ.ID ) INNER JOIN KEYCOUNCIL ON AIM_OBJ.KCID = KEYCOUNCIL.ID ) ON AIM.ID = KEYCOUNCIL.AIM_ID) INNER JOIN CSF ON AIM.CSF_ID = CSF.IDWHERE ( ((FinYearQuarter([QTRDATE]))=[Quarter]) AND ((AIM_OBJ_DELIV.STATUS)=-1) AND ((AIM_OBJ.CORPORATEPLAN)=-1) ) OR (((AIM_OBJ.AIPLAN)=-1))GROUP BY tblRating.Description, tblRating.Count, CSF.IDHAVING (((CSF.ID)=[ThemeID]))ORDER BY tblRating.Count;
  23. justsomeguy

    SQL Help needed

    What are you trying to do? What is the relationship between text1 and text2? Are you saying you want to get all text fields that have the same label?
  24. justsomeguy

    easyphp help

    Here's one example of what I'm talking about:sshd: Authentication Failures: root (218.188.2.148 ): 7 Time(s) root (103-mo5-2.acn.waw.pl ): 2 Time(s) unknown (218.188.2.148 ): 268 Time(s) admin (200.242.79.172 ): 1 Time(s) unknown (200.242.79.172 ): 2 Time(s) unknown (bsn-95-249-239.dsl.siol.net ): 1 Time(s) lp (218.188.2.148 ): 1 Time(s) root (218.63.200.199 ): 8 Time(s)We can see where some of these IPs are located:IP: 218.188.2.148Country: Hong KongCity: Hong Kong, Hong Kong (Sar)IP: 200.242.79.172Country: BrazilCity: UnknownIP: 218.63.200.199Country: ChinaCity: Yunnan, Yunnansiol.net is located in Slovenia, and waw.pl is obviously Polish. I doubt you want to let these people access your self-configured Windows machine. Some script kiddie from HK trying to log in under 268 different accounts isn't looking to do me any good. Server admins make very good money, and the reason they make good money isn't because servers are easy to lock down, let alone home Windows machines.If you DO install a test server at your home, it is a good idea to start up the server, and from the same machine, go to grc.com and run a Shields UP test. If your computer responds on port 80 (or really any port for that matter), shut down the server immediately and reconfigure your firewall before running the server again.This isn't something you want to be naive about.
  25. justsomeguy

    easyphp help

    EasyPHP is a development tool, it should not be used to host or support anything online. That's what actual webservers are for. If you intend on hosting internet content on your home computer, the first thing you need is a static IP address. Most ISPs charge considerably more for a static IP address (such as a T1; cable, DSL, modems etc are generally not static), but that depends on where you live.EasyPHP is intended to make installing and setting up a development server easy (hence the name). The alternative to this is something like I have running at home. My computer there is running Microsoft's webserver software (IIS), and I manually installed and configured PHP, MySQL, and phpMyAdmin. It takes a bit of work to do, which is why EasyPHP exists. But even so, I wouldn't even think of opening up my network to incoming internet traffic, a quick look at the server logs at work that show hundreds of login requests from China and South America tells me that I want to worry about development, not securing my server against foreign hackers that I have no legal recourse against.
×
×
  • Create New...