[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Html med PHP men så også lige med lidt Java



Hej slugg folk

Jeg har tilpasset den her lille form med bagrud i nogle forskellige php
form tutorials.
http://www.mimeini.latestdot.dk/form.html

Den har  jeg nogenlunde styr over nu, men jeg kunne godt tænke mig at

Message feltet var sådan et felt med tæller på i stedet. Jeg har fundet et
eksempel på sådan et tæller felt her:

http://www.reconn.us/demo/character_counter.html

Koden til dette ligger her:

http://www.reconn.us/content/view/34/46/

Gennerelt kan man sige at jeg nogenlunde kan analysere mig igennem php
coder imens java stadig er temmeligt sort for mig.

Jeg kunne godt bruge lidt hjælp til hvordan jeg griber det an. Jeg gættet
på at man skal få java scriptet til at overgive tekststrengen til php'en.
Hvordan gør jeg det? Eller vil i foreslå at jeg i stedet laver det hele i
java (jeg kan ikke noget java man jeg kunne vel finde nogle eksempler og
tilpasse dem :-)).

Tillægs spørgsmål

Det nederste i koden  forstår jeg ikke. Jeg må bare konstaterer at hvis jeg
fjerner det at så viker scriptet ikke. Kan nogen sige mig hvad det gør og
hvorfor mit script ikke virker hvis  jeg fjerner det??

for ($i=0;$i<count($types);$i++){
  $ctypes=  $ctypes . "\n$types[$i]";
  $screen_ctypes=  $screen_ctypes . "\n$types[$i]";
}
$body= $message . " \n\nComment type(s)" . $ctypes;
}

Mvh
Mikkel

Her er hele php coden:

<?
//import form information
$message = $_POST['message'];
$gender = $_POST['gender'];
$sorient = $_POST['sorient'];
$types=$_POST['types'];
$message=stripslashes($message);

/*
Simple form validation
check to see
*/
//noter om radio button checked

if (isset ($gender))
  {
$genderradio = 'HelFin';
  }
else
  {
$genderradio = 'unchecked';
  }

if (isset ($sorient))
  {
$sorientradio = 'HelFin';
  }
else
  {
$sorientradio = 'unchecked';
  }

 //if no
if ($genderradio=="unchecked"){
  print "Der blev ikke afkrydeset noget køn. <br>Please include a gender";
  }
   //if no
  elseif ($sorientradio=="unchecked"){
  print "Der blev ikke afkrydset nogen seksuel orientering. <br>Please
include a sexual orientering.<br>";
  }
   //if no message entered send print an error
  elseif (empty($message)){
  print "No message was entered.<br>Please include a message.<br>";
  }
else {
// print a response message
print "<b>Thank you. You are $gender and you like it, and your sexual
orientation is towords $sorient</b><br>
$message<br>
";

for ($i=0;$i<count($types);$i++){
  $ctypes=  $ctypes . "\n$types[$i]";
  $screen_ctypes=  $screen_ctypes . "\n$types[$i]";
}
$body= $message . " \n\nComment type(s)" . $ctypes;
}
?>


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2012-07-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *