Second Opinion
Folosind serviciul second opinion ne puteți trimite RMN-uri, CT -uri, angiografii, fișiere .pdf, documente medicale. Astfel vă vom putea da o opinie neurochirurgicală, fără ca aceasta să poată înlocui un consult de specialitate. Răspunsurile vor fi date prin e-mail în cel mai scurt timp posibil (de obicei în mai putin de 24 de ore, dar nu mai mult de 48 de ore). Second opinion – Neurohope este un serviciu gratuit. www.neurohope.ro |
Folosirea unui chestionar php intr-un site html
Last Updated: Jan 26 2017 13:37, Started by
15dorin89
, Jan 21 2017 01:29
·
0
#1
Posted 21 January 2017 - 01:29
Salutare,
Am creat un site html cu ajutorul Dreamweaver CS3. Pe langa chestiile de CSS m-am gandit sa fac si o pagina php, pe care o numesc chestionar(index.php). Zis si facut, am creat baza de date in localhost, ma conectez la ea cu ajutorul wamp-ului si adaug noi inregistrari din pagina mea php.Tot in pagina mea php imi afisez ultimele 5 cele mai recente inregistrari adaugate in baza de date. Toate bune si frumoase, functioneaza foarte bine, dar doar din localhost!!! De ceva timp ma chinui sa conectez asa-zisul chestionar, la paginile mele html. Ce am incercat pana acum a fost sa modific fisierul .htaccess, adaugand AddType application/x-httpd-php .html .htm, dar in zadar pentru ca nu reusesc sa includ fisieul php in cel html, si implicit sa intru in chestionar din site-ul html. Imi lipseste ceva ? Pot sa adaug cumva un form in pagina mea de html, iar in form sa incarc fisierul meu php ? Sau sa fac legatura cumva din html in php si pe urma invers ? Orice idee este bine venita. Iata si ceva cod din php-ul meu : <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysqli_real_escape_string") ? mysqli_real_escape_string(dbconnect(), $theValue) : mysqli_escape_string(dbconnect(), $theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $maxRows_Comments = 5; $pageNum_Comments = 0; if (isset($_GET['pageNum_Comments'])) { $pageNum_Comments = $_GET['pageNum_Comments']; } $startRow_Comments = $pageNum_Comments * $maxRows_Comments; mysqli_select_db($localhost, $database_localhost); $query_Comments = "SELECT * FROM mytable1 ORDER BY DateCreated DESC"; $query_limit_Comments = sprintf("%s LIMIT %d, %d", $query_Comments, $startRow_Comments, $maxRows_Comments); $Comments = mysqli_query($localhost, $query_limit_Comments) or die(mysqli_error($localhost)); $row_Comments = mysqli_fetch_assoc($Comments); if (isset($_GET['totalRows_Comments'])) { $totalRows_Comments = $_GET['totalRows_Comments']; } else { $all_Comments = mysqli_query($localhost,$query_Comments); $totalRows_Comments = mysqli_num_rows($all_Comments); } $totalPages_Comments = ceil($totalRows_Comments/$maxRows_Comments)-1; Multumesc anticipat! |
#2
Posted 26 January 2017 - 13:37
15dorin89, on 21 ianuarie 2017 - 01:29, said:
Pot sa adaug cumva un form in pagina mea de html, iar in form sa incarc fisierul meu php? Sau sa fac legatura cumva din html in php si pe urma invers ? Orice idee este bine venita. Daca vrei sa ascunzi extensii, poti folosi foarte usor rewrite. Apoi, ceea ce ai mai sus este o interogare, nu vad ca ai face vro actiune. Daca vrei sa faci o actiune (add comment, de exemplu) atunci poti pune un formular care are un action catre un fisier PHP iar acolo verifici requestul. Sunt multe de discutat, trebuie sa stii care este diferenta dintre GET si POST Cauta pe google "php simple post form example" si sigur o sa gasesti ceva resurse. |
Anunturi
▶ 0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users