php necesidad de ayudar a casilla PRONTO!

  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Septiembre 23rd, 2010, 12:34 am

righteous_trespasser escribió:
Creo que se acercan a esto desde el ángulo incorrecto...En lugar de enviar el formulario y crear un vínculo con los valores de correos, y no basta con incluir los archivos correctos...Así, en otras palabras, crear solution_1.html a los archivos solution_10.html y sólo si es necesario incluirlos...de este modo:

form.html

HTML Código: [ Select ]
<form action="checkbox-control.php" method="post">
  Please, check all the boxes that applies to your current sitiation:<br /><br />
  <input type="checkbox" name="problem[]" value="A" />Problem 1.<br />
  <input type="checkbox" name="problem[]" value="B" />Problem 2.<br />
  <input type="checkbox" name="problem[]" value="C" />Problem 3.<br />
  <input type="checkbox" name="problem[]" value="D" />Problem 4.<br />
  <input type="checkbox" name="problem[]" value="E" />Problem 5.<br />
  <input type="checkbox" name="problem[]" value="F" />Problem 6.<br />
  <input type="checkbox" name="problem[]" value="G" />Problem 7.<br />
  <input type="checkbox" name="problem[]" value="H" />Problem 8.<br />
  <input type="checkbox" name="problem[]" value="I" />Problem 9.<br />
  <input type="checkbox" name="problem[]" value="J" />Problem 10.<br />
<center><input type="submit" name="formSubmit" value="Submit" /></center><br /><br />
<br /> If your problem is not listed here then please let me know so.<br />
</form>
  1. <form action="checkbox-control.php" method="post">
  2.   Please, check all the boxes that applies to your current sitiation:<br /><br />
  3.   <input type="checkbox" name="problem[]" value="A" />Problem 1.<br />
  4.   <input type="checkbox" name="problem[]" value="B" />Problem 2.<br />
  5.   <input type="checkbox" name="problem[]" value="C" />Problem 3.<br />
  6.   <input type="checkbox" name="problem[]" value="D" />Problem 4.<br />
  7.   <input type="checkbox" name="problem[]" value="E" />Problem 5.<br />
  8.   <input type="checkbox" name="problem[]" value="F" />Problem 6.<br />
  9.   <input type="checkbox" name="problem[]" value="G" />Problem 7.<br />
  10.   <input type="checkbox" name="problem[]" value="H" />Problem 8.<br />
  11.   <input type="checkbox" name="problem[]" value="I" />Problem 9.<br />
  12.   <input type="checkbox" name="problem[]" value="J" />Problem 10.<br />
  13. <center><input type="submit" name="formSubmit" value="Submit" /></center><br /><br />
  14. <br /> If your problem is not listed here then please let me know so.<br />
  15. </form>


casilla de control. php

PHP Código: [ Select ]
<?php
  for($i=0;$i<11;$i++){
    if(isset($_POST['problem'][$i]) && !empty($_POST['problem'][$i])){
      include("includes/solution_$i.html");
    }
  }
?>
  1. <?php
  2.   for($i=0;$i<11;$i++){
  3.     if(isset($_POST['problem'][$i]) && !empty($_POST['problem'][$i])){
  4.       include("includes/solution_$i.html");
  5.     }
  6.   }
  7. ?>

Alguien se perdió mi post anterior :P
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Septiembre 23rd, 2010, 12:34 am

  • BomWatchout
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Sep 20, 2010
  • Mensajes: 12
  • Status: Offline

Nota Septiembre 23rd, 2010, 12:47 am

Tengo esta:

Código: [ Select ]
<?php
$pro = $_POST['problem'];

