User Profile

Collapse

Profile Sidebar

Collapse
nathj
nathj
Last Activity: Apr 22 '21, 11:16 AM
Joined: May 17 '07
Location: Blyth
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hi,

    I figured it out. So, in case anyone else is working on this sort of thing here is what I have done.

    About.aspx
    Code:
     <asp:SqlDataSource ID="sdsEmployee" runat="server" 
                ConnectionString="<%$ ConnectionStrings:Enterprise4 %>" >
            </asp:SqlDataSource>
            <asp:GridView ID="GridView1" runat="server" AllowSorting="True"
    ...
    See more | Go to post

    Leave a comment:


  • nathj
    started a topic How can I use aGridView and maintain good MVC?

    How can I use aGridView and maintain good MVC?

    So I've got to learn ASP.Net and C# for work. The organisation has bought in some training and some books. I'm using the books and the web ahead of the training next month.

    Presently I have worked through some tutorials online and in the books. I've got a basic handle on C# now and am working on some mock projects for ASP.Net. A good friend of mine , pointed me in the direction of the GridView as a very useful tool. I must agree this...
    See more | Go to post

  • nathj
    replied to Form to E-Mail Problem
    in PHP
    Hi,

    I've just read over the code and can see that when you call the mail function you provide a $body variable. this variable doesn't appear to be defined anywhere. Should it perhaps be $comments?

    hope this helps
    nathj
    See more | Go to post

    Leave a comment:


  • Don't build a website entirely in Flash, that is not what flash is for. Youw ill alienate a number of users - SEO Bots, Mobile users and accessibility issues are a nightmare.

    The effects you mention can be achieved using something like jQuery that supports progressive enhancement so you only get the fully swish version if your browser can support it otherwise you get the basic version. this means the site is better crawled for SEO, more...
    See more | Go to post

    Leave a comment:


  • nathj
    replied to no results in WHERE LIKE without capital
    If it is case sesitivity and you want to maintain that then you could use something like:
    Code:
        SELECT id, companyname, city FROM crediteuren 
        WHERE ( LOWER(companyname) LIKE '%someon%' ) OR (LOWER(city) LIKE '%someon%' )
        ORDER BY companyname
    There is also an UPPER() function that could be used.

    Hope that helps
    nathj
    See more | Go to post

    Leave a comment:


  • nathj
    replied to unable to insert data in mysql
    in PHP
    Ok, that's a great question but with not much to go on for helping you out.

    In the case of the 2 tables you cannot input data into can you answer the following;
    1. Can you put data in using phpMyAdmin or similar?
    2. Are you trying to input data from a form using php?

    If you are using the form method can you please supply the relevant code so we can see if there is a problem there.

    Please provide...
    See more | Go to post

    Leave a comment:


  • nathj
    replied to PHP MYSQL data fetching problem
    in PHP
    Alternatively you could try:
    Code:
    $sql = "SELECT company_id FROM `companies` WHERE company_name = 'Jet Stream'"
    theother option is to set up a variable
    Code:
    $companyname= "Jet Stream";
    $sql = "SELECT company_id FROM `companies` WHERE company_name = '$companyname'";
    Using a variable like this makes the code much more reusable.

    Cheers
    na...
    See more | Go to post
    Last edited by nathj; Jun 29 '11, 07:22 AM. Reason: minor addition to the idea

    Leave a comment:


  • nathj
    replied to Php Through java
    in PHP
    Ok, I've never called Java from PHP though I have and do develop in both. Perhaps have a look at the PHP manual.

    I can't provide you with code for this one I'm afraid. But if you post any code you have got so far someone else may be able to help you out.

    Cheers
    nathj
    See more | Go to post

    Leave a comment:


  • nathj
    replied to Php Through java
    in PHP
    Ok, I've not actually done this before but this link looks potentially useful.
    See more | Go to post

    Leave a comment:


  • The article id you are passing in your example URL can be accessed:
    Code:
    $article = $_GET['id']; // need to error check this first and stripslash at the very least.
    You can then use the variable in your SQL query as code green says.

    Cheers
    nathj
    See more | Go to post

    Leave a comment:


  • nathj
    replied to Php Through java
    in PHP
    Do you mean Java or JavaScript as they are very different. I just want to make sure I have the right question before I try to answer.

    Thanks
    nathj
    See more | Go to post

    Leave a comment:


  • nathj
    replied to Best Option For Redirect
    in PHP
    The advatnage of using .htaccess is that you can specify it as a 301 redirect. This method maintains any link equity that you may have built up with search engines like Google and Yahoo.

    Which is what Markus is doing with the '[R=301]' part of the line.

    If you do it with php functions you will damage the link equity you have built up.

    Cheers
    nathj
    See more | Go to post

    Leave a comment:


  • nathj
    replied to dynamic breadcrum in php
    in PHP
    Hi Sunil,

    Good to see you have had a crack at this function. DO you have any specific questions about this? If so post back and I'll do my best to answer them for you.

    Cheers
    nathj
    See more | Go to post

    Leave a comment:


  • Hi,

    I normally use a little javascript so when the box is checked I set the value to 1 and when it is unchecked set the value to 0. Then you can use $_POST to access the value. You may need to parse it from a string to an int to put it in the db.

    nathj
    See more | Go to post

    Leave a comment:


  • I took a look and the field length shoul be 1. You can set a default value of 0.

    Changing the length should allow you to create the field which you can then use as de discussed previously.

    Thanks
    nathj
    See more | Go to post

    Leave a comment:


  • nathj
    replied to dynamic breadcrum in php
    in PHP
    Hi,

    I am happy to help you with your own code, I am not going to simlpy provide the code for you. Here is a rough plan of what should happen:

    1. pass the variables from the URL query string to a function as parameters.

    2. make a database connection

    3. query the database using the parameters to get the page and section titles

    4. build a string that is the breadcrumb

    5....
    See more | Go to post

    Leave a comment:


  • Hi,

    Good progress has been made. The trouble you know have is a classic typing error.

    The form contains an item named stroyTitle and you are accessing a POST variable storyTitle.

    I suggest you change the name in the form and all should be well.

    Cheers
    nathj
    See more | Go to post

    Leave a comment:


  • nathj
    replied to dynamic breadcrum in php
    in PHP
    If that URL has all the information in it to retrieve the breadcrumb from the database then it should be a simple task to query the DB to get the page names/titles and then use a horizontal list to display them.

    I would recommend developing a small php function that would do jsut that - take the parameters from the url, query the datbase and return the breadcrumb string for display. This function could then be used whereever you need...
    See more | Go to post

    Leave a comment:


  • That shoudl do it yeah. In a nutshell ensuring that any data passed to the server is as expected is the way to prevent SQL Injection attacks.

    Cheers
    nathj
    See more | Go to post

    Leave a comment:


  • In a nutshell the SQL Injection can be prevented by making sure a given $_POST variable is exactly what you expect it to be. So if you are expecting just a date check that it is a date.

    This article here looks good but I haven't read it all yet.

    I did take a quick look over the code and I thiknk you are heading in the right direction. I would suggest testing it and posting any errors you may encouter.

    Cheers...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...