
fraser5002
Members-
Posts
33 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
fraser5002's Achievements

Member (2/5)
0
Reputation
-
Hi i have the following query for my database. $query = "SELECT * FROM entries WHERE id = '$u'"; Is there anyway i can alter this to use all but the last 3 characters from "id" for the query ( will need to obviously determine the length of id for this entry in the database first ) i.e similar to the operation of the php statement substr() Any Ideas? Thanks
-
Hi this is probably a easy question but i have been rattling my mind to it for about half an hour now . Im using an onclick event of a button to open a new webpage passing a PHP variable through the url at the moment im trying to use the following code. onclick="window.open('otherwebpage.php?itemtopassinurl=<? echo "$title[$i]"; ?>','popuppage','width=300,toolbar=1,resizable=0,scrollbars=yes,height=700,top=100,left=100')" ?>' I know i cant use the " " in the php bit of the code but i dont know what to use instead . I assume i cant use the ' character either??? How can i do this? Cheers
-
hi thanks the the reply it nearly works for me but i run into a problem when the <a is not separated by a space from the characters before it i.e sometext<a href="blabla.php"> link1</a> it does not seem to be able to pick up that first <a> tag and im assuming its because there is no space between the text and the start of the <a is this right? Thanks Fraser
-
Hi i have a string which contains some text and 2 links for example. How could i extract all the string minus one of the links eg $textstring = "some text before <a href="testpage.php"> <img src="image1.jpg" /></a> <a href="testpage2.php"> <img src="image2.jpg" /></a> some text after " i would like to make a create a new string which contains all this text minus the first link $newstring = "some text before <a href="testpage2.php"> <img src="image2.jpg" /></a> some text after " any ideas?
-
Hi All, Bit of a strange one but i would like to be able to supply a URL to a page. This page will always contain an image and the copyright that goes with it for example http://www.geograph.org.uk/photo/693325 The copyright lies undearneath I would like to get some php code that would automatically grab the image and copy this to a directory on mt site and also take the creative commons copyright notice as a string ( which i will then display along side the image when i add it to my site) How can i do this through php I know that the word "copyright" only ever appears once on the page ( as part of the bit im trying to grab) so can i use this somehow to grab the whole string? Basically im being lazy and would like to automate the process of grabbing the image and copywrite without having to download it to my computer first and reload to my server ( as i will be doing this quite a lot) Any ideas much appreciated Thanks
-
Hi all, I have a value in my MY SQl database that has carfriage returns in it such as "line 1 bla bla bla line2 bla bla bla line 3 bla bla bla " Im doing a query statement to return the value stored in this field and display it back in a textbox using javascript Problem is though when i try query this field it messes up my results and displays "object HTMLInputElement" in my textbox where it is supposed to go . If i take out the carriage retursn so the field looks like "line 1 bla bla blaline2 bla bla bla line 3 bla bla bla " then everything works fine. Why is the carriage returns messing up my code? Cheers
-
Hi, How would i strip out both the " and ' characters from a php string? Thanks Fraser
-
Hi i am using the following to try and add a string to a mysql database var ajax_connection = createRequest(); ajax_connection.open('get', "addtodb.php?text=" + textstring); ajax_connection.send(null); My problem lies when the string gets large >2000 characters as IE can no longer use URLs this long. How else can i achieve passing such a large string ? My idea was to use a cookie or a session but it seems a bit overkill in my opinion. Is there anything simpler?
-
Hi , I have a login page that i acces via www.mydomain.com/logib.php?last_visited_page.php however the passed in variable last_visited_page.com is not always set . once the login script has run , when the variable it is not set i would want jump to myaccount.php otherwise jump to last_visited_page.php How do i check for no variable beinf present and therefore jump to myaccount.php Many Thanks Fraser
-
Hi Im trying to keep a session open once a user logs in for a large amount of time ( months) I have set the following in a .htaccess file php_value session.cookie_lifetime 99999999 php_value session.gc_maxlifetime 99999999 But i still lose the session and get logged out after 10 minutes or so i have created a phpinfo page and see that for these values the following is set session.cookie_lifetime 99999999( local) 0 (global) session.gc_maxlifetime 99999999 ( local) 1440 (global) What is the difference between the local and global? Any other ides why might session keeps timing out after 10 mins or so of inactivity?
-
Hi Indeed that is what i am asking, i want the soundex for each word within the string which i will then cat together to form one new string of soundex values. What i dont understand is how to split up the string to its component words and take the soundex of each.
-
Hi i i need to be able to get the 4 lettter soundex value for each for in a string and combine them rather than having one 4 letter soundex code for the entire string . How would i do this?
-
Hi i am tryign to get to grips with FULLTEXT in MySQL to improve the search facilities on my site. $searchterm = 'Tomate' $query= SELECT * FROM testtable WHERE MATCH(vegetable) AGAINST($searchterm); I have the above code to to mess about to try understand . My table has a field called vegetable full of vegetables funnily enough, I have set this field to fulltext index My query is not returning any results for " Tomate" only if i use the proper word "Tomato" I thought the point with FULLTEXT is it would return "similar" results. DO i have the wrong end of the stick here? How do i use FULLTEXT to return searches of misspelt words?
-
Hi i have a php string in the form of an html tag i.e my php string $string = "<img title="http://www.mydomain.com/pic.jpg" src="http://www.mydomain.com/pic.jpg" alt="http://www.mydomain.com/pic.jpg" width="400" height="300" /> how do i extract out the src part of the tag so that i am just left with $src = "http://www.mydomain.com/pic.jpg" Many thanks
-
Im not sure how to debug it as the upload script is seperate and i just call it from my main page, so i'm not sure how to use echo?