cross platform problem - advice needed

Discussion in 'HTML' started by Ian Davies, Jul 31, 2006.

  1. Ian Davies

    Ian Davies Guest

    Hello
    I would appreciate some help from someone who has knowledge of working with
    css, php javascript and how they interact.
    Ive been working on a task for the last few days and have started to hit a
    brick wall. I need general advice on whether I m tackling the problem the
    correct way and some solutions for my current problems

    Ive posted my project below where ive detailed the current problems im
    having
    http://www.iddsoftware.co.uk/test.php

    in short im trying to allow my users to take their records from my database
    and arrange them dynamically on a web page into custom reports. which they
    can them print directly or download into something like Word

    Hope you can help as that brick wall is looming

    Ian
     
    Ian Davies, Jul 31, 2006
    #1
    1. Advertising

  2. Ian Davies

    J.O. Aho Guest

    Ian Davies wrote:
    > Hello
    > I would appreciate some help from someone who has knowledge of working with
    > css, php javascript and how they interact.
    > Ive been working on a task for the last few days and have started to hit a
    > brick wall. I need general advice on whether I m tackling the problem the
    > correct way and some solutions for my current problems
    >
    > Ive posted my project below where ive detailed the current problems im
    > having
    > http://www.iddsoftware.co.uk/test.php
    >
    > in short im trying to allow my users to take their records from my database
    > and arrange them dynamically on a web page into custom reports. which they
    > can them print directly or download into something like Word
    >
    > Hope you can help as that brick wall is looming


    Javascript ain't my strong point, so I will just think about php and css.

    First of all you should have some default starting points, as you already
    have. Store those into variables, as $xh1=40;, you will also need to check if
    the page has been updated or show for the first time, you can add the

    <input name="updated" type="hidden" value="1">

    to your form

    in your php you will need to make a check something like

    if($_REQUEST['updated']==1) {
    $xh1=$_REQUEST['xh1'];
    } else {
    $xh1=40;
    }

    Then you have your inputs in html

    <input name="xh1" class="BodyText" value="<?PHP echo $xh1;>" size="1" type="text">

    You should include the css code that handles the location of the text in the
    php file, and with usage of php in the same manner that in the input tag, you
    will dynamically change the coordinates in the css/style part of the code.



    //Aho
     
    J.O. Aho, Jul 31, 2006
    #2
    1. Advertising

  3. Ian Davies

    Andy Dingley Guest

    Ian Davies wrote:

    > I would appreciate some help from someone who has knowledge of working with
    > css, php javascript and how they interact.


    They don't - or at least they shouldn't. As far as possible, keep them
    separate -- life will be easier that way.

    Avoid JavaScript. Just not needed, or useful.

    Start by writing SQL to collect the data you're after. Doesn't need to
    be done through the web yet, you can easily do this through a SQL
    client tool.

    Spew your report's content out crudely into some sort of text editor
    (maybe copy-and-paste through the SQL client). Now make it into a HTML
    document. Don't worry too much looks as yet, just get all the content
    you need represented as good clean HTML with meaningful markup and no
    attempt at presentation. You don't even need all the data - just a
    page or so. Don't be afraid to include data you don't want to appear,
    such as repeated header values for each section - we can always hide
    them with CSS later.

    Now add CSS. Take your boring pure HTML document and add a stylesheet
    to it. Revise the HTML as needed, such as by adding classes to get the
    presentation control you need. Classes such as "odd" and "even" are
    well worth having on rows, even if you're not yet sure you need them.
    Then do some little extras with a print media stylesheet to make sure
    it prints well (text sizes in points, maybe some extra headers,
    page-break-after: avoid; should already be in there).

    Your report should now look and print perfectly. Work on it until it
    does.

    Only then, convert the HTML document to PHP that calls the SQL. You
    should now have a dynamic document with live data and perfect
    formatting. Make sure you call .HTMLEncode() where needed, in case
    there are entity refeferences etc. needed between database and HTML.
    Check that it works and debug as needed.
     
    Andy Dingley, Jul 31, 2006
    #3
  4. Ian Davies wrote:
    > Hello
    > I would appreciate some help from someone who has knowledge of working with
    > css, php javascript and how they interact.


    PHP doesn't interact with either CSS or Javascript. To PHP, CSS and
    Javascript are just strings being written out as part of the web page,
    just as they HTML is. To CSS and Javascript, PHP doesn't exist, since
    they operate only within the browser, and the browser only knows what's
    on the HTML page it has been sent, and nothing about the programming
    used to generate and send that page.

    By the way, please do not post questions to six different groups. It
    isn't necessary and annoys people who read multiple groups. One or two
    of these would probably have been sufficient.
     
    Harlan Messinger, Jul 31, 2006
    #4
  5. Ian Davies

    Gleep Guest

    Unless it's absolutley neccesary, don't bother giving this much contorl to users for a report.
    Really think if is't worth the hassle.

    I suggest give the users maybe 3 or 4 templates to pick from, possibly show a picture of example
    report they pick the template then select and the data is 'replaced' with your template. Here is a
    example of what I do.

    first make your report templates - make it elaborate as needed with css whatever...
    this is just one simple sample

    save this as template1.html

    <html>
    <head></head>
    <body>
    Thank you for signing up, %%name%%! <br>
    Company: %%companyName%% <br>
    Email: %%email%% <br>
    Phone: %%phone%% <p>
    Event: %%title%%, %%grpdate%% <p>
    Description: <br> %%data%% <p>
    Time & Location: %%time%%, %%location%% <p>
    Content goes here: %%content%% <p>
    Sincerely,<br>
    The Team<p>
    </body></html>


    on another page give them a choice to select a template and do a content replacement...

    // after a user selects a template and submits form here is code replacement example...
    if (isset($_POST["submit"]){
    $report = $_POST['report'];
    ...... blah blah other code here as needed
    // at this point generate the content variables with query
    $name = $data['name'];
    $companyName = $data['companyName'];
    $password = $data['password'];
    $email = $data['email'];
    $phone = $data['phone'];
    $data = $data['data'];

    if($report=='1') $message = implode(file("template1.html"));
    if($report=='2') $message = implode(file("template2.html"));
    if($report=='3') $message = implode(file("template3.html"));

    $message = str_replace("%%companyName%%", $companyName, $message);
    $message = str_replace("%%name%%", $name, $message);
    $message = str_replace("%%password%%", $password, $message );
    $message = str_replace("%%phone%%", $phone, $message );
    $message = str_replace("%%data%%", $data, $message );
    }


    the above is just an example to follow. From there you can email the entire doc, display on
    screen, or make it a pdf doc look into html 2 pdf at sourgeforge

    Note you don't have to use %%somevalue%% it can be anything
    ~somevalue~


    Good Luck


    On Mon, 31 Jul 2006 13:55:33 GMT, "Ian Davies" <> wrote:

    >Hello
    >I would appreciate some help from someone who has knowledge of working with
    >css, php javascript and how they interact.
    >Ive been working on a task for the last few days and have started to hit a
    >brick wall. I need general advice on whether I m tackling the problem the
    >correct way and some solutions for my current problems
    >
    >Ive posted my project below where ive detailed the current problems im
    >having
    >http://www.iddsoftware.co.uk/test.php
    >
    >in short im trying to allow my users to take their records from my database
    >and arrange them dynamically on a web page into custom reports. which they
    >can them print directly or download into something like Word
    >
    >Hope you can help as that brick wall is looming
    >
    >Ian
    >
     
    Gleep, Jul 31, 2006
    #5
  6. Ian Davies

    Ian Davies Guest

    Some useful tips Gleep that I can use somewhere else
    Unfortunately I do need this level of flexibility wher euser creates their
    own report as there will be large variations between users.
    Thanks for the feedback


    "Gleep" <> wrote in message
    news:...
    > Unless it's absolutley neccesary, don't bother giving this much contorl to

    users for a report.
    > Really think if is't worth the hassle.
    >
    > I suggest give the users maybe 3 or 4 templates to pick from, possibly

    show a picture of example
    > report they pick the template then select and the data is 'replaced' with

    your template. Here is a
    > example of what I do.
    >
    > first make your report templates - make it elaborate as needed with css

    whatever...
    > this is just one simple sample
    >
    > save this as template1.html
    >
    > <html>
    > <head></head>
    > <body>
    > Thank you for signing up, %%name%%! <br>
    > Company: %%companyName%% <br>
    > Email: %%email%% <br>
    > Phone: %%phone%% <p>
    > Event: %%title%%, %%grpdate%% <p>
    > Description: <br> %%data%% <p>
    > Time & Location: %%time%%, %%location%% <p>
    > Content goes here: %%content%% <p>
    > Sincerely,<br>
    > The Team<p>
    > </body></html>
    >
    >
    > on another page give them a choice to select a template and do a content

    replacement...
    >
    > // after a user selects a template and submits form here is code

    replacement example...
    > if (isset($_POST["submit"]){
    > $report = $_POST['report'];
    > ..... blah blah other code here as needed
    > // at this point generate the content variables with query
    > $name = $data['name'];
    > $companyName = $data['companyName'];
    > $password = $data['password'];
    > $email = $data['email'];
    > $phone = $data['phone'];
    > $data = $data['data'];
    >
    > if($report=='1') $message = implode(file("template1.html"));
    > if($report=='2') $message = implode(file("template2.html"));
    > if($report=='3') $message = implode(file("template3.html"));
    >
    > $message = str_replace("%%companyName%%", $companyName, $message);
    > $message = str_replace("%%name%%", $name, $message);
    > $message = str_replace("%%password%%", $password, $message );
    > $message = str_replace("%%phone%%", $phone, $message );
    > $message = str_replace("%%data%%", $data, $message );
    > }
    >
    >
    > the above is just an example to follow. From there you can email the

    entire doc, display on
    > screen, or make it a pdf doc look into html 2 pdf at sourgeforge
    >
    > Note you don't have to use %%somevalue%% it can be anything
    > ~somevalue~
    >
    >
    > Good Luck
    >
    >
    > On Mon, 31 Jul 2006 13:55:33 GMT, "Ian Davies" <>

    wrote:
    >
    > >Hello
    > >I would appreciate some help from someone who has knowledge of working

    with
    > >css, php javascript and how they interact.
    > >Ive been working on a task for the last few days and have started to hit

    a
    > >brick wall. I need general advice on whether I m tackling the problem the
    > >correct way and some solutions for my current problems
    > >
    > >Ive posted my project below where ive detailed the current problems im
    > >having
    > >http://www.iddsoftware.co.uk/test.php
    > >
    > >in short im trying to allow my users to take their records from my

    database
    > >and arrange them dynamically on a web page into custom reports. which

    they
    > >can them print directly or download into something like Word
    > >
    > >Hope you can help as that brick wall is looming
    > >
    > >Ian
    > >

    >
     
    Ian Davies, Jul 31, 2006
    #6
  7. Ian Davies

    Ian Davies Guest

    Thanks for your response Aho


    > First of all you should have some default starting points, as you already
    > have. Store those into variables, as $xh1=40;, you will also need to check

    if
    > the page has been updated or show for the first time, you can add the
    >
    > <input name="updated" type="hidden" value="1">
    >
    > to your form



    How will this value =1
    remain. wont it disapear when the browser is closed. meaning that if the
    user visits again it will not remember him? or have I missuderstood?


    > in your php you will need to make a check something like
    >
    > if($_REQUEST['updated']==1) {
    > $xh1=$_REQUEST['xh1'];
    > } else {
    > $xh1=40;
    > }
    >
    > Then you have your inputs in html
    >
    > <input name="xh1" class="BodyText" value="<?PHP echo $xh1;>" size="1"

    type="text">
    >
    > You should include the css code that handles the location of the text in

    the
    > php file, and with usage of php in the same manner that in the input tag,

    you
    > will dynamically change the coordinates in the css/style part of the code.


    This last bit sounds interesting, but Im not clear what you mean? Do you
    know how to retreive the coordinates of the position the user dragged the
    text to and put them in the text boxes? The drag bit of the code I used was
    taken from elswhere and my java script isnt up to much. What I really whish
    to do is to have the text boxes update continuously as te text is dragged so
    that it is constantly displaying the new coordinated.
     
    Ian Davies, Jul 31, 2006
    #7
  8. Ian Davies

    Ian Davies Guest

    > By the way, please do not post questions to six different groups. It

    I know
    but is wasnt a specific question so the greater the postings in relevant
    groups would increase the chanceof a solution.


    > isn't necessary and annoys people who read multiple groups. One or two


    They'll live :)
     
    Ian Davies, Jul 31, 2006
    #8
  9. Ian Davies

    Andy Dingley Guest

    On Mon, 31 Jul 2006 09:39:40 -0700, Gleep <> wrote:

    >save this as template1.html
    >
    ><html>
    ><head></head>
    ><body>
    >Thank you for signing up, %%name%%! <br>
    >Company: %%companyName%% <br>
    >Email: %%email%% <br>
    >Phone: %%phone%% <p>
    >Event: %%title%%, %%grpdate%% <p>
    >Description: <br> %%data%% <p>


    Please don't do this.

    1. The HTML markup is poor. No DTD and it's not even valid HTML.

    2. There's no need to do this. Half-decent HTML and CSS will provide
    just as much flexibility, without having to change the page generation
    at all.

    3. If you must use templating in HTML, then you can do better markers
    than "%%title%%"
     
    Andy Dingley, Jul 31, 2006
    #9
  10. Ian Davies wrote:
    >>By the way, please do not post questions to six different groups. It

    >
    >
    > I know
    > but is wasnt a specific question so the greater the postings in relevant
    > groups would increase the chanceof a solution.
    >
    >
    >
    >>isn't necessary and annoys people who read multiple groups. One or two

    >
    >
    > They'll live :)
    >
    >
    >
    >
    >
    >
    >


    But many of them won't answer your questions.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.

    ==================
     
    Jerry Stuckle, Jul 31, 2006
    #10
  11. Jerry Stuckle wrote:
    > Ian Davies wrote:
    >>> By the way, please do not post questions to six different groups. It

    >>
    >>
    >> I know
    >> but is wasnt a specific question so the greater the postings in relevant
    >> groups would increase the chanceof a solution.
    >>
    >>
    >>
    >>> isn't necessary and annoys people who read multiple groups. One or two

    >>
    >>
    >> They'll live :)


    And you'll live if people choose not to answer your questions, if that's
    how you want to play the game.
     
    Harlan Messinger, Jul 31, 2006
    #11
  12. Ian Davies

    Ian Davies Guest

    Another thing that is annoying when you open a reply to your post eagerly
    thinking someone has answered your question, only to find it is just someone
    moaning about something. That actually wastes time and is probably even more
    annoying.


    "Jerry Stuckle" <> wrote in message
    news:...
    > Ian Davies wrote:
    > >>By the way, please do not post questions to six different groups. It

    > >
    > >
    > > I know
    > > but is wasnt a specific question so the greater the postings in relevant
    > > groups would increase the chanceof a solution.
    > >
    > >
    > >
    > >>isn't necessary and annoys people who read multiple groups. One or two

    > >
    > >
    > > They'll live :)
    > >
    > >
    > >
    > >
    > >
    > >
    > >

    >
    > But many of them won't answer your questions.
    >
    > --
    > ==================
    > Remove the "x" from my email address
    > Jerry Stuckle
    > JDS Computer Training Corp.
    >
    > ==================
     
    Ian Davies, Jul 31, 2006
    #12
  13. Ian Davies

    Miguel Cruz Guest

    Harlan Messinger <> wrote:
    > By the way, please do not post questions to six different groups. It
    > isn't necessary and annoys people who read multiple groups. One or two
    > of these would probably have been sufficient.


    He crossposted properly; something is wrong with your newsreader if you
    are seeing the question more than once.

    Still 6 groups does seem like overkill.

    miguel
    --
    Photos from 40 countries on 5 continents: http://travel.u.nu
    Latest photos: Malaysia; Thailand; Singapore; Spain; Morocco
    Airports of the world: http://airport.u.nu
     
    Miguel Cruz, Jul 31, 2006
    #13
  14. Ian Davies wrote:
    > Another thing that is annoying when you open a reply to your post eagerly
    > thinking someone has answered your question, only to find it is just someone
    > moaning about something. That actually wastes time and is probably even more
    > annoying.
    >
    >
    > "Jerry Stuckle" <> wrote in message
    > news:...
    >
    >>Ian Davies wrote:
    >>
    >>>>By the way, please do not post questions to six different groups. It
    >>>
    >>>
    >>>I know
    >>>but is wasnt a specific question so the greater the postings in relevant
    >>>groups would increase the chanceof a solution.
    >>>
    >>>
    >>>
    >>>
    >>>>isn't necessary and annoys people who read multiple groups. One or two
    >>>
    >>>
    >>>They'll live :)
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>>

    >>
    >>But many of them won't answer your questions.
    >>
    >>--
    >>==================
    >>Remove the "x" from my email address
    >>Jerry Stuckle
    >>JDS Computer Training Corp.
    >>
    >>==================

    >
    >
    >


    Not nearly as annoying as opening a message thinking you could help them
    and finding it posted to umpteen different newsgroups - and the question
    not even being applicable to many of those newsgroups (including the one
    you're looking at it from).

    You go ahead and keep posting to all kinds of newsgroups. Watch your
    responses drop to zero.

    A friendly suggestion - do a little homework. Find 2 or 3 newsgroups
    which are appropriate to your question and post in those.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.

    ==================
     
    Jerry Stuckle, Jul 31, 2006
    #14
  15. Ian Davies

    axlq Guest

    In article <xItzg.103685$>,
    Ian Davies <> wrote:
    >Another thing that is annoying when you open a reply to your post eagerly
    >thinking someone has answered your question, only to find it is just someone
    >moaning about something. That actually wastes time and is probably even more
    >annoying.


    Then don't use usenet as your tech support service if you don't like
    the fact that anybody can post anything in a public forum. Go to a
    moderated newsgroup, or hire a consultant and you'll get more direct
    answers.

    -A
     
    axlq, Jul 31, 2006
    #15
  16. Ian Davies

    axlq Guest

    In article <>,
    Andy Dingley <> wrote:
    >3. If you must use templating in HTML, then you can do better markers
    >than "%%title%%"


    For templating, personally I'm a big fan of smarty -- see
    http://smarty.php.net

    CSS lets you separate styling from markup.

    Smarty lets you go further, separating php scripts from HTML
    content.

    The HTML content is all in templates and the php scripts perform
    all the logical operations, set the smarty template variables to be
    filled in, etc. The smarty templates have directives to include
    other templates, if/elseif/then logic, math and logic operators,
    etc.

    -A
     
    axlq, Jul 31, 2006
    #16
  17. Ian Davies wrote:
    >
    > "Jerry Stuckle" <> wrote in message
    > news:...
    >> Ian Davies wrote:
    >>>> By the way, please do not post questions to six different groups. It
    >>>
    >>> I know
    >>> but is wasnt a specific question so the greater the postings in relevant
    >>> groups would increase the chanceof a solution.
    >>>
    >>>> isn't necessary and annoys people who read multiple groups. One or two
    >>>
    >>> They'll live :)
    >>>

    >> But many of them won't answer your questions.

    > Another thing that is annoying when you open a reply to your post eagerly
    > thinking someone has answered your question, only to find it is just

    someone
    > moaning about something. That actually wastes time and is probably

    even more
    > annoying.


    Top-posting is another annoying thing.

    So is ignoring the fact that someone did in fact provide a valid answer
    to your question, as I did.

    But beyond that, one of the most annoying things is someone who solicits
    help but then, when someone explains posting etiquette to him, gives a
    response like "they'll live", showing a puzzling disregard for the very
    people whose assistance he's hoping to enlist.
     
    Harlan Messinger, Aug 1, 2006
    #17
  18. Miguel Cruz wrote:
    > Harlan Messinger <> wrote:
    >> By the way, please do not post questions to six different groups. It
    >> isn't necessary and annoys people who read multiple groups. One or two
    >> of these would probably have been sufficient.

    >
    > He crossposted properly; something is wrong with your newsreader if you
    > are seeing the question more than once.


    Granted that he crossposted rather than multiposting.

    > Still 6 groups does seem like overkill.


    Yes. In fact, I think six is the maximum my news provider will allow me
    to post to, reflecting their enforcement of Usenet etiquette.
     
    Harlan Messinger, Aug 1, 2006
    #18
  19. Ian Davies

    Andy Mabbett Guest

    In message <xItzg.103685$>, Ian Davies
    <> writes

    >even more annoying


    Not as annoying as top-posting.

    A: Because it messes up the order in which we read text
    Q: Why is top posting such a bad thing?
    A: Top posters
    Q: What's the most annoying thing on usenet?

    FU set
    --
    Andy Mabbett
    Say "NO!" to compulsory ID Cards: <http://www.no2id.net/>

    Free Our Data: <http://www.freeourdata.org.uk>
     
    Andy Mabbett, Aug 1, 2006
    #19
  20. Ian Davies

    Ian Davies Guest

    "Harlan Messinger" <> wrote in message
    news:...
    > Ian Davies wrote:
    > >
    > > "Jerry Stuckle" <> wrote in message
    > > news:...
    > >> Ian Davies wrote:
    > >>>> By the way, please do not post questions to six different groups. It
    > >>>
    > >>> I know
    > >>> but is wasnt a specific question so the greater the postings in

    relevant
    > >>> groups would increase the chanceof a solution.
    > >>>
    > >>>> isn't necessary and annoys people who read multiple groups. One or

    two
    > >>>
    > >>> They'll live :)
    > >>>
    > >> But many of them won't answer your questions.

    > > Another thing that is annoying when you open a reply to your post

    eagerly
    > > thinking someone has answered your question, only to find it is just

    > someone
    > > moaning about something. That actually wastes time and is probably

    > even more
    > > annoying.

    >
    > Top-posting is another annoying thing.
    >
    > So is ignoring the fact that someone did in fact provide a valid answer
    > to your question, as I did.
    >
    > But beyond that, one of the most annoying things is someone who solicits
    > help but then, when someone explains posting etiquette to him, gives a
    > response like "they'll live", showing a puzzling disregard for the very
    > people whose assistance he's hoping to enlist.



    I make a great point of thanking those who provided me with useful
    information even if it couldnt help me. Check back over the previous posts
    (about first 3 except yours) and you will quickly realise my gratitude.

    >PHP doesn't interact with either CSS or Javascript. To PHP, CSS and
    >Javascript are just strings being written out as part of the web page,
    >just as they HTML is. To CSS and Javascript, PHP doesn't exist, since
    >they operate only within the browser, and the browser only knows what's
    >on the HTML page it has been sent, and nothing about the programming
    >used to generate and send that page.


    Your response, I feel wasnt that valid really, much of this I already knew I
    was, like most on these forums looking for something a little more specific
    that addresses the problems I was having. I was going to say that your info
    was as useless as a one legged man in an arse kicking competition, but I
    detect a lack of sense of humour, as you took too very seriously the
    following

    "they'll live :)"

    note the :) bit
     
    Ian Davies, Aug 1, 2006
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dnickell

    Cross platform "Mailto" problem

    dnickell, Aug 28, 2004, in forum: HTML
    Replies:
    3
    Views:
    764
    Jukka K. Korpela
    Aug 29, 2004
  2. jcc
    Replies:
    15
    Views:
    4,729
    Nigel Wade
    May 12, 2006
  3. Coca
    Replies:
    15
    Views:
    663
    Alan Balmer
    Jan 14, 2004
  4. Chelonian
    Replies:
    4
    Views:
    409
    crystalattice
    Sep 27, 2006
  5. Giff
    Replies:
    4
    Views:
    299
Loading...

Share This Page