PHP - Regarding Php Admin Control Panel Design, Is Iframe A Good Choice?
Well lately I've decided to split the big script in admin.php(admin control panel file) into several smaller script files such as admin_index.php, admin_settings.php and admin_createuser.php. I was thinking about this idea of locating all menus/submenus to the left hand side of the page and use an iframe to load info from any admin script files. This way the admin can access everything without having to be directed to a different url. I believe this is what Vbulletin has been doing for its ACP(they may have used javascript though), and I have a few questions to ask:
1. Is this a feasible idea, especially if I choose not to use javascript? 2. Is it safe to design admin control panel this way for a PHP script? If not, please lemme know possible security issues? 3. Is it possible to restrict direct access to other admin type script files, but allow access if they are loaded in iframe? Please do lemme know, thanks. Similar TutorialsHi Everybody i am working on admin panel but right now i encounter a problem i can't edit i also can't delete news but insert is working maybe somebody can help me find mistake and fix it up . You can visit web and see what is what Admin Panel http://faksx.sytes.net/blogs/?page=cp Admin Panels news management http://faksx.sytes.net/blogs/?page=news_cp user andis |pw andis (don't try hack it won't work) Here is code i . if ($_POST['submit']) { $id = (int)$_POST['id']; $news_title = mysql_real_escape_string($_POST['news_title']); $news_category = mysql_real_escape_string($_POST['news_category']); $news_short_text = mysql_real_escape_string($_POST['news_short_text']); $news_text = mysql_real_escape_string($_POST['news_text']); $news_title = htmlentities($_POST['news_title']); $news_category = htmlentities($_POST['news_category']); $news_short_text = htmlentities($_POST['news_short_text']); $news_text = htmlentities($_POST['news_text']); if (!empty($id)) { $sql = ("UPDATE news SET news_title = '$news_title', news_category = '$news_category', news_short_text = '$news_short_text', news_text = '$news_text' WHERE id = '$id' "); } else { $sql = "INSERT INTO news (news_title,news_category,news_short_text,news_text,news_author,news_date) VALUES ('".$news_title."','".$news_category."','".$news_short_text."','".$news_text."','".$_SESSION[u_nick]."','".$last_time_seen."')"; mysql_query($sql) or die (mysql_error()); } } if($_GET['edit'] == 1) { $id = (int)$_GET['id']; $sql = ("DELETE FROM news WHERE id = '$id'"); mysql_query($sql) or die (mysql_error()); } if ($_GET['edit'] == 1) { $id = (int)$_GET['id']; $sql = ("SELECT * FROM news WHERE id = '$id'"); $date = mysql_query($sql) or die (mysql_error()); $row = mysql_fetch_array($date); $edit_title = $row['news_title']; $edit_group = $row['news_category']; $edit_short_text = $row['news_short_text']; $edit_text = $row['news_text']; $edit_id = (int)$row['id']; } mysqlutf8(); $sql = ("SELECT * FROM news"); $date = mysql_query($sql) or die (mysql_error()); echo '<select>'; while($row = mysql_fetch_array($date)) { echo "<option value='$row[id]'>".$row[news_title].'</option>' ; } #" <a href='/blogs/?page=comment&id=".$row['id']."'>Comment</a> " #"<a href='/blogs/?page=news_cp&edit=id=".$row['id']."'>" echo '</select>'."<a href='/blogs/?page=news_cp&edit&id=".$row['id']."'><input type='button' name='edit' id='button2' value='Edit' /></a> <a href='/blogs/?page=news_cp&delete&id=".$row['id']."'><input type='button' name='delete' id='button3' value='Delete' /></a>"; echo "<form id='form1' name='submit' method='post'> <p>Virsrakts <label for='textfield'></label> </p> <p> <input type='text' name='news_title' value='$news_title'> </p> <p>Ziņu Gruppa</p> <p> <label for='select'></label> <select name='news_category' value='$edit_group'> <option>News</option> <option>Bugs</option> </select> </p> <p>Teksts</p> <p> <label for='textfield2'></label> <textarea name='news_short_text' cols='50' rows='10' id='textfield2' value='$edit_short_text_text'></textarea> </p> <p>Pilns Teksts</p> <p> <label for='textfield3'></label> <textarea name='news_text' cols='70' rows='15' id='textfield3' value='$news_text'></textarea> </p> <p> <input type='submit' name='submit' id='button' value='Pievienot' /> <input type='reset' name='reset' id='button4' value='Reset' /> </p> </form>"; } well i have a problem... i have a website running and anyone can get to the admin control panel login page by going to "mywebsite.com/admin" how can i hide this or change it so that they cant get to it unless they know it...? problem 2... when u visit my website... its shows in the url the path of the file for example... "mywebsite.com/register.php" when on the register page or like "mywebsite.com/sells.php" if on the sells page... how can i hide it so that only my website name is showing and not the path of the file? please i need tutorial to learn me how to create admin panel like jommla or other >>> please dont late to answer this is my first topic Hello,
I am making a UCP to go along side a game server. The game server adds a mysql row when a account is created and places the password under Whirlpool encryption.
I am looking for someone who can help me make a basic login page that needs to enter a user name and password, with the password then encrypting to Whirlpool or whatever needs to be done for the login to be a success.
I am a total new guy to HTML / PHP scripting and looking to do this as a learning project.
what am i doing wrong? Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /****/*****/*/domains/klikertje.nl/public_html/adminpaneel/index.php on line 123 script of adminpaneel/index.php <?php include("../config.php"); include('../cronjobs.php'); $gebruikersnaam = "robin"; //De gewenste gebruikernaam $wachtwoord = "rg953gejFDI3c"; //Het gewenste wachtwoord if(preg_match('/^[a-zA-Z ]+$/D', $_SERVER['PHP_AUTH_USER']) == 0){ if(preg_match('/^[a-zA-Z ]+$/D', $_SERVER['PHP_AUTH_PW']) == 0){ if($_SERVER['PHP_AUTH_USER'] != $gebruikersnaam || $_SERVER['PHP_AUTH_PW'] != $wachtwoord) { header("WWW-Authenticate: Basic realm=\"Beveiliging\""); header("HTTP/1.0 401 Unauthorized"); echo "Je bent niet ingelogd! Probeer het <A HREF=\"javascript:location.reload();\">opnieuw</A>."; exit; } ?> <!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> <title>MiljoenenMail</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="keywords" content="miljoenenmail" /> <meta name="description" content="MiljoenenMail" /> <meta http-equiv="content-language" content="nl" /> <link href="../css/style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="containermain"> <div id="headercontainer"> <div id="headerleft"> <div id="logo"><img src="../images/miljoenenmaillogo.png"></div> <div id="menu"> <ul> <li class="first"><a href="index.php">Algemeen</a></li> <li><a href="afmelden.php">Uitloggen</a></li> <li><a href="profile.php">profiel</a></li> <li><a href="payout.php">Uitbetaling</a></li> </ul> </div> </div> <div id="headerright"> <center><i>Welkom Beheerder</i></center> <table border="0" width="235px" style="margin-top: 5px;" height="85px"> <tr><td><img src="images/parel.png" alt="Parel" /></td><td style="text-align:left;">Parels: <?=$gebruiker->parels?></td><td><img src="images/eurosymbol.png" alt="Euro" /></td><td style="text-align:left;"><?=$gebruiker->saldo?></td></tr> <tr><td><img src="images/klikmissie.png" alt="Kliknissie" /></td><td style="text-align:left;">Klikmissie</td><td><img src="images/wallet.png" alt="Uitbetalen"/></td><td style="text-align:left;">Uitbetalen</td></tr> <tr><td><img src="images/message.png" alt="Berichten" /></td><td style="text-align:left;">Berichten: <b><?=$gebruiker->berichten?></b></td><td><img src="images/nl_flag.png" alt="" /></td><td style="text-align:left;">Nederland</td></tr> 2 </table> </div> </div> <div id="floatheader"></div> <div id="tab_understroke"></div> <div id="container"> <div id="rechtscontainer"> <div id="topblue"></div> <div id="main"> <p><strong><h2>AdminPaneel</h2></strong></p> <hr /> <form name="form1" method="post" action=""> <table border="0"> <tr> <td>de nieuws/voorpagina wijzigen:</td> <?php if(!isset($_POST['Submit'])) { ?> <td><input name="nieuws" type="text" size="20" <?php if(isset($nieuws->inhoud)) { ?>value="<?=$nieuws->inhoud?>"<?php } ?>></td> </tr> <tr> <td colspan="2"> <input type="submit" name="Submit" value="Opslaan"> </td> </tr> </table> </form> <?php } else { if(isset($_POST['nieuws']) OR $_POST['nieuws'] !== $nieuws->inhoud ) { mysql_query("UPDATE cmssysteem SET inhoud='".$_POST['nieuws']."'"); } echo "bedankt voor je wijzigingen ze zijn succesvol opgeslagen en veel plezier verder met de site admin ;)"; } ?> </div> <div id="right"> <div class="title">Statistieken</div> <div class="right_content"> Aantal leden: <?=$leden?><br /> Leden online: <?=$leden?><br /> Totaal aantal parels: <?=$totaalparels?><br /> € 532,00 uitgekeerd! </div> </div> </div> <div id="float"></div> <div id="footer"></div> </div> </div> <center><table border="0" width="861px"> <tr><td align="left"><pre>© 2010 Miljoenenmail.nl</pre></td><td align="right"><pre>made by: Ismail Metaich</pre></td></tr> </table></center> </body> </html> <? } else { echo "<html><body>$_SERVER['PHP_AUTH_PW'] bevat cijfers of speciale tekens alleen letters mogelijk!</html></body>" } } else { echo "$_SERVER['PHP_AUTH_USER'] bevat cijfers of speciale tekens alleen letters mogelijk!"; } ?> So, built a classifieds site.
The link is something like this: mysite.com/category/subcategory/1234
The category & subcategory don't do anything, they are just for vanity.
My question is about the '1234'. The number corresponds to an "id" which is a unique key in my database.
When people make a post, I use LAST_INSERT_ID() to get the most recent post and generate the URL.
So basically, my urls correspond 100% to database ID's, for better or worse. These go up by 1 with each post. I anticipate some potential numbering issues when I eventually delete posts.
Would it be a better idea to generate these unique IDs some other way, or is this acceptable design?
Thanks.
Edited by arbitrageur, 19 November 2014 - 11:13 AM. I'm building a site similiar to a web forum.
The code is all done, this is how it works:
CREATING POST:
------------------------
In PHP: Create Post -> Upload Images -> Remake Images (For security) -> Create Thumbnails (saved in uploads folder with unique name) With DATABASE: I have a table called "images" which tracks user uploaded images: uploaded_by_username (stores who posted it) image_status (tracking whether user aborted upload) thumbnail_confirm (tracking whether thumbnail generated successfully) post_association (tracking the post that the images go to) image_name (the image filename in uploads filefolder) time (unix time-stamp of upload tracking for admin purposes) DELETING POST: ------------------------ In PHP: Move all images into a "deleted_images" folder ( I'm afraid to use "unlink") With DATABASE: Delete all associated images from images table ( Is this risky? Should I use a second table and transfer the images? ) Anyhow, feedback appreciated in regards to how I designed this. Is this acceptable for the industry? hello. I need your help please. I'm building logistics website with user panel and admin panel. I've done all login and register forms. now I want to : admin can add package with: tracking number , weight , cost , and declaration form. user can fill declaration form after admin add package to user panel. then admin can see the declared form. is it possible in php? thank you in advance This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=353217.0 Hi, I've been looking around the net and various forums and found that the code below does appear to work and do what I need at a basic level, but I was wondering if there was a quick and easy way to improve this code OR another alternative that would give me similar/better results. I effectively have certain word documents that I want to use as templates for part of a project. So if i were to write a letter I could pull from the DB usual name/address, but also other intelligent information that might be dependant on different DB fields so it could generate different options, ie if they had children it would produce a different sentence?? Obviously my ideal solution would be that the php coding wouldnt need to be touched, but would allow for 'coded options' within the document to be added/removed without causing any issues, maybe some kind of generic coding so at least some content can be re-used for multiple documents ? However, I did have two initial thoughts on how to do some of this - maybe? (be gentle im still a learner!) 1, create an array of somekind and use generic terms for a set range, say 'bookmark1','bookmark2', etc so a user could just tag the original word document knowing they only had to add a new number to the end if they needed to add something new ? 2,read the document contents out -DO STUFF TO IT- load it back into a doc/save. with this method I will have to admit ive not done before so would welcome any extra detailed input or advisory suggestions, ie. ensuring it goes back into the correct format, say there was an image/logo or complicated series or bulleted paragraghs or tables ?? I have initially choosen MS word as many people out there are familiar with this product and is widely used. However, if it means I am able to create something easily and better within some other format or package that will give me what I want but also be compatible with word then im more than happy to go with any suggestions (ie templates initially created within openoffice and merely saved into .DOC format?) <?php //1. Instanciate Word $word = new COM("word.application") or die("Unable to instantiate Word"); //2. specify the MS Word template document (with Bookmark TODAYDATE inside) $template_file = "C:/t.doc"; //3. open the template document $word->Documents->Open($template_file); //4. get the current date MM/DD/YYYY $current_date = date("m/d/Y"); //5. get the bookmark and create a new MS Word Range (to enable text substitution) $bookmarkname = "mytester"; $objBookmark = $word->ActiveDocument->Bookmarks($bookmarkname); $range = $objBookmark->Range; //6. now substitute the bookmark with actual value $range->Text = $current_date; //7. save the template as a new document (c:/reminder_new.doc) $new_file = "c:/reminder_new.doc"; $word->Documents[1]->SaveAs($new_file); //8. free the object $word->Quit(); //$word->Release(); $word = null; ?> I have had nothing but great luck with these forums and I am hoping that I am not pressing said luck by asking another question. I have a drop down list populated by information in a database: <?php include_once('../other/functions.php'); $con = mysql_connect($hostname, $username, $password) OR DIE ('Unable to connect to database! Please try again later.'); $db = mysql_select_db($dbname, $con); $sql="SELECT owner_id, teamname FROM owners WHERE active = 1 ORDER BY division, teamname"; $result=mysql_query($sql); $options=""; while ($row=mysql_fetch_array($result)) { $id=$row["owner_id"]; $thing=$row["teamname"]; $options.="<OPTION VALUE=\"$id\">".$thing.'</option>'; } mysql_close($con); ?> <SELECT NAME=thing> <OPTION VALUE=0>Choose One <?=$options?> </OPTION> </SELECT> I have a query that will get the information I want into a table: <?php $con = mysql_connect($hostname, $username, $password) OR DIE ('Unable to connect to database! Please try again later.'); $db = mysql_select_db($dbname, $con); $query = "SELECT * FROM standings, owners, divisions WHERE owners.owner_id = standings.owner_id AND owners.division = divisions.division AND standings.owner_id = 1 ORDER BY year"; $result = mysql_query($query); $row = mysql_fetch_array($result); if (!$result) { die('Invalid query: ' . mysql_error()); } mysql_data_seek($result, 0); echo "<table CELLPADDING=5 border =1>"; echo "<tr>"; echo "<th align=center colspan = 2> Team Name </th>"; echo "<th align=center> Team Owner </th>"; echo "<th align=center> Conference </th>"; echo "<th align=center> Division </th>"; echo "</tr>"; echo "<tr>"; echo "<td align=center colspan = 2>".$row['teamname']."</td>"; echo "<td align=center>".$row['firstname']."</td>"; echo "<td align=center>".$row['conference']."</td>"; echo "<td align=center>".$row['division']."</td>"; echo "</tr>"; echo "<tr>"; echo "<th align=center> Year </th>"; echo "<th align=center> Wins </th>"; echo "<th align=center> Losses </th>"; echo "<th align=center> Points For </th>"; echo "<th align=center> Points Against </th>"; echo "</tr>"; $row = mysql_fetch_array($result); while ($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td align=center>".$row['year']."</td>"; echo "<td align=center>".$row['win']."</td>"; echo "<td align=center>".$row['loss']."</td>"; echo "<td align=center>".$row['points_for']."</td>"; echo "<td align=center>".$row['points_against']."</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> How do I make it so a user can use the drop down list, select a team name, and the query will then display the info?? Thank you very much Hi, I just want to put up a simple page that has an NDA to which someone can either "agree" or "disagree" and then automatically be forwarded to specific pages accordingly (google and yahoo are just there for testing). Problem is that I keep getting and "Undefined Index" for both "agree" and "disagree". What am I doing wrong? Here is my code: Code: [Select] <form id="nda" name="nda" method="post" action=""> <input type="submit" name="agree" value="I agree" /> <input type="submit" name="disagree" value="I disagree" /> </form> <?php if($_POST['agree']){ header("Location: http://www.google.com"); } else if ($_POST['disagree']){ header("Location: http://www.yahoo.com"); } ?> Thanks! Greetings, Hi Guys, What I'm aiming for is a random choice generator from a list of variables, and when that choice is chosen, it redirects to a new page. Eg. Random Choice Generator spits out "John Smith" -- Browser redirects to "John Smith's" character card. Below I have the PHP script for the random choice (I think, I'm a total PHP noob!), I'm just having trouble with the redirect part. Any light you could shed would be much appreciated! And also, I do believe this code is just for one choice, would I just need to duplicate it x amount of times? Code: [Select] <?php $stats[1] = 0; $stats[2] = 0; $stats[3] = 0; for ($i = 0; $i < 1000; $i++){ $choice = rand(1,3); if (!$i){ echo "First random choice: $choice<BR>\n"; } $stats[$choice]++; } reset($stats); while (list($num, $count) = each($stats)){ echo "$num: $count<BR>\n"; } ?> Thanks, Jack In this form, I am using radio buttons to select various PHP math function results (total, average,both) and it works but was wondering if it is possible to make it multiple choice, that is to say instead of displaying one result at t time when you submit, displaying two or three of the results, depending on how many radio buttons are clicked. Can this be done? Here is the form code <form action="." method="post"> <input type="hidden" name="action" value="process_scores" /> <label>Score 1:</label> <input type="text" name="scores[]" value="<?php echo $scores[0]; ?>"/><br /> <label>Score 2:</label> <input type="text" name="scores[]" value="<?php echo $scores[1]; ?>"/><br /> <label>Score 3:</label> <input type="text" name="scores[]" value="<?php echo $scores[2]; ?>"/><br /> <!-- ADD LOGIC TO DETERMINE WHETHER TO CALCULATE AVERAGE, TOTAL OR BOTH --> <fieldset> <legend> What do you want to calculate?</legend> <p> <input type="radio" name="calculate" value="average" checked="checked" /> Average<br /> <input type="radio" name="calculate" value="total" />Total<br /> <input type="radio" name="calculate" value="both" />Both</p> <p><br /> </p> </fieldset> <br /><br /> <label> </label> <input type="submit" value="Process Scores" /><br /> <label>Scores:</label> <span><?php if (isset($scores_string)) { echo $scores_string; } ?></span><br /> <label>Score Total:</label> <span><?php if (isset($score_total)) { echo $score_total; } ?></span><br /> <label>Average Sco </label> <span><?php if (isset($score_average)) { echo $score_average; } ?></span><br /> </form> and the processing code <?php if (isset($_POST['action'])) { $action = $_POST['action']; } else { $action = 'start_app'; } if (isset($_POST['calculate'])) { $calculate = $_POST['calculate']; } switch ($action) { case 'start_app': $scores = array(); $scores[0] = 70; $scores[1] = 80; $scores[2] = 90; break; case 'process_scores': $scores = $_POST['scores']; // validate the scores $is_valid = true; for ($i = 0; $i < count($scores); $i++) { if (empty($scores[$i]) || !is_numeric($scores[$i])) { $scores_string = 'You must enter three valid numbers for scores.'; $is_valid = false; break; } } if (!$is_valid) { break; } // process the scores $scores_string = ''; $score_total = 0; foreach ($scores as $s) { $scores_string .= $s . '|'; $score_total += $s; } $scores_string = substr($scores_string, 0, strlen($scores_string)-1); // calculate the average $score_average = $score_total / count($scores); // format the total and average switch($calculate) { case 'average': $score_average = number_format($score_average, 2); $score_total = ""; break; case 'total': $score_average = ""; $score_total = number_format($score_total, 2); break; case 'both': $score_total = number_format($score_total, 2); $score_average = number_format($score_average, 2); break; } break; } include 'loop_tester.php'; ?> Hello every body....
I'm creating a simple php project where the user will be able to choose option from dropdown menu and the query will be executed accordingly..
The html form is shown below....
<select name='movie_name'> <option value='ALL'>All</option> <option value='blah'>Blah blah </option> <option value='blah'>Blah blah </option> ... </select> <select name='movie_genre'> <option value='ALL'>All</option> <option value='Horror'>Horror</option> <option value='Anime'>Anime</option> ... </select> <select name='movie_cast'> <option value='ALL'>All</option> <option value='john'>john</option> <option value='Katrina'>Blah blah Katrina</option> ... </select>If the user select "ALL" then, all the resuls will be displayed according to the selected options AND again If the user select "different" options then, all the resuls matcing from the database will be shown... Tha database schema is shown below | id | movie_name| movie_genre | movie_cast | 1 | Hello Brother | Comedy | Salman Khan | 2 | Blah blah | ALL | Blah blah | 3 | ALL | ALL | ALL | 4 | Blah Blah | Blah Blah | ALL * here "ALL" is a specific text which may or may not be present in the rows.... Thank u in advance.... I have a multiple choice search page which asks visitors to select one or more choices before rendering the search results. It only works in items 1+2 are selected, or 1+2+3, or 1+2+3+4, or 1+2+3+4, etc... I want to make it so that any combination of choices work. Example: Items 1+6 or 2+3+5 or 1+4+6 etc... I have four hours to fix it before my client shows up and need help BADLY. Anyone out there who can help? Whoever can help me... you are the best and I will have a special prayer for you tonight. Here is the coding: <?php } else{ if(!empty($_GET['latt']) && !empty($_GET['long'])) { $condition="SELECT ( 3959 * acos( cos( radians( '".$_GET['latt']."' ) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians( '".$_GET['long']."' ) ) + sin( radians( '".$_GET['latt']."' ) ) * sin( radians( latitude ) ) ) ) as distance,id,membership FROM notary_members "; if(!empty($_GET['s'])) { $a=" where and"; } else { $a=" where"; } if($_GET['edoc']!='') { $condition.=$a." edoc= 'yes'"; } if($_GET['esign']!='') { if($_GET['edoc']!='') $condition.=" and esign= 'yes'"; else $condition.=$a." esign= 'yes'"; } if($_GET['laserprinter']!='') { if($_GET['esign']!='' || $_GET['edoc']!='') $condition.=" and laserprinter= 'yes'"; else $condition.=" laserprinter= 'yes'"; } if($_GET['dualtray']!='') { if( $_GET['laserprinter']!='' || $_GET['esign']!='' || $_GET['edoc']!='') $condition.=" and dualtray= 'yes'"; else $condition.=" dualtray= 'yes'"; } if($_GET['error_in']!='') { if($_GET['dualtray']!='' || $_GET['laserprinter']!='' || $_GET['esign']!='' || $_GET['edoc']!='') $condition.=" and error_in= 'yes'"; else $condition.=" error_in= 'yes'"; } if($_GET['bg_checked']!='') { if($_GET['error_in']!='' || $_GET['dualtray']!='' || $_GET['laserprinter']!='' || $_GET['esign']!='' || $_GET['edoc']!='') $condition.=" and bg_checked= 'yes'"; else $condition.=" bg_checked= 'yes'"; } if($_GET['home_insp']!='') { if($_GET['bg_checked']!='' || $_GET['error_in']!='' || $_GET['dualtray']!='' || $_GET['laserprinter']!='' || $_GET['esign']!='' || $_GET['edoc']!='') $condition.=" and home_insp= 'yes'"; else $condition.=" home_insp= 'yes'"; } if($_GET['fingerprint']!='') { if($_GET['home_insp']!='' || $_GET['bg_checked']!='' || $_GET['error_in']!='' || $_GET['dualtray']!='' || $_GET['laserprinter']!='' || $_GET['esign']!='' || $_GET['edoc']!='') $condition.=" and fingerprint= 'yes'"; else $condition.=" fingerprint= 'yes'"; } if($_GET['hosp_signing']!='') { if($_GET['fingerprint']!='' || $_GET['home_insp']!='' || $_GET['bg_checked']!='' || $_GET['error_in']!='' || $_GET['dualtray']!='' || $_GET['laserprinter']!='' || $_GET['esign']!='' || $_GET['edoc']!='') $condition.=" and hosp_signing= 'yes'"; else $condition.=" hosp_signing= 'yes'"; } if($_GET['jail_signing']!='') { if($_GET['hosp_signing']!='' || $_GET['fingerprint']!='' || $_GET['home_insp']!='' || $_GET['bg_checked']!='' || $_GET['error_in']!='' || $_GET['dualtray']!='' || $_GET['laserprinter']!='' || $_GET['esign']!='' || $_GET['edoc']!='') $condition.=" and jail_signing= 'yes'"; else $condition.=" jail_signing= 'yes'"; } if($_GET['im_docs']!='') { if($_GET['jail_signing']!='' || $_GET['hosp_signing']!='' || $_GET['fingerprint']!='' || $_GET['home_insp']!='' || $_GET['bg_checked']!='' || $_GET['error_in']!='' || $_GET['dualtray']!='' || $_GET['laserprinter']!='' || $_GET['esign']!='' || $_GET['edoc']!='') $condition.=" and im_docs= 'yes'"; else $condition.=" im_docs= 'yes'"; } if($_GET['jail_signing']!='' || $_GET['hosp_signing']!='' || $_GET['fingerprint']!='' || $_GET['home_insp']!='' || $_GET['bg_checked']!='' || $_GET['error_in']!='' || $_GET['dualtray']!='' || $_GET['laserprinter']!='' || $_GET['esign']!='' || $_GET['edoc']!='' || $_GET['im_docs']!='') { $condition.=" and status=1 order by distance asc"; } else { $condition.=$a." status=1 order by distance asc"; } $sql=mysql_query($condition); $num=mysql_num_rows($sql); $getmile=explode(' ',$_GET['miles']); $c=0; while($getidres=mysql_fetch_array($sql)) { if($getidres['distance']<=$getmile[0]) { if($getidres['membership']=='premium') { $prefirst[$getidres['id']]=$getidres['distance']; $c++; } else { $basicfirst[$getidres['id']]=$getidres['distance']; $c++; } } } if(!empty($sql)) { if($c!=0) { if(!empty($prefirst) || !empty($basicfirst)) { ?> Hey guys.
The problem is like that:
I have a panel that shows live statistics on a game called Samp , and i used the template Ace Admin boostrap , and the theme is not showing , the template doesen't work , but i have all the necesary files ,css and all
Those are my files:
http://i.imgur.com/CF0kebR.jpg http://i.imgur.com/7quVxHJ.jpg Footer: http://pastebin.com/NAi6EHg4 Header: http://pastebin.com/GmBriy8G hi
I use dreamweaver cc and I make a recordset ,so I need to create a dynamic table but the data panel and data object panel not appear
can any one help me please
I am pretty new to using php and mysql and am struggling to understand how to go about processing a multiple choice quiz script to check if the answer given by the user is right or wrong and give the user the final result . I understand how to write and process register pages and login scripts and the like but for some reason I just can't understand what i need to do for this type of script So far my thinking has been 1) When the page is submitted have a query that compares the answer selected to the answer in the database. 2) Have php variables for correct and and incorrect both initialised to 0 and which will change depending on the answers given. 3) Use an if else statement similar to the code below to add up the score : - if($result['answer']==$_POST[$result['id']]){ $correct_answer++; }else{ $incorrect_answer++; } 4) Have a query that enters the person taking the quiz's grade in to the database. I would really appreciate it someone could give me some guidance for the best way to do this. I have included below my code for selecting the questions form the database. <?php // Starts the session session_start(); /* */ if (!isset($_SESSION['user_level']) or ($_SESSION['user_level'] != 0)) { header("Location: error_page.php"); exit(); } ?> <?php require_once ('mysqli_connect.php'); $email_address = ['email_address']; $quizGradeBegan=("INSERT INTO learner_grade_db( email_address, score, )VALUES ('$email_address',0) "); $result=@mysqli_query($dbcon, $submittedAnswerQuery); if(isset($_SESSION['email_address'])){ ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Q-Quiz: Learner Homepage</title> <link rel="stylesheet" href="sdnt.css" /> </head> <body> <div class="wrapper"> <!-- Start of wrapper div --> <div class="header"> <!-- Start of header div --> <h1>e-Quiz: <br> Learner Homepage</h1> <?php //Makes a call to includes/leaner_nav.php in order to show The Learner Navigation Bar require_once("includes/learner_nav.php"); //Makes a call to includes/welcome_name.php in order to show the Learners name. require_once("includes/welcome_name.php"); /*Makes a call to includes/current_date in order to shows the current date. Will appear in the Day Month Year Format.*/ require_once("includes/current_date.php"); ?> <!-- Shows the Change text size images --> <div id="textSizer"><!-- Start of the textSizer div --> <img id="smallStyler" class="textSize" src="imgs/fontSmall.jpg" height="18" width="18" alt="Smallest" /> <img id="mediumStyler" class="textSize" src="imgs/fontMedium.jpg" height="18" width="18" alt="Default" /> <img id="largeStyler" class="textSize" src="imgs/fontLarge.jpg" height="18" width="18" alt="Biggest" /> </div> <!-- End of textsizer div --> </div><!-- End of Header div --> <div class="article"> <!-- Start of the article div --> <?php $query=("SELECT question_id, question, distractor_1, distractor_2, distractor_3, distractor_4 FROM multiplechoice_db ORDER BY RAND() LIMIT 3 " ); $result = @mysqli_query ($dbcon, $query); // Run the query. while($row = mysqli_fetch_array($result, MYSQL_BOTH)):?> <br> <form action="gradepage.php" method="post"> <?php echo $row['question_id'];?> <br> <?php echo $row['question'];?> <br> <input type="radio" value="1" id=' distractor <?php echo $row['question_id'];?>' name ='<?php echo $row['question_id'];?>'/><?php echo $row['distractor_1'];?> <br> <input type="radio" value="2" id=' distractor <?php echo $row['question_id'];?>' name ='<?php echo $row['question_id'];?>'/><?php echo $row['distractor_2'];?> <br> <input type="radio" value="3" id=' distractor <?php echo $row['question_id'];?>' name ='<?php echo $row['question_id'];?>'/><?php echo $row['distractor_3'];?> <br> <input type="radio" value="4" id=' distractor <?php echo $row['question_id'];?>' name ='<?php echo $row['question_id'];?>'/><?php echo $row['distractor_4'];?> <br> <?php endwhile;?> <p> <input id="submit" type="submit" name="submit" value="Click To Submit Completed Quiz "></> </div> <!-- End of the article div --> <div class="aside"> <!-- Start of the aside div --> <ul class="nav2"> <?php //Makes a call to includes/leanersidebar1.php in order to show The Learner Sidebar require_once("includes/learnersidebar1.php"); ?> </ul> <br><br><br><br><br> </div> <!-- End of the aside div --> <div class="footer "><!-- Start of the footer div --> <?php //Makes a call to includes/footer.php in order to show the Footer require_once("includes/footer.php"); ?> </div><!-- End of the footer div --> </div><!-- End of the wrapper div --> </body> <html> |