Jump to content

flunn

Members
  • Posts

    38
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

flunn's Achievements

Member

Member (2/5)

0

Reputation

  1. I decided to try the code offered by michaelburt rather than try the solution suggested by PFMaBiSmAd. I can see that it would be more elegant to use the one-page solution but from my point of view it seemed impracticable because I have no experience with accessing data from urls or with databases — which seem to be necessary according to the tutorial which PFMaBiSmAd links to. michaelburt's code actually contained a couple of minor syntax errors, but after fiddling with it I managed to come up with something that seems to work perfectly. I'll paste it in below. I've included all the code in the file in order to emphasize the importance of putting the php section at the top. It seems that the "header" function must be placed not just before any info being uploaded but at the very beginning, even before the "DOCTYPE." Many thanks to michaelburt, PFMaBiSmAd and all the others who responded to my original posting. Forrest <?php if (isset ($_POST['word'])){ $target="flash_card_".$_POST['word'].".php"; if (is_file ($target)) header ("Location: $target"); } ?> <!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" lang="en" xml:lang="en"> <head> <title></title> </head> <body> <form action="<?php echo basename(flash_card_1b) .".php"; ?>" method="post"> <input type="text" name="word" /> <input type="submit" value="Enter" /> </form> <?php print $target; ?> </body> </html>
  2. When I insert the code recommended by Pikachu I get the following: Array ( [number] => hello [submit] => enter ) Doesn't that mean that the POST variable is not empty? As to the suggestion from dougjohnson, it sounds like a good idea but I'm afraid I don't know enough about using "GET" to implement it. I'm going to have to do some more studying I guess. PFMaBiSmAd's idea of using just one card would be good if I really were making flash cards but in fact those words were in the url only by accident. What I'm trying to do is to make a "page turner" like the ones you see in pdf readers etc. (I mean something that allows the user to go to any one of many pages of text by submitting the page number.)
  3. I really appreciate the three quick answers I got to my question but I guess I should have made it more clear that the POST values are not empty. I know they're not because when I submit the form, what I enter in the text box reappears there; in other words the form is 'sticky' because of the POST value in the first input tag. Also if I add another line after the form, <?php " print '$_POST['word'];" ?>, what I put into the text box is printed onto the screen.
  4. I have limited php skills but I thought it would be easy to write a script that would allow a user to use a html form to go from one page to another. I thought I could do this by simply inserting a php variable into the function tag but after many attempts I've had to give up. Here is my most recent attempt. <?php print '<form action= "flash_card_'.$_POST['number'].'.php" method= "post">'; print '<input type= "text" name= "word" value= "'.$_POST['number'].'" />'; print '<input type= "submit" name="submit" value="enter"/>'; print '</form>'; ?> My html editor says the syntax here is OK and the variable in the value attribute of the first input tag does what I want it to do. But the variable in the form tag does nothing. (If the user enters "2" in the text box, for example, the script attempts to send the user to the nonexistent "flash_card_.php" rather than to "flash_card_2.php" which is what I want.) any advice would be much appreciated regards to all from Forrest
  5. Thank you, Ignace, for your reply. I am posting the code as you requested. First the header: <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <title> <?php if (defined ('TITLE')) { print TITLE; }else{ print 'flesl.net - ESL materials'; } ?> </title> <script type="text/javascript" src="swfobject.js"></script> <link rel ="stylesheet" type = "text/css" href = "tense_quiz_styles.css" media="all" /> <style type="text/css"> p a { text-decoration: underline; color:black; } p a:hover { color:black; text-decoration: underline; } p a:visited { color:black; text-decoration: underline; } .comment{ width: 524px; margin-left: auto; margin-right: auto; margin-top:-6px; margin-bottom: 25px; font-style: italic; } .hi-lite{ padding: 2px; border: 2px solid #0099FF; background:#CCFFFF; } .light_hi-lite{ padding: 2px; border: 1px solid #0099FF; } .normal_space{ word-spacing:1px; } .plus_top{ margin-top:14px; } h2 { margin-left:0px; } .instructions{ color:black; text-indent: -.5em; margin-left: 10px; font-size: 12px; line-height: 140%; margin-bottom: 5px; } .bold{ font-weight: bold; } .instructions2{ margin-top:-3px; color:black; margin-left: 15px; font-size: 11px; } #instruction_box{ border: none; top: 35px; margin-left:0px; } #exercise_box{ } </style> </head> <body> <!--[if IE 6]> <div id="IEroot"> <![endif]--> <div id="new_wrapper"> <div id="banner_box"> <div id="banner_topLeft"> <?php print '<h1 class="gray">'; print $title ; print '</h1>'; ?> </div> <!--banner_topLeft--> <div id="banner_topRight"> <h2 class="banner_text"> <a href ="../new_home.html">home</a> &#8226; <a href ="../Directories/reading_directory.html">reading</a> &#8226; <a href ="../Directories/grammar_directory.html">grammar</a> &#8226; <a href ="../Directories/vocab_directory.html">vocab</a> &#8226; <a href ="../Directories/listening_directory.html">listening</a> &#8226; <a href ="../Directories/speaking_directory.html">speaking</a> &#8226; <a href ="../Directories/writing_directory.html">writing</a> &#8226; <a href ="../Directories/activities_directory.html">activities</a> </h2> </div> <!--banner_topRight_alt--> <div id="banner_bottomLeft"> <?php print '<h1 class="fourteen gray">'; print $sub_title ; print '</h1>'; ?> </div><!--banner_bottomLeft--> <div id="banner_bottomRight"> <h2 class="banner_text_bottom"><a href ="<?php print $local1;?>"><?php print $local1txt;?></a> <a href ="<?php print $local2;?>"><?php print $local2txt;?></a> <a href ="<?php print $local3;?>"><?php print $local3txt;?></a> &#8226; <a href ="<?php print $local4;?>"><?php print $local4txt;?></a> &#8226; <a href ="<?php print $local5;?>"><?php print $local5txt;?></a> </h2> </div><!--banner_bottomRight--> <div id="logo_box"> <!--<img src="http://www.flesl.net/Stories/Series2/flesl_logo(ps).jpg" alt="logo"/>//localhost:8888/flesl--> <img src="g_logo_5.jpg" alt="grammar_logo"/> </div> <!--logo--> </div> <!--banner--> And here is the rest of the code <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <?php $title="verb tense quiz"; $sub_title="simple past &<br/>present perfect"; $local3="about_tense_quizzes.php"; $local3txt="<span class=\"small_spacing\">about the tense quizzes</span>"; $local4="about_this_quiz.php"; $local4txt="<span class=\"small_spacing\">about this quiz</span>"; $local5txt="printable"; $start1= "\"I "; $end1=" an ad for this new movie, <span class=\"italic\">One for the Money,</span> in the paper this morning,\" Harry said to Jill at lunch. \"Do you know anything about it?\""; $correct1="saw"; $start2= "\"I certainly do,\" said Jane with a big smile. \"I "; $end2=" it three times already. I think it's great!\""; $correct2="have seen"; $start3= "\"By the way,\" said Harry a bit later, \"I "; $end3=" Jack at <span class=\"italic\">Pedro's</span> last night.\""; $correct3="saw"; $start4= "\"Was he by himself?\" Jill asked. \"Jane told me she "; $end4=" him with Sally quite often recently.\""; $correct4="has seen"; $start5= "\"Well, this time he was with Suzie,\" said Harry. \"She "; $end5=" me when they came in and gave me a big smile.\""; $correct5="saw"; $start6= "\"I'm pretty sure he "; $end6=" me too, but he pretended not to.\""; $correct6="saw"; $start7= "\"That's typical,\" said Jill. \"I "; $end7=" him do that sort of thing many times. He seems to think he can make himself invisible by not looking at you.\""; $correct7="have seen"; $start8= "Harry took a sip of his drink, looked at Jill, and said, \"Let's change the subject. I "; $end8="Ted's report on <span class=\"italic\"> NewStart</span> on your desk earlier.\""; $correct8="saw"; $start9= "And Jill replied, \"It looks fine to me, but I don't know if Jeremy "; $end9=" it yet. He's the one everything depends on.\""; $correct9="has seen"; $start10= "Jill and Harry walked most of the way back to the office in silence. When they were nearly there, Jilll suddenly said, \"Harry, I've decided to get a divorce. I "; $end10=" my lawyer."; $correct10="have seen"; require('tense_quiz_header.html'); print '<div id="content_box">'; print '<h2>Verb Tense Quiz 4: Simple Past & Present Perfect</h2>'; print '<form action="tense_quiz_4.php" method="post">';//START OF FORM print '<div id="instruction_box">'; print '<p class= "instructions bold">INSTRUCTIONS:</p>'; print '<p class= "instructions2">&#8226; TYPE THE <span class="bold">SIMPLE PAST</span> OR THE <span class="bold">PRESENT PERFECT</span> OF <span class="bold">"SEE"</span> IN EACH OF THE BOXES.</p>'; print '</div>'; //instruction_box print '<div id="exercise_box">'; //LOOP TO CHECK WHETHER ALL THE QUESTIONS HAVE BEEN ANSWERED foreach ($_POST as $value){ if (!empty ($value)){ $done++; } } //QUESTION ONE //if button has not been clicked if(!isset ($_POST['answer1'])){ print '<p> (1) '; print $start1; print '<input class = "white_back" type="text" name="answer1" size="10" value="'.$_POST['answer1'].'" />'; print $end1; print '</p>'; } //if button has been clicked but this question has not been answered elseif (empty($_POST['answer1'])){ print '<p>(1) '; print $start1; print '<input class= "yellow_back" type="text" name="answer1" size="10" value="'.$_POST['answer1'].'" />'; print $end1; print '</p>'; } //if all questions have been answered elseif ($done==11){ if (($_POST['answer1'])==$correct1){ $_SESSION['answer1']="right"; $score++; print '<p> (1) '; print $start1; print '<input class = "green_back" type="text" name="answer1" size="10" value="'.$_POST['answer1'].'" />'; print $end1; print '</p>'; }else{ $_SESSION['answer1']="wrong"; print '<p> (1) '; print $start1; print '<input class = "red_back" type="text" name="answer2" size="10" value="'.$_POST['answer1'].'" />'; print $end1; print '</p>'; } } //if not all questions have been answered but this one has else{ print '<p> (1) '; print $start1; print '<input class="white_back" type ="text" name="answer1" size="10" value="'.$_POST['answer1'].'" />'; print $end1; print '</p>'; } //QUESTION TW0 if(!isset ($_POST['answer2'])){ print '<p> (2) '; print $start2; print '<input class="white_back" type="text" name="answer2" size="10" value="'.$_POST['answer2'].'" />'; print $end2; print '</p>'; } elseif (empty($_POST['answer2'])){ print '<p>(2) '; print $start2; print '<input class= "yellow_back" type="text" name="answer2" size="10" value="'.$_POST['answer2'].'" />'; print $end2; print '</p>'; } elseif ($done==11){ if (($_POST['answer2'])==$correct2){ $_SESSION['answer2']="right"; $score++; print '<p> (2) '; print $start2; print '<input class = "green_back" type="text" name="answer2" size="10" value="'.$_POST['answer2'].'" />'; print $end2; print '</p>'; }else{ $_SESSION['answer2']="wrong"; print '<p> (2) '; print $start2; print '<input class = "red_back" type="text" name="answer2" size="10" value="'.$_POST['answer1'].'" />'; print $end2; print '</p>'; } } else{ print '<p> (2) '; print $start2; print '<input class="white_back" type="text" name="answer2" size="10" value="'.$_POST['answer2'].'" />'; print $end2; print '</p>'; } //QUESTION THREE if(!isset ($_POST['answer3'])){ print '<p> (3) '; print $start3; print '<input class= "white_back" type="text" name="answer3" size="10" value="'.$_POST['answer3'].'" />'; print $end3; print '</p>'; } elseif (empty($_POST['answer3'])){ print '<p>(3) '; print $start3; print '<input class= "yellow_back" type="text" name="answer3" size="10" value="'.$_POST['answer3'].'" />'; print $end3; print '</p>'; } elseif ($done==11){ if (($_POST['answer3'])==$correct3){ $_SESSION['answer3']="right"; $score++; print '<p> (3) '; print $start3; print '<input class = "green_back" type="text" name="answer3" size="10" value="'.$_POST['answer3'].'" />'; print $end3; print '</p>'; }else{ $_SESSION['answer3']="wrong"; print '<p> (3) '; print $start3; print '<input class = "red_back" type="text" name="answer3" size="10" value="'.$_POST['answer3'].'" />'; print $end3; print '</p>'; } } else{ print '<p> (3) '; print $start3; print '<input class="white_back" type="text" name="answer3" size="10" value="'.$_POST['answer3'].'" />'; print $end3; print '</p>'; } //QUESTION FOUR if(!isset ($_POST['answer4'])){ print '<p> (4) '; print $start4; print '<input class="white_back" type="text" name="answer4" size="10" value="'.$_POST['answer4'].'" />'; print $end4; print '</p>'; } elseif (empty($_POST['answer4'])){ print '<p>(4) '; print $start4; print '<input class= "yellow_back" type="text" name="answer4" size="10" value="'.$_POST['answer4'].'" />'; print $end4; print '</p>'; } elseif ($done==11){ if (($_POST['answer4'])==$correct4){ $_SESSION['answer4']="right"; $score++; print '<p> (4) '; print $start4; print '<input class = "green_back" type="text" name="answer3" size="10" value="'.$_POST['answer4'].'" />'; print $end4; print '</p>'; }else{ $_SESSION['answer4']="wrong"; print '<p> (4) '; print $start4; print '<input class = "red_back" type="text" name="answer4" size="10" value="'.$_POST['answer4'].'" />'; print $end4; print '</p>'; } } else{ print '<p> (4) '; print $start4; print '<input class="white_back" type="text" name="answer4" size="10" value="'.$_POST['answer4'].'" />'; print $end4; print '</p>'; } //QUESTION FIVE if(!isset ($_POST['answer5'])){ print '<p> (5) '; print $start5; print '<input class="white_back" type="text" name="answer5" size="10" value="'.$_POST['answer5'].'" />'; print $end5; print '</p>'; } elseif (empty($_POST['answer5'])){ print '<p>(5) '; print $start5; print '<input class= "yellow_back" type="text" name="answer5" size="10" value="'.$_POST['answer5'].'" />'; print $end5; print '</p>'; } elseif ($done==11){ if (($_POST['answer5'])==$correct5){ $_SESSION['answer5']="right"; $score++; print '<p> (5) '; print $start5; print '<input class = "green_back" type="text" name="answer5" size="10" value="'.$_POST['answer5'].'" />'; print $end5; print '</p>'; }else{ $_SESSION['answer5']="wrong"; print '<p> (5) '; print $start5; print '<input class = "red_back" type="text" name="answer5" size="10" value="'.$_POST['answer5'].'" />'; print $end5; print '</p>'; } } else{ print '<p> (5) '; print $start5; print '<input class="white_back" type="text" name="answer5" size="10" value="'.$_POST['answer5'].'" />'; print $end5; print '</p>'; } //QUESTION SIX if(!isset ($_POST['answer6'])){ print '<p> (6) '; print $start6; print '<input class="white_back" type="text" name="answer6" size="10" value="'.$_POST['answer6'].'" />'; print $end6; print '</p>'; } elseif (empty($_POST['answer6'])){ print '<p>(6) '; print $start6; print '<input class= "yellow_back" type="text" name="answer6" size="10" value="'.$_POST['answer6'].'" />'; print $end6; print '</p>'; } elseif ($done==11){ if (($_POST['answer6'])==$correct6){ $_SESSION['answer6']="right"; $score++; print '<p> (6) '; print $start6; print '<input class = "green_back" type="text" name="answer6" size="10" value="'.$_POST['answer6'].'" />'; print $end6; print '</p>'; }else{ $_SESSION['answer6']="wrong"; print '<p> (6) '; print $start6; print '<input class = "red_back" type="text" name="answer6" size="10" value="'.$_POST['answer6'].'" />'; print $end6; print '</p>'; } } else{ print '<p> (6) '; print $start6; print '<input class="white_back" type="text" name="answer6" size="10" value="'.$_POST['answer6'].'" />'; print $end6; print '</p>'; } //QUESTION SEVEN if(!isset ($_POST['answer7'])){ print '<p> (7) '; print $start7; print '<input class="white_back" type="text" name="answer7" size="10" value="'.$_POST['answer7'].'" />'; print $end7; print '</p>'; } elseif (empty($_POST['answer7'])){ print '<p>(7) '; print $start7; print '<input class= "yellow_back" type="text" name="answer7" size="10" value="'.$_POST['answer7'].'" />'; print $end7; print '</p>'; } elseif ($done==11){ if (($_POST['answer7'])==$correct7){ $_SESSION['answer7']="right"; $score++; print '<p> (7) '; print $start7; print '<input class = "green_back" type="text" name="answer7" size="10" value="'.$_POST['answer7'].'" />'; print $end7; print '</p>'; }else{ $_SESSION['answer7']="wrong"; print '<p> (7) '; print $start7; print '<input class = "red_back" type="text" name="answer7" size="10" value="'.$_POST['answer7'].'" />'; print $end7; print '</p>'; } } else{ print '<p> (7) '; print $start7; print '<input class="white_back" type="text" name="answer7" size="10" value="'.$_POST['answer7'].'" />'; print $end7; print '</p>'; } //QUESTION EIGHT if(!isset ($_POST['answer8'])){ print '<p> ( '; print $start8; print '<input class="white_back" type="text" name="answer8" size="10" value="'.$_POST['answer8'].'" />'; print $end8; print '</p>'; } elseif (empty($_POST['answer8'])){ print '<p>( '; print $start8; print '<input class= "yellow_back" type="text" name="answer8" size="10" value="'.$_POST['answer8'].'" />'; print $end8; print '</p>'; } elseif ($done==11){ if (($_POST['answer8'])==$correct5){ $_SESSION['answer8']="right"; $score++; print '<p> ( '; print $start8; print '<input class = "green_back" type="text" name="answer8" size="10" value="'.$_POST['answer8'].'" />'; print $end8; print '</p>'; }else{ $_SESSION['answer8']="wrong"; print '<p> ( '; print $start8; print '<input class = "red_back" type="text" name="answer8" size="10" value="'.$_POST['answer8'].'" />'; print $end8; print '</p>'; } } else{ print '<p> ( '; print $start8; print '<input class="white_back" type="text" name="answer8" size="10" value="'.$_POST['answer8'].'" />'; print $end8; print '</p>'; } //QUESTION NINE if(!isset ($_POST['answer9'])){ print '<p> (9) '; print $start9; print '<input class="white_back" type="text" name="answer9" size="10" value="'.$_POST['answer9'].'" />'; print $end9; print '</p>'; } elseif (empty($_POST['answer9'])){ print '<p>(9) '; print $start9; print '<input class= "yellow_back" type="text" name="answer9" size="10" value="'.$_POST['answer9'].'" />'; print $end9; print '</p>'; } elseif ($done==11){ if (($_POST['answer9'])==$correct9){ $_SESSION['answer9']="right"; $score++; print '<p> (9) '; print $start9; print '<input class = "green_back" type="text" name="answer9" size="10" value="'.$_POST['answer9'].'" />'; print $end9; print '</p>'; }else{ $_SESSION['answer9']="wrong"; print '<p> (9) '; print $start9; print '<input class = "red_back" type="text" name="answer9" size="10" value="'.$_POST['answer9'].'" />'; print $end9; print '</p>'; } } else{ print '<p> (9) '; print $start9; print '<input class="white_back" type="text" name="answer9" size="10" value="'.$_POST['answer9'].'" />'; print $end9; print '</p>'; } //QUESTION TEN if(!isset ($_POST['answer10'])){ print '<p> (10) '; print $start10; print '<input class="white_back" class="white_back" type="text" name="answer10" size="10" value="'.$_POST['answer10'].'" />'; print $end10; print '</p>'; } elseif (empty($_POST['answer10'])){ print '<p>(10) '; print $start10; print '<input class= "yellow_back" type="text" name="answer10" size="10" value="'.$_POST['answer10'].'" />'; print $end10; print '</p>'; } elseif ($done==11){ if (($_POST['answer10'])==$correct10){ $_SESSION['answer10']="right"; $score++; print '<p> (10) '; print $start10; print '<input class = "green_back" type="text" name="answer10" size="10" value="'.$_POST['answer10'].'" />'; print $end10; print '</p>'; }else{ $_SESSION['answer10']="wrong"; print '<p> (10) '; print $start10; print '<input class = "red_back" type="text" name="answer10" size="10" value="'.$_POST['answer10'].'" />'; print $end10; print '</p>'; } } else{ print '<p> (10) '; print $start10; print '<input class="white_back" type="text" name="answer10" size="10" value="'.$_POST['answer10'].'" />'; print $end10; print '</p>'; } print '</div>'; //exercise_box print '<div id="button_box">'; if ($done !=11) print '<p><input type="submit" name="submit" value="check answers"/></p>'; if (($done > 0)&&($done < 11)) print '<p class="incomplete_message">Answer all the questions before checking!</p>'; if($done==11){ if ($score==0) $score="0"; print "<p class='score'>score: $score/10.<br/></p>"; print '<a href="tense_quiz_4.php"><p class="score">repeat quiz?</p></a>'; print '<a href="tense_quiz_4(KEY).php"><p class="score">study explanations?</p></a>'; print '</div>'; } print '</div>'; //button_box print '</form>'; print '</div>'; //content_box print '</div>'; //wide_wrapper ?> </body> </html>
  6. I have a page on my website which includes a form-based quiz, coded in php, that works properly on my local (MAMP) server but not on my public server. The quiz is supposed to work in the following way: The user answers the questions by typing into text boxes and then clicks on a “submit” button. The quiz reappears with the answers intact but with the background colors of the text boxes changed to green or red depending on whether the questions are answered correctly or incorrectly. This works properly on the local server, but on the public server, the first time the button is clicked, the quiz simply reappears without the background colors changed. When the button is clicked for a second time, everything works as it’s supposed to and continues to do so until the browser is closed. When the browser is reopened, the problem reappears. I have contacted the support people at the public server but they have been no help so far. Any ideas on what might be causing this or on how it might be fixed would be much appreciated. regards to all from flunn
  7. I'm working on a redesign of the home page of my website. I'm using rollover popups (text only, no images, no links) as a way of providing more information to users without cluttering up the page. I’ve managed to write valid code that works fine in all browsers I’ve tested except for IE 6 and 7. There are two problems with the popups on IE 6 & 7: (1) the formatting disappears (very simple formatting, just a matter of bold and italic text and indentation) (2) the popups are not on the top level (in other words, when the popups appear, they are not fully visible because they spread “under” adjacent divs rather than over them as in other browsers.) I have used “x-index” in the code and have tried to solve the problem by fiddling with the settings but to no avail. (I have read that x-index is not supported in IE6, but I’m not too worried about that. I’d be happy if I could get the popups working properly in IE7 and then write special code without popups for IE6.) These two snippets include the crucial code. h4 a:hover{ color: black; border-bottom: 1px solid black; } h4 a span{ display:none; text-decoration: none; } h4 a:hover span { display:block; position:relative; top:0px; left: -10px; width:200px; height:255px; padding: 12px; margin: 10px; z-index: 5; color: black; background: #FDF8AB; font: 12px Arial; text-align: left; font-weight: normal; line-height: 125%; } <div id = "fp_box_6"><h4><a href="/flesl/Directories/listening_directory.html">listening<span> <object class="bold">&#8226; audio files for paired stories</object><br/> <object class="bold">&#8226; other listenings</object><br/> <object class="pop">- gambling addiction (2)</object> </span> </a> </h4> </div> <!--fp_box_6--> (I would be happy to give the url of the page, but as I understand it, this site does not permit the posting of urls.) with best regards to all from flunn
  8. Thanks, ACE, for your reply. I used the function you suggested and it certainly does come closer to getting the lines right. However there are problems: -The doctype does not appear. -None of the html tags appear. -The radio buttons I used in forms appear as actual radio buttons instead of appearing as '<input type = "radio" ...'. -Instead of being at the end of the lines of php code as they're supposed to be, the quotation marks and the semi-colons come at the beginning of the following line. If you have any other suggestions as to how I can display code that is set up in the way it's set up in my html editor, I'd be very grateful. regards to all from flunn
  9. I want to display a hundred or so lines of html/php code on a web page. I've found a code munger that does an excellent job of converting html code into ascii codes. The problem is that when I put the results between <p> tags there are no line breaks, so it's quite unreadable. When I put the ascii codes into a "TEXT AREA" box there are line breaks but not in the right places. Any suggestions as to how I might solve this problem would be much appreciated. I just want the displayed code to look like it looks in my html editor (Taco). best regards to all from flunn
  10. Thanks to Steve Angelis and PFMaBiSmAd for their replies. I've tried the "<pre>" and the nl2br() ideas, but without success I'm afraid. I've also tried a couple of online translators that are supposed to make code friendly for display. They solve part of the problem but if I put in all the code I want to display they generate php errors like ("expecting T_string") I'm afraid I've got in over my head here. Anyway thanks again to both of you and regards to all from flunn
  11. Greetings: I'm trying to use htmlentities() to display html/php code on a web page. It works fine except for one problem: the code is displayed as a single line, but I want line breaks where I have put them in my editor. Any advice as to how to solve this problem would be much appreciated. regards to all from flunn
  12. Thanks (blush!) to everyone for their replies. with regards from flunn
  13. I seem to be missing something very basic about how "sessions" works. If I understand it correctly, I should be able to use it to assign a value to a variable on one page and then access that value on another page. But if I use this code on the first page <?php session_start(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN"> <html> <head> <title></title> </head> <body> <?php $_SESSIONS['test']= 1; print $_SESSIONS['test']; ?> </body> </html> "1" is returned,but if I try to access the value of $_SESSIONS['test'] on another page with this code: <?php session_start(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN"> <html> <head> <title></title> </head> <body> <?php if(isset($_SESSIONS['test'])) print $_SESSIONS['test']; else print 'not set'; ?> </body> </html> 'not set' is returned. Any advice would be much appreciated. regards to all from flunn
  14. Thank you, premiso, for your reply. Basically your solution works fine. When I used absolute paths in the header the css style sheet and the graphic were accessed properly. There's still a serious problem however: there's a "Flash" sound file linked to the page but now that I've moved that page into another directory, I can't access the Flash player. The Java code that sets this up is as follows: <script type="text/javascript"> var s3 = new SWFObject("mp3player.swf", "line", "100", "20","7"); s3.addVariable("file","<?php print $listen; ?>"); s3.addVariable("repeat","false"); s3.addVariable("showdigits","true"); s3.write("flashbanner"); </script> I tried replacing "mp3player.swf" with an absolute url but that didn't help. ("mp3player.swf" is in the same directory as the file I'm working with was originally in.) best regards and thanks again for your help.
  15. Thanks, Glyde, for your reply. But: I'm not sure what you mean by 'modifying tags. Are there different sorts of "img" tags? (And, if so, how would I figure out which one I need here?) Also, I had no idea there was such a thing as a "css tag." I thought that ''css" was just used as an "extension" at the end of a file name. Also, if this were a html problem, I don't see why everything would work fine when all the files were in the same directory, but not when they're in different directories.
×
×
  • 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.