![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 4 Pomógł: 0 Dołączył: 9.04.2010 Ostrzeżenie: (0%) ![]() ![]() |
witam, prosze o pomoc bo od trzech dni nie moge znalezc rozwiazania (IMG:style_emoticons/default/sad.gif) pracuje na xampp, mam skrypt formularza php zachowany na htdocs:
[//dodaj.html <html> <head> <title>Dołącz do Nas!</title></head> <body> <form method="POST" action="dodaj.php"> Podaj imię: <input type="text" size="30" name="name" /><br /> Podaj nazwisko: <input type="text" size="40" name="nazwisko" /><br /> Podaj e-mail: <input type="text" size="40" name="email" /><br /> Podaj powiat: <input type="text" size="20" name="powiat" /><br /> Podaj miejskowość: <input type="text" size="40" name="miejscowosc" /><br /> <input type="submit" value="Wyślij" /> </form> </body> </html> ] [//dodaj.php <?php require("connection.php"); connection(); $name = $_POST['name']; $nazwisko = $_POST['nazwisko']; $email = $_POST['email']; $powiat = $_POST['powiat']; $miejscowosc = $_POST['miejscowosc']; $zapytanie ="INSERT INTO 'ankieta' (id, name, nazwisko, email, powiat, miejscowosc, plainText, enabled, sdate) VALUES('', $name, $nazwisko, $email, $powiat, $miejscowosc,'','','')"; mysql_query($zapytanie)'; ?> ] [//connection.php <?php function connection() { $mysql_host = "localhost"; $mysql_user = "angela"; $mysql_pass = "haslo"; $mysql_db = "ankieta"; @mysql_connect($mysql_host, $mysql_user, $mysql_pass) or die('Brak połączenia z serwerem MySQL.'); @mysql_select_db($mysql_db) or die('Błąd wyboru bazy danych.'); } ?> ] po wprowadzeniu na serwer: localhost/dodaj.html pokazuje sie tabela formularza, po wypelnieniu tabeli i zatwierdzeniu pokazuje sie pusty ekran i nic nie zapisuje zadnych danych w bazie danych mysql... gdzie robie blad? |
|
|
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 706 Pomógł: 108 Dołączył: 12.03.2010 Ostrzeżenie: (0%) ![]() ![]() |
Proszę używać prawidłowo kolorowania składni.
Zamień odpowiedni fragment kodu na taki:
Ten post edytował croc 23.05.2010, 21:13:29 |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 4 Pomógł: 0 Dołączył: 9.04.2010 Ostrzeżenie: (0%) ![]() ![]() |
niestety, to nic nie pomoglo. nadal dane z formularza nie zapisuja sie w bazie danych. nigdy wczesniej nie korzystalam z mysql i xampp - wszystkie skrypty php zapisuje w htdocs. czy trzeba moze jakos skonfiguropwac mysql?
|
|
|
![]()
Post
#4
|
|
Grupa: Zarejestrowani Postów: 706 Pomógł: 108 Dołączył: 12.03.2010 Ostrzeżenie: (0%) ![]() ![]() |
|
|
|
![]()
Post
#5
|
|
Grupa: Zarejestrowani Postów: 873 Pomógł: 25 Dołączył: 24.07.2005 Ostrzeżenie: (0%) ![]() ![]() |
daj print $zapytanie i puść to w jakimś phpmyAdmin albo ściągnij mysql Lite
http://www.sqlmanager.net/products/mysql/manager zobaczymy czy na bank zapytanie masz gut |
|
|
![]()
Post
#6
|
|
Grupa: Zarejestrowani Postów: 706 Pomógł: 108 Dołączył: 12.03.2010 Ostrzeżenie: (0%) ![]() ![]() |
|
|
|
![]()
Post
#7
|
|
Grupa: Zarejestrowani Postów: 4 Pomógł: 0 Dołączył: 9.04.2010 Ostrzeżenie: (0%) ![]() ![]() |
Nadal pojawia się pusty ekran? A skopiuj plik dodaj.php i w oryginale zrób takie coś: Wyślij formularz i pokaż co się wyświetla. require("connection.php"); connection(); $name = $_POST['name']; $nazwisko = $_POST['nazwisko']; $email = $_POST['email']; $powiat = $_POST['powiat']; $miejscowosc = $_POST['miejscowosc']; $zapytanie ="INSERT INTO 'ankieta' (id, name, nazwisko, email, powiat, miejscowosc, plainText, enabled, sdate) VALUES('', $name, $nazwisko, $email, $powiat, $miejscowosc,'','','')"; mysql_query($zapytanie)'; ?> |
|
|
![]()
Post
#8
|
|
Grupa: Zarejestrowani Postów: 706 Pomógł: 108 Dołączył: 12.03.2010 Ostrzeżenie: (0%) ![]() ![]() |
|
|
|
![]()
Post
#9
|
|
Grupa: Zarejestrowani Postów: 4 Pomógł: 0 Dołączył: 9.04.2010 Ostrzeżenie: (0%) ![]() ![]() |
czy po zainstalowaniu xampp-a powinnam jeszcze w jakikolwiek sposob zainstalowac mysql? gdy wlaczam xampp control panel apache and mysql are running. czy jest jakis inny plik do zapisywania danych php do bazy danych mysql? mnie uczono ze wszystkie pliki .php zapisuje sie w htdocs i wyswietla sie je na serwerze localhost: http:/localhost/dodaj.html
po wypelnieniu formularza przechdzimy na pusta strone http://localhost/dodaj.php prosze, co robie zle? |
|
|
![]()
Post
#10
|
|
Grupa: Zarejestrowani Postów: 706 Pomógł: 108 Dołączył: 12.03.2010 Ostrzeżenie: (0%) ![]() ![]() |
|
|
|
![]()
Post
#11
|
|
Grupa: Zarejestrowani Postów: 2 Pomógł: 0 Dołączył: 23.05.2010 Ostrzeżenie: (10%) ![]() ![]() |
|
|
|
![]()
Post
#12
|
|
Grupa: Zarejestrowani Postów: 706 Pomógł: 108 Dołączył: 12.03.2010 Ostrzeżenie: (0%) ![]() ![]() |
Po co zakładasz nowe konto?
Przeczytaj jeszcze raz temat od początku to zobaczysz, że jednak wszystkiego nie przeczytałaś. |
|
|
![]()
Post
#13
|
|
Grupa: Zarejestrowani Postów: 2 Pomógł: 0 Dołączył: 23.05.2010 Ostrzeżenie: (10%) ![]() ![]() |
PHP Version 5.3.1
System Windows NT ACER 6.1 build 7600 ((null)) i586 Build Date Nov 20 2009 17:20:57 Compiler MSVC6 (Visual C++ 6.0) Architecture x86 Configure Command cscript /nologo configure.js "--enable-snapshot-build" Server API Apache 2.0 Handler Virtual Directory Support enabled Configuration File (php.ini) Path no value Loaded Configuration File C:\xampp\php\php.ini Scan this dir for additional .ini files (none) Additional .ini files parsed (none) PHP API 20090626 PHP Extension 20090626 Zend Extension 220090626 Zend Extension Build API220090626,TS,VC6 PHP Extension Build API20090626,TS,VC6 Debug Build no Thread Safety enabled Zend Memory Manager enabled Zend Multibyte Support disabled IPv6 Support enabled Registered PHP Streams https, ftps, php, file, glob, data, http, ftp, compress.zlib, compress.bzip2, phar, zip Registered Stream Socket Transports tcp, udp, ssl, sslv3, sslv2, tls Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, zlib.*, bzip2.* This program makes use of the Zend Scripting Language Engine: Zend Engine v2.3.0, Copyright © 1998-2009 Zend Technologies -------------------------------------------------------------------------------- PHP Credits -------------------------------------------------------------------------------- Configuration apache2handler Apache Version Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 Apache API Version 20051115 Server Administrator postmaster@localhost Hostname:Port localhost:80 Max Requests Per Child: 0 - Keep Alive: on - Max Per Connection: 100 Timeouts Connection: 300 - Keep-Alive: 5 Virtual Server No Server Root C:/xampp/apache Loaded Modules core mod_win32 mpm_winnt http_core mod_so mod_actions mod_alias mod_asis mod_auth_basic mod_auth_digest mod_authn_default mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_cgi mod_dav mod_dav_fs mod_dav_lock mod_dir mod_env mod_headers mod_include mod_info mod_isapi mod_log_config mod_mime mod_negotiation mod_rewrite mod_setenvif mod_ssl mod_status mod_autoindex_color mod_php5 mod_perl mod_apreq2 Directive Local Value Master Value engine 1 1 last_modified 0 0 xbithack 0 0 Apache Environment Variable Value AuthDigestEnableQueryStringHack On MIBDIRS C:/xampp/php/extras/mibs MYSQL_HOME C:\xampp\mysql\bin OPENSSL_CONF C:/xampp/apache/bin/openssl.cnf PHP_PEAR_SYSCONF_DIR C:\xampp\php PHPRC C:\xampp\php TMP C:\xampp\tmp HTTP_ACCEPT image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/x-esobi, application/x-shockwave-flash, application/vnd.ms-xpsdocument, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* HTTP_REFERER http://localhost/dodaj.html HTTP_ACCEPT_LANGUAGE en-GB HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; eSobiSubscriber 2.0.4.16; Media Center PC 5.0; SLCC1; InfoPath.2) CONTENT_TYPE application/x-www-form-urlencoded HTTP_ACCEPT_ENCODING gzip, deflate HTTP_HOST localhost CONTENT_LENGTH 64 HTTP_CONNECTION Keep-Alive HTTP_CACHE_CONTROL no-cache PATH C:\Program Files\PC Connectivity Solution\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Acer\Empowering Technology\eDataSecurity\;C:\Program Files\Acer\Empowering Technology\eDataSecurity\x86;C:\Program Files\Acer\Empowering Technology\eDataSecurity\x64;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\QuickTime\QTSystem\;C:\Windows\System32\WindowsPowerShell\v1.0\ SystemRoot C:\Windows COMSPEC C:\Windows\system32\cmd.exe PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC WINDIR C:\Windows SERVER_SIGNATURE <address>Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 Server at localhost Port 80</address> SERVER_SOFTWARE Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 SERVER_NAME localhost SERVER_ADDR ::1 SERVER_PORT 80 REMOTE_ADDR ::1 DOCUMENT_ROOT C:/xampp/htdocs SERVER_ADMIN postmaster@localhost SCRIPT_FILENAME C:/xampp/htdocs/dodaj.php REMOTE_PORT 52021 GATEWAY_INTERFACE CGI/1.1 SERVER_PROTOCOL HTTP/1.1 REQUEST_METHOD POST QUERY_STRING no value REQUEST_URI /dodaj.php SCRIPT_NAME /dodaj.php HTTP Headers Information HTTP Request Headers HTTP Request POST /dodaj.php HTTP/1.1 Accept image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/x-esobi, application/x-shockwave-flash, application/vnd.ms-xpsdocument, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* Referer http://localhost/dodaj.html Accept-Language en-GB User-Agent Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; eSobiSubscriber 2.0.4.16; Media Center PC 5.0; SLCC1; InfoPath.2) Content-Type application/x-www-form-urlencoded Accept-Encoding gzip, deflate Host localhost Content-Length 64 Connection Keep-Alive Cache-Control no-cache HTTP Response Headers X-Powered-By PHP/5.3.1 Keep-Alive timeout=5, max=100 Connection Keep-Alive Transfer-Encoding chunked Content-Type text/html bcmath BCMath support enabled Directive Local Value Master Value bcmath.scale 0 0 bz2 BZip2 Support Enabled Stream Wrapper support compress.bz2:// Stream Filter support bzip2.decompress, bzip2.compress BZip2 Version 1.0.5, 10-Dec-2007 calendar Calendar support enabled com_dotnet COM support enabled DCOM support disabled .Net support enabled Directive Local Value Master Value com.allow_dcom 0 0 com.autoregister_casesensitive 1 1 com.autoregister_typelib 0 0 com.autoregister_verbose 0 0 com.code_page no value no value com.typelib_file no value no value Core PHP Version 5.3.1 Directive Local Value Master Value allow_call_time_pass_reference On On allow_url_fopen On On allow_url_include Off Off always_populate_raw_post_data Off Off arg_separator.input & & arg_separator.output & & asp_tags Off Off auto_append_file no value no value auto_globals_jit On On auto_prepend_file no value no value browscap C:\xampp\php\extras\browscap.ini C:\xampp\php\extras\browscap.ini default_charset no value no value default_mimetype text/html text/html define_syslog_variables Off Off disable_classes no value no value disable_functions no value no value display_errors On On display_startup_errors On On doc_root no value no value docref_ext no value no value docref_root no value no value enable_dl On On error_append_string no value no value error_log no value no value error_prepend_string no value no value error_reporting 22519 22519 exit_on_timeout Off Off expose_php On On extension_dir C:\xampp\php\ext C:\xampp\php\ext file_uploads On On highlight.bg #FFFFFF #FFFFFF highlight.comment #FF8000 #FF8000 highlight.default #0000BB #0000BB highlight.html #000000 #000000 highlight.keyword #007700 #007700 highlight.string #DD0000 #DD0000 html_errors On On ignore_repeated_errors Off Off ignore_repeated_source Off Off ignore_user_abort Off Off implicit_flush Off Off include_path .;C:\xampp\php\PEAR .;C:\xampp\php\PEAR log_errors Off Off log_errors_max_len 1024 1024 magic_quotes_gpc Off Off magic_quotes_runtime Off Off magic_quotes_sybase Off Off mail.add_x_header Off Off mail.force_extra_parameters no value no value mail.log no value no value max_execution_time 60 60 max_file_uploads 20 20 max_input_nesting_level 64 64 max_input_time 60 60 memory_limit 128M 128M open_basedir no value no value output_buffering no value no value output_handler no value no value post_max_size 128M 128M precision 14 14 realpath_cache_size 16K 16K realpath_cache_ttl 120 120 register_argc_argv On On register_globals Off Off register_long_arrays Off Off report_memleaks On On report_zend_debug On On request_order no value no value safe_mode Off Off safe_mode_exec_dir no value no value safe_mode_gid Off Off safe_mode_include_dir no value no value sendmail_from no value no value sendmail_path no value no value serialize_precision 100 100 short_open_tag Off Off SMTP localhost localhost smtp_port 25 25 sql.safe_mode Off Off track_errors Off Off unserialize_callback_func no value no value upload_max_filesize 128M 128M upload_tmp_dir C:\xampp\tmp C:\xampp\tmp user_dir no value no value user_ini.cache_ttl 300 300 user_ini.filename .user.ini .user.ini variables_order GPCS GPCS xmlrpc_error_number 0 0 xmlrpc_errors Off Off y2k_compliance On On zend.enable_gc On On ctype ctype functions enabled date date/time support enabled "Olson" Timezone Database Version 2009.18 Timezone Database internal Default timezone Europe/London Directive Local Value Master Value date.default_latitude 31.7667 31.7667 date.default_longitude 35.2333 35.2333 date.sunrise_zenith 90.583333 90.583333 date.sunset_zenith 90.583333 90.583333 date.timezone Europe/London Europe/London dom DOM/XML enabled DOM/XML API Version 20031129 libxml Version 2.7.6 HTML Support enabled XPath Support enabled XPointer Support enabled Schema Support enabled RelaxNG Support enabled ereg Regex Library System library enabled exif EXIF Support enabled EXIF Version 1.4 $Id: exif.c 287372 2009-08-16 14:32:32Z iliaa $ Supported EXIF Version 0220 Supported filetypes JPEG,TIFF Directive Local Value Master Value exif.decode_jis_intel JIS JIS exif.decode_jis_motorola JIS JIS exif.decode_unicode_intel UCS-2LE UCS-2LE exif.decode_unicode_motorola UCS-2BE UCS-2BE exif.encode_jis no value no value exif.encode_unicode ISO-8859-15 ISO-8859-15 fileinfo fileinfo support enabled version 1.0.5-dev filter Input Validation and Filtering enabled Revision $Revision: 289434 $ Directive Local Value Master Value filter.default unsafe_raw unsafe_raw filter.default_flags no value no value ftp FTP support enabled gd GD Support enabled GD Version bundled (2.0.34 compatible) FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.3.11 T1Lib Support enabled GIF Read Support enabled GIF Create Support enabled JPEG Support enabled libJPEG Version 7 PNG Support enabled libPNG Version 1.2.40 WBMP Support enabled XBM Support enabled JIS-mapped Japanese Font Support enabled Directive Local Value Master Value gd.jpeg_ignore_warning 0 0 gettext GetText Support enabled hash hash support enabled Hashing Engines md2 md4 md5 sha1 sha224 sha256 sha384 sha512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru snefru256 gost adler32 crc32 crc32b salsa10 salsa20 haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5 iconv iconv support enabled iconv implementation "libiconv" iconv library version 1.13 Directive Local Value Master Value iconv.input_encoding ISO-8859-1 ISO-8859-1 iconv.internal_encoding ISO-8859-1 ISO-8859-1 iconv.output_encoding ISO-8859-1 ISO-8859-1 imap IMAP c-Client Version 2007e SSL Support enabled json json support enabled json version 1.2.1 libxml libXML support active libXML Compiled Version 2.7.6 libXML Loaded Version 20706 libXML streams enabled mbstring Multibyte Support enabled Multibyte string engine libmbfl HTTP input encoding translation disabled mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1. Multibyte (japanese) regex support enabled Multibyte regex (oniguruma) version 4.7.1 Directive Local Value Master Value mbstring.detect_order no value no value mbstring.encoding_translation Off Off mbstring.func_overload 0 0 mbstring.http_input pass pass mbstring.http_output pass pass mbstring.http_output_conv_mimetypes ^(text/|application/xhtml\+xml) ^(text/|application/xhtml\+xml) mbstring.internal_encoding no value no value mbstring.language neutral neutral mbstring.strict_detection Off Off mbstring.substitute_character no value no value mcrypt mcrypt support enabled Version 2.5.8 Api No 20021217 Supported ciphers cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes Supported modes cbc cfb ctr ecb ncfb nofb ofb stream Directive Local Value Master Value mcrypt.algorithms_dir no value no value mcrypt.modes_dir no value no value Ten post edytował angel75 24.05.2010, 09:15:53 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 24.08.2025 - 01:35 |