Jump to content

wejofost

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Everything posted by wejofost

  1. I have a website that reads Excel csv files ( using Excel reader.php ) and stores the data into a MySql database. This web site was written in 2006 and has worked well ( not every day but quite frequently ) without problems. Now it is failing, even when using previously accepted files saying the file is not .csv material. With the latest issues of MS Office do I require a newer version of Excel/reader.php? Is this the reason it is failing? Wej Parry
  2. Thank you roopurt18. I last used UNIX 10 years ago! but I do remember that find with grep is a cunning bit of software. I have access to a HPUX system so I'll use that. Best regards. Wej Parry
  3. Thank you for your reply. I fully understand that Text Editors can search a slected file for matching data but I have not yet come across a Text Editor that can open directories and search multiple files. The old Windows 2000 professional can search a whole series of directories for data strings within a whole series of files but I can't do that in Vista and Windows 7?
  4. I have over 230 files plus 39 directories ( 3.5Mb ) in my public_html directory and I am looking for where I specified/declared the contents of a variable! I can't for the life of me remember in which web page/directory I set up the contents of that run time variable. ( It was three years ago! ) Can anyone advise me how find that data variable ( Its called $depositrules )?
  5. Thank you Mike . I have added your suggested line to my test page. I have 4 similar lines in my test page but echo is displaying the code but not displaying results on the screen?? Please look at test page www.theparrys.co.uk/test.html It is something stupid that I am doing ( or not doing more likely )
  6. Very simple problem but got me beat. I am trying to capture and print on the screen the IP address that is looking at my webpage. After a lot of research I believe I have the data but cannot print it in PHP ( in an ASP WRITE RESPONSE type manner) Here is my test page. What am I doing wrong ?! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Untitled</title> </head> <body> <?php $page ='Test page'; $ipaddress = $_SERVER['REMOTE_ADDR']; $date = date ("M dS H:i:s"); $message = "$page _ $ipaddress _ $date\n"; $File = "track.txt"; $Open = fopen($File, "a+"); if ($Open){ fwrite($Open, "$message"); fclose ($Open); } <br> print this is a print on the screen statement; <br> print $message; <br> <br> Some test data to see if it can be displayed. $result = "OK"; $update = "Yes"; $updateid = "90094"; echo "result=".$result."\n"; echo "update=".$update."\n"; echo "updateid=".$updateid."\n"; ?> </body> </html>
  7. Good point "cags". However from time to time when I make a simple (typing/transposition?) mistake in the address in sending an email, using say outlook, I do get some responses saying message undeliverable. If an email was undeliverable would Phpmailer attempt to send such an undeliverable report?
  8. Users of our websites leave us their email addresses for us to reply to. Sometimes they make mistakes in their email addresses that our email address checks cannot determine ( bad spelling etc ). I am using Phpmailer but when I send an email that cannot be delivered ( because of an invalid email address) I do not get a delivery failed message? When sending emails with PhpMailer is there a specific address to catch undelivered mails? Where should I expect to see an undeliverable mail message?
  9. O.K. It works for me. Thank you. I was trying to be too sophisticated and ......... I'll stop trying to explain my stupidity.
  10. Just got PHP sessions working and getting results but unable to display the session data results in an existing HTML table. I can display it else where ( using echo etc ). How do I make the PHP session data visible in an existing HTML table?
  11. I have 5 pages that collect data ( a row of between 4 and 6 items per page ) I wish to display the collected data ( a row of between 4 and 6 items from each page ) in a table of results in the final "display" page. How can I store the intermediate result during processing other pages for subsequent display on the last page. Do I use Global data stores or do I have to use a MySql database? Wej Parry
  12. I have a HTML form with a series of 7 check boxes that have been passed to a php page where for each of the check boxes "ticked" I wish to increment a total by a different value depending on the check box ticked. I have a test page ( code below ) which proves that the check boxes have been ticked and I am using a 'while' statement to check if the box has been ticked and if so increment a total. PROBLEM is that the while statement runs continously when true. I expected it to go through once and then step on to the next statement but it loops for ever!. After a successful while statement ( that is the condition is true ) do I have to 'disable' the value ( make the condition false )? Help! <?php $newline = "<br>"; echo " Start of Living Room Selection. " ; echo $newline; echo " Total so far "; $lrtotal = 25000; echo $lrtotal; echo $newline; echo "Switch value = "; echo ($_POST['option1']); echo $newline; echo ($_POST['option2']); echo $newline; echo ($_POST['option3']); echo $newline; echo ($_POST['option4']); echo $newline; echo ($_POST['option5']); echo $newline; echo ($_POST['option6']); echo $newline; echo ($_POST['option7']); echo $newline; $TwoSeaterSofa = 1.00; $ThreeSeaterSofa = 9.00; echo "Twoseater literal is "; echo $TwoSeaterSofa; echo $newline; echo "Threeseater literal is "; echo $ThreeSeaterSofa; echo $newline; while (($_POST['option1'])== true) {echo ($_POST['option1']); $lrtotal = $lrtotal + $TwoSeaterSofa; echo $lrtotal; echo $newline; } while (($_POST['option2'])== true) {echo ($_POST['option2']); $lrtotal = $lrtotal + $ThreeSeaterSofa; echo $lrtotal; echo $newline; } // 5 more while statementsfor $_POST [option3 to 7 ] in here. echo " Total for living room "; echo $lrtotal; echo $newline; ?>
  13. :)Ken, Thank you for your patience and effort. A good working solution has been offered by user DyslexicDog so problem solved. Thank you.( and a happy new year. ). Wej Parry
  14. Thank you DyslexicDog. Solution works. Brilliant! Happy new year to all who have read and helped me with the resolution of this problem. Wej Parry
  15. Ken. You asked me to beter explain what I am trying to do. How is this? I am having a problem with the PHP Select/Case statement. Background. I am trying to create a series of web pages in PHP and HTML to allow users to calculate how much space they require for storage purposes of their household furniture. I have created a series of web pages in a test environment at www.ychdb.co.uk. The first page . ( see www.ychdb.co.uk/select_room_type.php ) presents a form to allow you to select a room type using radio buttons. When the SUBMIT button is selected you go to www.ychdb.co.uk/go_to_room.php which has a PHP SELECT statement. This is a series of CASE statements which I want to result in the user being transferred to different web-pages. I am trying to use HTML anchor tags and URLs to direct the user to their selected web-page. I can see that the correct value is being POSTed from the original form and that it is being interpreted correctly. However the user is not directed to the new web page. Everything else is working fine. What am I doing wrong ( or perhaps is there a better way? ) Here is the code that is failing. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Go To Room</title> </head> <body> <font size = "5"> Room Selector </font> <?php // The next line shows me what the FORM data is for testing purposes echo '<pre>' . print_r($_POST,true) . '</pre>'; $newline = "<br />"; echo $newline; import_request_variables('p', 'p_'); echo $p_group1.$newline; //set switch value $switch_value= "$p_group1"; switch ($switch_value) { case "R1": echo '<a href = "http://www.ychdb.co.uk/living_room.php">Go to Room 1</a><br>'; break; case "R2": echo '<a href= "http://www.ychdb.co.uk/dining_room.php">Go to Room 2</a><br>'; break; case "R3": echo '<a href= "http://www.ychdb.co.uk/other_room.php">Go to room 3</a>'; break; default: echo '<a href= "http://www.ychdb.co.uk/no_room.php">Go to any other room</a>'; // break; } ?> </body> </html>
  16. O.K. I have done that.Where would I see the output? Going to bed now as 3.30 in the morning ( Monday ). Thank you for your efforts so far. Wej Parry
  17. When I set the radio button on for the Living room selection and press Submit I know that the value "R1" is sent by the form and is visible to the SWITCH but the program flow does not go to the destination URL ( which is www.ychdb.co.uk/living_room.php ) and all other radio button selections are the same. Thank you.
  18. Ken Thank you for your help and patience. I see that you have combined the select page code and the distribution page code into one page. This completely covers the area where I have a problem. I have taken the code you sent and just changed the destination urls to the correct destinations and it does not work for me. See code below. Please try it? <?php //set switch value if (isset($_POST['submit'])) switch ($_POST['group1']) { case "R1": echo '<a href = "http://www.ychdb.co.uk/living_room.php">Go to Living room</a><br>'; break; case "R2": echo '<a href= "http://www.ychdb.co.uk/dining_room.php">Go to Room 2</a><br>'; break; case "R3": echo '<a href= "http://www.ychdb.co.uk/other_room.php">Go to room 3</a>'; break; default: echo '<a href= "http://www.ychdb.co.uk/no_room.php">Go to any other room</a>'; break; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>Select room type</title> </head> <body> <table width="100%" height="50%" border="2" bgcolor="green"> <tr> <td></td> <td> <form name="chooseroom" method="post"> <div align="left"><br> <input type="radio" name="group1" value="R1"> Living Room<br> <input type="radio" name="group1" value="R2"> Dinning Room<br> <input type="radio" name="group1" value="R3"> Kitchen<br> <input type="radio" name="group1" value="R4"> Laundry/Utillity Room<br> <input type="radio" name="group1" value="R5"> Bedroom<br> <input type="radio" name="group1" value="R6"> Garage<br> <input type="radio" name="group1" value="R7"> Other<br> </div> <input type="submit" value="submit" name="submit"><br /> </form> </td> <td bgcolor="white">Room for results </td> <td bgcolor="white"></td> </tr> </table> </body> </html>
  19. OK. I have extracted the failing logic bits and put together 7 "pages" that should achieve what I want to with all the other logic removed and the fault is still there. ( These are all in www.ychdb.co.uk. ) The application is to allow users to calculate what space they require for the storage of their household goods. I have attached the 7 pages. You start at select_room_type.php and this will take you to go_to_room.php and then depending on your selection go on to living_room.php, dining_room.php, other_room.php and no_room.php. The end event is calculate.php Thank you for your patience and time. Wej Parry [attachment deleted by admin]
  20. ??? Sorry to be a pain but that solution does not seem to work for me either??? Also that was the first solution I tried before I dug into the PHP header and location method that also doesn't work for me??? I am an old mainframe ex-programmer and trying to get to grips with PHP. Perhaps I'm on a different planet or something. I have put a test system together in a test environment. Basically go to www.ychdb.co.uk/select_room_type.php and then select a room and submit. You can see that the room numbers are POSTed correctly and the <A> tags are there via "view source" but interestingly the single quotes that top and tail them are not visible ( I have checked and I have put them in the original code on all cases ). Absolutely infuriating to get stuck on such a silly point as the rest of the coding is going fine in a mixture of HTML and PHP. Help!
  21. I found the "header (Location:" string in the online manual some time ago and have tried that several times and I get this error message. Quote Warning: Cannot modify header information - headers already sent by (output started at /home/yellohir/public_html/Calculate_values.php:14) in /home/yellohir/public_html/Calculate_values.php on line 47 The POST works OK as I get the correct "switch" value and can process almost anything within the switch/case environment ???
  22. I wish to "go to" a url as the result of a PHP SWITCH function. Here is an example. I reach this point via an HTML form which sends a value by POST like this <form name="chooseroom" action="Calculate_values.php" method="post"> and I pick up the switch value like this in a php environment <?php //set switch value $switch_value= "$p_group1"; switch ($switch_value) { case "R1": echo "Go to Living room"; // I want to put a url in here like <a href= "http://www.mysite.com/room1"></a> ?> <a href = "http://www.yellohire.com/about.php"></a> <?php break; case "R2": echo "Go to Room 2"; // I want to put a url in here like <a href= "http://www.mysite.com/room2"></a> break; case "R3": echo "Go to room 3"; // I want to put a url in here like <a href= "http://www.mysite.com/room3"></a> break; default: echo "Go to any other room"; // I want to put a url in here like <a href= "http://www.mysite.com/anyroom"></a> break; } ?> but I cannot get the transfer to the URL. Help (edited by kenrbnsn to put in the tags)
×
×
  • 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.