Jump to content

MichaelMackey

Members
  • Posts

    44
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

MichaelMackey's Achievements

Member

Member (2/5)

0

Reputation

  1. Ah there I go, with the pages being set up automatically having a single GET feature stuck to them it was confusing the program when I tried to add more. I got it working now, thanks for the help guys.
  2. Ah i see, I've been doing this the hard way. I didn't realize the GET method could just be set to replace the POST method, I've been manually assigning the GET variables through the URL.
  3. It's my code and two other peoples. I understand how everything here works, I just don't understand some features of PHP/HTML. For instance my other forms simply submit fine even if they don't have a method listed, I dont know why this one sends me to the index. Edit: I could post the full code if you'd like.
  4. This is the form itself echo '<form name="formDDL" id="formDDL" method="get">'; //This was added in to make the lists easier to read, alternating row colour $count = 0; while(($displaystuff = mysql_fetch_array($results)) && $rowCount <= ($currentPage * 50)) { if($rowCount > (($currentPage -1) * 50)){ //Paging if ($count == 0){echo '<tr bgcolor="#f9f9f9">'; $count = $count + 1;} else {echo '<tr>'; $count = 0;} //To add in the middlename here just add $displaystuff[1] //It was removed by Michael Mackey June 2 2008 to make more room on the page. //June 3 added in wordwrap function instead of substring $tmpname = wordwrap($displaystuff[0]." ".$displaystuff[2], 23, "<br />\n"); if(!empty($displaystuff['email2'])) {$emailadr = $displaystuff['email1']."; ".$displaystuff['email2']; } else {$emailadr = $displaystuff['email1'];} echo '<td> <input id="email" type="checkbox" value="'."$emailadr".'"/></td>'; echo '<td><a href="ad_index.php?kn_mod=edit_contresults&id='.$displaystuff[5].$gradevalue.'">'; echo '<img src="./images/b_edit.png" border="0" align="left" alt="Edit">'; echo '</a></td>'; echo "<td>$serialnum</td>"; echo "<td>$tmpname</td>"; echo "<td style='text-align:center;'>$displaystuff[3]</td>"; // grade $sadress = wordwrap($displaystuff[4], 23, "<br />\n"); echo "<td>$sadress</td>"; echo "<td>$displaystuff[6]</td>"; //echo "<td>$displaystuff[6]</td>"; // city echo (isset($displaystuff[7]) ? "<td style='text-align:center;'>$displaystuff[7]</td>" : "<td style='text-align:center;'>-</td>"); // score //Added in June 2 2008 by Michael Mackey in order to show the contestant awards in the listing $awards = wordwrap($displaystuff[recognition], 23, "<br />\n"); echo "<td>$awards</td>"; echo '</tr>'; } $serialnum++; $rowCount++; //Paging } echo '</form></table>'; This is the javascript that changes the action method of the form before submitting it function newGetValue(newValue, getType){ document.getElementById(getType).value = newValue; //This assigns the url var thisURL = document.getElementById('urlLink').value; //This creates the get string based on the page if(thisURL = 'ad_index.php?kn_mod=resultslist'){ var thisYear = document.getElementById('getYear').value; var thisCity = document.getElementById('getCity').value; var thisGrade = document.getElementById('getGrade').value; var thisScore = document.getElementById('getScore').value; var thisType = document.getElementById('getType').value; var thisAward = document.getElementById('getAward').value; var thisPage = document.getElementById('getPage').value; var thisEmail = document.getElementById('getEmail').value; var thisOrder = document.getElementById('getOrder').value; document.formDDL.action = thisURL + '&year=' + thisYear + '&city=' + thisCity + '&grade=' + thisGrade + '&score=' + thisScore + '&type=' + thisType + '&award=' + thisAward + '&page=' + thisPage + '&email=' + thisEmail + '&order=' + thisOrder; document.formDDL.submit(); } }
  5. Hmm, also the GET doesn't seem to work.... It still sends me back to the index? page. I could post all the code if needed but I don't think it would help too much for this issue. Right now if I had to guess I would say it isn't referencing the action change for the page correctly from the javascript when no POST method is there. Why does it do that? No idea
  6. The page I'm using has many lists and has to be referred back to regularly, with POST it was constantly giving the POST reload warning. Sorry if this was a little vague I'm new to PHP and working with a previously set up system, it's a lot to take in:)
  7. So I've been recently trying to remove POST requirements on some of the pages in the site Im working on. I've managed to remove most of the requirement now, but when I try and remove method=post from the form variables, the page sends me to the ad_index.php? instead of ad_index.php?kn_mod=resultslist after a submit, as it does when method=post is there. Is there something obvious I'm missing here? Thanks.
  8. Ah yes you were right. I had assumed it was something like that but I had been focusing in the wrong areas to fix it, it suddenly clicked when I read what you said. Thanks.
  9. Hi, as the title says I have an issue where I can get the $_GET variable to send the proper item to the URL, but if I try and retrieve it it will fail. So I need to get the value "St.%20John's" from my URL, but the GET can't seem to process it right and returns St.John\ Would the easiest method here just to assign a different value to the apostrophe and then reassign it later, or is there something I can do to get it to work? Thanks
  10. Hi, heres my problem: I have 2 tables I'm joining together. The first table has user information such as their ID, name, etc. The second table has test results for these users, the users can have multiple test results and it is also possible they will have no test results. What determines if a user will have multiple test results is the year on the test (only one test result per user per year). What I'm trying to do is select a list of ALL of the users, and if it's applicable it will also show their result data. What I can't seem to figure out is how to select this data while ignoring the previous years data as well as ensuring all users are in the list even if they have no data. This is what I'm currently trying to work with: SELECT m.idcontestant, r.recognition FROM kn_contestant m LEFT JOIN kn_results_contestant r ON m.idcontestant = r.idcontestant WHERE (r.result_year = 2008 OR r.result_year IS NULL) Any help is appreciated, thanks. Mike
  11. I have the following piece of code that works fine in firefox but IE fails to relocate the page with the new selected score. <a href="javascript://" onclick="document.formDDL.action = 'ad_index.php?selectedScore=' + document.getElementById('selectedScore').value; document.formDDL.submit();">OK</a> Is there something I'm doing here that IE doesn't approve of? Thanks Mike
  12. Hi, I'm having trouble understanding how to get this median to display correctly. I found script that works for a Median but my problem is I need to select from multiple tables and that seems to be whats screwing up my query. This is the query I'm trying to find the median of: SELECT Total FROM kn_contestant INNER JOIN kn_results_contestant ON kn_contestant.idcontestant = kn_results_contestant.idcontestant WHERE kn_contestant.school_grade = 5 ORDER BY Total desc This is what I'm using to do it, but it retrieves 3 identical results and they're noticeably higher than they should be. SELECT Total Median FROM (SELECT a1.idcontestant, a1.Total , COUNT(a1.Total ) Rank FROM kn_results_contestant a1 INNER JOIN kn_contestant b1 ON b1.idcontestant = a1.idcontestant, kn_results_contestant a2 INNER JOIN kn_contestant b2 ON b2.idcontestant = a2.idcontestant WHERE a1.Total < a2.Total OR (a1.Total = a2.Total AND a1.idcontestant <= a2.idcontestant) AND b1.school_grade = 5 AND b2.school_grade = 5 GROUP BY a1.idcontestant, a1.Total ORDER BY a1.Total desc) a3 WHERE Rank = (SELECT (COUNT(*)+1) DIV 2 FROM kn_results_contestant) I would guess there is some easy solution to this, but I've never gone into this type of select before and it's really been a time waster trying to figure out so far. Any help is appreciated, thanks. Mike
  13. Sorry, Essentially I have a few places where there will be two pages. One page has a fair amount of post data on it, and occasionally it will send the user to a new page depending on what they select. The problem is these pages can be accessed from multiple locations so I need the user to just be able to be sent back a page when they are done at the new page. In Firefox this works ok, it gives a post data prompt but it does send them back. In IE though it just won't work and I have to refresh it for it to load the page. This was definitely not something I was thinking about before hand as post data is new to me. I'm working on a system that was previously set up so saying no to POST data is just not an option at this stage, it's used everywhere.
  14. So what's the deal with POST data and Internet Explorer? It doesn't seem to play too friendly with IE and history.back options. What's the best way to deal with this? Everything I try seems to have the same effect and the general impression I get from googling is that short of changing my POST to something like SESSION there isn't much I can do. Any help is appreciated, thanks. Mike
  15. Why do I only figure out these things after I post them! Turns out IE doesn't like 0's in single digits.
×
×
  • 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.