Jump to content

ToonMariner

Members
  • Posts

    3,342
  • Joined

  • Last visited

Everything posted by ToonMariner

  1. Best setting a cron job (thast what they are for!). I have done so in the past - I think it is better to NOT loop but to let the app run once every minute (unless you are really desperate).
  2. test your query in phpmyadmin or similar and see what is returned... (echo out your query string before you run the query - then you can copy and paste into your favorite db app!)
  3. function num_swap ($val) { $numbers=array('1','2','3','4','5','6','7','8','9','0'); $images=array('<img src="1.gif">','<img src="2.gif">','<img src="3.gif">','<img src="4.gif">','<img src="5.gif">','<img src="6.gif">','<img src="7.gif">','<img src="8.gif">','<img src="9.gif">','<img src="0.gif">'); $b=str_replace($numbers,$images,$val); echo $b; } num_swap('555'); num_swap('43545'); and so on......
  4. Don't! Just have a table of artist and a field for their publisher
  5. Only thing I can think of is providing a link next to the image.  When they click that link create the image and save it into a temp folder and allow them to save that image. Clear you temp folder of images older than 1 hour every hour (or day or what ever) with a cron job.
  6. The sites I have developed recently have been 'single' page - that is you only see /index.php in the url followed by any parameters needed to grab content from a database etc etc. To create a truely dynamic page as you suggest would require some templating system where you can dictate what elements are in the menu adn which data to grab from your db. instead of creating a new php page each time have one that can display everything you need (having to produce a new php page each time is almost the same as hving to produce a new html page!!!!)
  7. if this is for a menu then perhaps consider dointh this with css rather than js rollovers. My method of chice is quite simple.... you have you two images (say 100 x 80 px) create one image from the two that is 100 x 160 (one above the other) now the images will be in an anchor tag so we can do this.... html... <a id="sitemap" href="/sitemap.php" title="Site Map"><span>Site Map</span></a> css a#sitemap {display: block; width: 100px; height: 80; background: transparent url(../images/bgdad.jpg) no-repeat 0 0;} a:hover#sitemap { background-position: 0 -80px;} a#sitemap span {display: none;} If a user then has css off they will still see the link..... beauty of this is that the 'roll-over' image is already there!!!!
  8. try... $terms = accept; $register = true; include('register.php'); and make sure that in register php that $terms and $register are exactly that NOT $_GET['terms'] etc....
  9. yep before the query you could put an if statement. If no session the redirect to closed page. the query shoudl only retuen one result so get rid of the while loops. you if statement to see if they are admin is missing quotes around teh string.... 'admin' as is the lock if statement.....
  10. indeed you can do this - its not too difficult... you will need to know opendir(), readdir(), closedir(). loop through the directory using read_dir() if its a directory then gen a link to run script again with the new directory the root folder its looking in, if a file generate a link to download/view. as far as the html goes... <div style="height: 400px; over-flow: auto;"> //stick you links in here... </div>
  11. you shoudl be using the strcomp functions - they are specifically designed to compare strings.
  12. Do update the database from the client side you will need to use ajax. Its fairly easy. you can indeed create arrays of elements in html : use name="chkbx[1]" , chkbx[2] etc. Or just chkbx[] if you want these fields to auto generate their indices.
  13. try not single quoting things that are not values!!! $q = "SELECT username FROM users WHERE username = '$username'"; I prefer: $q = "SELECT `username` FROM `users` WHERE `username` = '$username'"; but thats just me.... Plus yoru insert statement could easilt be wrong.... I prefer to define my insert statmenets with all the fields of the table listed and the corresonding values. Unless your table only has 2 fields that query string will fail. Buttom line its not yoru code but yoru queries that are wrong.
  14. ToonMariner

    HeLp?

    '/.{0,50}' . $string . '.{0,50}/' should do the trick
  15. yep change this bit... [code]<?php echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?id=" . $prev . "\">previous</a>"; echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?id=" . $next . "\">next</a>"; ?> [/code] to this. [code]<?php if ($curr > 0) echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?id=" . $prev . "\">previous</a>"; if ($curr < (count($results['id']) - 1) echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?id=" . $next . "\">next</a>"; ?> [/code]
  16. Shouldn't make any difference BUT just thought you don't need the new setTime taken function. Cut and paste the document.getElementById line into the stopCount function and delete the setTimetaken function and all references to it. As for the email - check that the variable names match in the script that processes the data.
  17. <?php $query = "UPDATE `WOR` SET Invoice=Yes where work_order_num='$ordernum' AND Invoice=No;"; $query .= "UPDATE `WOR` SET Invoice=No where work_order_num='$ordernum' AND Invoice=Yes;"; $qry = mysql_query($query); if 9mysql_affected_rows() == 0) { // output some error warninh } ?>
  18. Kinda my bad here. you need to set a variable equal to the time AND (embarrassed) have a hidden field of that variable name. so put in anywhere in your form <input type="hidden" name="timetaken" id="timetaken" value=""> then the onSubmit attribute of the form put onSubmit="setTimetaken()" and add thsi function in the js in the head of the page (under your timedCount function) function setTimetaken () { document.getElementById('timetaken').value = c; }
  19. I started here about 4 years ago [url=http://www.sitepoint.com/article/getting-started-mysql]http://www.sitepoint.com/article/getting-started-mysql[/url] within a couple of days I was creating, inserting deleting stuff in my database via php scripts and user inouts from forms. The best way to learn is to do things yourself - build on things you have learnt - try to find thinsg in the manual (most have user submitted examples) - ask questions on here. Someone once wrote something like: PHP taught = 1 site PHP learned = 1,000,000
  20. raza if you have ftp access to download this then you already have all teh scripts you need. When people ask for clones of a site it means they don't have teh scripts but want to copy the functionality/services offered on that site. If the latter is the group you fit into then saving the site to your hard drvie is pointless. There is a significant amopunt of wrok to be done just to record what functionality you wish to re-create on your site and ow you want to do that. Once that is finalised you can start to design your database so it can hold the relevant info in a structed manner. THEN you can plan your code and start the design. At that point you need to worry about what aspects of php you know/need to learn. Planning the code is good way of helping you focus on what you need to learn and to leave the other stuff out. Hope that helps you a little.
  21. its not whether js is on on your machine - its whether the person filling in the form has js on. One way of ensuring they have js on when answering is to use js to produce the submit button using document.write('<input type="sumit" .... Having looked at your html.... change <body><onload="timedcount"> to <body onLoad="timedCount();"> remove the document.getelementbyid line in the timed count function. and add a semicolon after the stopCount() in the onClick event of the submit button. The action of your form MUST point to something cabale of processing the data in the manner you want. ../_vti_bin/shtml.exe/forecast/tester.html can that send an email? (i know is an exe but I have never used a method liek that - suppose thats why I use php ;) )
  22. I think it would be better tohave the form on your server and just send a link to it in the e-mail.  depending on where the users accesses the form js may be disabled. You will also have to check that js in enabled on the page the script is running on - which is why I think you should use the server to monitor the times via the sesion variable that way you don't have to worry about js being on or off.
  23. have a look look at the Timing event in an infinite loop - with a Stop button example on this page. [url=http://www.w3schools.com/js/js_timing.asp]http://www.w3schools.com/js/js_timing.asp[/url] everything you need is in there.  Just change the script so that tht timer starts on page load (onLoad in the body tag) and add the onClick event to your submit button.
  24. why create multiple cookies????? all those cookies will be sent separately have a look at this [url=http://uk.php.net/manual/en/function.setcookie.php]http://uk.php.net/manual/en/function.setcookie.php[/url] and pay particular attention to example 3.
  25. You could set a session variable (make it an array) and record the time the request was recieved to display the next page in the exam. OR you could use javascript to do the same thing - record start/stop time for each page either way you don't need a hidden field to achieve it.
×
×
  • 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.