if(empty($pro))
{
echo("You got this error because you didnt select any issue.<br />
  Please, click the back bottom and recheck your issues.");
}
else
{
$N = count($pro);

echo("You selected $N issues(s) in your computer: ");


 for($i=0;$i<11;$i++){
  if(isset($_POST['problem'][$i]) && !empty($_POST['problem'][$i])){
   include("includes/solution_$i.html");
  }
 }
?>
  1. <?php
  2. $pro = $_POST['problem'];
  3. if(empty($pro))
  4. {
  5. echo("You got this error because you didnt select any issue.<br />
  6.   Please, click the back bottom and recheck your issues.");
  7. }
  8. else
  9. {
  10. $N = count($pro);
  11. echo("You selected $N issues(s) in your computer: ");
  12.  for($i=0;$i<11;$i++){
  13.   if(isset($_POST['problem'][$i]) && !empty($_POST['problem'][$i])){
  14.    include("includes/solution_$i.html");
  15.   }
  16.  }
  17. ?>

obtener error de análisis en la línea 21
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Septiembre 23rd, 2010, 12:48 am

El más no está cerrada. Es necesario un mayor ) antes de la ?>
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • BomWatchout
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Sep 20, 2010
  • Mensajes: 12
  • Status: Offline

Nota Septiembre 23rd, 2010, 12:54 am

se puede ver ahora, pero esto todavía no es lo que estoy buscando. Como he dicho antes "esta casilla de verificación no están diseñados para dar al usuario el vínculo tutorial directa, que se supone que me informen de su situación actual y de que se les conceda un tutorial".

Esto sólo le dará abierto un tutorial para cada individuo casilla ..

muestra:

box1 Tengo Windows XP
box2 tengo un SO de 32 bits
Box3 no tengo el juego

qué tipo de tutorial que sería si sólo una casilla de verificación?

Creo que los nombres de archivo del tutorial debe estar buscando algo así como tutorial_ABC o tutorial_BDGEJ etc.
  • BomWatchout
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Sep 20, 2010
  • Mensajes: 12
  • Status: Offline

Nota Septiembre 23rd, 2010, 1:33 am

Por último, lo hice! :D

Debo darle las gracias un bogey LOT por el tiempo y paciencia para pasado aquí, realmente me ayudan a hombre, te debo una por esto. Tú también righteous_trespasser, gracias por el apoyo.
Ustedes me alegró el día en este momento. No puedo encontrar las palabras para decir lo agradecida que estoy! gif "alt =": D "title =" muy feliz ">

ok aquí está el resultado final:

Forum.html
Código: [ Select ]
<form action="checkbox-control.php" method="post">
 Please, check all the boxes that applies to your current sitiation:<br /><br />
 <input type="checkbox" name="problem[]" value="A" />Problem 1.<br />
 <input type="checkbox" name="problem[]" value="B" />Problem 2.<br />
 <input type="checkbox" name="problem[]" value="C" />Problem 3.<br />
 <input type="checkbox" name="problem[]" value="D" />Problem 4.<br />
 <input type="checkbox" name="problem[]" value="E" />Problem 5.<br />
 <input type="checkbox" name="problem[]" value="F" />Problem 6.<br />
 <input type="checkbox" name="problem[]" value="G" />Problem 7.<br />
 <input type="checkbox" name="problem[]" value="H" />Problem 8.<br />
 <input type="checkbox" name="problem[]" value="I" />Problem 9.<br />
 <input type="checkbox" name="problem[]" value="J" />Problem 10.<br />
<center><input type="submit" name="formSubmit" value="Submit" /></center><br /><br />
<br /> If your problem is not listed here then please let me know so.<br />
</form>
  1. <form action="checkbox-control.php" method="post">
  2.  Please, check all the boxes that applies to your current sitiation:<br /><br />
  3.  <input type="checkbox" name="problem[]" value="A" />Problem 1.<br />
  4.  <input type="checkbox" name="problem[]" value="B" />Problem 2.<br />
  5.  <input type="checkbox" name="problem[]" value="C" />Problem 3.<br />
  6.  <input type="checkbox" name="problem[]" value="D" />Problem 4.<br />
  7.  <input type="checkbox" name="problem[]" value="E" />Problem 5.<br />
  8.  <input type="checkbox" name="problem[]" value="F" />Problem 6.<br />
  9.  <input type="checkbox" name="problem[]" value="G" />Problem 7.<br />
  10.  <input type="checkbox" name="problem[]" value="H" />Problem 8.<br />
  11.  <input type="checkbox" name="problem[]" value="I" />Problem 9.<br />
  12.  <input type="checkbox" name="problem[]" value="J" />Problem 10.<br />
  13. <center><input type="submit" name="formSubmit" value="Submit" /></center><br /><br />
  14. <br /> If your problem is not listed here then please let me know so.<br />
  15. </form>


Casilla de verificación-control.php

Código: [ Select ]
<html>
<?php
$pro = $_POST['problem'];
if(empty($pro))
{
echo("You got this error because you didnt select any issue.<br />
  Please, click the back bottom and recheck your issues.");
}
else
{
$N = count($pro);

echo("You selected $N issues(s) in your computer: ");
}

?>
<br /><br />
Based on what you choosed, we recommend the following tutorial for you<br /><br />
<center>
<a href=
 "tutorial_<?php
  for($i=0; $i < $N; $i++)
  {
   echo($pro[$i]); 
  }
  ?>.html
">your tutorial</a>
</center>
</html>
  1. <html>
  2. <?php
  3. $pro = $_POST['problem'];
  4. if(empty($pro))
  5. {
  6. echo("You got this error because you didnt select any issue.<br />
  7.   Please, click the back bottom and recheck your issues.");
  8. }
  9. else
  10. {
  11. $N = count($pro);
  12. echo("You selected $N issues(s) in your computer: ");
  13. }
  14. ?>
  15. <br /><br />
  16. Based on what you choosed, we recommend the following tutorial for you<br /><br />
  17. <center>
  18. <a href=
  19.  "tutorial_<?php
  20.   for($i=0; $i < $N; $i++)
  21.   {
  22.    echo($pro[$i]); 
  23.   }
  24.   ?>.html
  25. ">your tutorial</a>
  26. </center>
  27. </html>

Yo espero que alguien Mijas más podría encontrar esta utilidad en el futuro. Gracias de nuevo muchachos, esta roca foro y no voy a dejarlo en el corto plazo :D
  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8211
  • Loc: USA
  • Status: Offline

Nota Septiembre 23rd, 2010, 10:38 am

Debemos tener miss-entendido lo que estaba pidiendo todo este tiempo :shock: Me alegro de que lo imaginó.
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • BomWatchout
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Sep 20, 2010
  • Mensajes: 12
  • Status: Offline

Nota Septiembre 23rd, 2010, 1:48 pm

bueno, ahora tengo que acortar esos resultados por eco-ción de errores si el usuario marque las casillas determinadas juntos. Sé que esto puede ser resuelto a través del "si" y "si no" declaraciones. ¿Sería mucho pedir?

Voy a mostrar un ejemplo utilizando mis conocimientos php mal gif "alt = =":)" título" Smile ">

Código: [ Select ]
<html>

<?php

$pro = $_POST['problem'];

if(empty($pro))
{
echo("You got this error because you didnt select any issue.<br />
  Please, click the back bottom and recheck your issues.");
}
else
{
$N = count($pro);

echo("You selected $N issues(s) in your computer: ");
}

?>
<br /><br />

Based on what you choosed, we recommend the following tutorial for you<br /><br />
<center>
<a href="tutorial_<?php
for($i=0; $i < $N; $i++)
{
  $p = ($pro[$i]);
  $a = array(($pro[$i]));
  if(array_key_exists("A"||"AB"||"ABC",$a)) /*<-- in here I meant to say if the value A (only) or the values AB (only) or values ABC (only) exist in the array...*\
  {
  echo("error");
  }
  else
  {
  echo($p);
  }
}
?>.html
">your tutorial</a>
</html>
  1. <html>
  2. <?php
  3. $pro = $_POST['problem'];
  4. if(empty($pro))
  5. {
  6. echo("You got this error because you didnt select any issue.<br />
  7.   Please, click the back bottom and recheck your issues.");
  8. }
  9. else
  10. {
  11. $N = count($pro);
  12. echo("You selected $N issues(s) in your computer: ");
  13. }
  14. ?>
  15. <br /><br />
  16. Based on what you choosed, we recommend the following tutorial for you<br /><br />
  17. <center>
  18. <a href="tutorial_<?php
  19. for($i=0; $i < $N; $i++)
  20. {
  21.   $p = ($pro[$i]);
  22.   $a = array(($pro[$i]));
  23.   if(array_key_exists("A"||"AB"||"ABC",$a)) /*<-- in here I meant to say if the value A (only) or the values AB (only) or values ABC (only) exist in the array...*\
  24.   {
  25.   echo("error");
  26.   }
  27.   else
  28.   {
  29.   echo($p);
  30.   }
  31. }
  32. ?>.html
  33. ">your tutorial</a>
  34. </html>

Para obtener más que lo intento no parece aplicar el "if" añadí...apenas va sobre ella y los Estados "si no" declaración.
Poco ayuda por favor? :D

Publicar Información

  • Total de mensajes en este tema: 22 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 216 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC