Jump to content

ToonMariner

Members
  • Posts

    3,342
  • Joined

  • Last visited

Everything posted by ToonMariner

  1. WHERE Username = '$username' [b]AND[/b] Password = '$password'");
  2. If I understand what you are trying to achieve try teh following... [code]<?php $arrsel = array(); while ($row_infowouldlikebeincluded = mysql_fetch_assoc($infowouldlikebeincluded)) { $temp = explode("|", $row_infowouldlikebeincluded['infowouldlikebeincluded']); foreach ($temp as $value) {   arraypush($arrsel,$value); } } ?>[/code] use print_r($arrsel); to check the results.
  3. If you have phpmyadmin then just go in and add your column with that file as teh default value. If you HAVE to do it through php then.. $query = mysql_query("ALTER TABLE `image` ADD `im` VARCHAR( 255 ) DEFAULT 'image.jpg' NOT NULL "); now varchar limits you to 255 characters - if you need more then use teh text datatype; NOTE you cannot set a default value for text type so you will have to do and extra update after. PS if that fails it will be down to the privilages you have on teh database
  4. All the cases where you use $var, $var2 $var3 etc etc. just use $var each time - help teh server out a little bit. Why not leave all the mesages where they are - add one filed to you database 'trash' and have it set no 'n' or 'y'. Just show the ones marked 'y' in teh trash can and the rest in inbox; would probably help u in the ong run. You can then just update that field whne the user has checked against any messages.
  5. First check you table - make sure there are no other fields that MUST have a value inserted (those fields that should NOT be null buit have no default value.) It maybe simply be that register globals is off (as it should be) if so you must reference teh posted data 'properly'.....As your post uses the post method... [code]<?php $query = "INSERT INTO EdBlog ( DateField, CommentField, TitleField) VALUES         ('$today','" . $_POST['blogcontents'] . "','" . $_POST['titleof'] . "')"; ?> [/code] I use concatenation in strings just because I find it easier to locate those vars that are relevant....
  6. it doesn'y matter what extension you give anyfile in an include statement. But bear in mind the file is treated as plain text so if you want to include more php code the included file must be a valid stand alone script (it must have the <?php and ?> tags in there.) You can include as many things as you like - but have a look at using include_once and the require equivalents also they can really help especially in big files when you are not sure what you have or have not included yet. Be sure to refrain from having paths to includes being generated from user input. If it is absolutely neccessary use $_SERVER['DOCUMENT_ROOT'] at the start of the path - this will prevent them from including files on another server which could easily breach your own security.
  7. if your own secure pages are at risk you can do a couple of things. Set an extra field in your user database for super-user status. Give all those who need access to your super sensitive scripts a value and everyone else a different one. In your login script retrieve the users data and check to see if this new field allows them access - if it does set another session variable with a difficult to guess name. In your sensitive scripts check for the existence of this variable if its there let them in if not boot em out. You could request login once more on those scripts you want secure - annoying for you but they have to guess yoru login!!! Basicaly you need to implement some structure in login that affects you alone - so it doesn't matter if they can access there own session variables - so long as they don't ever hav the one set that gets you into yoru scripts then it should be good enough for you.
  8. forms for uploading files must have the enctype="multipart/form-data" attribute otherwise no file will be uploaded....
  9. From your code I can olny guess that the <> replacements are not workin as expected. &gt &lt need a ; after them!
  10. It is incrediably difficult to control any printing from php. PHP is server side and what happens client side is an different story. NOW printing is not the same world-wide I am informed that those in the US don't use the A4 size - predominant in european countries. You absolute best route of atck on this is to use a style sheet. just like anyother style sheet you can create one just for printing by adding the media="print" to the end of the link tag in the head section. Even then you are not guaranteed exactly what you want different printers and different drivers can alter margin sizes (although you can set them in your style sheet), and any number of default settings that you just cannot account for.
  11. Anything that sends headers MUST come BEFORE ANY output! session_start(); is often simply placed at the very top of the file as you can set it and forget it!. Unless you are using outout buffering for caching then NO output should come before ANYTHING that has to send headers.
  12. try... echo '<style type="text/css"> <!-- BODY { scrollbar-arrow-color: #FFFFFF; scrollbar-base-color: #008055; scrollbar-face-color: #008080; scrollbar-highlight-color: #83D8B0; scrollbar-shadow-color: #FFFFFF; scrollbar-3d-light-color: #FFFFFF; scrollbar-dark-shadow-color: #FFFFFF; } --> </style>';
  13. you sholdn't have any problems..... There is one session per client visiting the site (or have left without closing their browser and session has not been destroyed!) but I think you are trying to avoid problems that just won't occur.
  14. use a bit of js. in your links have onMouseover="javascript: window.statusbar.text 'urltoshow';" (or something like that - pretty sure gooling window.status will provide you with answers) this is of course only hiding from the status bar - if they go read the html then the normal stuff is there.
  15. all arrays (unless otherwise specified) are referenced bginning at 0. so..... $myrow[0], $myrow[1] amd $myrow[2] shoudl show the info you are expecting.....
  16. it will return C:\\blah blah on your machine but that is fine! did it include the menu file correctly? You should have no probs using it at ll just makes sure that all the paths are correct.
  17. Sorry mate its my short hand... $_SERVER['DOCUMENT_ROOT'] get that used to talking bout it!!!! sorry my bad (embarrassed smily ;))
  18. Not really. It simply appears that on your own machine you have error reporting switched off in your php.ini file. If you go and switch it on and DON'T get the same errors then something is a miss. Also check you are running the same versions of apache, php and mysql as the 'live' server. Now to your problem.... How is $id defined prior to these lines of code? I refer to the value of $id used in the mysql query. Also looking at the relevant lines.... $_SESSION['cart'][$id][0] = $id;..... ..... $_SESSION['cart'][$id][7] = $foo; since this is a session variable when you add another item to the cart $id is actually an array of 8 elements (0-8)... So the next page you use $id on it will take the array $id from the session array['cart']. the reason fro this..... I suspect you have register globals on your own computer set to a different value than it is on the server. (perhaps you shoudl clone the php.ini settings of the server too!!!!) If globals is on the $id will be 'assumed' teh $id from the session var. if globasl if off then you must refer to the session['cart'][$id] directly.
  19. That will only work if the call is from a file in a directory of teh same level as the inc directory. if inc is in teh root dir then a call to "../inc/menu.php" from root/dir1/dirx/diry/file.php would NOt call the correct file (the only time infact, that no error would be returned in that situation is if this existed.. root/dir1/dirx/inc/menu.php) MAKE SURE YOUR PATH IS CORRECT AT ALL TIMES (which is why $_SERVER['DOC_ROOT'] is so very useful)
  20. Alternatively you could use this... [code]<?php include($_SERVER['DOC_ROOT'] . "/includes/menu.php"); ?>[/code] Should be able to use that on each and every page with no problem. Bear in mind that apache shutting down could be as a result of a different error in your scripts... even if it only occure when you implemented this.
  21. replace the < and > tags with &lg; and &gt;
  22. Just thought further on this... the frame src="...." - if you want that to be different then use src="<?php echo FILEPATH&NAME; ?>" you don't need to include the file - but it shudl be valid html if only to not like a noob..... Now theother point - I hate frames. Much of my work is done for accessibility to AA and some to AAA and I prefer to mainta9in control over the flow of documents. Instead of a frame why not consider usign a div and specify some height and width for the div and also set a value for the overflow so that you can scroll within it. In my personal opinion your page will look far more professional and the doc flow will be maintained. If you did use that then you would of course use the include('FILEPATH&NAME'); inside the div tags.
  23. [b]<frame name="newsframe" src=<php? echo include "news.txt"?>> [/b] Should be... <frame name="newsframe" src="news.txt">.... try that.
  24. Yep. Just change smtp = localhost to smtp = smtp.talktalk.net Then all shoudl be well - ou shoudln't need anything else.
×
×
  • 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.