www.webdeveloper.com

Search:

Type: Posts; User: chrisb

Page 1 of 7 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    609

    Converting a date in PHP?

    Hello,

    I'm using $_GET to grab hold of a URL string which contains a date which in the format like so:

    YYYY-MM-DD

    Now, my question is, how do I grab this value and transform it, so when I...
  2. Replies
    4
    Views
    1,939

    Thanks!

    Thanks!
  3. Replies
    4
    Views
    1,939

    Thanks notdog, but still have that same issue. ...

    Thanks notdog, but still have that same issue.

    Say a user enters the URL as:

    page.php?news_id=dodgycode

    The code should chuck the user out to my error page, but it's not. I'm getting an...
  4. Replies
    4
    Views
    1,939

    Working with intval?

    Hello Peeps,

    I'm trying to keep my data safe and clean in my database, so anything that i'm using with $_GET to retrieve a URL I want to make sure an int value is passed. IE, say my URL was:
    ...
  5. Thanks NotDog. The previous posting threw me a...

    Thanks NotDog. The previous posting threw me a bit. So simply this for using $_GET is fine?:



    if(intval($_GET['id'] == $_GET['id']) {

    $SQL = "SELECT * from news WHERE...
  6. Sorry been away from the forum for a few days. ...

    Sorry been away from the forum for a few days. Am still a bit confused though. Eval said:



    So do I have to also use mysql_real_escape_string in my query like so when using $_GET, so my new...
  7. Sorry one last question. When you say about...

    Sorry one last question. When you say about image tags:



    Do you mean when I pull data out of MYSQL? If so the data I am pulling out could contain image links but to legitimate pictures ie...
  8. Thanks, that's great. Couple of things though ...

    Thanks, that's great. Couple of things though

    1) So would you suggest I do something like this to solve my problem?



    if (is_int($_GET['id'] )) {

    $SQL = "SELECT * from news WHERE...
  9. Is my site vunerable to xxs or CSRF attacks or SQL injections?

    Quick one really. On my website I call stories via $_GET. So for example if the url was:

    story.php?id=123

    The database would be queried for id=123 like so and output something like the...
  10. Thanks Nog Dog knew it was something simple! :) ...

    Thanks Nog Dog knew it was something simple! :)

    Also quick question if I may, while I was putting it together from what i've learnt online and other resources I was was wondering why I have to...
  11. Help creating a MySQL connection class in OOP?

    Hello,

    I'm trying to create a class named MySQL database as kindly suggested by NogDog in an earlier thread that will connect to a database and also query a table.

    However, i'm getting an error...
  12. Using OOP to output database driven content?

    Hello,

    I've kind of mastered the basics of working with OOP with regards to 'static' content thats not database driven, but now I want to make it database driven. So take this example below where...
  13. Replies
    3
    Views
    1,861

    OOP - return rather than echo?

    Hello,

    I've been told using php that it's bad practice to echo any contents in a class and you should always use return and never echo? Is that right?

    If it is the case is the best case...
  14. Thread: strpos?

    by chrisb
    Replies
    3
    Views
    1,011

    strpos?

    Morning,

    Quick one I can't seem to work out or find in the manual for strpos. Say I have this code and I want to check for the word dog




    foreach ( $lines as $line ) {

    if(strpos($line,...
  15. Replies
    2
    Views
    977

    if ($file == '.' || $file == '..') ?

    Never fully understood this. I understand if the file has one dot in it, but why two dots?




    if ($file == '.' || $file == '..') {
    //Code
    }
  16. Thread: Help with OR?

    by chrisb
    Replies
    2
    Views
    772

    Help with OR?

    Hello,

    I have this code and I want to say if the below is not true then continue:



    if ($array[0] != '' || $array[0] !='Mark' || $array[0] !='*'){
    //Do this, but only works singually, not...
  17. Replies
    1
    Views
    638

    On Key Up/ OnClick?

    Hello All,

    I have a piece of Javascript which i'm using to count the number of words in a textbox, which works nicely.

    However the text called into that textbox is called dynamically from a...
  18. Replies
    1
    Views
    663

    Video Player Javascript - help please?

    Hi,

    I'm looking for something along the lines of this on this website. Not exactly the same but i'd like the same kind of functionality.

    www.getbracknell.co.uk

    About half way down the page...
  19. Replies
    3
    Views
    738

    Thanks, I've tried this, and the feature comes...

    Thanks,

    I've tried this, and the feature comes out, but v doesn't for some reason?
  20. Replies
    3
    Views
    738

    Grabbing part of a youtube string?

    Hello,

    Say I assigned a variable a value from youtube ie:



    $var = 'http://www.youtube.com/watch?v=da5OtbEKhUg&feature=related';


    or
  21. Replies
    5
    Views
    910

    preg replace help?

    Hi,

    Say I have a string:



    $string ='This is <a href="http://www.absgsgjsssd.com">dsss</a>some text <a href="http://www.absgsgjs.com">dsss</a>';


    How could I find all the <a> tags in the...
  22. Replies
    2
    Views
    1,761

    Getting the next record using php

    Say i'm on a page in my website:

    page.php?story_id=1

    and I get that information out for that id (1)

    But say I want to get the next record in the databases information, how could I do that in...
  23. Thread: Time question

    by chrisb
    Replies
    1
    Views
    694

    Time question

    Hi,

    Say I had a time saved to a variable like so:



    $o_time = '11:55:00';


    How could I ditch the last two digits ie so 00 is not there?
  24. Replies
    1
    Views
    493

    Adding a day to a timestamp

    Can anyone tell me what's wrong with this please:




    $old_date = '2007-06-22 11:55:07';

    //Add one day
    $expiredate = date(''.$old_date.'',+3600*24);
    print $expiredate;
  25. Replies
    1
    Views
    682

    Drag and drop picture image?

    Hello all,

    I have a script in php which re-sizes and image and scales the canvas down to 200x200. However the full image remains in a folder.

    Is there any kind of javascript (or even php)...
Results 1 to 25 of 172
Page 1 of 7 1 2 3 4
HTML5 Development Center



Recent Articles