Jump to content

completeamateur

Members
  • Posts

    69
  • Joined

  • Last visited

    Never

Everything posted by completeamateur

  1. I just turned on all error reporting in php and its spuing out loads of errors all over my local site. The most common being trying to GET or POST a non-existant variable. What should I do? Ignore it or add something like this: if(isset($_POST["username"])) { $username = $_POST["username"]); } Regards.
  2. Ok scrap that, it seems to be working now. Bizarre. Instead, Does anybody know an easy way of converting a single digit to a double, i.e. 1 --> 01 Thanks
  3. Hello, I'm trying to query a database to obtain the correct results for a particular season. I'm trying to do this... (YEAR(datetime) = 2008 AND MONTH(datetime) < 07) OR (YEAR(datetime) = 2007 AND MONTH(datetime) >= 07) but it returns no rows. Confused as using one or the other works so I don't see why I can't use both. Thanks in advance.
  4. Thanks for the reply. The scripts use global variables so maybe thats the problem. What's the deal, do you have to use them as session variables nowadays? Bit of a ball ache changing it all.
  5. I feel a bit lazy posting on here, but I'm trying to upgrade from PHP 4.something to PHP 5.2.6. I tried using the windows installer to install php 5 which meant the bottom of my config file changed to this... LoadModule php4_module php4apache2.dll LoadModule dav_svn_module "C:/Program Files/Subversion/bin/mod_dav_svn.so" LoadModule authz_svn_module "C:/Program Files/Subversion/bin/mod_authz_svn.so" AddType application/x-httpd-php .php #BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL PHPIniDir "C:/Program Files/PHP/" LoadModule php5_module "C:/Program Files/PHP/php5apache2.dll" #END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL After deleting the top line, phpinfo() tells me Im running PHP Version 5.2.6 but half my websites don't load and I don't know why. Anyone any ideas what the problem could be? Many thanks. (Running apache 2.0)
  6. Hi guys, I'm after some constructive criticism of the design of www.footieclassics.com. I am quite keen to replace the shopping basket links with images to make them stand out. Does anybody know where I can get some free buttons? All comments welcome. Regards.
  7. Ok, I've ditched the javascript but now I'm getting some rather strange results... Whilst it's fine on my local server, when I upload them to my webspace, the menu appears twice in Internet Explorer. Any ideas why?
  8. I am trying to make my website fully xhtml/css compliant but am having troubles getting the menu working properly in IE. Works fine in firefox. Would be grateful of any advice/suggestions. http://www.villa4life.co.uk Thanks in advance. ???
  9. I am trying to rid my scripts of potential XSS/injection attacks. Can anyone tell me if it is messy to nest functions like this... $topicname = mysql_real_escape_string(strip_tags($_POST['topicname'])); ...is there a better way? Thanks in advance.
  10. Well, I have had a go at writing (and snatching) a simple message board. ...but have given up for the mo due to lack of time, i just wondered what everyone thinks so far & (more importantly) whether anyone can help simplify/improve it... The main objectives were: -simple as pie -xhtml/css compliant (no tables) -cross browser compatible (namely firefox/ie) for the time being i want to leave out user registration/login, as it is a different kettle of fish really (and as my user name suggests, i am a complete amateur) http://villa4life.co.uk/msgboard A zip with all the files in is available here, http://villa4life.co.uk/msgboard/msgboard.zip If I have forgotten anything, let me know, if not... tear it apart!!! thanks in advance!
  11. Cheers guys, I wouldn't have thought about exposing code when not using ".php".
  12. Just a couple of q's regarding include files... 1. Can I give them any extension I want? What is the best (.php .inc .txt)? 2. Does it matter if I have loads of includes in one page. I plan to have a template with 7 different include files (albeit small) to make maintenance/content easier to manage. Thanks in advance.
  13. Tested it all on my webspace and local server and it seems to all work swimmingly, I just need to design the rest of the site now!!! No doubt i'll be back on here before the end of the day! Thanks for your help.
  14. Got it working. It seems this doesn't work: [blockquote]<?php echo("<html> <body> This is some text.<p>"); echo("DOCUMENT_ROOT " . $_SERVER['DOCUMENT_ROOT']); include($_SERVER['DOCUMENT_ROOT'] . "/include/menu.php"); echo("This is some more text. <a href='" . [b]$_SERVER['DOCUMENT_ROOT'][/b] . "/subdir/anotherindex.php'>Click here</a>. </body> </html>"); ?>[/blockquote] But this does: [blockquote]<?php [b]$root = ("http://localhost");[/b] echo("<html> <body> This is some text.<p>"); echo("DOCUMENT_ROOT " . $_SERVER['DOCUMENT_ROOT']); include($_SERVER['DOCUMENT_ROOT'] . "/include/menu.php"); echo("This is some more text. <a href='" . [b]$root[/b] . "/subdir/anotherindex.php'>Click here</a>. </body> </html>"); ?>[/blockquote] I guess it all comes with being a complete amateur! I will post back when I get a chance to upload it to my webspace, but fingers crossed it is all sorted now. Big thank you to everyone who has helped, particularly the tyneside massive!
  15. DOCUMENT_ROOT seems to return: C:/Program Files/Apache Group/Apache2/htdoc on my local server, rather than [a href=\"http://localhost/\" target=\"_blank\"]http://localhost/[/a] which is what I think I require, so unfortunately it doesn't work. Suppose it will if I upload it but would be nice to get it working in both. Is this something to do with the setup of apache? Thanks.
  16. [!--quoteo(post=360723:date=Apr 1 2006, 11:22 PM:name=ToonMariner)--][div class=\'quotetop\']QUOTE(ToonMariner @ Apr 1 2006, 11:22 PM) [snapback]360723[/snapback][/div][div class=\'quotemain\'][!--quotec--] 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. [/quote] Toon, this works for the index.php file in the main directory but not for the anotherindex.php file in the "subdir" directory. Is this because it calls the root of where the file is? I suppose the root I require will always be the root to the main directory? Is there a function for this... or am I just talking garbage!
  17. [!--quoteo(post=360716:date=Apr 1 2006, 11:12 PM:name=play_)--][div class=\'quotetop\']QUOTE(play_ @ Apr 1 2006, 11:12 PM) [snapback]360716[/snapback][/div][div class=\'quotemain\'][!--quotec--] Try this: $root = "http://localhost/"; $menu = "include/menu.php"; $file = $root.menu; include ($file); and see if it still gives you an error [/quote] No joy play, but thanks for the quick reply. Do you think it is a problem with my set up but might work if I upload it to my webspace?
  18. Hello, I am new to php and I have a problem that I am sure php can solve, but don't know how. Firstly, I suppose it may help if I tell everyone what I have got: Windows XP Apache 2.0.55 win32 (for testing offline) PHP 4.4.2 win32 IE/firefox What I am trying to do is have an include file (which is the menu for the whole site) which I can then just 'load' into all individual files, making changes easier. The problem I have is defining the location of the include file (as it is located in a different directory). The source files are stored on a local server in: C:\Program Files\Apache Group\Apache2\htdocs and can be viewed by opening (in a browser): [a href=\"http://localhost/\" target=\"_blank\"]http://localhost/[/a] I had thought of $root = "http://localhost/"; //can be changed to address of website then constructing the location of the include file: include ($root . "include/menu.php") ...but this doesn't seem to work on my local server. I get the "Apache HTTP Server has encountered a problem and needs to close. We are sorry for the inconvenience." pop-up box. I haven't tried uploading it. I suppose what I really need is to be able to access the root directory or something? I don't really know what I'm talking about so if anyone can make any sense of this, that would be great! Below is the location & content of the files to try and give a better explanation. [a href=\"http://localhost/index.php\" target=\"_blank\"]http://localhost/index.php[/a] [blockquote]<?php $root = "http://localhost/"; echo("<html> <body> This is some text."); include ($root . "include/menu.php"); echo("This is some more text. <a href='" . $root . "subdir/anotherindex.php'>Click here</a>. </body> </html>"); ?>[/blockquote] [a href=\"http://localhost/subdir/anotherindex.php\" target=\"_blank\"]http://localhost/subdir/anotherindex.php[/a] [blockquote]<?php $root = "http://localhost/"; echo("<html> <body> This is some text."); include ($root . "include/menu.php"); echo("This is some more text. <a href='" . $root . "index.php'>Back to main index</a>. </body> </html>"); ?>[/blockquote] [a href=\"http://localhost/include/menu.php\" target=\"_blank\"]http://localhost/include/menu.php[/a] [blockquote]<?php echo("<hr>This is the menu<hr>"); ?>[/blockquote]
×
×
  • 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.