Jump to content

TimUSA

Members
  • Posts

    151
  • Joined

  • Last visited

    Never

Everything posted by TimUSA

  1. thank you for your help, this solved it. believe it or not your explanation was easy to understand as well. thanks for taking the extra time.
  2. turned on joomla's debugging and got this:
  3. im on a virtual server, so no development server and to be honest the php.ini is typically over my head as I am still a rookie. this is from my php.ini: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Error handling and logging ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; error_reporting is a bit-field. Or each number up to get desired error ; reporting level ; E_ALL - All errors and warnings (doesn't include E_STRICT) ; E_ERROR - fatal run-time errors ; E_RECOVERABLE_ERROR - almost fatal run-time errors ; E_WARNING - run-time warnings (non-fatal errors) ; E_PARSE - compile-time parse errors ; E_NOTICE - run-time notices (these are warnings which often result ; from a bug in your code, but it's possible that it was ; intentional (e.g., using an uninitialized variable and ; relying on the fact it's automatically initialized to an ; empty string) ; E_STRICT - run-time notices, enable to have PHP suggest changes ; to your code which will ensure the best interoperability ; and forward compatibility of your code ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup ; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's ; initial startup ; E_COMPILE_ERROR - fatal compile-time errors ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) ; E_USER_ERROR - user-generated error message ; E_USER_WARNING - user-generated warning message ; E_USER_NOTICE - user-generated notice message ; ; Examples: ; ; - Show all errors, except for notices and coding standards warnings ; error_reporting = E_ALL & ~E_NOTICE ; ; - Show all errors, except for notices ; ;error_reporting = E_ALL & ~E_NOTICE | E_STRICT ; ; - Show only errors ; ;error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR ; ; - Show all errors, except coding standards warnings ; ;error_reporting = E_ALL ; Print out errors (as a part of the output). For production web sites, ; you're strongly encouraged to turn this feature off, and use error logging ; instead (see below). Keeping display_errors enabled on a production web site ; may reveal security information to end users, such as file paths on your Web ; server, your database schema or other information. display_errors = On ; Even when display_errors is on, errors that occur during PHP's startup ; sequence are not displayed. It's strongly recommended to keep ; display_startup_errors off, except for when debugging. display_startup_errors = Off ; Log errors into a log file (server-specific log, stderr, or error_log (below)) ; As stated above, you're strongly advised to use error logging in place of ; error displaying on production web sites. log_errors = Off ; Set maximum length of log_errors. In error_log information about the source is ; added. The default is 1024 and 0 allows to not apply any maximum length at all. log_errors_max_len = 1024 ; Do not log repeated messages. Repeated errors must occur in same file on same ; line until ignore_repeated_source is set true. ignore_repeated_errors = Off ; Ignore source of message when ignoring repeated messages. When this setting ; is On you will not log errors with repeated messages from different files or ; source lines. ignore_repeated_source = Off ; If this parameter is set to Off, then memory leaks will not be shown (on ; stdout or in the log). This has only effect in a debug compile, and if ; error reporting includes E_WARNING in the allowed list report_memleaks = On ;report_zend_debug = 0 ; Store the last error/warning message in $php_errormsg (boolean). track_errors = Off ; Disable the inclusion of HTML tags in error messages. ; Note: Never use this feature for production boxes. ;html_errors = Off ; If html_errors is set On PHP produces clickable error messages that direct ; to a page describing the error or function causing the error in detail. ; You can download a copy of the PHP manual from http://www.php.net/docs.php ; and change docref_root to the base URL of your local copy including the ; leading '/'. You must also specify the file extension being used including ; the dot. ; Note: Never use this feature for production boxes. ;docref_root = "/phpmanual/" ;docref_ext = .html ; String to output before an error message. ;error_prepend_string = "<font color=ff0000>" ; String to output after an error message. ;error_append_string = "</font>" ; Log errors to specified file. ;error_log = filename ; Log errors to syslog (Event Log on NT, not valid in Windows 95). ;error_log = syslog
  4. I was able to get my userID and now I am getting empty query results and not sure where this is breaking down, my full code now looks like this: conducttest.php <?php require "library.php"; function conducttest() { //GET JOOMLA USER ID FOR USER $userID = getuserid(); //NEW TESTS QUERY (what purchased test are available for use with 'item_available' == '1' {unused test} and matching current 'user_id') $new_test=new_test_query(); //RESUME TESTS QUERY (what purchased test are available for use with 'item_available' == '1' {unused test} and matching current 'user_id') $resume_test=resume_test_query(); //PART1 SELECT A TEST TO BE USED if(!isset($_POST['select_test'])) { echo ' <form method="post" action="'.$PHP_SELF.'"> <fieldset> <legend>Please Select A Test To Be Used</legend> <table>'; if (empty($new_test)) { echo ' <th colspan="3"align="left">NO NEW TESTS AVAILABLE</th>'; } else { echo ' <th colspan="3"align="left">NEW TESTS AVAILABLE</th> <tr> <td width="75px">SELECT</td> <td width="50px">ID</td> <td width="150px">TEST TYPE</td> <td width="150px">UNIQUE TEST ID</td> <tr>'; foreach ($new_test as $result1) { echo ' <tr> <td><input type="radio" value="' .$result1['Id']. '" name="Id"></td> <td>'.$result1['Id'].'</td> <td>'.$result1['test_name'].'</td> <td>'.$result1['test_number'].'</td> <tr>'; } } echo ' </table> <hr /> <table>'; if (empty($resume_test)) { echo ' <th colspan="3"align="left">NO NEW TESTS AVAILABLE</th>'; } else { echo ' <th colspan="3"align="left">NEW TESTS AVAILABLE</th> <tr> <td width="75px">SELECT</td> <td width="50px">ID</td> <td width="150px">TEST TYPE</td> <td width="150px">UNIQUE TEST ID</td> <tr>'; foreach ($resume_test as $result2) { echo ' <tr> <td><input type="radio" value="' .$result2['Id']. '" name="Id"></td> <td>'.$result2['Id'].'</td> <td>'.$result2['test_name'].'</td> <td>'.$result2['test_number'].'</td> <tr>'; } } echo ' </table> </fieldset> <input type="submit" name="select_test" value="Select" /> </form>'; } else echo'nothong to do yet'; } ?> library.php <?php //GET JOOMLA USER ID & USERNAME FOR LOGGED USER function getuserid() { $userID =& JFactory::getUser(); return $userID->id; } //NEW TESTS QUERY (what purchased test are available for use with 'item_available' == '1' {unused test} and matching current 'user_id') function new_test_query() { $db =& JFactory::getDBO(); $new_test_query = " SELECT * FROM crt_transactions WHERE user_id = ".$userID." AND test_available = '1' ORDER BY test_name, id "; $db->setQuery($new_test_query); $new_test = $db->loadAssocList(); return $new_test; } //RESUME TESTS QUERY (what purchased test are available for use with 'item_available' == '2' {resume test} and matching current 'user_id') function resume_test_query() { $db =& JFactory::getDBO(); $resume_test_query = " SELECT * FROM crt_transactions WHERE user_id = ".$userID." AND test_available = '2' ORDER BY test_name, id "; $db->setQuery($resume_test_query); $resume_test = $db->loadAssocList(); return $resume_test; } ?>
  5. Learning something new here so if anyone can tell me why I this wont return a value? page1.php <?php require "page2.php"; getuserid(); echo $userID; ?> page2.php <?php function getuserid() { $user =& JFactory::getUser(); $userID = $user->id; global $userID; } ?>
  6. thanks for your help that explained it enough for me to sort it.
  7. i am writing this script for use as an include in joomla and the directphp plugin so in my joomla article i have: <?php include 'test/conducttest.php'; conducttest(); ?> Ok now my issue! the form in this function is passing only the values for the last item in the loop rather than for the selected radio item when submitted. so when say for example the radio selected is: ID TEST TYPE UNIQUE TEST ID AVAILABLE 5 Adolescent Clinical 50021629 1 and the last item in the list is: ID TEST TYPE UNIQUE TEST ID AVAILABLE 4 Adult Clinical 12341629 1 When the form is submitted even if the 1st item is selected, it returns the value for the second one. I am sorta new to php so any suggestions will be appreciated. Here is my full code: <?php function conducttest() { //GET JOOMLA USER ID & USERNAME FOR LOGGED USER $user =& JFactory::getUser(); $userID = $user->id; //GET JOOMLA DATABASE OBJECTS $db =& JFactory::getDBO(); //NEW TESTS QUERY (what purchased test are available for use with 'item_available' == '1' {unused test} and matching current 'user_id') $new_query = " SELECT * FROM crt_transactionHistory WHERE user_id = ".$userID." AND item_available = '1' ORDER BY item_name, id "; $db->setQuery($new_query); $new = $db->loadAssocList(); //OPEN TESTS QUERY (what purchased test are available for use with 'item_available' == '2' {resume test} and matching current 'user_id') $resume_query = " SELECT * FROM crt_transactionHistory WHERE user_id = ".$userID." AND item_available = '2' ORDER BY item_name, id "; $db->setQuery($resume_query); $resume = $db->loadAssocList(); //DISPLAY use_test FORM if(!isset($_POST['test'])) { //SELECT FORM: WHICH TEST WOULD YOU LIKE TO USE? echo ' <fieldset> <table> <form method="post" action="'.$PHP_SELF.'">'; if (empty($new)) { echo ' <th colspan="3"align="left">NO NEW TESTS AVAILABLE</th>'; } else { echo ' <th colspan="3"align="left">NEW TESTS AVAILABLE</th> <tr> <td width="75px">SELECT</td> <td width="50px">ID</td> <td width="150px">TEST TYPE</td> <td width="150px">UNIQUE TEST ID</td> <tr>'; foreach ($new as $result1) { echo ' <tr> <td><input type="radio" value="' .$result1['id']. '" name="test_id"></td> <td>'.$result1['id'].'</td> <td><input type="hidden" value="'.$result1['item_name'].'" name="item_name">'.$result1['item_name'].'</td> <td><input type="hidden" value="'.$result1['item_number'].'" name="item_number">'.$result1['item_number'].'</td> <input type="hidden" value="'.$result1['item_available'].'" name="item_available"> <input type="hidden" value="'.$userID.'" name="userID"> <tr>'; } } echo ' </table> <hr /> <table>'; if (empty($resume)) { echo ' <th colspan="3"align="left">NO TESTS TO RESUME</th>'; } else { echo ' <th colspan="3"align="left">RESUME TEST</th> <tr> <td width="75px">SELECT</td> <td width="50px">ID</td> <td width="150px">TEST TYPE</td> <td width="150px">UNIQUE TEST ID</td> <tr>'; foreach ($resume as $result2) { echo ' <tr> <td><input type="radio" value="' .$result2['id']. '" name="test_id"></td> <td>'.$result2['id'].'</td> <td><input type="hidden" value="'.$result2['item_name'].'" name="item_name">'.$result2['item_name'].'</td> <td><input type="hidden" value="'.$result2['item_number'].'" name="item_number">'.$result2['item_number'].'</td> <input type="hidden" value="'.$result2['item_available'].'" name="item_available"> <input type="hidden" value="'.$userID.'" name="userID"> <tr>'; } } echo ' </table> </fieldset> <input type="submit" name="test" value="Conduct Test" /> </form> '; } //NOW A TEST HAS BEEN SELECTED FOR USE if(isset($_POST['test'])) { $test_id = $_POST['test_id']; $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $item_available = $_POST['item_available']; $userID = $_POST['userID']; echo $test_id.'<br />'; echo $item_name.'<br />'; echo $item_number.'<br />'; echo $item_available.'<br />'; echo $userID.'<br />'; //IF THIS IS A NEW TEST... if ($item_available == "1") { echo 'new test'; } //IF WE ARE RESUMING A TEST... elseif ($item_available == "2") { echo 'resume test'; } } } ?>
  8. in the long run i will have probably ended up agreeing with you, so i will go ahead and agree with you now! especially after reading this thread...wow what an idiot! http://www.phpfreaks.com/forums/index.php/topic,192347.0.html Ben: problem is i barely know php, would know where to begin with js!!
  9. Yes but first I want to check if they are empty.
  10. I have a PHP question probably easy but no for me. I am developing an online employment application for my company and i want to require the user to post at least one employment reference. so i have for example $_POST['emp1'] , $_POST['emp1add'] , $_POST['emp1phone'] ect ect ect. Instead of checking each field individually can I do something like this? if (empty($_POST['emp1*'])) { execute code } If not any suggestions?
  11. Hello all. I would normally never do this, but i need some help finishing this code. I just took a new job opening a new nightclub and I am providing the ability to apply for positions online. Unfortunately I am way behind the 8-ball on everything else I have to accomplish to fiinsh this code. I need to add format error checking for each form field, and also need to have it set so the user must select from the drop down boxes, and must fill out at least one employment reference. I have a good start on this, but really need a pro's help to make this fool proof and secure. Anyone care to tackle this? global $scripturl; echo' <style type="text/css"> #formfield { width:90%; border: solid 1px; padding:25px; } </style> <h2 style="color: #EB0105;">The Ottawa Tavern, Inc Express Application</h2>'; function application() { $date = date("Y/m/d"); echo' <form action="'.$scripturl.'?page=7'.$get['page'].'" method="post"> <input name="application" type="hidden" value="TRUE" /> <h3>Personal Information</h3> <div id="formfield"> Date:<br> <input type="text" name="date" READONLY value="' . $date . '" /><hr> Last Name:<br> <input type="text" size="50"name="last" value="'.$_POST['last'].'" /><br> First Name:<br> <input type="text" size="50"name="first"value="'.$_POST['first'].'" /> </div> <br> <div id="formfield"> <div style="padding-right:15px; float:left;"> Street Address:<br> <input type="text" name="street" value="'.$_POST['street'].'" /><br> City:<br> <input type="text" name="city" value="'.$_POST['city'].'" /><br> State:<br> <input type="text" name="state" value="'.$_POST['state'].'" /><br> </div> <div style="float:left;"> Zip Code:<br> <input type="text" name="zip" value="'.$_POST['zip'].'" /><br> Telephone:<br> <input type="text" name="phone" value="'.$_POST['phone'].'" /><br> Email:<br> <input type="text" name="email" value="'.$_POST['email'].'" /><br> </div> <br style="clear:both;"> </div> <br> <div id="formfield"> Position applied for:<br> <input type="text" name="position" value="'.$_POST['position'].'" /><br> Salary desired:<br> <input type="text" name="salary" value="'.$_POST['salary'].'" /> <hr> Are you of legal age to serve alcohol:<br> <select name="age"> <option value="NA" SELECTED>No Answer</option> <option value="Yes">Yes</option> <option value="No">No</option> </select> <hr> I can work nights and weekends:<br> <select name="avail1"> <option value="NA" SELECTED>No Answer</option> <option value="Yes">Yes</option> <option value="No">No</option> </select> <hr> I am available for...<br> <select name="avail2"> <option value="NA" SELECTED>No Answer</option> <option value="Full-Time">Full-Time</option> <option value="Part-Time">Part-Time</option> </select> <hr> Have you ever been convicted of a crime:<br> <select name="crime"> <option value="NA" SELECTED>No Answer</option> <option value="Yes">Yes</option> <option value="No">No</option> </select> <hr> Do you have a valid drivers license:<br> <select name="license"> <option value="NA" SELECTED>No Answer</option> <option value="Yes">Yes</option> <option value="No">No</option> </select> </div> <h3>Employment References</h3> <div id="formfield"> <h4>Employer #1</h4> <div style="padding-right:5px; float:left;"> Name of employer:<br> <input type="text" name="emp1" value="'.$_POST['emp1'].'" /> </div> <div style="padding-right:5px; float:left;"> Address:<br> <input type="text" size="80"name="emp1add" value="'.$_POST['emp1add'].'" /> </div> <div style="float:left;"> Phone:<br> <input type="text" name="emp1phone" value="'.$_POST['emp1phone'].'" /> </div> <br style="clear:both;"> <div style="padding-right:5px; float:left;"> Start date:<br> <input type="text" name="emp1start" value="'.$_POST['emp1start'].'" /> </div> <div style="padding-right:5px; float:left;"> End date:<br> <input type="text" name="emp1end" value="'.$_POST['emp1end'].'" /> </div> <div style="padding-right:5px; float:left;"> Title:<br> <input type="text" name="emp1title" value="'.$_POST['emp1title'].'" /> </div> <div style="padding-right:5px; float:left;"> Supervisor:<br> <input type="text" name="emp1sup" value="'.$_POST['emp1sup'].'" /> </div> <br style="clear:both;"> <div style="padding-right:5px; float:left;"> Reason for leaving:<br> <input type="text" size="80" name="emp1reason" value="'.$_POST['emp1reason'].'" /> </div> <br style="clear:both;"> </div> <br> <div id="formfield"> <h4>Employer #2</h4> <div style="padding-right:5px; float:left;"> Name of employer:<br> <input type="text" name="emp2" value="'.$_POST['emp2'].'" /> </div> <div style="padding-right:5px; float:left;"> Address:<br> <input type="text" size="80"name="emp2add" value="'.$_POST['emp2add'].'" /> </div> <div style="float:left;"> Phone:<br> <input type="text" name="emp2phone" value="'.$_POST['emp2phone'].'" /> </div> <br style="clear:both;"> <div style="padding-right:5px; float:left;"> Start date:<br> <input type="text" name="emp2start" value="'.$_POST['emp2start'].'" /> </div> <div style="padding-right:5px; float:left;"> End date:<br> <input type="text" name="emp2end" value="'.$_POST['emp2end'].'" /> </div> <div style="padding-right:5px; float:left;"> Title:<br> <input type="text" name="emp2title" value="'.$_POST['emp2title'].'" /> </div> <div style="padding-right:5px; float:left;"> Supervisor:<br> <input type="text" name="emp2sup" value="'.$_POST['emp2sup'].'" /> </div> <br style="clear:both;"> <div style="padding-right:5px; float:left;"> Reason for leaving:<br> <input type="text" size="80" name="emp2reason" value="'.$_POST['emp2reason'].'" /> </div> <br style="clear:both;"> </div> <br> <div id="formfield"> <h4>Employer #3</h4> <div style="padding-right:5px; float:left;"> Name of employer:<br> <input type="text" name="emp3" value="'.$_POST['emp3'].'" /> </div> <div style="padding-right:5px; float:left;"> Address:<br> <input type="text" size="80"name="emp3add" value="'.$_POST['emp3add'].'" /> </div> <div style="float:left;"> Phone:<br> <input type="text" name="emp3phone" value="'.$_POST['emp3phone'].'" /> </div> <br style="clear:both;"> <div style="padding-right:5px; float:left;"> Start date:<br> <input type="text" name="emp3start" value="'.$_POST['emp3start'].'" /> </div> <div style="padding-right:5px; float:left;"> End date:<br> <input type="text" name="emp3end" value="'.$_POST['emp3end'].'" /> </div> <div style="padding-right:5px; float:left;"> Title:<br> <input type="text" name="emp3title" value="'.$_POST['emp3title'].'" /> </div> <div style="padding-right:5px; float:left;"> Supervisor:<br> <input type="text" name="emp3sup" value="'.$_POST['emp3sup'].'" /> </div> <br style="clear:both;"> <div style="padding-right:5px; float:left;"> Reason for leaving:<br> <input type="text" size="80" name="emp3reason" value="'.$_POST['emp3reason'].'" /> </div> <br style="clear:both;"> </div> <br> <div id="formfield"> <input type="submit" value="submit" style="padding-right:5px;" /> <input type="reset" value="reset" /> </div> </form>'; } if (!isset($_POST['application'])) { application(); } else { if (isset($_POST['application'])) { $process = true; //check format personal information if (!ereg("[A-Za-z' -]{1,50}", $_POST['last'])) { echo' One or more fields have information that appears to be incorrect. Last Name: '.$_POST['last'].'<br>'; $process = false; } if (!ereg("[A-Za-z' -]{1,50}", $_POST['first'])) { echo' One or more fields have information that appears to be incorrect. First Name: '.$_POST['first'].'<br>'; $process = false; } if (!ereg("[A-Za-z' -]{1,50}", $_POST['city'])) { echo' One or more fields have information that appears to be incorrect. City: '.$_POST['city'].'<br>'; $process = false; } if (!ereg("[A-Za-z' -]{1,50}", $_POST['state'])) { echo' One or more fields have information that appears to be incorrect. State: '.$_POST['state'].'<br>'; $process = false; } if (!ereg("[^0-9]",$_POST['zip'])) { echo' One or more fields have information that appears to be incorrect. Zip: '.$_POST['zip'].'<br>'; $process = false; } if (!ereg("[^0-9]",$_POST['phone'])) { echo' One or more fields have information that appears to be incorrect. Phone: '.$_POST['phone'].'<br>'; $process = false; } $pattern = "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"; if (!eregi($pattern, $_POST['email'])) { echo "You entered an invalid e-mail address<br>"; $process = false; } if ($process == false) { application(); } if ($process == true) { $sendto = "ottawatavern@yahoo.com"; $subject = 'An application for employment has been made by '.$_POST['first'].' '.$_POST['last']; $body = ' An application for employment has been made by '.$_POST['first'].' '.$_POST['last'].' Street: '.$_POST['street'].' City: '.$_POST['city'].' State: '.$_POST['state'].' Zip: '.$_POST['zip'].' Phone: '.$_POST['phone'].' Email: '.$_POST['email'].' Position: '.$_POST['position'].' Salary: '.$_POST['salary'].' Alcohol Service: '.$_POST['age'].' Nights and Weekends: '.$_POST['avail1'].' Availability: '.$_POST['avail2'].' Crime: '.$_POST['crime'].' ---Employment Information--- Empoyer 2: '.$_POST['emp1'].' Address: '.$_POST['emp1add'].' Phone: '.$_POST['emp1phone'].' Start: '.$_POST['emp1start'].' End: '.$_POST['emp1end'].' Title: '.$_POST['emp1title'].' Supervisor: '.$_POST['emp1sup'].' Reason for leaving: '.$_POST['emp1reason'].' ---Employment Information--- Empoyer 3: '.$_POST['emp2'].' Address: '.$_POST['emp2add'].' Phone: '.$_POST['emp2phone'].' Start: '.$_POST['emp2start'].' End: '.$_POST['emp2end'].' Title: '.$_POST['emp2title'].' Supervisor: '.$_POST['emp2sup'].' Reason for leaving: '.$_POST['emp2reason'].' ---Employment Information--- Empoyer 1: '.$_POST['emp3'].' Address: '.$_POST['emp3add'].' Phone: '.$_POST['emp3phone'].' Start: '.$_POST['emp3start'].' End: '.$_POST['emp3end'].' Title: '.$_POST['emp3title'].' Supervisor: '.$_POST['emp3sup'].' Reason for leaving: '.$_POST['emp3reason']; mail($sendto,$subject,$body); echo' Thank you for your application. We will be contacting you soon.<br> This is an express application. If you are contacted for an interview, you will be required to fill out a complete written application.<br>'; } } }
  12. Hello all. I would normally never do this, but i need some help finishing this code. I just took a new job opening a new nightclub and I am providing the ability to apply for positions online. Unfortunately I am way behind the 8-ball on everything else I have to accomplish to fiinsh this code. I need to add format error checking for each form field, and also need to have it set so the user must select from the drop down boxes, and must fill out at least one employment reference. I have a good start on this, but really need a pro's help to make this fool proof and secure. Anyone care to tackle this?
  13. yep tried that just redisplaying the form after submit http://vsk-ayc.totalh.com/Untitled.php
  14. BUMP. Still cant get this to work, when you submit it just redisplays the form
  15. that didnt work either, still just keeps redisplaying the form. have to go to the real job will get back to this later. thanks all!
  16. here is the full code: <?php echo' <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <meta name="author" content="joao casanova"> <style type="text/css"> /*----------Text Styles----------*/ .ws6 {font-size: 8px;} .ws7 {font-size: 9.3px;} .ws8 {font-size: 11px;} .ws9 {font-size: 12px;} .ws10 {font-size: 13px;} .ws11 {font-size: 15px;} .ws12 {font-size: 16px;} .ws14 {font-size: 19px;} .ws16 {font-size: 21px;} .ws18 {font-size: 24px;} .ws20 {font-size: 27px;} .ws22 {font-size: 29px;} .ws24 {font-size: 32px;} .ws26 {font-size: 35px;} .ws28 {font-size: 37px;} .ws36 {font-size: 48px;} .ws48 {font-size: 64px;} .ws72 {font-size: 96px;} .wpmd {font-size: 13px;font-family: \'Arial\';font-style: normal;font-weight: normal;} /*----------Para Styles----------*/ DIV,UL,OL /* Left */ { margin-top: 0px; margin-bottom: 0px; } </style> <style type="text/css"> div#container { position:relative; width: 566px; margin-top: 0px; margin-left: auto; margin-right: auto; text-align:left; } body {text-align:center;margin:0} </style> </head> <script type="text/javascript"> function noSpam() { if (document.getElementById) { var at = "@"; var id = document.getElementById("mail"); var mail = id.firstChild; var domain = id.lastChild; mail.nextSibling.firstChild.innerHTML = at; id.href = "mailto:" + mail.data + at + domain.data; } } </script> <body onload="noSpam()"> <body background="images/background_firstlight.gif" Link="#000080" VLink="#000080" ALink="#000080"> <div id="container"> <div id="text1" style="position:absolute; overflow:hidden; left:0px; top:94px; width:217px; height:130px; z-index:0"><div class="wpmd"> <div><font class="ws11" color="#333333" face="Trebuchet MS"><B>Dr. Harald Schnitzler</B></font></div> <div><font class="ws11" color="#333333" face="Trebuchet MS">Im Schaber 13</font></div> <div><font class="ws11" color="#333333" face="Trebuchet MS">CH-9450 Lüchingen</font></div> <div><font class="ws11" color="#333333" face="Trebuchet MS">Switzerland</font></div> <div><font class="ws11" color="#333333" face="Trebuchet MS"><BR></font></div> <div><font face="Trebuchet MS"><B><BR></B></font></div> <div><font face="Trebuchet MS"><B><BR></B></font></div> <div><font face="Trebuchet MS"><B> </B></font></div> </div></div> <div id="text2" style="position:absolute; overflow:hidden; left:0px; top:0px; width:212px; height:129px; z-index:1"><div class="wpmd"> <div><font class="ws14" face="Trebuchet MS"><B><BR></B></font></div> <div><font class="ws14" face="Trebuchet MS"><B>Contacts</B></font></div> </div></div> <div id="text3" style="position:absolute; overflow:hidden; left:0px; top:296px; width:210px; height:130px; z-index:2"><div class="wpmd"> <div><font class="ws11" color="#333333" face="Trebuchet MS"><B>Markus Wegmann</B></font></div> <div><font class="ws11" color="#333333" face="Trebuchet MS">Ettaler-Str. 5b</font></div> <div><font class="ws11" color="#333333" face="Trebuchet MS">D-86199 Augsburg</font></div> <div><font class="ws11" color="#333333" face="Trebuchet MS">Germany</font></div> <div><font class="ws11" face="Trebuchet MS"><BR></font></div> <div><font face="Trebuchet MS"><B><BR></B></font></div> <div><font face="Trebuchet MS"><B> </B></font></div> </div></div> <div id="image1" style="position:absolute; overflow:hidden; left:0px; top:185px; width:59px; height:18px; z-index:3"><a href="http://www.skype.com/intl/en-gb/" target="_blank"><img src="images/icon_skype.gif" border=0 width=59 height=18></a></div> <div id="text4" style="position:absolute; overflow:hidden; left:64px; top:185px; width:109px; height:20px; z-index:4"><div class="wpmd"> <div><font face="Trebuchet MS">: harald.schnitzler</font></div> </div></div> <div id="image2" style="position:absolute; overflow:hidden; left:0px; top:390px; width:59px; height:18px; z-index:5"><a href="http://www.skype.com/intl/en-gb/" target="_blank"><img src="images/icon_skype.gif" border=0 width=59 height=18></a></div> <div id="text5" style="position:absolute; overflow:hidden; left:64px; top:390px; width:109px; height:20px; z-index:6"><div class="wpmd"> <div><font face="Trebuchet MS">: markuswegmann</font></div> </div></div> <div id="image3" style="position:absolute; overflow:hidden; left:0px; top:214px; width:77px; height:19px; z-index:7"><a href="mailto:info@velumng.com"><img src="images/botaoemail.gif" border=0 width=77 height=19></a></div> <div id="image4" style="position:absolute; overflow:hidden; left:0px; top:419px; width:77px; height:19px; z-index:8"><a href="mailto:info@velumng.com"><img src="images/botaoemail.gif" border=0 width=77 height=19></a></div>'; /////FORM AND PROCESSING///// if (!isset ($_POST['contactform'])) { echo' <form method="POST" name="contactform" action="' .$_SERVER['PHP_SELF']. '"> <textarea name="text" style="position:absolute;width:300px;height:156px;left:266px;top:124px;z-index:10"> </textarea> <input name="name" type="text" style="position:absolute;width:300px;left:266px;top:308px;z-index:11"> <input name="club" type="text" style="position:absolute;width:300px;left:266px;top:355px;z-index:12"> <input name="email" type="text" style="position:absolute;width:300px;left:266px;top:403px;z-index:13"> <input name="submit" type="submit" value="submit" style="position:absolute;left:447px;top:433px;z-index:14"> <input name="reset" type="reset" value=" reset " style="position:absolute;left:509px;top:433px;z-index:15"> </form>'; } else echo 'testing'; /////END FORM AND PROCESSING///// echo' <div id="text6" style="position:absolute; overflow:hidden; left:266px; top:382px; width:129px; height:21px; z-index:16"><div class="wpmd"> <div><font face="Trebuchet MS">email</font></div> </div></div> <div id="text7" style="position:absolute; overflow:hidden; left:266px; top:334px; width:129px; height:21px; z-index:17"><div class="wpmd"> <div><font face="Trebuchet MS">club</font></div> </div></div> <div id="text8" style="position:absolute; overflow:hidden; left:266px; top:287px; width:129px; height:21px; z-index:18"><div class="wpmd"> <div><font face="Trebuchet MS">name</font></div> </div></div> <div id="text9" style="position:absolute; overflow:hidden; left:266px; top:102px; width:220px; height:23px; z-index:19"><div class="wpmd"> <div><font face="Trebuchet MS">your question on</font><font face="Trebuchet MS"><B> </B></font><font color="#000080" face="Trebuchet MS"><B>Velum</B></font><font color="#FF0000" face="Trebuchet MS"><B>NG</B></font><font face="Trebuchet MS">:</font></div> </div></div> </div></body> </html>'; ?>
  17. ok good find, but still not working: if (!isset ($_POST['contactform'])){ echo' <form method="POST" name="contactform" action="' .$_SERVER['PHP_SELF']. '"> <textarea name="text" style="position:absolute;width:300px;height:156px;left:266px;top:124px;z-index:10"> </textarea> <input name="name" type="text" style="position:absolute;width:300px;left:266px;top:308px;z-index:11"> <input name="club" type="text" style="position:absolute;width:300px;left:266px;top:355px;z-index:12"> <input name="email" type="text" style="position:absolute;width:300px;left:266px;top:403px;z-index:13"> <input name="submit" type="submit" value="submit" style="position:absolute;left:447px;top:433px;z-index:14"> <input name="reset" type="reset" value=" reset " style="position:absolute;left:509px;top:433px;z-index:15"> </form>'; } else echo'testing';
  18. This seams ridiculous that this is not working for me, but when submit is done, this is still displaying the form. /////FORM AND PROCESSING if (!isset ($_POST['cantactform'])){ echo' <form method="POST" name="contactform" action="' .$_SERVER['PHP_SELF']. '"> <textarea name="text" style="position:absolute;width:300px;height:156px;left:266px;top:124px;z-index:10"></textarea> <input name="name" type="text" style="position:absolute;width:300px;left:266px;top:308px;z-index:11"> <input name="club" type="text" style="position:absolute;width:300px;left:266px;top:355px;z-index:12"> <input name="email" type="text" style="position:absolute;width:300px;left:266px;top:403px;z-index:13"> <input name="submit" type="submit" value="submit" style="position:absolute;left:447px;top:433px;z-index:14"> <input name="reset" type="reset" value=" reset " style="position:absolute;left:509px;top:433px;z-index:15"> </form>'; } else { echo 'testing'; }
  19. I run a gaming site for a yacht racing simulator. http://vsk-ayc.totalh.com We use a unique scoring system we call a Bonus High Point System to generate the base points for our individual races and series results. it looks something like this: Base Points = [bS] 1st = 50pts 2nd = 47pts 3rd = 44.3pts 4th = 42pts 5th = 40pts 6th = 38pts 7th = (50 - finish position - 6) or 37 *each position after is calculated the same way. These base points are then used to calculate ladder points which I accomplish by using a factor for each race type. Ad Hoc Race Ladder Points = [bS]*1 Match Race Ladder Points = [bS]*2 Club Fleet Race Ladder Points = [bS]*6 Championship Race Ladder Points = [bS]*8 The problem with this system is that it does not reward the best sailor, it rewards the most active player. I need to be able to reward a combination of both! I have tried just averaging the points, but this allows someone who say has only raced 3 races to be ranked higher then someone who has raced 200. So my question is this. Given the know factors that i have [bS], the race type multiplier, ladder points, and number of races, what are your thoughts on how I could best achieve my goal of rewarding the best sailor. btw here is the code i use to generate the ladder results: global $settings; $query = "SELECT pts_table.skipperName, sum(pts_table.fleetPoints) as SumfleetPoints, smf_members.ID_MEMBER, thm.value AS country FROM pts_table LEFT JOIN smf_members ON pts_table.skipperName = smf_members.realName LEFT JOIN smf_themes AS thm ON (thm.ID_MEMBER = smf_members.ID_MEMBER AND thm.ID_THEME = 1 AND thm.variable = 'country') WHERE pts_table.fleetPoints> 0 GROUP BY pts_table.skipperName ORDER BY SumfleetPoints DESC;"; $result = mysql_query($query); if(mysql_num_rows($result)) { echo' <table class = "bordercolor" cellSpacing="1" cellPadding="1" width="100%" border="0"> <tr class ="catbg"> <td width = "100%">Fleet Race Ladder:</td> <tr> </table><br> <table class = "bordercolor" cellSpacing="1" cellPadding="1" width="100%" border="0"> <tr class ="catbg4"> <td width = "5%"></td> <td width = "70%">Skipper Name:</td> <td width = "25%">Ladder Points:</td> </tr> </table>'; $x = 1; while($row = mysql_fetch_row($result)) { echo' <table class = "bordercolor" cellSpacing="1" cellPadding="1" width="100%" border="0"> <tr> <td width = "5%" class = "catbg2"><img src="' . $settings['default_images_url'] . '/flags/' . $row[3] . '.png" /></td> <td width = "70%" class = "titlebg">' . $x++ . ': ' . $row[0] . '</td><br> <td width = "25%" class = "catbg2">' . $row[1] . '</td><br> </tr> </table>'; } }
  20. Ok, I have worked on this a bit and am hoping for some further suggestions for error checking. if(!isset($_POST['Upload'] )) { echo' <table class = "bordercolor" cellspacing="1" cellpadding="1" width="100%" border="0"> <td class ="catbg">SUBMIT SCREENSHOT:</td> </table> <br>'; upload(); } else { if($_FILES['pix']['tmp_name'] == "none") { echo'<p>File did not upload. File size must be less than 500K</p>'; upload(); } if(!ereg("image", $_FILES['pix']['type'])) { echo'<p>File is not a picture. Please try another file.</p>'; upload(); } else { copy ($_FILES['pix']['tmp_name'], "screenshots/".$_FILES['pix']['name']) or die(''$_FILES['pix']['error']''); echo'Your file has uploaded correctly:<br>'; echo $_FILES['pix']['name']; echo'<br>'; echo $_FILES['pix']['size']; } } I am concerned that one particular part may not be correct: Will this work? or die(''$_FILES['pix']['error']'') EDIT: I forgot the function code which displays the form function upload(){ echo' <form name="form1" method="post" action="'.$scripturl.'?page=181'.$get['page'].'" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value="500000"> <input type="file" name="pix"> <br> <input type="submit" name="Upload" value="Upload Picture"> </form>'; }
  21. My max upload is 2mb. The users are uploading screenshots from a game and the now just email me the files instead. the size of the files are all less the 75kb.
×
×
  • 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.