Jump to content
Killersites Forums

Michael_

Member
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Michael_

  • Rank
    New member
  1. Let's see your HTML form source code. I'm guessing you forgot to change the original form to name='editor_name'. ps: and you don't need those session lines about editor_name
  2. are you getting the "The answer was submitted successfully" message? add echo $sql and post the command here
  3. No, you will just echo the same thing $n times. Take a look at this <?php // display the number of input rows for invites. for ( $c=0, $c<$n, $c++) { echo " \n"; } ?> View your html source to see the generated code. You will have name='whole_name[0]' Also, I removed id= because unless you're doing stuff with client side java script you don't need it, and if you do it must be a unique value (to be valid html) so you'd have to append $c to the id value
  4. take a look at url_encode $string = '&fn='. url_encode($firstname). '&ln='. url_encode($lastname);
  5. Do you get values displayed for Sent: Sixe: and Type: also see the use of basename and move_uploaded_file if (move_uploaded_file( $_FILES['file']['tmp_name'], "/usr/local/zend/apache2/htdocs/" . basename($_FILES['file']['name']) ) echo "File is valid, and was successfully uploaded.\n"; else echo "File upload failed!\n";
  6. close, just added brackets [] is used for checkboxes, because you have text fields you shoud include an index inside the brackets. //assuming you have a for loop like for ($row=0; $row<5; $row++) { echo "... name=\"whole_name[$row]\" ..."; } // fyi html also likes single quotes, this just looks cleaner echo "... name='whole_name[$row]' ..."; // it will return $_POST['whole_name'][0]
  7. my guess is hat name is a reserved word. you can either rename it to something like $student_name or try changing your sql statement to enclose field names in accents $sql="INSERT INTO Responses (`name`,`Answer1`,`Answer2`,`Answer3` ...
  8. Michael_

    strtoupper question

    einsteinsboi is close, $name would be better, but $new_name is probably correct. if ($new_name != "Jimmy Two Guns") { $this->name = strtoupper($new_name); }
  9. I think it's because you don't have quotes around the data fields in the sql statement. Using ',' may seem like you have the quotes, but that only creates a comma, you have to have "','" function newSchool() { $sql_command = "INSERT INTO schools (school, country, city, state, zip) VALUES ('" . $this->school . "','" . $this->country . "','" . $this->city . "','" . $this->state . "','" . $this->zip . "')"; // by placing this in a variable you can test with echo $sql_command; $sql = mysql_query ($sql_command); return $sql; }
×
×
  • Create New...