Jump to content

ToonMariner

Members
  • Posts

    3,342
  • Joined

  • Last visited

Everything posted by ToonMariner

  1. possibly... I was completely oblivious to that - but the I have got to the point where uppercase letters in files is unfamiliar to that I probably just read past it.
  2. just a little add on there thorpey! if security is what you were after in teh realm of escaping then you need to do this... <?php if (!get_magic_quotes_gpc()) { $data = mysql_real_escape_string($_POST['data']); } else { $data = mysql_real_escape_string(strip_slashes($_POST['lastname'])); } ?> a minor but very important addition... for a fuller picture look at example 1428 http://uk.php.net/manual/en/function.mysql-real-escape-string.php
  3. position: absolute; bottom: 0; you will will probably need to have the footer as a child of the body tag and give teh body tag position: relative and give the html and body 100% height.
  4. its a flash file so the browser will not know where abouts on the scene you are - a html form would not have the same issues... if you know then you could get flash to grab the co-ordinates of the cursor each time a an element gains focus and then send it to some javascript. The javascript would have to then grab the position on teh screen of the flash file and add the y-co-ordinate sent from flash. It could then scroll to that point. Personally I would not use flash for this - there is no need for any 'fabulous' graphical experience so a good old html form would be better... (IMO)
  5. this is a servr configuration - the server is instructed to find the default file in a directory normally index.htm or index.html. if you have .htaccess ability to alter this setting then simply place the following line in your .htaccess file DirectoryIndex index.php index.html index.htm if you don't then you need to ask your server people to add index.php to the list. If they are running apache then ask them change the 'DirectoryIndex' setting to: DirectoryIndex index.php index.html index.htm
  6. This may be a little more than you asked for but you should try to avoid using spacer html elements. they add to the file size and hence the bandwidth used and hence the page loading time. css can perform all teh spacing you need with the margin property. A back 'button' shoudl simply be a link. You can again use cs to style both a normal submit button (image inputs behave differently on different browsers) and a link to look like one anther on most browsers. I promise if you stick to smeantic html and leave the rest to style you will have a faster loading, more managable web site.
  7. automatcially escaped? do you mean you have coded to escape the data or are you assuming it is escaped properly? mysql_real_escape_string is pretty useful when entering user defined data into a table...
  8. Azu - not wanting to offend but perhaps you should learn the html basics?? http://www.w3schools.com/html/default.asp
  9. if you refer to having this on other peoples servers then you shoudl look at ioncube or zend guard or similar...
  10. once you have created the thumnail save it in a directory. I have an 'images' folder for uploaded images that contains a folder called 'thumbs' I save humbnails in there. If I grab an image to be displayed I can check to see if the thumbnal exists - if so show that in stead else create it, save it in thumbs and then show it.
  11. that is a subdomian which you can set up via yur control panle on teh server - if you have a package that allows subdomains...
  12. Implement both but javascript can be disabled so you MUST check server side to ensure no html is entered to be absolutely sure.
  13. Actually I disagree with YOU FilmGod. Bottom line is there is not enough diskspace on this server to explain why tablelayouts are NEVER better than css layouts. You will simply have to accept that. If you can't get a layout to work with just css and have to resort to tables then you aren't using the css right... Browsers do vary - and thats a wonderful thing but if you use a good dtd (xhtml 1.1 is weapon of choice) then you can get VERY good results across browsers. Tables are for tabular data and NOTHING else.
  14. Nowt (much) worng with FF - its always IE that doesn't do what its supposed to...
  15. have you checked you junk mail? it may be getting filtered out.
  16. <input type="text" value='$text'/> should be <input type="text" value="<?php echo $text; ?>" />
  17. after your insert/update query use header ('Location: ' . $someurl); where $someurl is the page you want them top go to...
  18. ??? This only works once the table has been created... to create a table you use "CREATE TABLE `tablename`...' followed by the field name, type, attributes, NULL or NOT NULL, default value, (key type)... all those bits are what SHOW COLUMNS get for you. So, use the result of your show query, loop through each record and each array returned by each record to fill in the info for you. If you want help then post an example of what you need, the table you are using to generate info (the one you run the show query on) and the table structure you expect it to create.
  19. Variables are not executed - they are 'used'. In php the mysql(i)_connect is a construct that creates a resource. This resource is used in subsequent interactions with the database.
  20. just spotted something... I suspect teh name fiedl is a text or varchar and I have not quoted the value in the query. replace the processing script with this. [code[<?php require_once('../Connections/conn_org.php'); mysql_select_db($database_conn_org, $conn_org); $qry = "INSERT INTO selected (ID, name) VALUES "; // the command wew will run. // now create the values that are going in. $values = NULL; // null string to check later. foreach ($_POST['checked'] as $key => $check){ $values .= "(" . $key . " , '" . $check . "'),"; } if (!is_null($values)) // check there is something to enter into db { $qry .= substr($values, 0, -1); // strip off the last comma - otherwise you get an error. echo $qry; $result = mysql_query($qry, $conn_org); if (mysql_affected_rows() > 0) { echo "Hooray!"; } } ?> I have added the echo $qry; line in so it should echo teh query that is going to be run... If you follow teh procesing code you will see all it is doing is generating the qry string via a series of concatenating the strings.
  21. Don't be lost... replace this <form method="post" name="selections" action="post_selectedt3.php"> <table> <?php do { ?> <tr> <td><?php echo $row_rs1['ID']; ?></td> <td><?php echo $row_rs1['name']; ?></td> <td> <input type="checkbox" name="checked[]" value="<?php echo $row_rs1['ID'].'.'.$row_rs1['name']; ?>" /></td> <td> </td> </tr> <?php } while ($row_rs1 = mysql_fetch_assoc($rs1)); ?> <tr> <input type="submit" value="record selections" /> </tr> </table> </form> with this <form method="post" name="selections" action="post_selectedt3.php"> <table> <?php while ($row_rs1 = mysql_fetch_assoc($rs1)) { ?> <tr> <td><?php echo $row_rs1['ID']; ?></td> <td><?php echo $row_rs1['name']; ?></td> <td> <input type="checkbox" name="checked[<?php echo $row_rs1['ID']; ?>]" value="<?php echo $row_rs1['name']; ?>" /></td> <td> </td> </tr> <?php } ?> <tr> <input type="submit" value="record selections" /> </tr> </table> </form> and replace this code <?php require_once('../Connections/conn_org.php'); mysql_select_db($database_conn_org, $conn_org); $qry = "INSERT INTO selected (ID, name) VALUES $values"; // the command wew will run. // now create the values that are going in. $values = NULL; // null string to check later. foreach ($_POST['checked'] as $key => $check){ $values = "(" . $key . " , " . $check . "),"; } if (!is_null($values)) // check there is something to enter into db { $values = substr($values, 0, -1); // strip off the last comma - otherwise you get an error. $result = mysql_query($values, $conn_org); if (mysql_affected_rows() > 0) { echo "Hooray!"; } } ?> with this <?php require_once('../Connections/conn_org.php'); mysql_select_db($database_conn_org, $conn_org); $qry = "INSERT INTO selected (ID, name) VALUES "; // the command wew will run. // now create the values that are going in. $values = NULL; // null string to check later. foreach ($_POST['checked'] as $key => $check){ $values = "(" . $key . " , " . $check . "),"; } if (!is_null($values)) // check there is something to enter into db { $qry .= substr($values, 0, -1); // strip off the last comma - otherwise you get an error. $result = mysql_query($qry, $conn_org); if (mysql_affected_rows() > 0) { echo "Hooray!"; } } ?> I do apologize - in my post I neglected to add the INSERT INTO ... to the values created in teh loop. That new code will rectify that problem.
  22. if you have upto 200 items then looping through and doing an insert each time for each item is both inefficient and (where you are limited to the number of queries per page) may not result in what you actually need or even an error.... first you need to assemble the html correctly. poco is correct in that you must make the checkboxes into an array by adding the [] but in the processing script you are using the value of each checkbox to create an array where it will be beneficial both visually and in efficiency in the processing script to separate indexes from values. So lets get the checkboxes right first.. <?php while ($row_rs1 = mysql_fetch_assoc($rs1)) { ?> <tr> <td><?php echo $row_rs1['ID']; ?></td> <td><?php echo $row_rs1['name']; ?></td> <td> <input type="checkbox" name="checkbox[<?php echo $row_rs1['ID']; ?>]" value="<?php echo $row_rs1['name']; ?>" /> </td> <td> </td> </tr> <?php } ?> </table> We have now removed the need for exploding each value.. Now the processing script (assuming the rest of the html form is OK!) We want to run just one query to make this as efficient as possible but put ALL the id value pairs on the data base and here is who to do just that... <?php $qry = "INSERT INTO selected (ID, name) VALUES "; // the command wew will run. // now create the values that are going in. $values = NULL; // null string to check later. foreach ($_POST['checked'] as $key => $check){ $values = "(" . $key . " , " . $check . "),"; } if (!is_null($values)) // check there is something to enter into db { $values = substr($values, 0, -1); // strip off the last comma - otherwise you get an error. $result = mysql_query($values); if (mysql_affected_rows() > 0) { echo "Hooray!"; } } ?> That should do the trick...
  23. change your code to this... <?php require_once('../connect.php'); $newsnumber = $_POST[newsnumber]; $date1 = $_POST[date1]; $title = $_POST[title]; $news = $_POST[news]; $query="UPDATE `news` SET `date` = '". $date1 . "', `title` = '".$title."', `news` = '".$news."' WHERE newsnumber = '" . `$newsnumber` . "'"; echo $query; $query = mysql_query($query) or die(mysql_error()); if ( mysql_affected_rows() > 0 ) { echo "<br>News Archive has been edited"; } mysql_close($link) ?> run teh page - check you db table if teh update still do not work then copy the query string (that is now eching out) and run teh direct in phpmyadmin (or what ever app you sue to administer your database) and see what it throws out.
  24. Yes - "SHOW COLUMNS FROM `tablename`" this returns an array of info for each field. (if you rn it in phpmyadmin you'll see what I mean.)
×
×
  • 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.