Jump to content

_giles_

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Everything posted by _giles_

  1. Hi - (I'm not 100% sure this is the right place to post this question ... apologies if it's not) I would like to add a simple Gantt chart to my development, was wondering if you could recommend any that seem good to you. I don’t need anything really flash (I’m not trying to reproduce MS Project) just need to plot a number of projects over a 24/7 timeframe. Would appreciate your comments thanks Giles
  2. Hi I'm working on a query where I'd like to be able to search one OR two attributes. I've come accross a few postings that lead me to the code below. It works fine if I put something in both attributes but fails if I leave the second blanc. Can you help? SELECT * FROM books WHERE title LIKE '%$title%' AND title_sub LIKE '%$title_sub%' ORDER_BY print_id (I would ideally like to make the first attribute optional. I may also want to add a few more attributes later)
  3. Hi there, I’ve written a simple mailout script. If appears to work fine for some people, appears to fail with others. The fails are with clients inside Uni’s and Corps ... so I’m wondering if I’m getting spam filtered or something alike. I include my code below. I would greatly appreciate any comments on how I may improve it. Thanks Giles $to = $email; $subject = "the subject"; $from = "my outgoing address"; $headers = "From: $from"; $headers.= "Content-Type: text/html; charset=ISO-8859-1 "; $headers .= "MIME-Version: 1.0 "; $body = "Dear " . $firstname . " " . $surname . ", my message goes here " . "Your username is : " . $username . " " . "Your password is : " . $password; this is a comment reinserted from the author /*notice there aren't any \r\n after the second two header additions. This is what made this version work correctly*/ mail($to,$subject,$body,$headers);
  4. hey thorpe works a treat, thank you for your response. REALLY makes a difference to this newbie to have the likes of you guy's around to help out - thanks again. Giles
  5. Hi, I want to concatenate a number of db entries into a single string (forming a summery) I’ve come up with something that illustrates the principle, I can see that I need some sort of loop that reads each array element into the string, and then exits the loop - however my lack of experience has now got the better of me. Can you help? - thanks in advance - Giles // db query $Ddb2_query = mysql_query ( "SELECT answer FROM ddb WHERE session_id = '$session_id' AND cache = '$cacheRecall' " ); if (!$Ddb2_query) { echo 'Could not run query - page.inc Ln 335 - ' . mysql_error(); exit; } // read query results into temp array for($i=0; $row2 = mysql_fetch_array($Ddb2_query); $i++) { global $tempAnswer; $tempAnswer[$i] = answerDecode($row2["answer"]); } // prepare to return above into a form using pear’s HTML_template_IT // ANSWER is the field that will hold the result // the concatenated $tempAnswer is where the sting should go $template->setCurrentBlock("answer"); $template->setVariable ( "ANSWER", ( $tempAnswer[0] . "<br><br>" . $tempAnswer[1] . "<br><br>" . $tempAnswer[2] . "<br><br>" . $tempAnswer[4] . "<br><br>" . $tempAnswer[5] . "<br><br>" . $tempAnswer[6] ) ); $template->parseCurrentBlock("answer");
  6. Interesting! The corsework I've been following uses it to encapsulate keyed text inside single quotes before entering it into a database, the idea being that even malicious keystrokes will be seen as a string therefore not acted upon by the system. Your response makes it appear that this is not standard practise ... begs the question ... what is the standard practise to render malicious keystrokes harmless??
  7. Hi, I’ve run into some problems with EscapeShellArg() – wonder if you can help? I’ve been using it very successfully to place single quotes around inputted text {e.g. EscapeShellArg($answer)} to prevent meliciously keyed data being stored in my database. As said, all has been well, running on my localhost – however things are not so good after uploading it to my domain. I’m now getting MySQL syntax errors trying to write to my databases (e.g.) 'users answer'' WHERE session_id = '6tidcs36jq4bm3cceu9nnqbi16' at line 3 obviously the noicable fact is the double single quote at the end of the users answer, but I’m foxed as to where this is coming from. I’ve checked the syntax of the $answer parameter feeding the function and it’s fine, so there’s nowhere that can be adding this extra quote. The one clue, after checking versions is that there is a difference between my localhost ( running php4.3.10 MySQL 3.23.49 … ok, ok, I know it’s old) and my IP (php 5.0.4 MySQL 4.1.20), however I’ve checked EscapeShellArg() in the MySQL manual and there appears to be no reported issues in implementation. SO that’s as far as my newbie brain has gotten me. I’d appreciate any thoughts you might have. Thanks Giles
  8. Hi, I’ve been studying a project recently which uses pear’s HTML_TEMPLATE_IT (http://pear.php.net/package/HTML_Template_IT) as a way of creating template pages that are filled with data from my databases at the time of serving. The idea is really neat, and saves loads of time, AND ISN’T SUPPORTED by my service provider It strikes me that the obvious choice is to look for alternatives, but I’m not finding much. I’m sure that this can’t be the only example of using templates in dynamic pages, but I’m getting a bit stuck. I’d really appreciate it if you could advise me of any other templates ... or should I bite the bullet and upgrade to a virtual domain (where I can apparently run PEAR) because it really is the best for the job! Thanks Giles
  9. ".L_EstDb." works just fine for me ... THANK YOU!
  10. Hi all, Is there any way that I can use something like define() to create an alias to a database name in a MySQL query? e.g. I currently have something like $result = mysql_query ( "UPDATE DestDb SET answer = '$answer' WHERE session_id = '$session_id' AND count = '$count_history' " ); and it wold be great if I could do define("L_DestDb", "DestDb"); and subsequently use $result = mysql_query ( "UPDATE L_DestDb SET answer = '$answer' WHERE session_id = '$session_id' AND count = '$count_history' " ); that way I can alter “DestDb” without having to trawl through my increasingly large project hunting out database instances!
  11. Hi Again, Thanks for the response ... was getting a bit tied up over the form. For anybody who has an interest my working version is : mysql_query(" UPDATE session SET session_end = NOW() WHERE session_id = '$session_id' "); thanks for your time
  12. Hi, I'm having trouble sending a PHP timestamp command to a MySQL database. I'm sending it as a normal query, but somethings not correct. Can you reccomment a simple tutorial or clarify what I should be doing? Thanks Giles
  13. OK ... so maybe ask the visitor to fill in a password displayed on the referring page. that way it's easy for them, that way I get to know of their referred or browsing? Eitherway thanks for shouting me back - I'm wiser and better for it - appreciate you spending the time
  14. OK here's the thing ... I'm working on a site that will service users coming from a number or regular clients, and some just browsing. The subscription clients have too many users to issue passwords or login's, so the easiest thing right now would be to log them by URL. session_start() and security will occur after that. So I simply need this ... where did you come from stage ... is $_SERVER["HTTP_REFERER"] stable enough to give me that?
  15. I don't need it for security, but I was thinking about it as a way of segregating paying from free visitors - (e.g. if visitor comes from a site that's signed up to our full service ...admit to full service, IfElse ... pass onto free pages) ... would that work?
  16. Hi, Is there any way of getting the URL of the page that has passed a visitor to my home page? - I’ve had a look about but can’t find much, am I asking an unusual question?
  17. Hi, I’m looking for a recommendation for a 2 way encryption function to encode / decode long strings (e.g. 1000 or more characters) into a MySQL table ... can you advise? thanks in advance
  18. Hi, I’m not sure if i’m just getting myself confused here! I want to build a simple redirection along the lines of : <?php require_once "siteDefaultsPage.inc"; if (!INTERACTION_TEST){ // redirect to new URL } ?> in order to control access to a page. I’m getting caught up with the headders being sent from the .inc file - however, I need the .inc file to set the variable INTERACTION_TEST. Can you help?
  19. Oh yes .... much better. Thanks for the replay and neat idea to put in include file ... where would us newbies be without the help of the more experoanced. thank you
  20. Hi, I’ve just finished my first development. Each page load is querying my database approx. 6 times from various stages including functions and classes etc. At this time, a connection is being made each time one of these queries is run. Everything works great, but I can’t help wondering if this is the most efficient way of operating? - for example, would it be possible / more efficient to create a single connection and pass it to each query? I’d appreciate any comments or thoughts Giles
  21. Hi All, I’ve just finished building my first PHP powered site. Quite a few people like it ... would like access to it .... thing is it’s quite specialist and linking to it leaves it a little to open for my liking right now. The IDEAL would be for them to access my site (and the development that’s on it) from within their site. I’m a little lost ... is this possible .... where do I start looking to learn how to do it if it is - is there anything you can suggest? Many thanks in advance Giles
  22. thanks for the quick response ... works a treat! guess the only thing leaving me a little puzzled is why do ALL the tutorials I've been working on put the include files at the top seemingly without getting into trouble? I thought I needed to put a reference to the file where I have the session variables before I try use them?
  23. Hi all, I’m working on my first project with sessions, kind of getting stuck on what is probably a simple point. Would you mind correcting me? My understanding is that I can declare the session variables in an include file such as <?php   if (!isset($_SESSION["count"]))   {     $_SESSION["start"] = time();     $_SESSION["count"] = 1; $_SESSION["counthistory"] = 1; $_SESSION["lastpage"] = 100;   }   $_SESSION["count"]++; ?> and that I can then access the session from other files such as : <?php  require_once "admin.inc"; session_start(); echo "session_id() is : " . session_id(); echo "</br>"; echo $_SESSION["count"]; ?> this is partly working, in that I can  return the session_id, but I get a “Undefined index: count” with the count parameter. what am I doing wrong? I’d appreciate any help you could give me. Thanks in advance Giles
  24. Hi all, I’m working on my first PHP project – fill a form, email details to me, trigger a force download. All the main components work, just need to fit them together I have a normal HTML page with a number of fields. Submit calls a .php page which checks the fields for user input, if >0  a email is dispatched to me. I have another .php page which starts a force download. Thing is how do I call this page from the end of the first script page? It has to be after the Email check script, which means it’s in the body so I can’t use headders or page divert. A manual hyperlink (as a way of testing) works just fine, but how to I call a automatically call a URL? fopen() appears to open and READ the file, calling the page via echo”URL” also fails. It can’t be that difficult can it? Hope you can help Many thanks Giles
  25. Hi I'm a PHP newbie working on my first project to build a simple form which emails me the content (this I've done successfully) and then triggers a file download. This is where I’m a bit stuck. I’ve tried (what seem to me to be) obvious things like trying to trigger hyperlinks etc, I’ve searched all over the place for tutorials, (I can find loads of them for uploading), but I can’t find anything for creating a download script. I’d really appreciate any tips, or URL’s of appropriate tutorials. Many thanks in advance Giles
×
×
  • 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.