Jump to content

warewolfe

Members
  • Posts

    57
  • Joined

  • Last visited

    Never

Everything posted by warewolfe

  1. if ($OK=1) is always true as it is true you have just assigned the value of 1 to the variable OK. Maybe you want ($OK == 1) $query2 = "IF ($OK==1) echo 'In Flight'; else echo ARRIVE ='$ARRIVEE'"; $result2 = mysql_query($query2); but even then $query2 doesn't look like any mysql query I've ever seen.
  2. Sorry, That doesn't scan as there is no reference to a product, link or anything commercial. The comment is typically positive if non-specific. For the example the name of comment maker would be something like williamxc and the comment will be something like, "nice site, good information, will be back". Where is advertising in that? Also, the site is accessibility active. Can't put off the visually impaired.
  3. change line 10 to echo "<td align=\"left\" width=\"50%\" height=\"35\"><a href=\"".$_SERVER['PHP_SELF'] ."?action=logout\">Logout</a></td>";
  4. From the script, you've missed the end brace on the first line. You've also got missing concatenations in line 10. I'd advice you look at the error logs. Also you'd save yourself a lot of work if you work more within the html rather than have the php generate the html. Don't echo the whole line, just insert <td> <?php ucfirst($name); ?> </td>
  5. I've written a guest book in php and had security issues which have been solved ,thanks in large part to reading other peoples questions in this site, and the tutorials. Lately I've been getting seemingly benign comments from people with weird names. I've googled some of them and they turn up with exactly the same name and comments on thousands of forums. Does anybody know why people would write bots to do this? I suspect that it has something to do with using search engines to target forums but does anybody know what they hope to gain from this?
  6. Thanks for the reply,   Found the answer myself but you kinda right for symptom two. For others who have similar problems (I found a couple of similar complaints when I googled the symptoms)   The problem was how I was calling the local php generated page. I was calling it from C:\Apache2.2\htdocs\MyWebDir\index.php instead of http:\\localhost\MyWebDir\index.php and so IE treated the page as an intranet generated file rather than a local file.   Once I had changed that everything was fixed.
  7. Due to a series of hardware failures I've recently had to do a full reinstall of my system (Win Xp) and took the chance to upgrade to the latest stable versions of Apache2.2, PHP5, and Mysql4.1.   After installation and testing I'm getting the strangest behaviour when I check out any local page with a php extension. Sympton 1) Treats any attempt to open a local php page as a "file download" (works ok for online pages) Sympton 2) If I go to any other page with javascript it comes up with a "information bar" saying that it's blocked some content, if I allow the content I can then use the browser to look at local php pages. But it won't use include files.   This behaviour is not replicated when I check out the same pages using FireFox. Everything works fine in FF.     Any help or hints would be appreciated. WW
  8. Hej,   The difference between case 1 ($var =="")  and case 2 ("" == $var) is this, if you forget to add the second = sign in case 2, which happens often as your first unedited post shows, then the program will fail right away and let you know exactly where it fails and is very easy to debug.   If you forget the second = sign in case 1 then the 'if' test will always return true, and sometimes your program will work and sometimes it won't. Much harder to debug.   K&R is a style of code presentation (indenting and bracketing), so is Allman. I prefer Allman style as it is easier to match brackets but it doesn't really matter which one you do as long as you do one consistently. check out http://en.wikipedia.org/wiki/Indent_style WW.
  9. Hej, I don't know if that is just a typo for the example but if($act = "") will always be true as it is true you are assigning $act the value of ""   some people recommend doing an if check if("" == $act) {do something}   because if you mistype and print if("" = $act) {do somthing} you'll find out pretty quickly. As for code layout, try bracketing and indenting in a consistent manner. All k&R or all Allman style. Mixing and matching makes for hard reading.
  10. You seem to be assigning $topOpen the results of an if else. which should get you an error of PHP Parse error:  parse error, unexpected T_IF in ...
  11. Hej,   If sessions are not working for you   && you are using a form on both page 1 and page 2   && and you need data passed from page 1 to go to page 3 then   use input type="hidden" fields to pass data along.      
  12. Hej   Use sessions? page one has session_start(); $_SESSION["data1"]=$data1; and page three has session_start(); $data1 = $_SESSION['data1']; WW
  13. Hej if it was ../ it would mean to go back one directory then up another directory branch. as it is ./ it would mean stay in the directory you are in now and then go up a named branch. (In Windows that is.) WW
  14. hej   two things you can do, 1) Add an alt attribute to the img tag, which will show up if the image can not be found or rendered.     replace img src=../images/btn_forum.gif width=66 height=21 border=0> with <img src=../images/btn_forum.gif  alt="missing image" width=66 height=21 border=0> or straight replacement. 2)   replace <img src=../images/btn_forum.gif width=66 height=21 border=0>   with <h3>Link here</h3> And could you use punctuation next time, it makes the question easier to understand and quicker to answer.
  15. Hej   Trying to understand the problem. Is it the sudden change in the script behaviour? Otherwise add $username=$_POST['username']; $password=$_POST['password']; to the start of the echo script.
  16. hej   Perhaps if you want multiple values to go to the same name then that name should be an array. Eg checkboxName[] WW
  17. Hej   I suggest you check that the 'first name' field on the form that sends to your script is spelt right. WW.
  18. <?php echo"Dear ". $first. " ";?> should have been <?php echo"Dear $first" ?>
  19. Hej,   I'm not certain if I understood your question, but should you just check to see if the checkbox is "off" That is   if(chck_box == "off")   {     //Error message   }   else if(chck_box =="on"   {     //Everything okay message   }   else   {     //violation of excluded middle law message   }
  20. Hej, In regards to the "Dear.."; not printing. replace <?php "Dear ". $first. "<br/>";?> with <?php echo"Dear ". $first. "<br/>";?>
  21. Hi, how are you planning in getting the page in the first place? Is it a page you are getting from the net or one you are generating in the first place? The second is a lot easier than the first.
  22. Hi, use the c style string commands to get a formatted answer. check out sprintf in the php manual for more information $price = 49.50; $formattedPrice = sprintf("%01.2f", $price); echo"$formattedPrice";
  23. Thanks for the help, I'm going to autoincrement the target image's name with "target$var.jpg" to get the same effect as a fresh name but still be able to show the image within an html tag.
  24. Actually above solution works for firefox, now guessing it's a case of Internet Explorer just being Internet Explorer.
  25. Got that, just trying to see if there was a non-javascript solution given that there is a form action going on and the page is renewing itself at least partially. I'm trying to understand why the page will not fully renew itself as the Headers for the target.jpg change on submit, but not the image itself. Even with the caching turned off.
×
×
  • 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.