User Profile

Collapse

Profile Sidebar

Collapse
fran7
fran7
Last Activity: May 18 '15, 02:31 PM
Joined: Jul 7 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • fran7
    started a topic Escaping quotes and injections

    Escaping quotes and injections

    Hi, I wonder if someone could advise on the following.
    I inherited this code, I am not a coder but have had some kind of hack and am looking at code to reduce its vulnerability. At the top of the page I have

    Code:
    	nPage = CLng(Request.QueryString("Page"))
    
    	
    	Keyword = Trim(Request.QueryString("Keyword"))
    in the where clause I have
    Code:
    p.area LIKE '%" & Replace(Keyword,
    ...
    See more | Go to post

  • fran7
    replied to Remove all after certain character
    hi, I solved it like this in the nd so thanks.

    Code:
    UPDATE tbl
    SET website= LEFT(website, CHARINDEX('<', website) - 1)
    WHERE CHARINDEX(';', website) > 0
    Thanks
    Richard
    See more | Go to post

    Leave a comment:


  • fran7
    started a topic Remove all after certain character

    Remove all after certain character

    Hi, I wonder if anyone could help. I have been hacked and one field in my database has had html and links added after the original content.


    http://www.website.com </title><style>.a jbv{position:ab solute;clip:rec t(481px,auto,au to,446px);}</style><div class=ajbv><a href=http://ma

    I need to remove everything after and including the title to leave only
    http://www.website.com
    ...
    See more | Go to post

  • fran7
    replied to Select in query sql server
    Hi, Thanks for the reply. WHERE country = 'uk' is right but i need to collect that info dynamically.

    As the query of the page is for city writing WHERE country = '" & description & "' just gets me the same city as the main query and not all the other cities that share the same country.

    Thanks for your help
    Richard
    See more | Go to post

    Leave a comment:


  • fran7
    started a topic Select in query sql server

    Select in query sql server

    Hi, I wonder if anyone has any pointers to this.

    I have a page querying cities from my database.

    fields to query in database

    country
    australia
    uk
    uk
    france
    uk

    city

    sydney
    london
    brighton
    paris
    oxford

    ?Keyword=London

    That works fine and...
    See more | Go to post

  • fran7
    replied to Add second recipient to email
    in PHP
    Hi, Thanks for the reply. I tried that but got the error. email not on server. I am trying to get it to redirect to a second email not on the server. Perhaps I should have specified that.
    Thanks again
    Richard
    See more | Go to post

    Leave a comment:


  • fran7
    started a topic Image resize on the fly

    Image resize on the fly

    Hi, I have this asp.net code to resize my images. It works fine although it resizes images without keeping the aspect ratio. My image display page is an .asp page extension.

    I would rather keep aspect ratio of my images. Could anyone tell me if there is a tinker one could do with this code to do that or would i need to look for another code to do the job.

    Thanks in advance

    Richard

    Code:
    <%@
    ...
    See more | Go to post

  • fran7
    started a topic Add second recipient to email
    in PHP

    Add second recipient to email

    Hi, I have this php email code that works fine but I want to add a second recipient to emails. I tried adding it here but it didnt work

    "CONTACT_FO RM", 'contact@mysite .co.uk' , 'secondemail@ho tmail.com'


    Code:
    <?php
    
    // Where will you get the forms' results?
    define("CONTACT_FORM", 'contact@mysite.co.uk');
    ?>
    Code:
    <?php
    ...
    See more | Go to post

  • is invalid in the select list because it is not contained in either an aggregate func

    Hi, Same old problem I see everywhere but dont quite get the solution.

    I have this query.
    Code:
    keywords_cmd.CommandText = "SELECT city,galleryimage1,galleryimage2,galleryimage3,galleryimage4,galleryimage5,galleryimage6 FROM databasetable where city like '%"  & Request.QueryString("term") & "%' and galleryimage1<>'' and galleryimage2<>'' and galleryimage3<>'' and galleryimage4<>''
    ...
    See more | Go to post

  • fran7
    started a topic SQL query cross match

    SQL query cross match

    Hi, I have individual members pages by profileid

    Code:
    lngprofileid=CLng(Request("profileid"))
    On these pages I am making a second query as I want to display other members who fall into a similar category (country) for example, to the member in the main query. Because the main query is by profileid and not the category (country) i cannot see how to get those members to display.


    Any pointers...
    See more | Go to post

  • Sql server Query, having count(*)>1 and order by count(*) desc

    Hi, I have this query to get a drop down list and that works fine. The trouble is I need to select another field from the table to give it a where clause but if I try I get an error message.

    Code:
    SQLQuery = "select tbl.country from tbl group by country HAVING COUNT(country) > 1 order by count(country) desc"
    Any pointers would be great
    Thanks
    Richard
    See more | Go to post

  • fran7
    replied to Adding Count table to query
    Hi, Thanks, This is how i did it in the end.

    Code:
    (Select WatchingUserID from tblWatches where WatchedProfileID <>0 group by WatchingUserID HAVING COUNT(*) > 5)"
    Thanks

    Richard
    See more | Go to post

    Leave a comment:


  • fran7
    started a topic Adding Count table to query

    Adding Count table to query

    Hi, The below 3 table join with select works fine.

    Code:
    		                 
       SQLQuery="Select top 5 L.accept,etc,etc, "
    
    SQLQuery= SQLQuery & "FROM tblAppsLoginDatabaseBySmo L INNER JOIN tblAppsProfilesDatabaseBySmo P ON L.UserId = P.UserId "
    SQLQuery= SQLQuery & " inner join tblWatches T ON P.UserId = T.WatchingUserID "
    SQLQuery= SQLQuery & "  and p.userid
    ...
    See more | Go to post

  • fran7
    replied to Request Query with three tables
    Thanks, that's what I thought but needed an expert to confirm.
    Thanks again
    Richard
    See more | Go to post

    Leave a comment:


  • fran7
    replied to Request Query with three tables
    Hi,
    I have a user (no 1), he follows other users and I collect those he follows on a page. In the page all the right info is displayed, as you rightly said, from tblprofile that I want.

    However, I want the title and description of the page to relate to the user (no 1). If I put " & Clng(lngprofile id) & " in the title I get (no 1)s userid, but if I include any more info about (no 1) from tblprofile it includes...
    See more | Go to post

    Leave a comment:


  • fran7
    started a topic Request Query with three tables

    Request Query with three tables

    Hi, I wonder if there are any pointers to the following problem.

    I Have three tables.

    tbllogin
    L.userid

    tblprofile
    P.userid,p.prof ileid,name,surn ame,etc

    tblWatches
    WatchingUserID, watchedprofilei d

    In each table these ids are the same
    L.userid,P.user id,WatchingUser ID

    In the query below I collect all the watchedprofilei d, being followed...
    See more | Go to post

  • fran7
    started a topic Next, previous records from unique query pages

    Next, previous records from unique query pages

    Hi, I wonder if anyone could point mne in the right direction. I have many many individual members profile pages. Each has a unique query.

    http://www.site/page.asp?firstn ame=bla&amp;las tname=bla&amp;p rofileid=2933

    I want to have a link on each profile page to the next profile page with a previous link too.

    Every sample of pagination that I have found are where there are multiple results returned...
    See more | Go to post

  • fran7
    replied to Sql sort records by count
    Thanks, this worked

    Code:
    select top 15 tblA.categories from tblA group by categories 
    order by count(categories) desc
    All the best
    Richard
    See more | Go to post
    Last edited by fran7; Feb 6 '14, 08:15 PM. Reason: none

    Leave a comment:


  • fran7
    started a topic Sql sort records by count

    Sql sort records by count

    Hi, I wonder if anyone can help with this query.

    I have a table with categories as follows

    profileid, categories
    1224 abstract
    234 illustration
    2345 abstract
    4 drawing
    56 sculpture



    This code works and creates me a list of categories.

    Code:
               SQLQuery = "SELECT DISTINCT tblA.categories"
    ...
    See more | Go to post

  • Order by two sql server fields datalength and date

    Hi, I order with datalength and that's fine.

    Code:
    order by datalength(workingmethods) desc,
    I was wondering if there is a way of combining with date members registered. The result being those newest members (JOINDATE) with the most data (WORKINGMETHODS ) being returned first in the results..


    This does not work
    Code:
    order by datalength(workingmethods) desc, JoinDate desc
    Any pointers...
    See more | Go to post
No activity results to display
Show More
Working...