Jump to content

murfitUK

Members
  • Posts

    207
  • Joined

  • Last visited

Everything posted by murfitUK

  1. murfitUK

    PHP editor

    I use PSPad - does the highlighting you want for almost any language(!) but not the debugging. www.pspad.com
  2. Probably need to use the ereg or eregi functions. Have a look at this page:http://uk2.php.net/manual/en/function.eregi.phpCan't help more as haven't yet plucked up the courage to use it!
  3. You could try this:SELECT * FROM books WHERE title < 'A'This would give you titles starting with a number - but also blank entries as well.
  4. As $page now hold the value found from the get statement you can put it straight into your $sql statement so you don't need to write a line for each letter of the alphabet. And you might as well stick the sort term in as well.$sql = "SELECT * FROM songs WHERE title LIKE '{$page}%' ORDER BY {$sort}";
  5. Use the wildcard in your select egSELECT titles FROM books WHERE titles LIKE 'A%'Have a look at sqlcourse.com
  6. Thanks for the quick replies.Good point about why was I escaping the double quotes so I've changed them all to single quotes. This now works OK if a double quote mark is used in form input line1. But now get the 1064 error message if line1 includes a single quote mark.I have echoed $query before running it and if line1 is I can't do that then $query prints out as:INSERT INTO table 'line1' VALUES ('I can't do that')Error 1064 : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 't this work?'I think this was why I used double quotes around the field name (hence the escaping) but I've sort of lost track of all the changes I've made since starting this project.Any suggestions?Thanks for your help.
  7. Following on to a previous enquiry about dealing with text input through an html form.Got a text input called line1. This posts to a php script. I have used the function stripslashes to deal with a problem if anyone used a single quote. This was if someone typed in eg I can't do that it displayed as I can\'t do that.Using $line1=stripslashes($_POST['line1']) solved that particular problem and echo($line1) printed I can't do that just fine.Now I am trying to get this string into a mysql database along the lines of:$query = "INSERT INTO table fieldname1 VALUES \"{$line1}\";";which works OK until a quote mark " is included in $line1. When the query is run eg:if (!($result = mysql_query($query, $connection))) showerror();it comes up with the error 1064 (I think) check your syntax near to ....Can someone suggest a solution. Thanks.
  8. I've been fiddling about with this today and think I've cracked it!Instead ofecho($data);tryecho nl2br($data);That the letters NL (just to clarify as the l can look like i or 1 | etc).You got in there quick justsomeguy!
  9. murfitUK

    Forms

    If your web hosting allows php you might think about php as it has some built in mail functions. I have a contact page that sends email directly through a web form. I pinched the code from somewhere and it was easy to copy & paste it in to my code. (Hint - don't try and re-invent the wheel if someone has already done it!)You can see it here My Webpage in the contact page - send me a message if you want!Also, have you tried scripts.com. There are quite a few webmail codes especially under the php scripts section.
  10. Not directly. HTML is a static language so once you have written and uploaded an HTML page to the server it is fixed. Any user who calls the html page will get the page exactly as it is stored on the server.Script languages such as PHP can be used to create dynamic html pages. When a user calls a page with .php or .asp etc the server "intercepts" the page, runs the script and transforms the output into html, and it the html that is then output to the user's browser.
  11. I have an html form with input type=text and name=line1. This calls reply.php using method=post.reply.php has:$line=$_POST['line1'];print $line;and does some other stuff.My problem is if the user types a ' in the form input eg I can't do that. It displays as I can\'t do that.What is the easiest way of solving this?I'm only asking because I know someone will have a quick answer. If I try and sort it by reading the manual I'll end up write 100s of lines of script!
  12. Well, you learn something new everyday! This will be useful to me too as I didn't know about it either.I wish I knew all the other things that I didn't know about - things would be so much easier!
  13. murfitUK

    Errors

    You've missed out a comma (,) between:'$_POST[Type]' '$_POST[Position]',
  14. murfitUK

    Row deletion

    From what I can work out, you are using a hyperlink to call the page called "delete_chk.php" and passing an id to that page by sticking "?id=something" on the end of the hyperlink.If this is correct I think you need to use $id=$_GET['id'] in your delete_chk page so that the variable $id now holds the value of id that it found at the end of the hyperlink.Try putting it immediately below the <?php declaration on delete_chk page.If that doesn't work let us know and we'll suggest other things.
  15. murfitUK

    Session variable

    You NEED session_start() on all the pages that reference the session. It checks to see if a session exists. If not , it creates a new session. If a session already exists it uses the data that's already there.Sometimes it seem silly having to do it immediately before you want to destroy a session, so your code looks like:session_start();session_destroy();but it has to be done!
  16. murfitUK

    windows username

    There's some suggestions here:http://www.thescripts.com/forum/thread2524.html
  17. You only need to separate the new row values with a comma.INSERT INTO tablename VALUES (a, b, c), (f, s, d), (x, y, z);Don't forget to put single quotes round strings though.
  18. To start with you need to add this to your left box#left {...float: left;...}Then remove the float from the right box and add a left margin that is bigger than the width of the left-hand box:#right {margin-left: 140px;}You will however encounter a couple of bugs in IE (the peek-a-boo bug and the guillotine bug) which can chop of parts of your div containers. Just google "IE CSS peek-a-boo" etc for some tips on how to solve it. It involves clearing the bottom of the div containers but I'm in a bit of a hurry and don't have time to go into more now.Good luck.
  19. It gives a warning because users are able to change default settings for example through Accessibility. I do it myself sometimes if my eyes are feeling tired. I can change Windows to eg Black background / White text. This means that if your website has specified black text then I won't see it because my background is also black. Unless of course you have also specifical stated a white background - which validator is warning that you haven't.If you use IE you can try it yourself. Go to Tools->Internet Options, then click the Accessibility button on the general tab.You will see various options for ignoring colours and fonts that your website uses. You can also use your own stylesheet to override everything which can be fun if you've got a few minutes to spare!
  20. murfitUK

    HTML Help

    Have you looked at this site?http://www.anicursor.com/moreani.htmlIf you read the tutorials you can find out how to create cursors and use them on a website. You have to consider using CSS but you can put the statement in the html <BODY> tag eg:<BODY style="CURSOR: url('myPointyCursor.ani')">obviously replacing myPointyCursor with the name of your cursor.
  21. Its definitely to do with IE6 reading pages from localhost. I uploaded the site to my web hosting space and tried it again. The cookies work over the internet but not from localhost.I'll start looking through internet option again!
  22. Me again.Right - I'm practising with cookies. It all works fine on firefox but not on IE6. I reckon I've changed some setting on IE6 to block cookies and now can't find how to enable them again.At the moment the site is on my computer - using Abyss web server, and WinmySqladmin and PHP4 (I think). The address I type in is http://localhost/website/index.phpAs I said, it works in FF but not IE6 so do you think there is a setting I need to change in IE6?
  23. Not sure what the problem is but maybe you could have a go at troubleshooting to see where it fails.First of all make your query to be SELECT.... all the way up to, but not including the WHERE or BETWEEN. See what the output is.If it works try it again but this time add the WHERE topics.topic_id=posts.topic_id. If that works then add the next bit (ie by adding topics.mod_id=$mod). And so on. If it all works up to the point you add the date fields then you know that's where the problem lies.
  24. I think it should endBETWEEN $startdate and $enddate(notice no ' at the start of the date fields).If this doesn't work - are you getting any error messages?
  25. murfitUK

    Webpage

    Not quite sure what you mean Paraiya. Do you want to move "Welcome to..." to the left hand side of the cell so it looks to be underneath "Banner Here".If so, its to do with the <center> tag you have around "Welcome to...". Also, If you put valign="top" it will move the text to the top of the cell. So this bit of the code: <td rowspan='3'><font color='white' face='verdana'><center>Welcome to Eternity Online</center></font></td>Try changing it to <td rowspan='3' valign='top' align='left><font color='white' face='verdana'>Welcome to Eternity Online</font></td>Have you though about trying to use css to create columns instead of using tables? Do a google for 2 column css layout.
×
×
  • Create New...