Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. You will need to show the code here. Also, make sure the file to be included has been started and finished with php tags.
  2. Thanks very much to both of you, that is exactly what i want. Thanks again.
  3. No problem, Im guessing that the problem with the included file is that your php is unlikely to be set up to parse .inc files, so you will have to rename it to something like file.inc.php
  4. [quote]<form action="B_A-Login.php" action="POST">[/quote] Needs to be: <form action="B_A-Login.php" method="POST">
  5. Well if you include or require the first file in your second, then it would run as if it were one file: include("file1.php");
  6. Ok, i am inserting a row into a mysql table and the field `id` is automatically given a number as it is set to auto-increment. After performing the insert, is there any way to find out what number was actually put into the id field? I hope that makes sense. Thanks in advance.
  7. Im pretty sure there is nothing wrong with having two submit buttons in a form, so you do use submit buttons but just use differant names for them.
  8. [code]       <? if ($_GET['msg']){       echo '       <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>       </tr>       <tr>'       } ?> [/code] The problem with this is that you are missing the semicolon on line 82 [code]       <? if ($_GET['msg']){       echo '       <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>       </tr>       <tr>';       } ?> [/code]
  9. I dont think wha you are trying to do quite makes sense at the moment... As it stands, if the subscription_amount is equal to 149, it displays $20 and if not, it displays $27 You would need some other condition to have three possible outputs: if ($recSubscription['subscription_amount'] == 149){ echo "<br>USD $20.00"; }elseif(some other condition){ echo "<br>USD $27.00"; }else{ echo "<br>USD $34.00"; }
  10. [a href=\"http://uk2.php.net/manual/en/function.imagecopyresized.php\" target=\"_blank\"]http://uk2.php.net/manual/en/function.imagecopyresized.php[/a]
  11. Yeah, i thought that would be the only way to do it. Thanks for your help.
  12. I was wondering if it is possible to use the header() function to redirect someone but achieve something like using a target in an HTML link...like target="_top". I know it can be done by echoing out javascript, but i was wondering if there is a way to do this in php for those people who have javascript turned off.
  13. I would guess this is all down to the use of AND and OR. I believe that, at present, your statement retrives rows where ethier (omit=n and category1 is like $search ) OR (subcategory1 is like $search) I hope the use of brackets there shows you what i mean; if omit=yes but subcatgeory1 is like $search, then the result will still be returned. Im not 100% on the solution, i have a feeling you might be able to use brackets in some way with the where statement, but i also think if you added on an extra part to the statement like this: $query="SELECT id FROM stock WHERE omit='n' AND category1 LIKE '%$search%' OR subcategory1 LIKE '%$search%' AND omit='n'"; It might work. Dont hold me to it though ;)
  14. Not sure how you would accomplish all of this, it would seem like a large number of explode and implode functions to me... However, if you having problems with case sensitivity with str_replace(), use: str_ireplace (PHP 5) str_ireplace -- Case-insensitive version of str_replace().
  15. Pretty much the whole title :p
  16. Nice design in general, my only critisism would be the that i dont think the title font fits too well with the rest of the layout. Apart from that, it looks good
  17. Not sure if it is possible - certainly not possible easily(might be able to be achieved with ajax but i dont know anything about that) But perhaps you could store all these variables that you want to keep in a session and then redirect to the same page but set the variable you want to change in the url?
  18. [a href=\"http://javascript.internet.com/generators/popup-window.html\" target=\"_blank\"]http://javascript.internet.com/generators/popup-window.html[/a] That does it for you. lol. Fill out the form with how you want it, and it will generate the javascript for you.
  19. So you want to submit the form and then have the values in the URL? You need to use the GET method.... <form action="formpage.php" method="get"> <input name = "idNo" type="text"> <input type="submit" name="Submit" value="Submit"> This would give a url of www.example.com/formpage.php?idNo=the value in the field.
  20. <a href="location of page with image or the image itselft" target="_blank">Click here!</a> If you wanted the new window to be of a particular size, you would use javascript. Try searching the web for javascript pop-ups.
  21. Perhaps your best bet is to put that idea to the side for a minute and concentrate on getting a better knowledge of php. Use the beginner tutorials on this site - they may not be specifically for what you want, but they will include elemnts you can appy to any situation.
  22. Its probably easiest if you take a look at the manual [a href=\"http://uk.php.net/foreach\" target=\"_blank\"]http://uk.php.net/foreach[/a]
  23. Use mysql_num_rows(); [code] $sql = "SELECT * FROM `fieldname` WHERE `id`='$id'"; $result = mysql_query($sql); $num = mysql_num_rows($result) if($num < 1){ header("location:errorpage.php"); exit; } [/code]
  24. As you would if you were hand coding the page, just use width attributes: echo "<TABLE border='1' width='80%'>\n";
  25. change: [code] while (list($id,$category,$model,$price,$stock_amount) = mysql_fetch_row(result)) [/code] to [code] while (list($id,$category,$model,$price,$stock_amount) = mysql_fetch_row($result)) [/code] Should fix that.
×
×
  • 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.