Jump to content

thehigherentity

Members
  • Posts

    49
  • Joined

  • Last visited

    Never

Posts posted by thehigherentity

  1. Im trying to update my BBCode function so it will check links and emails have the current beginnings eg mailto:, http:// etc

    What I would like to know is how i can add a function into the following so the $1 is checked my my fix_url() function.

     

    $str = ' My wbsite '; // my link

    $str = preg_replace('/\[url\=(.*?)\](.*?)\[\/url\]/is', '<a href="$1">$2</a>', $str);

     

    I have tried changing the code to the following and many versions of it with no luck!

     

    $str = ' My wbsite '; // my link

    $str = preg_replace('/\[url\=(.*?)\](.*?)\[\/url\]/is', '<a href="'.fix_url('$1').'">$2</a>', $str);

     

    If It cant be done this way could someone please point me in the right direction to another way I could do the same type of thing.

     

    Thanks in advance

     

  2. Is there any way I can return results by searching part words ?

    eg I have a table with 5 columns

     

    Id | Name | address | Phone | email

     

    Lets say I have 3 people in this table with the following names

     

    Smith, Stephen Michael

    Wilson, Sarah Louise

    Wood, Stephanie  Anne

     

    What I want to be-able to do is search part of the name eg "steph" and get the results that contain this.

    which from this example would be

     

    Smith, Stephen Michael

    Wood, Stephanie  Anne

     

    At the moment I am returning all the results and looping through them doing a php check but I now have over 2000 people and growing fast.

    any help that can be given would be appreciated

  3. All i can tell u is the £ shows up as £ in the code however I cant even get a str_replace("£","£", $whatever) to work.

    But... Once i have used the htmlentities() on it i can simply remove the  and i can then display it.

     

    It just means i have had to change my code a little later on but, its no real problem now seems to work ok. I would of like to of blocked out all the strange symbols but they all seem to be displaying correctly now so its all good. until i find somthing else that dont show correctly

     

    thanks for everyones help though :)

  4. Thanks for that, My docunent is saved in utf-8 format and I tried the utf8_encode() but it made even more problems.

     

    so for now i have taken the following out

    $document = eregi_replace("[^[:space:][:punct:]a-zA-Z0-9]"," ",$document);

     

    and replaced it with the following, I know this does not do what the above does but it seems to fix many of the errors

    on my site and my £'s are not being removed, so it will have to do for now i think.

    $document = str_replace("Â", "", htmlentities($document, ENT_QUOTES));

     

    thanks for your help though :)

     

  5. Im having even more problems with my £ sign :(

     

    Im trying to pass a document through the following code (hoping it will stop any strange symbols being passed onto the page).

     

    $document = eregi_replace("[^[:space:][:punct:]a-zA-Z0-9]"," ",$document);

     

    I had to use <META http-equiv=Content-Type content="text/html; charset=UTF-8"> in my header to get my £ signs to show correctly and now it gets removed when the document is passed through the above line? everything else i want to allow through is getting there with no problems and i realy dont want to convert anything to html at this point.

     

    Can anyone help with this please. I dont care if its done through another bit of code as long as it will still pass everything this line will.

  6. Thanks for that,

     

    I have checked the settings on scream and found they where already set to Unicode (UTF-8) so, I believe thats ok...

    However, I am getting the same problem even when i write a page in my text editor so it could be a system setting I'm missing somewhere that could be overiding it (God knows where though).

     

    Thanks for your help and if anyone has any ideas I would be very happy to here them.

  7. strange symbols appearing

     

    This is a problem i have never come across before and I'm stumped to why I am now getting this?

     

    I use scream on ubuntu when building websites (but i get the same problem when using a text editor too), I have never had a problem until the last few days I have noticed any £ signs i enter seem to display with a strange a like symbols (Â) before them. Has anyone else had this problem? or can someone point me in the right direction to fixing it? As far as I'm aware i haven't changed any settings that could of done this.

     

    thanks for any help anyone can give me...

  8. Fist off i have looked all over trying to work out how to do this but with no real luck...

    what i want to do is have hidden div's containing links. once you click a link it will open the relivent container showing the hidden links inside
    I have this working now but my problem is getting the other div's that have also been opened to close so only one container is open at a time.
    I hope i have explained this ok

    here is the test code i have just so you can see how i am trying to do this, any help anyone can give would be great!

    [code]
    <style type="text/css">
    div#menu1 { display: none; }
    div#menu2 { display: none; }
    div#menu3 { display: none; }
    div#menu4 { display: none; }
    </style>

    <script language="JavaScript" type="text/JavaScript">
    <!--
    function togglehide(what){
    if (document.getElementById){ // this is the standard code
    var itsstyle = document.getElementById(what).style;
    itsstyle.display = itsstyle.display? "":"block";
    } else if (document.all){ // this is the old msie versions code
    var itsstyle = document.all[what].style;
    itsstyle.display = itsstyle.display? "":"block";
    } else if (document.layers){ // this is the nn4 code
    var itsstyle = document.layers[what].style;
    itsstyle.display = itsstyle.display? "":"block";
    }
    }
    //-->
    </script>

    <div id="sectionLinksheader"><a href="javascript:togglehide('menu1');" title="information">Information</a></div>
    <div id="menu1" style="">
    <div id="sectionLinks"><a href="index.php?page=news">News</a></div>
    <div id="sectionLinks"><a href="index.php?page=tou">Terms</a></div>
    <div id="sectionLinks"><a href="index.php?page=study">Study</a></div>
    <div id="sectionLinks"><a href="index.php?page=media">Media</a></div>
    <div id="sectionLinks"><a href="index.php?page=contact">Contact</a></div>
    </div>
    <br />
    <div id="sectionLinksheader"><a href="javascript:togglehide('menu2');" title="indormation2">Information2</a></div>
    <div id="menu2" style="">
    <div id="sectionLinks"><a href="index.php?page=news">News</a></div>
    <div id="sectionLinks"><a href="index.php?page=tou">Terms</a></div>
    <div id="sectionLinks"><a href="index.php?page=study">Study</a></div>
    <div id="sectionLinks"><a href="index.php?page=media">Media</a></div>
    <div id="sectionLinks"><a href="index.php?page=contact">Contact</a></div>
    </div>
    <br />
    <div id="sectionLinksheader"><a href="javascript:togglehide('menu3');" title="information3">Information3</a></div>
    <div id="menu3" style="">
    <div id="sectionLinks"><a href="index.php?page=news">News</a></div>
    <div id="sectionLinks"><a href="index.php?page=tou">Terms</a></div>
    <div id="sectionLinks"><a href="index.php?page=study">Study</a></div>
    <div id="sectionLinks"><a href="index.php?page=media">Media</a></div>
    <div id="sectionLinks"><a href="index.php?page=contact">Contact</a></div>
    </div>
    <br />
    <div id="sectionLinksheader"><a href="javascript:togglehide('menu4');" title="information4">Information4</a></div>
    <div id="menu4" style="">
    <div id="sectionLinks"><a href="index.php?page=news">News</a></div>
    <div id="sectionLinks"><a href="index.php?page=tou">Terms</a></div>
    <div id="sectionLinks"><a href="index.php?page=study">Study</a></div>
    <div id="sectionLinks"><a href="index.php?page=media">Media</a></div>
    <div id="sectionLinks"><a href="index.php?page=contact">Contact</a></div>
    </div>
    [/code]

    P.S. im no expert with this, I have put this together from bits of code i have found allover the place
  9. I am in the process of making a website were people will beable to upload images and write a little bit about the image. At the moment i have functions made that will upload the image then reseze the image and create a thumbnail, what i want to do next is add a perminent watermark to the image, IS THIS POSSIBE?

    I have tried to figger this out myself and only managed to creat images with watermarks that are only there while the image is displayed, this would be great if they didnt use a header call such as
    header("Content-type: image/jpeg"); or
    header("Content-Disposition: filename=" . $image);

    my problem is once i load some text to the screen alonge with this image the who page is destroyed with heaer already set errors or my text is jumbeled into the image.

    So basicaly, im after some advice, is there a way i can add a perminent watermark afer i have uploaded the image or is there a way to merge two images on screen and still beable to add more test and images too ?

    a little more info just incase its needed, I am only allowing gif and jpg files to be uploaded and my watermark image is png, I dont know if this makes any differeace?

    Thanks for any help u can give me...

  10. [quote author=kenrbnsn link=topic=112068.msg454672#msg454672 date=1161294114]
    Use the functions [url=http://www.php.net/date]date()[/url] and [url=http://www.php.net/strtotime]strtotime()[/url]:
    [code]<?php echo date('d/m/Y',strtotime('19760427')); ?>[/code]

    Ken
    [/quote]
    Thanks for that m8, I have been banging my head on the wall trying, I new it would be simple. Cant believe i never thought of the date function lol
  11. Im trying to find a way to convert dates that are stored in a database as E.G. 19760427 to 27/04/1976.

    I cant change how they are saved as this "19760427" format is needed for a different part of the code but
    I would like to be-able to display the date in this "27/04/1976" format too.

    Any ideas ?
    Its probaly simple but i have no idea....

    Thanks to anyone in advance that can help
  12. Im not 100% sure what you mean by that, the java menu is fine until the drop menu opens and hapens to be in the same area as a flash file, I have noticed this on a number of other sites too.

    Infact I have been looking all over and cant find a site that has the menu float over a flash file anywere.

    Is it not posible?
  13. I have a java menu on my site and I displau flash movies on some of the pages, my problem or question is,
    Can i stop the flash movie floating over my menus?

    when a dropdown java menu is displayed in the same place as a flash file it disapears behind it rather then floating over it?

    is there anything that can be done about this or is it better to change to a different form of menu?
  14. I am working on a flash header for my site but… I’m using flash 8, I know that there are a lot of people that have not yet updated to view these files,

    so i want to add some code to see if they have a viewer for flash 8 files

    Is it possible to do this with php?

    All I need to know is how to find out if they have macromedia flash 8, I can work the rest out as I go

    Thanks for any help
  15. for starters i have only been playing around with mysql for a few days so i know very little about it

    I am trying to move a guest book to another server, however I cant connect to mysql and create the needed database

    the code we are using is
    [code]
    $host = 'localhost';
    $user = 'username';
    $pass = 'password';
    $dbname = 'gbook';
    $query = "CREATE DATABASE $dbname";
    mysql_connect($host, $user, $pass) or die(mysql_error());
    mysql_query($query) or die(mysql_error());
    [/code]
    all we get is the following error!
    Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

    im geussing its the 'localhost' thats the problem, but the server we're trying to move to, is a shared host and gives you access to nothing. I have been told you can access mysql by changing localhost to the correct path but all the information we know is The MySQL installation directory ' /usr/local/mysql' and have no idea how to work out what the correct path is [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /]

    could anyone help me out here? I have been looking round the net and there are loads of sites explaining how to sort this at the prompt, however we dont have access to one!
  16. I have setup a table with a number of users
    I am now trying to get a login to work but for some reason the password() function
    is giving me loads of hassle.

    the following is the query being sent to mysql

    I have set the user name to username and the password to password just to make life realy easy

    SELECT userref FROM users WHERE userid = 'username' AND userpassword = password('password')

    if i change it to

    SELECT userref FROM users WHERE userid = 'username' AND userpassword = '5d2e19393c'

    it works fine so the problem has to be in the encryption

    does anyone know of this problem and how to fix it?

    I'm completly lost here
  17. is there a way to retreave all the data from a set user in a table?

    Im querying select username from users_table were userid = '$userid'

    then im using mysql_fetch_row($results);

    I believe this only brings the one row though

    and i want to bring more then one row back from the db

    I have managed to do it,

    I called all the data from the table then looped through taking out what i wanted
    but I just wonderd if there was a better way?

    I have only been playing with mysql for a couple of days and realy have no idea what can and cant be done
×
×
  • 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.