Ninjakreborn
Members-
Posts
3,922 -
Joined
-
Last visited
Everything posted by Ninjakreborn
-
Problem reading array's, validation's not working.
Ninjakreborn replied to Ninjakreborn's topic in PHP Coding Help
anybody? -
Problem reading array's, validation's not working.
Ninjakreborn replied to Ninjakreborn's topic in PHP Coding Help
I am running into a few problem's currently, this isn't working the way I need. First I have to get validation down, then I have to get it to prefill back out the one's that were selected. For now, the problem I am currently having is ok if you look below you see on post 3, this is where the form itself is, and where I name the array's then if you look on post 4 you see where I am attempting to validate the data. At first I thought it was working, but it now doesn't care whether one of the fields of classification are field out or not, that is the first thing, Ihave to test whether one within that array was set. I tried the obvious but it's not reading it right, it doesn't seem to care whether it's set or not, either way it's telling me they didn't check "anything" within classification. THe next thing, is I had it set up, to test the array for the existence of the variable other, and a few other's but this is just an example, if other was selected the field should be required, it's not seeming to read that right either, as it's not even returning to me a message in my error handler when other or another one that I need to validate is checked. These are just 2 of the problem's I am currently having, so it seems like I am not creating, or accessing the array's properly. I think once I get help with this, then I will know then how to access them, and be able to get the rest working. post 3 [code]<?php require_once("../master/config/config.php")?> <?php if ($_SESSION['controller'] == true) { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php require_once($docroot . "/master/includes/meta.inc.php"); ?> <style type="text/css"> .labelform3 { text-align:center; } .test { width:600px; } #frontendformdiv3logo { width:600px; } #frontendformdiv3 { width:600px; } </style> </head> <body id="admin"> <div id="frontendformdiv3logo"><p>Event Incident Accident Report</p></div> <div id="frontendformdiv3"> <p>(*required field)</p> <p><a href="/eventaccident/cleardata.php" title="Clear Data">Clear Data, and return to panel</a> </p> <?php if ($_GET['get'] != "yes") { if (isset($_POST['submit']) || isset($_GET)) { $errorhandler = ""; $reg = "/^(0[1-9]|1[012])[\\/-](0[1-9]|[12][0-9]|3[01])[ \\/-](19[0-9]{2}|2[0-9]{3})$/"; if ($_POST['eventdate'] == "") { $errorhandler .= "Event Date was left blank.<br />"; } if (isset($_POST['eventdate'])) { if (!preg_match($reg, $_POST['eventdate'])) { $errorhandler .= "Event date was invalid. (mm/dd/yyyy)<br />"; } } if ($_POST['eventtime'] == "") { $errorhandler .= "Event Time was left blank.<br />"; } if (isset($_POST['eventtime'])) { if (!is_numeric($_POST['eventtime'])) { $errorhandler .= "Event time must be number only. Military Time format(0000)<br />"; } } if ($_POST['flightnumber'] == "") { $errorhandler .= "Flight Number was left blank.<br />"; } if ($_POST['scheduleddepartureairport'] == "") { $errorhandler .= "Scheduled Departure Airport was left blank.<br />"; } if ($_POST['scheduledarrivalairport'] == "") { $errorhandler .= "Scheduled Arrival Airport was left blank.<br />"; } if ($_POST['captain'] == "") { $errorhandler .= "Captain was left blank.<br />"; } if ($_POST['pax'] == "") { $errorhandler .= "Pax was left blank.<br />"; } errorhandler($errorhandler); if ($errorhandler != "") { echo "<br />"; $_SESSION['temp']['aircraftnumber'] = stripslashes($_POST['aircraftnumber']); $_SESSION['temp']['eventdate'] = stripslashes($_POST['eventdate']); $_SESSION['temp']['eventtime'] = $_POST['eventtime']; $_SESSION['temp']['flightnumber'] = $_POST['flightnumber']; $_SESSION['temp']['scheduleddepartureairport'] = $_POST['scheduleddepartureairport']; $_SESSION['temp']['scheduledarrivalairport'] = $_POST['scheduledarrivalairport']; $_SESSION['temp']['captain'] = $_POST['captain']; $_SESSION['temp']['firstofficer'] = $_POST['firstofficer']; $_SESSION['temp']['flightattendant'] = $_POST['flightattendant']; $_SESSION['temp']['additionalcrewmembers'] = $_POST['additionalcrewmembers']; $_SESSION['temp']['weather'] = $_POST['weather']; $_SESSION['temp']['flightplan'] = $_POST['flightplan']; $_SESSION['temp']['pax'] = $_POST['pax']; $_SESSION['temp']['lapchildren'] = $_POST['lapchildren']; echo "<p>The link below will allow you to edit the fields. Please note"; echo "That the fields you filled out on the first page where saved, the below link "; echo "only makes you return to the previous page.</p>"; echo "<a href=\"/eventaccident/eventincidentaccidentform2.php?get=yes\" title=\"Return and fix errors\">Return And Fix Errors</a>"; }else { $_SESSION['temp']['aircraftnumber'] = stripslashes($_POST['aircraftnumber']); $_SESSION['temp']['eventdate'] = stripslashes($_POST['eventdate']); $_SESSION['temp']['eventtime'] = $_POST['eventtime']; $_SESSION['temp']['flightnumber'] = $_POST['flightnumber']; $_SESSION['temp']['scheduleddepartureairport'] = $_POST['scheduleddepartureairport']; $_SESSION['temp']['scheduledarrivalairport'] = $_POST['scheduledarrivalairport']; $_SESSION['temp']['captain'] = $_POST['captain']; $_SESSION['temp']['firstofficer'] = $_POST['firstofficer']; $_SESSION['temp']['flightattendant'] = $_POST['flightattendant']; $_SESSION['temp']['additionalcrewmembers'] = $_POST['additionalcrewmembers']; $_SESSION['temp']['weather'] = $_POST['weather']; $_SESSION['temp']['flightplan'] = $_POST['flightplan']; $_SESSION['temp']['pax'] = $_POST['pax']; $_SESSION['temp']['lapchildren'] = $_POST['lapchildren']; $show = true; } } }else { $show = true; } ?> <?php if ($show == true) { ?> <form name="form3" id="form3" action="eventincidentaccidentform4.php" method="post"> <table class="test"> <tr> <td colspan="4" style="text-align:left;"><h2>Action Taken(Select all that apply)</h2></td> </tr> <?php echo "<tr>"; select("actiontaken[abortedtakeoff]", "Aborted Takeoff", "abortedtakeoff"); select("actiontaken[cancelledflight]", "Cancelled Flight", "cancelledflight"); echo "</tr>"; echo "<tr>"; select("actiontaken[declaredemergency]", "Declared Emergency", "declaredemergency"); select("actiontaken[delayedflight]", "Delayed Flight", "delayedflight"); echo "</tr>"; echo "<tr>"; select("actiontaken[diversion]", "Diversion", "diversion"); select("actiontaken[goaround]", "Go Around", "goaround"); echo "</tr>"; echo "<tr>"; select("actiontaken[groundaircraftatoutstation]", "Ground AirCraft At Outstation", "groundaircraftatoutstation"); select("actiontaken[inflightshutdown]", "In Flight Shutdown", "inflightshutdown"); echo "</tr>"; echo "<tr>"; select("actiontaken[missedapproach]", "Missed Approach", "missedapproach"); select("actiontaken[returnaircrafttomaintenance]", "Return Aircraft To Maintenance", "returnaircrafttomaintenance"); echo "</tr>"; echo "<tr>"; select("actiontaken[returntogate]", "Return To Gate", "returntogate"); select("actiontaken[turnback]", "Turn Back", "turnback"); echo "</tr>"; ?> <tr><td colspan="4"><hr /></td></tr> <tr> <td colspan="4" style="text-align:left;"><label for="phaseofflight"><h2>Phase Of Flight:(Select One)</h2></label></td> </tr> <tr> <td colspan="4"><select name="phaseofflight" id="phaseofflight"> <option selected="selected">Please Select One!</option> <option>Fueling</option> <option>Towing</option> <option>Pre Flight</option> <option>Boarding</option> <option>Taxi Out</option> <option>Runup</option> <option>Takeoff</option> <option>Climb</option> <option>Cruise</option> <option>Holding</option> <option>Decent</option> <option>Approach</option> <option>Landing</option> <option>Taxi In</option> <option>Parking</option> <option>Deplanning</option> <option>Post Flight</option> </select></td> </tr> <tr><td colspan="4"><hr /></td></tr> <tr> <td colspan="4" style="text-align:left;"><h2>Classification(Select all that apply)</h2></td> </tr> <?php echo "<tr>"; select("classification[aircraftdamage]", "Aircraft Damage", "aircraftdamage"); select("classification[aircraftonrunway]", "Aircraft On Runway", "aircraftonrunway"); echo "</tr>"; echo "<tr>"; select("classification[aircraftlogsmanualsorphase]", "Aircraft Logs / Manuals / Phase (missing, incomplete, inaccurate)", "aircraftlogsmanualsorphase"); select("classification[airportclosure]", "Airport Closure", "airportclosure"); echo "</tr>"; echo "<tr>"; select("classification[alternatorfailure]", "Alternator Failure", "alternatorfailure"); select("classification[atcdelay]", "ATC Delay", "atcdelay"); echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"><p style=\"padding-bottom:0px; margin-bottom:0px; text-align:left;\"><b>Avionics Failure</b></p></td>"; echo "</tr>"; echo "<tr>"; select("classification[avionicsfailure-communication]", "Communication", "communication"); echo "<td></td>"; echo "<td></td>"; echo "</tr>"; echo "<tr>"; select("classification[avionicsfailure-navigation]", "Navigation", "navigation"); echo "<td></td>"; echo "<td></td>"; echo "</tr>"; echo "<tr><td colspan=\"4\"> </td></tr>"; echo "<tr>"; select("classification[battery]", "Battery", "battery"); select("classification[birdstrike]", "Bird Strike", "birdstrike"); echo "</tr>"; echo "<tr>"; select("classification[brakefailure]", "Brake Failure", "brakefailure"); select("classification[collision]", "Collision (Aircraft Or Object)", "collision"); echo "</tr>"; echo "<tr>"; select("classification[crewincapacitation]", "Crew Incapacitation", "crewincapacitation"); select("classification[debrisonrunway]", "Debris On Runway", "debrisonrunway"); echo "</tr>"; echo "<tr>"; select("classification[deviationofatcinstructions]", "Deviation Of ATC Instructions", "deviationofatcinstructions"); select("classification[distruptiveorsickpassenger]", "Disruptive/Sick Passenger", "disruptiveorsickpassenger"); echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"> </td>"; echo "</tr>"; echo "<tr>"; select("classification[doorwarning]", "Door Warning", "doorwarning"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; text("classification[doorwarningwhichone]", "Which Door?", 200, ""); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"> </td>"; echo "</tr>"; echo "<tr>"; select("classification[dooropening]", "Door Opening", "cdooropening"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; text("classification[dooropeningwhichone]", "Which Door?", 200, ""); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"> </td>"; echo "</tr>"; echo "<tr>"; select("classification[electricalfailure]", "Electrical Failure", "electricalfailure"); select("classification[emergencyevacuation]", "Emergency Evacuation", "emergencyevacuation"); echo "</tr>"; echo "<tr>"; select("classification[enginefailure]", "Engine Failure", "enginefailure"); select("classification[enginefire]", "Engine Fire", "enginefire"); echo "</tr>"; echo "<tr>"; select("classification[fireorsmokeincabin]", "Fire/Smoke In Cabin", "fireorsmokeincabin"); select("classification[flapfailure]", "Flap Failure", "flapfailure"); echo "</tr>"; echo "<tr>"; select("flattire", "Flat Tire", "flattire"); select("flightcontrolfailure", "Flight Control Failure", "flightcontrolfailure"); echo "</tr>"; echo "<tr>"; select("classification[fuelleak]", "Fuel Leak", "fuelleak"); select("classification[fuelquantity]", "Fuel Quantity", "fuelquantity"); echo "</tr>"; echo "<tr>"; select("classification[hardlanding]", "Hard Landing", "hardlanding"); select("classification[icing]", "Icing", "icing"); echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\" style=\"text-align:left;\"><p><b>Instrument Failure?</b></p></td>"; echo "</tr>"; echo "<tr>"; select("classification[flightinstrument]", "Flight Instrument", "flightinstrument"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; text("classification[flightinstrumentwhich]", "Which One?", 200, ""); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[engineinstrument]", "Engine Instrument", "engineinstrument"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; text("classification[engineinstrumentwhich]", "Which One?", 200, ""); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr><td colspan=\"4\"> </td></tr>"; echo "<tr>"; echo "<td><label for=\"landinggear\"><b>Landing Gear</b></label></td>"; echo "<td></td><td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[blowdown]]", "Blow Down", "blowdown"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[failtoextend]]", "Fail To Extend", "failtoextend"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[failtoretract]]", "Fail To Retract", "failtoretract"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[hydraulicleak]]", "Hydraulic Leak", "hydraulicleak"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[hydraulicsystelfailure]]", "Hydraulic System Failure", "hydraulicsystelfailure"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[landinggear[indicationfailure]]", "Indication Failure", "indicationfailure"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"> </td>"; echo "</tr>"; echo "<tr>"; select("classification[lighteningstrike]", "Lightening Strike", "lighteningstrike"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[magnetofailedorrough]", "Magneto (Failed Or Rough):", "magnetofailedorrough"); select("classification[nearmidaircollission]", "Near Mid-Air Collission", "nearmidaircollission"); echo "</tr>"; echo "<tr>"; select("classification[paxinjury]", "Pax Injury", "paxinjury"); select("classification[propstrike", "Prop Strike", "propstrike"); echo "</tr>"; echo "<tr>"; select("classification[roughengine]", "Rough Engine", "roughengine"); select("classification[runwayincursion]", "Runway Incursion", "runwayincursion"); echo "</tr>"; echo "<tr>"; select("classification[starterfailureorwarning]", "Starter (Failure Or Warning)", "failureorwarning"); select("classification[tailstrike]", "Tail Strike", "talestrike"); echo "</tr>"; echo "<tr>"; select("classification[turbulence]", "Turbulence", "turbulence"); select("classification[vacuumfailure]", "Vacuum Failure", "vacuumfailure"); echo "</tr>"; echo "<tr>"; select("classification[waketurbulence]", "Wake Turbulence", "waketurbulence"); select("classification[weatherbelowminimums]", "Weather Below Minimums", "weatherbelowminimums"); echo "</tr>"; echo "<tr>"; select("classification[weatherbelowhighminimums]", "Weather Below High Minimums", "weatherbelowhighminimums"); select("classification[weightandbalance]", "Weight And Balance", "weightandbalance"); echo "</tr>"; echo "<tr>"; select("classification[windshear]", "Wind Shear", "windshear"); echo "<td></td><td></td>"; echo "</tr>"; echo "<tr>"; select("classification[other]", "Other", "cother"); echo "<td colspan=\"2\"></td>"; echo "</tr>"; echo "<tr>"; text("classification[othertext]", "Required(if selected)", 200, ""); echo "<td colspan=\"2\"></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"> </td>"; echo "<tr>"; echo "<td colspan=\"4\"><label for=\"description\">Brief Description:</label></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"><textarea name=\"description\" id=\"description\" cols=\"30\" rows=\"10\"></textarea></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"4\"><input name=\"submit\" id=\"submit\" type=\"submit\" value=\"Continue\" /> <input name=\"clear\" id=\"clear\" type=\"reset\" value=\"Clear\" /></td>"; echo "</tr>"; ?> </table> </form> <?php } ?> </div> </body> </html> <?php }else { header("Location: /index.php"); } ?>[/code] post 4 [code]<?php require_once("../master/config/config.php")?> <?php if ($_SESSION['controller'] == true) { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php require_once($docroot . "/master/includes/meta.inc.php"); ?> <style type="text/css"> .labelform3 { text-align:center; } .test { width:600px; } #frontendformdiv3logo { width:600px; } #frontendformdiv3 { width:600px; } </style> </head> <body id="admin"> <div id="frontendformdiv3logo"><p>Event Incident Accident Report</p></div> <div id="frontendformdiv3"> <p>(*required field)</p> <p><a href="/eventaccident/cleardata.php" title="Clear Data">Clear Data, and return to panel</a> </p> <?php if (isset($_POST['submit']) || isset($_GET)) { $errorhandler = ""; if (!is_array($_POST['classification'])) { $errorhandler .= "You have to check atleast one of the classifications.<br />"; } if (isset($_POST['classification[doorwarning]'])) { if ($_POST['classification[doorwarningwhichone]'] == "") { $errorhandler .= "If Door Warning is selected, the text box must also<br />"; $errorhandler .= "be filled in.<br />"; } } if (isset($_POST['classification[dooropening]'])) { if ($_POST['classification[dooropeningwhichone]'] == "") { $errorhandler .= "If Door Opening is selected, the text box must also<br />"; $errorhandler .= "be filled in.<br />"; } } if (isset($_POST['classification[flightinstrument]'])) { if ($_POST['classification[flightinstrumentwhich]'] == "") { $errorhandler .= "If Door Opening is selected, the text box must also<br />"; $errorhandler .= "be filled in.<br />"; } } if (isset($_POST['classification[engineinstrument]'])) { if ($_POST['classification[engineinstrumentwhich]'] == "") { $errorhandler .= "If Door Opening is selected, the text box must also<br />"; $errorhandler .= "be filled in.<br />"; } } if (isset($_POST['classification[other]'])) { if ($_POST['classification[othertext]'] == "") { $errorhandler .= "If Door Opening is selected, the text box must also<br />"; $errorhandler .= "be filled in.<br />"; } } if ($_POST['description'] == "") { $errorhandler .= "The description was left blank, it has to be filled in.<br />"; } errorhandler($errorhandler); if ($errorhandler != "") { echo "<br />"; // session variables here echo "<p>The link below will allow you to edit the fields. Please note"; echo "That the fields you filled out on the first page where saved, the below link "; echo "only makes you return to the previous page.</p>"; echo "<a href=\"/eventaccident/eventincidentaccidentform3.php?get=yes\" title=\"Return and fix errors\">Return And Fix Errors</a>"; }else { // session variables here $show = true; } } ?> <?php if ($show == true) { ?> <p>This is where all the information itself is going to go, like the actual confirmation message or something.</p> <?php } ?> </div> </body> </html> <?php }else { header("Location: /index.php"); } ?>[/code] edit - Also yes, I know I used tables to layout the form, I got tired this time of fighting with the css, this time, it was murder. So I did the form itself in tables, in a css layout. I may start doing all my advanced form's like that, this one took me 2 day's to layout because of how big it was, it was split up into 3-4 parts. -
Problem reading array's, validation's not working.
Ninjakreborn replied to Ninjakreborn's topic in PHP Coding Help
so this would also let me know if it was selected. For instance if I did that in the name's. Then fed them into the session['temp array or whatever say I wanted to check to see if the variable router was selected. I could say for instance if it was selected then the text box below it was required [code]<?php if (isset($_SESSION['temp']['actiontaken']['router'])) { if (!isset($_POST['textbox'])) { // text box required when selected }else { // not required } } ?>[/code] Just an example, could it be used with that type of usage, and be reliable. -
Problem reading array's, validation's not working.
Ninjakreborn replied to Ninjakreborn's topic in PHP Coding Help
nevermind I saw your edit, thanks again for the advice. -
Problem reading array's, validation's not working.
Ninjakreborn replied to Ninjakreborn's topic in PHP Coding Help
perfect, thanks do I need to use the ['variablename'] the ' where they are, or is that not going to be needed since it's still html. -
Problem reading array's, validation's not working.
Ninjakreborn replied to Ninjakreborn's topic in PHP Coding Help
Ok this leaves me with one final question now that I realize that. So if I can get an array called actiontaken with all the variable(value combinations then I am good to go How do I get them all into an array do I have to manually put each field into an array or because when I saw people name them say <input name="actiontaken[]" type="select" value="firstname" /> *just an example* ok, I have a whole bunch of these, which is how I saw to name checkboxes. If I do this, logically it looks like it's going to create an array of the values. I need to be able to access the variables, like $_SESSION['temp']['actiontaken']['firstname']; and it contain I guess, I am not sure how this is going to work out? Edit- See I literally need the action, I don't know. For instance landing, I need to know whether it was selected or not, but in a way I can database it, it's very hard to explain, if someone knows what I mean? -
Problem reading array's, validation's not working.
Ninjakreborn replied to Ninjakreborn's topic in PHP Coding Help
Ok, so that should put the entire action taken array into the temp array. So for instance if I had first name saved in that 2nd array, after doing that, I could use that by doing [code]<?php echo $_SESSION['temp']['actiontaken']['firstname']; ?>[/code] -
I have started using wildteen's, and other people's advice on using array'ed sessions even for temporarily storing vast amounts of data when it deal's with a larger form. I have a form split into 3 sections. the first is small, the other 2 are considerably large. The thing now is that the form's themselves, the fields are getting filled into an array [code]$_SESSION['temp'][/code] That is the master array that contains all the other information in it then you can access various variables within that array like: [code]$_SESSION['temp']['firstname']; $_SESSION['temp']['lastname'];[/code] The temp session array is where everything is primarily stored. I have 2 smaller array's called actiontaken and classification There are 2 sections of checklists, one will have an array called actiontaken the other will have one called classification, so in the end I will have the $classification['variablename']; and $actiontaken['variablename']; array's I want to feed them into the bigger session array so there value's can be found like this $_SESSION['temp']['actiontaken']['firstname']; that would access the firstname field informaiton which is in side the array "actiontaken", inside the "temp" array, inside a session. Then also I wuold need access to the variables that were in the original array, like $_SESSION['temp']['variablename']; as well as the one's from the sub-array's when needed, like $_SESSION['temp']['classification']['variablename']; So the point is I need to be able to put smaller array's, inside larger arrays while still having some variables in side that one array. I am afraid if I put the classification and action array, into the session array it might overwrite something?? How do I do this properly? say once I collect the data, how do I put it all into the session at once, as a whole?
-
[SOLVED] need help with Initials PLEASE ...
Ninjakreborn replied to rsammy's topic in PHP Coding Help
or just create a new field and record it first thing would be easier. Because either of these method's are great, but what if they have 3 names. Like for there first name they put Joyel West my middle name's are West Lee Joyel West Lee Puryear say I put west lee after joyel, then how is your program goign to cut that up, it won't. See what I mean, you have to accont for that as well. -
something so simple, over such a large problem. I didn't even think I might have mispelled it, I forgot the : thanks thorpe, I set here for 4 hour's and I missed a damn : I can't believe I forgot something so small/simple, thanks again.
-
[code]<?php require_once("../master/config/config.php"); unset($_SESSION['temp']); header("Location /admin.php"); ?>[/code] http://www.9ksafety.com/eventaccident/cleardata.php It make's no sense, I narrowed it down, it's my redirect. It's not working for some reason? It work's on the other page's properly, but on this one it give's me that, this is simply suppose to clear the variables that are there, and redirect, it didn't even give me headers already sent, it just gave me this, am I doing something wrong.
-
I discovered a way to pass the information on, to atleast automatically register them. The only problem now, is that, I need to be able to automatically log them in, that's fine as well. There is one problem though, I need to be able to set them up to the member group they are suppose to be in, how do I set there member group up during actual registration
-
[quote]I guess I'm not sure what the question is, because if you've "seen hundreds of web hosts", you would know that 90% of them offer such functionality.[/quote] I am not really in the mood for those kind of comments. I am relaunching my entire business again, there are no comment's on my site like that. What I was asking is for good advice on a host. [quote]look for a dedicated server. if you're a little bit short on the $$$, then a VPS (virtual private server) will offer a nice alternative. tis what i use, and includes all the above. mine: http://www.webfusion.co.uk/vps - prob not ideal for you (UK based) but will give you a rundown on what to expect from a VPS.[/quote] I will take a look at virtual private hosts and see what I can find out now that I know about that. As far as seeing hundreds of host's, it's hard not to, with doing web development. You end up working for different one's every day, I have tried doing site's for people on yahoo, geocities web servers, and those type's of server's I stopped taking project's on because of the hasstle, especially with yahoo. I tried godaddy.com, 1&1, network solutions, bluehost, serverpowered, and about 4-5 other's, that I have directly worked on websites on, and none of them are specifically what I am looking for, except maybe 1&1 which has evil prices.
-
Basically it's not working out. I have 2 things I need to do and can't do either of them 1. When the person first registers for the "site" I need to be able to take the username, password, membergroup, and email over to the forum 2. When the person click's the link to go to the forum, it'll pass there id number or something and automatically log them into the forum or something.
-
I have seen hundreds of web hosts. I am wanting to be able to have one sort of like www.bluehost.com but they only allow a certain percentage of computer space, they also say that they can't support really large site's. I want to get a permanent place on the internet, one that will fit all of my need's. 1. I need one that can hold as many domain name's equally as I want. 2. I need one that will allow me to hold all the site's from my network. I have a network of site's I am creating, all under my own company name (freelance businessman), and I want to be able to get them all up and running in my spare time, but I need a place that can support them all, some of them are going to be as huge (space wise), and functionality wise, as some massive site's out there, and over time, if I eventually have 10-15 of them I need a place to hold them all. 3. I also need one that will allow me to have extra, extra, extra room aside from my network to allow me to do hosting for various people as well. I want to be able to get client's over to my webhost, and then be able to host there site's for them for a specific amount of money per month. With enough people that I start hosting (just regular clients), then I would also be able to have it pay for itself with income as well.
-
Is there a way to make checkboxs go back to default based on session settings. I have a form that's in 3 parts, the first 2 part's were basic drop downs and text fields. The last one has 2 huge sections of select boxes and 1 section of dropdowns. I was wondering when they go to the next page, and I validate the field's, if I have them come back to correct there error's is there a way to have the one's that were chosen previously to be selected as well, or is that not possible.
-
How do you properly validate military time using regular expressions. RIght now I am just making the maxlength 4 and using is_numeric but I don't think that will do total validation as someone could get around that, any advice?
-
I want to try and validate the date. I wanted it to validate as (mm/dd/yyyy) but the following code I tried, and that I created doesn't seem to work. I must be doing something wrong, can someone see a problem with it. [code]<?php $reg = "(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d"; if ($_POST['eventdate'] == "") { $errorhandler .= "Event Date was left blank.<br />"; } if (isset($_POST['eventdate'])) { if (!ereg($reg, $_POST['eventdate'])) { $errorhandler .= "Event date was not formatted properly.(mm/dd/yyyy)<br />"; } } ?>[/code]
-
I have been thinking about this steadily for a few months. Literally what is the difference between building a site with regular php programming, as opposed to Object Oriented PHP Programming. What is the difference. When I write regular code, ti get's pretty advanced at time's, but everything is always neat. What's wierd even when I know someone uses OOP a lot they don't seem to be using it for regular web projects. I also don't understand the concept behind OOP, are they like functions on steriod's, with just a quicker way to call them when needed or something.
-
I will look into these, the reason it take's me 30 minutes to adjust is because. I said that I do things the hard way, that's why I am looking for an easier way. I have like each and every label/input tag combination, I have id's. I seperately space each input away from each label, one at a time, until all are equal, I know there's ane asier way I just didn't know what it was, I will look into these, thanks.
-
I have been messing with form's a lot lately. I did a few test's, opposing building forms in 1. CSS 2. Tables Just to test out the specific form's in both. The issue is, without any styling, form's look 150 time's better than regular forms. Then when you add in css styling, I start seeing a bunch of complexities, What I use to do, is take and makee each and every input field, have a specific id, then with those id's Iput in left margin. each one has a different value though because hte label's are different sizes, this took about 30-45 minute's of aligning and adjusting, and if even one name get's changed, it take's tweaking the css until it's aligned again. I need a quicker way to do this, but then when I use table's I start getting other issues. I see my form's, compare them to other people's form's. Is it best to use css/tables on form's, if css does anyone know of a good tutorial or something specifically geared towards teaching form alignment/styling using css
-
I have been creating a huge form, and I came up into 2 section's that have ton's and ton's of options all under select type. I never used select much, but I know it's easy enough to use, and with the value attribute, you can set what variables they are when the time come's. [quote]"ACTION TAKEN Select all that apply." Aborted Takeoff Cancelled Flight Declared Emergency Delayed Flight Diversion Go Around Ground Aircraft at Outstation Inflight Shutdown Missed Approach Return Aircraft to Maintenance Return to Gate Turnback "PHASE OF FLIGHT Select the one most appropriate option." Fueling Towing Pre Flight Boarding Taxi Out Runup Takeoff Climb Cruise Holding Descent Approach Landing Taxi In Parking Deplanning Post Flight "CLASSIFICATION Select most specific option. May choose multiple if appropriate." Aircraft Damage Aircraft on Runway "Aircraft Logs / Manuals / Phase Missing, incomplete, inaccurate" Airport Closure Alternator Failure ATC Delay Avionics Failure Communication Navigation Battery Bird Strike Brake Failure Collision (with aircraft or object) Crew Incapacitation Debris on Runway Deviation of ATC Instructions Disruptive / Sick Passenger Door Warning Door Opening Electrical Failure Emergency Evacuation Engine Failure Engine Fire Fire / Smoke in Cabin Flap Failure Flat Tire Flight Control Failure Fuel Leak Fuel Quantity Hard Landing Icing Instrument Failure Flight Instrument Engine Instrument Landing Gear Blow Down Fail to Extend Fail to Retract Hydraulic Leak Hydraulic System Failure Indication Failure Lightening Strike Magneto (failed or rough) Near Mid-Air Collission Pax Injury Prop Strike Rough Engine Runway Incursion Starter (failure or warning) Tail Strike Turbulence Vacuum Failure Wake Turbulence Weather Below Minimums Weather Below High Minimums Weight and Balance Wind Shear Other[/quote] Those are the one's I am creating, they will be 3 different sections. The top, and bottom are checkbox's, the middle type will be a select box which is easy, so the 2 I am having problem's with are action taken, and classification. These 2 specifically have to be checkbox's, because they have to be able to select multiple choice. This was suppose to be a simple project, and I would like to keep it simple if possible, as simple as I can atleast. At this point, it's a large time consuming process to create the select box's however it's just time consuming, not hard. Even though I might use tables to lay out that section since it's backend, and since it's easier to get them set right, that is no problem. The problem I am having now is collecting/databasing the information. I could pick up each one, one at a time and see if the value is there. The only thing is, I want to be able to database it, if I have 1 field for each option, set to true or false, that will take forever. because I also need to create things to search the the data, and edit that data at a later date. Any advice would be appreciate. Primarily I had 2 idea's as far as databasing/database structure 1. Have 1 field for each option, and have it set to true or false. Then just allow her to search by a preset list, and if she search's by that, she search's wherever that specific thing is true, or something similar. Or 2. I was thinking of saving them all in one field, seperated by comma's all the one's that pertained to the record would all be recorded together jsut seperated by comma's in a specific field. I also need a good idea as far as how to collect the data, I could test for each and every variable name for checkbox and just pick up whichever one's are there, but that's definitely the long way around, especially when I am going to need to be able to possibly edit/change this information if needed.
-
If anyone can help it would be appreciated. I am still having the same problem, I was bumping because it was last week sometime. I have the whole thing setup properly. It's setup to where each school has 2 area's to post for instance UPenn it would have 2 boards UPenn Easy A's UPenn Hard Classes or something, it would have 2, then there would be a usergroup called UPenn that only give's right's to that school. Now I need a way to somehow when the character goes to teh site, there associated school is saved in a session, I need a way for the smf, to pick up that, and know what school they want to sign up under. They can only see the forum posts related to that school, because that is the purpose, only 1 school per student, of course a student of that school. All they need to signup to the forum by default is a username, email, and password, and there usergroup. THe usergroup is the school, so I have that information, the username is the email I have that, the email is the email, I have that. How do I make this work the way I want. As for the schools' I am rewritting the setup for hte schools. I decided I am going to have 1 post for each school, then have child forum's for it. The main for general chat, and then the other 2. I am not sure, but any advice on how to pass the information over to the forum so I can use that info to create the registration information automatically, and then always allow them to be logged in. Even if it's creating a gateway.php page, that takes the information I have on them in session's and records it in the proper smf table within that database, then rig the forum to auto log them in when the session is set propery. Or just authenticate the username/password to the smf database to make sure it's the same each itme, so ti know's they are authorized.
-
Thanks fenway, I went ahead and set the function to still recieve the id, but instead it replaces the getElementById(bottomimg) then I pass the value as the id, then it works perfectly now, thanks for all the help.
-
General coding structure and ideology
Ninjakreborn replied to Ninjakreborn's topic in Application Design
Then I am definitely confused. I alway's thought I am totally confused on object oriented programming. No matter what anyone say's, I took people's advice and dropped graphic design, and got a friend, that has a lot of experience to do it for me, actually with a sliding scale payment arrangement, (I don't pay him, I work it off through programming, and he end's up owing me anyway. So because of that I feel that I haev gotten a lot better at programming, with not only PHP but with general programming, And other languages as well seem to be all the same ocncepts as I go along. This is what I think each thing meant. 1. Object Oriented Programming - I can never get a grasp to it's meaning because every person, and every tutorial relates it to real life. In a program I am writing how am I going to make a dog, and make it sit, lay down, take a shit, and walk. But so far everyone I have asked, has used dog, or cat, or person as an analogy. Everytime you create a new instance of an object, you create a new instance of that dog, and it's a little hard to follow. I don't have use for dog's and cat's in my programming, so what can I think about to help me understand the concept, because even tutorials I have read tries to explain it from a real life perspective. 2. patterns - mvc and vcp I think was what you called htem. I am going to look up on them, so far I am thinking they are a specific pattern (style) to programming. This "one point of input one point of output" sounds like you only allow one form to bring information into the page, and you make everything on the site at the end go into one huge variable and echo it onto the page. What I don't know about that is, when I try to edit third party script's sometimes when clients ask, I go into it and try to modify the code, I always figure it out, but it take's forever I am guessing it's because they use OOP. 3. Templating engine - i thought this was a framework. I have something that allows me to have access to all my function's, as well as work have all of my stuff together, like database login information, session information or whatever else I think i'll need. I thought a templating engine would be like a replicateable way to build site's. Like I use the docroot variable now, I thought that would bes omething that would be found in a templating engine.