Jump to content

ICubis2

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Everything posted by ICubis2

  1. S$%t - I apologize. This problem is being caused by the same HTML code that gave me the other problem. Somehow I reverted back to that other code without the fix. (All those lines of code commented out.) Making the fix again did take care of the problem. Again, sorry for wasting your time on this one.
  2. Here's the section of HTML for the page the presents the results table: <div id="e16" style="position:absolute;left:177;top:147;width:418;height:573;"><script type="text/javascript"> function checkForm16() { return true; } </script> <?php echo "<form action='other_flip.php' method='post'>"; echo "<table border='1'>"; echo "<tr><th colspan='2'>Your competition results.</th></tr>"; echo "<tr> <th bgcolor ='#FFFF00'>Winning Team</th> <th>2nd Place Team</th></tr>"; echo "<tr> <th bgcolor ='#FFFF00'>".$_SESSION['win_num']."</th> <th>".$_SESSION['2nd_num']."</th></tr>"; $count =1; while ($count <= $_SESSION['rows']){ echo "<tr><td valign ='top'>"; echo "<tr><td bgcolor ='#FFFF00'>".$_SESSION['winner'][$count]."</td><td>".$_SESSION['second'][$count]."</td></tr>"; echo "</td><td valign ='top'>"; echo "</td></tr>"; $count++; } echo "<input type='submit' value='What if - opposite flip?'>"; echo "</table>"; echo "</form>"; //reset button echo "<form action='kind-comp_input.php' method='post'>"; echo "<input type='submit' value='Start Over'>"; echo "</form>"; ?> <!--$end exclude$--> </div>
  3. The user selects a radio button in the beginning of the process to set the coin flip - either heads or tails. The initial results table show the result correctly. Also the first time the swap coin flip SUBMIT button is activated it works fine and shows the opposite. The problem is on the next activation of this same button. $_SESSION['Coin_Flip'] becomes the same thing (either heads or tails) because the script is being run through twice. Again, EI works correctly and only runs through the script once, so the user can toggle back and forth between the heads and tails results tables. FF and Safari start double executing the script on on each activation of the button from the 2nd time onward.
  4. I have a problem that is particular to the FF and Safari browsers. I do not see the problem in IE. Again, I am very new to php programming - no formal training - just a hacker. I have a web page that presents a form with a results table and a SUBMIT button. Each time the button is selected I want to present one of two different tables of results. Everything works fine the first time I hit the SUBMIT button. The page updates and shows the second table. But on the next SUBMIT the script that swaps things around is executed twice in FF and Safari vs. one time like in EI. This results in the same result table being displayed over and over vs. the two switching back and forth. Any idea what could be going wrong in these two browsers? Here's my swap script: <?php session_start(); // This script reverses the coin flip to see what would happen the other way if ($_SESSION['Coin_Flip'] == "heads") { //switch to tails $_SESSION['Coin_Flip'] = "tails"; include ('tails_algo.php'); } elseif ($_SESSION['Coin_Flip'] == "tails") { $_SESSION['Coin_Flip'] = "heads"; include ('heads_algo.php'); } include ('kind-comp_result.php'); ?>
  5. I already did and by commenting each of them out is what fixed my session variable problem. When I put just one back in then I lose the session variables again. I saw no formatting issues removing these lines of code. I was hoping someone much more knowledgeable than I would recognize what might be going on, but I'm just happy I can move on past this problem issue now. Thanks all.
  6. The presence of this code in itself does not kill my session variables. I can echo them after the nav bar code is executed and they are fine. They do not get destroyed until the SUBMIT button of this displayed page is activated. This is the action that then destroys the session variables. I believe everything not dependent on these variables is fine.
  7. OK, I have found the line(s) of code that are killing the session variables in my code. It is in the section that builds my navigation menu. Again, understand that I did not explicitly write this code - Yahoo! Sitebuilder did the writing. Each menu option within the table is written like this: <tr><td> <a href="index.html"> <img name="i5" src="sitebuilder/images/navbar-0-inactive-39952.png" border="0" width="163" height="22" alt=""/> </a></td></tr> <tr><td height="17" width="0"> <!--<img src="" height="17" width="1" alt="">--> </td></tr> The line that is commented out is the line causing the problem. I'm no expert on HTML. Anyone see what parameters within this line might be causing the problem?
  8. Oh, it is not solved yet. I will need to study your solution a little closer to understand it all. Then to try to implement it into my own app. Thanks...
  9. BlueSkyIS, That is the syntax I was looking for. Thank you. And I with this code I can harvest the inputs in a while loop that is based on the random number the user inputs to generate the number of different participants: $temp = $_SESSION['Num_Part']; $count = 0; while ($count <= $temp){ $temp3[$count]=$_POST['Participant_P'][$count]; $temp5[$count]=$_POST['Result_P'][$count]; $count++; } Many thanks.
  10. I hear you and may very well need to invest the time and effort into this - as I'm wasting too much time here. BTW - Yahoo! tech support tells me the php is working fine and the errors are being dumped to that file now. I ran my script and I'm seeing no new messages dumped there. So can I assume my script is not creating any errors? Something else must be killing my session variables???
  11. It's the file I posted previously. Also I'm on with Yahoo! tech support and they are telling me that there is php error reporting. They send all error messages to a scripts.log file in a log folder. That folder did not exist, so they are doing some php testing on my account now. Hopefully I will be able to access error messages for you soon.
  12. Yahoo! has error_reporting: no value and display_errors: off
  13. I have isolated the problem to a specific action. When the user selects a SUBMIT button from a 2nd form the session variables are lost then. They are there while the form page is created. They are there if I skip creating this page. The same file I use to test whether the variables are there or not works fine if I skip this file or call it at the end of this file - meaning the session variables are there and OK. But if I call this file from the action of the SUBMIT then the session variables are gone. Does this point to anything specific?
  14. I have isolated the problem to a single file. I'm now trying to associate the code that is causing the problem. Stay tuned...
  15. Thank you for your reply. I thought I understood what you were saying but I cannot get it to work. First, re naming input boxes... You say to name them all as one array name leaving the argument blank. Does php automatically assign and increment the argument with each subsequent input box? So I will have textboxes named: Participant_P[0] Participant_P[1] Participant_P[2] etc etc Then in my routine that harvests the user inputs from these textboxes... I'm confused still about how to access each array value. Is it $_POST['Participant_P[1]'] or $_POST['Participant_P1']? I tried both ways and neither seem to work. Thanks for your time.
  16. I use Firefox as a browser, but I'm not developing within a Simple Machine Forum platform.
  17. Yahoo! does not allow us to access our php.ini file. I have written their tech support to ask them what my settings are set to.
  18. I understand the first requirement, but not sure what you mean by the second. Do you mean it needs to be added into any file that subsequently creates new pages that use SESSION variable data? In my case here I have placed session_start() at the beginning of all my files. I guess my question next is - can it be used in error. Meaning - if I have it in a file where it should not be, does this then restart the session, so this is why my session variables are being killed? Should it not be used in a file that is called after one that has it - if that next file does not print to the browser?
  19. I have a form that creates rows of data input textboxes depending on a user input number of things. I have a naming convention for all these textboxes that basically just keeps incrementing a number suffix for each row. All this is working fine. My problem is I need to get the data inserted into this table of textboxes into an array. Here's my code where I attempt to to this (it does not work): $temp = $_SESSION['Num_Part']; $count = 1; while ($count <= $temp){ $temp2[$count] = "'Participant_P".$count."'"; //echo $temp2[$count]."<br/>"; $temp3[$count]=$_POST[$temp2[$count]]; //here's the problem $temp4[$count] = "'Result_P".$count."'"; $temp5[$count]=$_POST[$temp4[$count]]; //here's the problem //echo $temp4[$count]."<br/>"; $count++; } The problem is that the $_POST does not work with the variable in the argument position - even though the argument is formatted with single quotes. Can a variable be used in a POST argument and if so what is the correct syntax? If not, is there some other simple solution to harvest the data into an array. I understand I can harvest by explicitly accessing each key in the post assoc array. But this could be dozens of rows of input fields. Thanks in advance for your help here. I couldn't find anything online re this topic.
  20. I already did this in the past and they are there at the end of the calling file and then gone in the next file called (test.php) by the Submit button action. So (to me) it appears like the Submit button is causing the problem. I'm wondering if there is a problem because I edited the original form code I created in Sitebuilder that uses their <form within their <div id... ??? I'm kind of confused about where exactly I need to place the session_start()... Do I only need it once before I begin to create session variables or does it need to be placed at the beginning of each called file that uses the session variables? I have tried it both ways and it did not change my problem. But I would appreciate a clarification on this. I wonder by using multiple times where it has some ill affect. Not sure where to go from here. I guess I should start skipped entire files and see whether a particular file is causing the problem.
  21. <?php session_start(); ?> <!--$sitebuilder version="2.6" extra="Java(1.6.0_05)" md5="1103a396ae2cf073a0d7c1ee03d35b27"$--> <!--$templateKey HotJobs|Nexus - Olive|2.0$--> <html> <head> <title>Kind-Comp Tool</title> <meta name="generator" content="Yahoo! SiteBuilder/2.6/1.6.0_05"> <meta name="author" content="P. Joseph Shumaker Jr."> <meta name="keywords" content="Sports competitions, Individual sports, training competition, practice competition, Shuamker Competition, Kind Compeition,"> <!--$page margin 0, 1, 20, 1$--> <!--$fontFamily Arial$--> <!--$fontSize 12$--> <style type="text/css"><!-- BODY {font-family:"Arial"; font-size:12;margin:0px;padding:0px;} P {font-family:"Arial"; font-size:12;} FORM {margin:0;padding:0;} --></style> <script type="text/javascript">// workaround for IE table layout bugs function tableWorkaround(cols) { if (document.all) { document.write('<tr>'); for (var i = 0; i < cols; i++) { document.write('<td></td>'); } document.write('</tr>') }; } function tableWorkaround2_colheader() { if (document.all) { document.write('<col width="0">') }; } function tableWorkaround2(rowHeight) { if (document.all) { document.write('<td height="' + rowHeight + '">'); document.write('</td>') }; } </script> </head> <body bgcolor="#FFFFFF" background="clipart/backgrounds/sidebar/oliveBars_grayLines.gif" text="#666666" link="#0000FF" vlink="#800080" topmargin="0" leftmargin="0"> <!--$begin exclude$--> <div id="root" style="position:absolute;width:760px;height:1449px;"> <!--$end exclude$--> <div id="e0" style="position:absolute;left:588;top:0;width:171;height:139;"> <table border="0" cellspacing="0" cellpadding="0" width="171"> <tr> <td nowrap height="139" valign="top" bgcolor="#FFFFFF"><!--$emptyText$--></td> </tr> </table> </div> <div id="e1" style="position:absolute;left:171;top:105;width:575;height:32;"> <table border="0" cellspacing="0" cellpadding="0" width="575"> <tr> <td nowrap height="32" valign="top" bgcolor="#C3C89B"><!--$emptyText$--></td> </tr> </table> </div> <div id="e2" style="position:absolute;left:168;top:2;width:576;height:101;"><!--$img %RemappedImageAsset:/sitebuilder/clipart/bars/regular/horizontal/AbstractOlive.jpg$--><img src="clipart/pageHeaders/AbstactOlive.jpg" width="576" height="101" alt=""></div> <div id="e3" style="position:absolute;left:190;top:108;width:546;height:25;"><span class="text"><b><font color="#666633" size="4"><span style="font-size:20px;line-height:24px;">Kind-Comp Data Input Tool<br soft></span></font></b></span> </div> <div id="e4" style="position:absolute;left:1;top:147;width:163;height:334;"><!--$navbar name=navbar.nav assetID=%NavbarAsset:/navigation_bars/navbar.nav $--><!--$begin exclude$--><table border="0" cellspacing="0" cellpadding="0"><tr><td><a href="index.html"><img name="i5" src="sitebuilder/images/navbar-0-inactive-39952.png" border="0" width="163" height="22" alt=""/></a></td></tr><tr><td height="17" width="0"> <img src="" height="17" width="1" alt=""></td></tr><tr><td><a href="aboutus.html"><img name="i6" src="sitebuilder/images/navbar-1-inactive-40139.png" border="0" width="163" height="22" alt=""/></a></td></tr><tr><td height="17" width="0"> <img src="" height="17" width="1" alt=""></td></tr><tr><td><a href="services2.html"><img name="i7" src="sitebuilder/images/navbar-2-inactive-40217.png" border="0" width="163" height="22" alt=""/></a></td></tr><tr><td height="17" width="0"> <img src="" height="17" width="1" alt=""></td></tr><tr><td><a href="kindness_competition.html"><img name="i8" src="sitebuilder/images/navbar-3-inactive-40342.png" border="0" width="163" height="22" alt=""/></a></td></tr><tr><td height="17" width="0"> <img src="" height="17" width="1" alt=""></td></tr><tr><td><a href="products.html"><img name="i9" src="sitebuilder/images/navbar-4-inactive-40436.png" border="0" width="163" height="22" alt=""/></a></td></tr><tr><td height="17" width="0"> <img src="" height="17" width="1" alt=""></td></tr><tr><td><a href="Awards.html"><img name="i10" src="sitebuilder/images/navbar-5-inactive-44234.png" border="0" width="163" height="22" alt=""/></a></td></tr><tr><td height="17" width="0"> <img src="" height="17" width="1" alt=""></td></tr><tr><td><a href="nhpc_IP.html"><img name="i11" src="sitebuilder/images/navbar-6-inactive-90359.png" border="0" width="163" height="22" alt=""/></a></td></tr><tr><td height="17" width="0"> <img src="" height="17" width="1" alt=""></td></tr><tr><td><a href="pro_affiliations.html"><img name="i12" src="sitebuilder/images/navbar-7-inactive-39364.png" border="0" width="163" height="22" alt=""/></a></td></tr><tr><td height="17" width="0"> <img src="" height="17" width="1" alt=""></td></tr><tr><td><a href="contactus.html"><img name="i13" src="sitebuilder/images/navbar-8-inactive-81422.png" border="0" width="163" height="22" alt=""/></a></td></tr></table><!--$end exclude$--> </div> <div id="e14" style="position:absolute;left:397;top:45;width:250;height:34;"><span class="text"><b><i><font size="2"><span style="font-size:14px;line-height:17px;">Innovative Product Development<br soft></span></font></i></b></span> </div> <div id="e15" style="position:absolute;left:316;top:10;width:413;height:59;"><span class="text"><b><font size="5"><span style="font-size:24px;line-height:29px;">New Hope Products Company, Inc.<br soft></span></font></b></span> </div> <div id="e16" style="position:absolute;left:177;top:147;width:397;height:745;"><script type="text/javascript"> function checkForm16() { return true; } </script> <form style="margin-top:0;margin-bottom:0;" name="Form16" method="POST" action="test.php" onSubmit="return checkForm16()"> <?php $temp = $_SESSION['Num_Part']; echo "<table border='1'>"; echo "<tr><th colspan='2'>Please enter your competition results.</th></tr>"; echo "<tr> <th>Participant Name</th> <th>Challenge Result</th> </tr>"; $count =1; while ($count <= $temp){ echo "<tr><td valign ='top'>"; $temp2 = "Participant_P".$count; echo "<input name=$temp2 type='text' value=$temp2 size='20' />"; echo "</td><td valign ='top'>"; $temp3 = "Result_P".$count; echo "<input name=$temp3 type='text' size='15' />"; echo "</td></tr>"; $count++; } echo "</table>"; echo "<br/>"; //echo $temp. "<br/>"; ?> <input type="submit" value="Submit"> </form> </div> <!--$begin exclude$--> </div> <!--$end exclude$--> </body> </html>
  22. More background info... I use Yahoo! Small Business webhosting and am operating within their system. I have never had to worry about understanding any of the backend stuff php app stuff. I just create static HTML pages with their Sitebuilder and then modify and create new php files with their file manager. (I also use their MySQL apps to manage and create databases, but at this point this project has no database.) Sorry, I don't know much more about this than that. The file code I provided is the file where the session variables are lost. The session variables are of course defined in other files before this. They even work fine in files before this. The file that calls this code file is mainly an HTML file that presents a form. This file code is called when a SUBMIT button is selected and the variables are lost entering this file. Do you need to see the code in the calling file? Sorry, I'm such a newbie and don't know how to communicate properly.
  23. <?php session_start(); echo "Num_Part = ".$_SESSION['Num_Part']."<br />"; echo "Num_Teams = ".$_SESSION['Num_Teams']."<br />"; echo "Ref_Numbers = ".$_SESSION['Ref_Numbers']."<br />"; echo "Format = ".$_SESSION['Format']."<br />"; echo "High_low = ".$_SESSION['High_low']."<br />"; echo "High_low = ".$_SESSION['High_low']."<br />"; echo "Unit = ".$_SESSION['Unit']."<br />"; ?>
  24. Hi. I'm brand new to this forum, so sorry if I do something wrong... I'm someone who has thought myself to code in php to add dynamic objects to my basic static websites. I have had no formal education. This is not my first project however. I'm having problems with session variables working fine up to a point when I call a new file and then all my session variables are lost. I have tried everything, but cannot keep them alive when I get into this or any other new file. I display a form, get user data submitted, then display a next form and after the user submits this next form all the session variables are lost. Anyone have any idea what is killing my session variables? Thanks in advance.
×
×
  • 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.