Привет, я пытаюсь исправить раздражающую проблему, которая у меня есть на данный момент, у меня есть страница PHP с обычным текстом и некоторые выпадающие окна, отображающие информацию из базы данных, и у меня есть некоторые кнопки, использующие ul
и li
прикрепленные к в раскрывающихся списках у меня есть пара функций JavaScript, которые отключают второй и третий, пока не будут выбраны первые два параметра. Все это работает.
Проблема у меня есть, у меня есть переменная PHP, которая содержит большую часть HTML и текст для страницы, и она повторяется, но я хочу поместить выпадающие окна в этом разделе, но с раскрывающимися ящиками мне нужно иметь включите для моих выпадающих ящиков правильную работу, но каждый раз, когда я пытаюсь либо включить слова, они вторят на экран, либо показывает мне белую страницу. Это моя переменная с текстом в
$info = '<div id="Text">This page will guide you through how to create your own Careers in the Classroom presentation.
Producing a presentation is very simple, just follow the steps below:
<ol>
1) Choose an academic principle around which to base your answers
<li> This will determine in which lesson your presentation will be shown to pupils </li>
<li> First choose an academic subject from the drop-down box below (i.e. Maths, Science, Geography)</li>
<li> Then choose an area out of the subject you have chosen (i.e. Geometry, Physics, Physical Geography) </li>
<li> Which will then bring up a list of principles to choose from* (i.e. Area, Forces, Rocks)</li>
*Make sure you pick the principle which is most relevant to your job because you will be asked to talk about it later*
</ol>
<<<<< this is where i want my drop down boxes to be >>>>
<br/><br/>
<ol>
2) Take note of your target age
<li> Click the Show my target age button and take note</li>
<li> The principle you have chosen will be taken from a school curriculum which may apply to a variety of age ranges. Bear in mind that if you are preparing a presentation for a 16 year old pupil this will need to have a different tone to that aimed at an 8 year old pupil.</li>
<div id="ResultList" >
Click the button to find the key stage
</div>
<input style="position:relative;left:320px;top:-20px;" type="submit" value="Search"/>
</ol>
<ol>
3) Download the questionnaire
<li> Below you will find a link to the questionnaire, it will be beneficial to read over this before you begin videoing. </li>
<li> The questionnaire is split into sections the most important section is D - Using school subjects in your career. </li>
<li> When answering the questions try to elaborate on your answers, the more information the better. </li>
<li> Where there is a choice of questions out of a section try to choose the ones which relate to your career the most or which yield surprising and interesting answers</li>
</ol>
<br/>
<ul style="width:140px;position:absolute;top:440px;height:25px;padding-top:1px;left:60px;list-style-type:none;" id="menu">
<li style="list-style-type:none;">
<a href=./downloads/questionaire.pdf>
Questionnaire
</a>
</li>
</ul>
<ol> 4) Filming your answers
<li> When you are ready you can film the answers to the questionnaire </li>
<li> The guide below will help you</li>
</ol>
<br/>
<br/>
<ul style="width:225px;height:25px;padding-top:1px;position:absolute;top:550px;left:60px;list-style-type:none;" id="menu">
<li style="list-style-type:none;">
<a href=./downloads/producingavideo.docx>
Guide to Producing a Video
</a>
</li>
</ul>
<ol> 5)Upload your footage to this website
<li> You will find a link below which will take you to the upload page </li>
<li> Here you will need to input information about your career and about the academic principle you have chosen </li>
<li> You will also need to put all your footage into a zipped folder and upload it - see the instructions below</li>
</ol>
<ul style="width:105px;height:25px;padding-top:1px;position:absolute;top:690px;left:60px;list-style-type:none;" id="menu">
<li style="list-style-type:none;">
<a href=./downloads/producingavideo.docx>
zip files
</a>
</li>
</ul>
<br/>
If you have any difficulty with any part of this website please do not hesitate to contact us using the details on the home page </div> ';
И этот раздел ниже - это код для моих выпадающих ящиков
include "select.class.php";
echo "<form id=\"select_Academic\">";
echo "<select style=\"width:200px;\" id=\"category\" name=\"cat\" >";
echo $opt->ShowAllCategory();
echo "</select>";
echo "<select style=\"width:200px;\"id=\"type\">";
echo "<option value=\"%\">";
echo "Section";
echo "</option>";
echo "</select>";
echo "<select style=\"width:200px;\"id=\"principle\">";
echo "<option value=\"%\">";
echo "Principle";
echo "</option>";
echo "</select>";
Если я поставил вышеприведенный код без include "select.class.php";
все отображается правильно, но выпадающие окна не выполняют функции так, как должны.
Я посмотрел на эту ссылку. Включите целое содержимое файла и повторите его.
любые идеи будут высоко оценены
+ Изменить
<<<<< this is where i want my drop down boxes to be >>>>
в
[LIST1] [LIST2]
+ Изменить
echo "<form id=\"select_Academic\">";
echo "<select style=\"width:200px;\" id=\"category\" name=\"cat\" >";
echo $opt->ShowAllCategory();
echo "</select>";
до $ list1 = "". "". $opt-> ShowAllCategory(). "";
Затем выполните str_replace ("[LIST1]", $ list1, $ info);
select.class.php
?$opt->ShowAllCategory();
вызывает SQL-запрос из select.class