bleured27 Posted July 16, 2012 Share Posted July 16, 2012 my biggest problem is debugging codes are there guides to debug and can some one post them it will help by my failed codes so plz help Quote Link to comment https://forums.phpfreaks.com/topic/265745-debugging/ Share on other sites More sharing options...
thara Posted July 16, 2012 Share Posted July 16, 2012 what you are trying to debug? Quote Link to comment https://forums.phpfreaks.com/topic/265745-debugging/#findComment-1361839 Share on other sites More sharing options...
bleured27 Posted July 16, 2012 Author Share Posted July 16, 2012 my session script post that one before last post this is not about that this is about learn debug a script i am totaly stucK when im debugging oKey writing (){} ican find rest is failing Quote Link to comment https://forums.phpfreaks.com/topic/265745-debugging/#findComment-1361840 Share on other sites More sharing options...
thara Posted July 16, 2012 Share Posted July 16, 2012 Post code please that you are trying to debug. Quote Link to comment https://forums.phpfreaks.com/topic/265745-debugging/#findComment-1361841 Share on other sites More sharing options...
bleured27 Posted July 16, 2012 Author Share Posted July 16, 2012 that is ban i thought ?  i try to get session userNAME as $user in success.php  checKlogin.php <?php $host = 'localhost'; // Server Host Name $user = 'root'; // Server User Name $password = ''; // Server Password $db = 'test'; // Your Database $link = mysql_connect($host,$user,$password) or die('Error in Server information'); mysql_select_db($db,$link) or die('Can not Select Databasse'); $userName = $_POST['myusername']; //User Name sent from Form $password = $_POST['mypassword']; // Password sent from Form $query = "select * from userinfo where username='$userName' and password='$password'"; $res = mysql_query($query); //Executing query and saving result in Result Set $rows = mysql_num_rows($res); if($rows==1) { session_register("userName"); session_register("password"); header("location:success.php"); } else { echo '<center>Data Does Not Match <br /> Re-Enter UserName and Password'; echo '<br /><a href="home.php"> home</a></center>'; include'main_login.php'; }  ?>  success.php <?php session_start(); echo ("<h2>Successfully Login <br /> Welcome ".$session[userName]."</h2>"); if(!session_is_registered("userName")) { header("location:login_form.php"); }else{ echo ("<h2>Successfully Login <br /> Welcome ".$session[userName]."</h2>"); echo '<a href="logout.php"> Log Out</a>'; }  ?>  Quote Link to comment https://forums.phpfreaks.com/topic/265745-debugging/#findComment-1361842 Share on other sites More sharing options...
PaulRyan Posted July 16, 2012 Share Posted July 16, 2012 You really haven't listened to the advice you've been given in the other multiple posts about this exact same code. session_is_registered is deprecated as of PHP 5.3 and has been completely removed as of PHP 5.4. Â You have been given examples of how to change your code accordingly. To start a session you need to use the following at the top of everypage that uses the session data: <?PHP Â session_start(); Â To create a new session variable you use the following: $_SESSION['variable_name_here'] = 'Variable Value Here'; Â Then any page that has the session_start() as the beginning can access the session variables, such as $_SESSION['variable_name_here'] from above Quote Link to comment https://forums.phpfreaks.com/topic/265745-debugging/#findComment-1361844 Share on other sites More sharing options...
bleured27 Posted July 18, 2012 Author Share Posted July 18, 2012 oKey finaly i got it onli 1 problem ovver when im trying this i have my php info here ! PHP Version 5.2.9 System Darwin imac-van-imac-600.local 8.11.0 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power Macintosh Build Date Apr 12 2009 21:27:44 Configure Command './configure' '--prefix=/Applications/XAMPP/xamppfiles' '--program-suffix=-5.2.9' '--libdir=/Applications/XAMPP/xamppfiles/lib/php/php-5.2.9' '--includedir=/Applications/XAMPP/xamppfiles/include/php/php-5.2.9' '--with-apxs2=/Applications/XAMPP/xamppfiles/bin/apxs' '--with-config-file-path=/Applications/XAMPP/xamppfiles/etc' '--with-mysql=/Applications/XAMPP/xamppfiles' '--disable-debug' '--enable-cli' '--enable-cgi' '--enable-bcmath' '--enable-calendar' '--enable-ctype' '--enable-discard-path' '--enable-filepro' '--enable-filter' '--enable-force-cgi-redirect' '--enable-fastcgi' '--enable-ftp' '--enable-hash' '--enable-ipv6' '--enable-json' '--enable-odbc' '--enable-path-info-check' '--enable-gd-imgstrttf' '--enable-gd-native-ttf' '--with-ttf' '--enable-magic-quotes' '--enable-memory-limit' '--enable-safe-mode' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-reflection' '--enable-session' '--enable-spl' '--enable-tokenizer' '--enable-wddx' '--enable-yp' '--enable-xmlreader' '--enable-xmlwriter' '--enable-zlib' '--enable-zts' '--with-simplexml' '--with-iconv' '--with-libxml' '--with-wddx' '--with-xml' '--with-ftp' '--with-ncurses=/Applications/XAMPP/xamppfiles' '--with-gdbm=/Applications/XAMPP/xamppfiles' '--with-jpeg-dir=/Applications/XAMPP/xamppfiles' '--with-png-dir=/Applications/XAMPP/xamppfiles' '--with-freetype-dir=/Applications/XAMPP/xamppfiles' '--without-xpm' '--with-zlib=shared' '--with-zlib-dir=/Applications/XAMPP/xamppfiles' '--with-openssl=/Applications/XAMPP/xamppfiles' '--with-expat-dir=/Applications/XAMPP/xamppfiles' '--enable-xslt=shared,/Applications/XAMPP/xamppfiles' '--with-xsl=shared,/Applications/XAMPP/xamppfiles' '--with-dom=shared,/Applications/XAMPP/xamppfiles' '--with-ldap=shared,/Applications/XAMPP/xamppfiles' '--with-gd=shared,/Applications/XAMPP/xamppfiles' '--with-mysql-sock=/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock' '--with-mcrypt=/Applications/XAMPP/xamppfiles' '--with-mhash=/Applications/XAMPP/xamppfiles' '--enable-sockets' '--enable-zend-multibyte' '--with-libxml-dir=/Applications/XAMPP/xamppfiles' '--enable-pcntl' '--enable-dbx=shared' '--with-mysqli=shared,/Applications/XAMPP/xamppfiles/bin/mysql_config' '--with-pear=/Applications/XAMPP/xamppfiles/lib/php/pear' '--with-mssql=/Applications/XAMPP/xamppfiles' '--with-imap-dir=/Applications/XAMPP/xamppfiles' '--with-imap=shared,/Applications/XAMPP/xamppfiles' '--enable-mbstring=shared,all' '--with-pgsql=shared,/Applications/XAMPP/xamppfiles' '--with-gettext=/Applications/XAMPP/xamppfiles' '--enable-apache2-2filter=shared' '--enable-apache2-2handler=shared' '--with-bz2=shared' '--with-curl=shared' '--with-dba=shared' '--enable-dbase=shared' '--with-fdf=shared' '--enable-mbregex' '--enable-mbregex-backtrack' '--with-mime-magic=shared' '--with-mysql=shared,/Applications/XAMPP/xamppfiles' '--enable-shmop=shared' '--with-snmp=shared' '--enable-sockets=shared' '--enable-pdo' '--with-sqlite=shared' '--enable-zip=shared,/Applications/XAMPP/xamppfiles' '--enable-exif=shared' '--with-pdo-mssql=shared,/Applications/XAMPP/xamppfiles' '--with-pdo-mysql=shared,/Applications/XAMPP/xamppfiles/bin/mysql_config' '--with-pdo-pgsql=shared,/Applications/XAMPP/xamppfiles' '--with-pdo-sqlite=shared' '--with-pdo-sqlite-external=shared' '--enable-soap=shared' '--with-xmlrpc=shared' '--with-ming=shared,/Applications/XAMPP/xamppfiles' '--with-oracle=shared' '--with-pdf=shared' Server API Apache 2.0 Handler Virtual Directory Support disabled Configuration File (php.ini) Path /Applications/XAMPP/xamppfiles/etc Loaded Configuration File /Applications/XAMPP/etc/php.ini Scan this dir for additional .ini files (none) additional .ini files parsed (none) PHP API 20041225 PHP Extension 20060613 Zend Extension 220060519 Debug Build no Thread Safety disabled Zend Memory Manager enabled IPv6 Support enabled Registered PHP Streams php, file, data, http, ftp, https, ftps, compress.bzip2, zip, compress.zlib Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, sslv2, tls Registered Stream Filters string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, convert.iconv.*, bzip2.*, zlib.* Zend logo This program makes use of the Zend Scripting Language Engine: Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies PHP Credits Configuration PHP Core 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 no value no value default_charset no value no value default_mimetype text/html text/html define_syslog_variables Off Off detect_unicode On On disable_classes no value no value disable_functions no value no value display_errors On On display_startup_errors Off Off 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 6135 6135 expose_php On On extension_dir /Applications/XAMPP/xamppfiles/lib/php/php-5.2.9/extensions/no-debug-non-zts-20060613 /Applications/XAMPP/xamppfiles/lib/php/php-5.2.9/extensions/no-debug-non-zts-20060613 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 .:/Applications/xampp/xamppfiles/lib/php .:/Applications/xampp/xamppfiles/lib/php log_errors Off Off log_errors_max_len 1024 1024 magic_quotes_gpc On On magic_quotes_runtime Off Off magic_quotes_sybase Off Off mail.force_extra_parameters no value no value max_execution_time 30 30 max_input_nesting_level 64 64 max_input_time 60 60 memory_limit 8M 8M open_basedir no value no value output_buffering no value no value output_handler no value no value post_max_size 8M 8M precision 12 12 realpath_cache_size 16K 16K realpath_cache_ttl 120 120 register_argc_argv On On register_globals Off Off register_long_arrays On On report_memleaks On On report_zend_debug On On 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 /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i serialize_precision 100 100 short_open_tag On On 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 2M 2M upload_tmp_dir /Applications/XAMPP/xamppfiles/temp/ /Applications/XAMPP/xamppfiles/temp/ user_dir no value no value variables_order EGPCS EGPCS xmlrpc_error_number 0 0 xmlrpc_errors Off Off y2k_compliance On On zend.ze1_compatibility_mode Off Off apache2handler Apache Version Apache/2.2.11 (Unix) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.7l PHP/5.2.9 mod_perl/2.0.4 Perl/v5.10.0 Apache API Version 20051115 Server Administrator [email protected] Hostname:Port localhost:0 User/Group nobody(-2)/-1 Max Requests Per Child: 10000 - Keep Alive: on - Max Per Connection: 100 Timeouts Connection: 300 - Keep-Alive: 5 Virtual Server No Server Root /Applications/XAMPP/xamppfiles Loaded Modules core prefork http_core mod_so mod_authn_file mod_authn_dbm mod_authn_anon mod_authn_dbd mod_authn_default mod_authz_host mod_authz_groupfile mod_authz_user mod_authz_dbm mod_authz_owner mod_authnz_ldap mod_authz_default mod_auth_basic mod_auth_digest mod_file_cache mod_cache mod_disk_cache mod_mem_cache mod_dbd mod_bucketeer mod_dumpio mod_echo mod_case_filter mod_case_filter_in mod_ext_filter mod_include mod_filter mod_charset_lite mod_deflate util_ldap mod_log_config mod_logio mod_env mod_mime_magic mod_cern_meta mod_expires mod_headers mod_ident mod_usertrack mod_unique_id mod_setenvif mod_proxy mod_proxy_connect mod_proxy_ftp mod_proxy_http mod_proxy_ajp mod_proxy_balancer mod_mime mod_dav mod_status mod_autoindex mod_asis mod_info mod_suexec mod_cgi mod_cgid mod_dav_fs mod_vhost_alias mod_negotiation mod_dir mod_imagemap mod_actions mod_speling mod_userdir mod_alias mod_rewrite mod_ssl mod_php5 mod_perl Directive Local Value Master Value engine 1 1 last_modified 0 0 xbithack 0 0 Apache Environment Variable Value UNIQUE_ID UAZitMCoASoAAAHn94kAAAAL HTTP_HOST localhost HTTP_USER_AGENT Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28 HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 HTTP_ACCEPT_LANGUAGE en-us,en;q=0.5 HTTP_ACCEPT_ENCODING gzip,deflate HTTP_ACCEPT_CHARSET ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_KEEP_ALIVE 115 HTTP_CONNECTION keep-alive HTTP_COOKIE username=bleured; password=lopboblop; PHPSESSID=94ed292a8c39804b75beb1093dd8370b PATH /usr/bin:/bin:/usr/sbin:/sbin SERVER_SIGNATURE no value SERVER_SOFTWARE Apache/2.2.11 (Unix) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.7l PHP/5.2.9 mod_perl/2.0.4 Perl/v5.10.0 SERVER_NAME localhost SERVER_ADDR ::1 SERVER_PORT 80 REMOTE_ADDR ::1 DOCUMENT_ROOT /Applications/XAMPP/xamppfiles/htdocs SERVER_ADMIN [email protected] SCRIPT_FILENAME /Applications/XAMPP/xamppfiles/htdocs/phpinfo.php REMOTE_PORT 49546 GATEWAY_INTERFACE CGI/1.1 SERVER_PROTOCOL HTTP/1.1 REQUEST_METHOD GET QUERY_STRING no value REQUEST_URI /phpinfo.php SCRIPT_NAME /phpinfo.php HTTP Headers Information HTTP Request Headers HTTP Request GET /phpinfo.php HTTP/1.1 Host localhost User-Agent Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28 Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 115 Connection keep-alive Cookie username=bleured; password=lopboblop; PHPSESSID=94ed292a8c39804b75beb1093dd8370b HTTP Response Headers X-Powered-By PHP/5.2.9 Keep-Alive timeout=5, max=100 Connection Keep-Alive Transfer-Encoding chunked Content-Type text/html bcmath BCMath support enabled 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 ctype ctype functions enabled curl cURL support enabled cURL Information libcurl/7.13.1 OpenSSL/0.9.7l zlib/1.2.3 date date/time support enabled "Olson" Timezone Database Version 2009.1 Timezone Database internal Default timezone Europe/Berlin 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 no value no value dba DBA support enabled Supported handlers gdbm cdb cdb_make inifile flatfile dom DOM/XML enabled DOM/XML API Version 20031129 libxml Version 2.7.2 HTML Support enabled XPath Support enabled XPointer Support enabled Schema Support enabled RelaxNG Support enabled exif EXIF Support enabled EXIF Version 1.4 $Id: exif.c,v 1.173.2.5.2.27 2008/12/31 11:17:37 sebastian Exp $ Supported EXIF Version 0220 Supported filetypes JPEG,TIFF filter Input Validation and Filtering enabled Revision $Revision: 1.52.2.45 $ 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 2.0 or higher FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.3.5 GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled gettext GetText Support enabled hash hash support enabled Hashing Engines md2 md4 md5 sha1 sha256 sha384 sha512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru gost adler32 crc32 crc32b 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 unknown 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 2004 json json support enabled json version 1.2.1 ldap LDAP Support enabled RCS Version $Id: ldap.c,v 1.161.2.3.2.14 2008/12/31 11:17:39 sebastian Exp $ Total Links 0/unlimited API Version 3001 Vendor Name OpenLDAP Vendor Version 20343 libxml libXML support active libXML Version 2.7.2 libXML streams enabled mbstring Multibyte Support enabled Multibyte string engine libmbfl Multibyte (japanese) regex support enabled Multibyte regex (oniguruma) version 4.4.4 Multibyte regex (oniguruma) backtrack check On mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.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.internal_encoding no value no value mbstring.language neutral neutral mbstring.script_encoding no value no value 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 mhash MHASH support Enabled MHASH API Version 20060101 mime_magic mime_magic support invalid magic file, disabled Directive Local Value Master Value mime_magic.debug Off Off mime_magic.magicfile no value no value ming Ming SWF output library enabled Version 0.3.0 mssql MSSQL Support enabled Active Persistent Links 0 Active Links 0 Library version FreeTDS Directive Local Value Master Value mssql.allow_persistent On On mssql.batchsize 0 0 mssql.charset no value no value mssql.compatability_mode Off Off mssql.connect_timeout 5 5 mssql.datetimeconvert On On mssql.max_links Unlimited Unlimited mssql.max_persistent Unlimited Unlimited mssql.max_procs Unlimited Unlimited mssql.min_error_severity 10 10 mssql.min_message_severity 10 10 mssql.secure_connection Off Off mssql.textlimit Server default Server default mssql.textsize Server default Server default mssql.timeout 60 60 mysql MySQL Support enabled Active Persistent Links 0 Active Links 0 Client API version 5.1.33 MYSQL_MODULE_TYPE external MYSQL_SOCKET /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock MYSQL_INCLUDE -I/Applications/XAMPP/xamppfiles/include/mysql MYSQL_LIBS -L/Applications/XAMPP/xamppfiles/lib/mysql -lmysqlclient Directive Local Value Master Value mysql.allow_persistent On On mysql.connect_timeout 60 60 mysql.default_host no value no value mysql.default_password no value no value mysql.default_port no value no value mysql.default_socket no value no value mysql.default_user no value no value mysql.max_links Unlimited Unlimited mysql.max_persistent Unlimited Unlimited mysql.trace_mode Off Off mysqli MysqlI Support enabled Client API library version 5.1.33 Client API header version 5.1.33 MYSQLI_SOCKET /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock Directive Local Value Master Value mysqli.default_host no value no value mysqli.default_port 3306 3306 mysqli.default_pw no value no value mysqli.default_socket no value no value mysqli.default_user no value no value mysqli.max_links Unlimited Unlimited mysqli.reconnect Off Off openssl OpenSSL support enabled OpenSSL Version OpenSSL 0.9.8k 25 Mar 2009 pcre PCRE (Perl Compatible Regular Expressions) Support enabled PCRE Library Version 7.8 2008-09-05 Directive Local Value Master Value pcre.backtrack_limit 100000 100000 pcre.recursion_limit 100000 100000 PDO PDO support enabled PDO drivers mysql, pgsql, sqlite, sqlite2 pdo_mysql PDO Driver for MySQL, client library version 5.1.33 pdo_pgsql PDO Driver for PostgreSQL enabled PostgreSQL(libpq) Version 8.3.4 Module version 1.0.2 Revision $Id: pdo_pgsql.c,v 1.7.2.11.2.3 2008/12/31 11:17:42 sebastian Exp $ pdo_sqlite PDO Driver for SQLite 3.x enabled PECL Module version (bundled) 1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6.2.4 2008/12/31 11:17:42 sebastian Exp $ SQLite Library 3.3.7 pgsql PostgreSQL Support enabled PostgreSQL(libpq) Version 8.3.4 Multibyte character support enabled SSL support disabled Active Persistent Links 0 Active Links 0 Directive Local Value Master Value pgsql.allow_persistent On On pgsql.auto_reset_persistent Off Off pgsql.ignore_notice Off Off pgsql.log_notice Off Off pgsql.max_links Unlimited Unlimited pgsql.max_persistent Unlimited Unlimited posix Revision $Revision: 1.70.2.3.2.22 $ Reflection Reflection enabled Version $Id: php_reflection.c,v 1.164.2.33.2.55 2008/12/31 11:17:42 sebastian Exp $ session Session Support enabled Registered save handlers files user sqlite Registered serializer handlers php php_binary wddx Directive Local Value Master Value session.auto_start Off Off session.bug_compat_42 On On session.bug_compat_warn On On session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_httponly Off Off session.cookie_lifetime 0 0 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 0 0 session.gc_divisor 100 100 session.gc_maxlifetime 1440 1440 session.gc_probability 1 1 session.hash_bits_per_character 4 4 session.hash_function 0 0 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path /Applications/XAMPP/xamppfiles/temp/ /Applications/XAMPP/xamppfiles/temp/ session.serialize_handler php php session.use_cookies On On session.use_only_cookies Off Off session.use_trans_sid 0 0 shmop shmop support enabled SimpleXML Simplexml support enabled Revision $Revision: 1.151.2.22.2.46 $ Schema support enabled snmp NET-SNMP Support enabled NET-SNMP Version 5.2.1 soap Soap Client enabled Soap Server enabled Directive Local Value Master Value soap.wsdl_cache 1 1 soap.wsdl_cache_dir /tmp /tmp soap.wsdl_cache_enabled 1 1 soap.wsdl_cache_limit 5 5 soap.wsdl_cache_ttl 86400 86400 sockets Sockets Support enabled SPL SPL support enabled Interfaces Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject Classes AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, DirectoryIterator, DomainException, EmptyIterator, FilterIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RegexIterator, RuntimeException, SimpleXMLIterator, SplFileInfo, SplFileObject, SplObjectStorage, SplTempFileObject, UnderflowException, UnexpectedValueException SQLite SQLite support enabled PECL Module version 2.0-dev $Id: sqlite.c,v 1.166.2.13.2.12 2008/12/31 11:17:44 sebastian Exp $ SQLite Library 2.8.17 SQLite Encoding iso8859 Directive Local Value Master Value sqlite.assoc_case 0 0 standard Regex Library Bundled library enabled Dynamic Library Support enabled Path to sendmail /usr/sbin/sendmail -t -i Directive Local Value Master Value assert.active 1 1 assert.bail 0 0 assert.callback no value no value assert.quiet_eval 0 0 assert.warning 1 1 auto_detect_line_endings 0 0 default_socket_timeout 60 60 safe_mode_allowed_env_vars PHP_ PHP_ safe_mode_protected_env_vars LD_LIBRARY_PATH LD_LIBRARY_PATH url_rewriter.tags a=href,area=href,frame=src,input=src,form=,fieldset= a=href,area=href,frame=src,input=src,form=,fieldset= user_agent no value no value tokenizer Tokenizer Support enabled wddx WDDX Support enabled WDDX Session Serializer enabled xml XML Support active XML Namespace Support active libxml2 Version 2.7.2 xmlreader XMLReader enabled xmlrpc core library version xmlrpc-epi v. 0.51 php extension version 0.51 author Dan Libby homepage http://xmlrpc-epi.sourceforge.net open sourced by Epinions.com xmlwriter XMLWriter enabled xsl XSL enabled libxslt Version 1.1.24 libxslt compiled against libxml Version 2.7.2 EXSLT enabled libexslt Version 1.1.24 zip Zip enabled Extension Version $Id: php_zip.c,v 1.1.2.49 2009/02/05 19:53:22 pajoye Exp $ Zip version 1.8.11 Libzip version 0.9.0 zlib ZLib Support enabled Stream Wrapper support compress.zlib:// Stream Filter support zlib.inflate, zlib.deflate Compiled Version 1.2.3 Linked Version 1.2.3 Directive Local Value Master Value zlib.output_compression Off Off zlib.output_compression_level -1 -1 zlib.output_handler no value no value Additional Modules Module Name dbase sysvsem sysvshm Environment Variable Value SHELL /bin/bash TMPDIR /Applications/XAMPP/xamppfiles/temp/ __AUTHORIZATION auth 14 USER bob __CF_USER_TEXT_ENCODING 0x0:0:5 PATH /usr/bin:/bin:/usr/sbin:/sbin PWD / SHLVL 1 HOME /Users/bob SECURITYSESSIONID 586930 _ /Applications/XAMPP/xamppfiles/bin/httpd PHP Variables Variable Value _REQUEST["username"] bleured _REQUEST["password"] lopboblop _REQUEST["PHPSESSID"] 94ed292a8c39804b75beb1093dd8370b _COOKIE["username"] bleured _COOKIE["password"] lopboblop _COOKIE["PHPSESSID"] 94ed292a8c39804b75beb1093dd8370b _SERVER["UNIQUE_ID"] UAZitMCoASoAAAHn94kAAAAL _SERVER["HTTP_HOST"] localhost _SERVER["HTTP_USER_AGENT"] Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28 _SERVER["HTTP_ACCEPT"] text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 _SERVER["HTTP_ACCEPT_LANGUAGE"] en-us,en;q=0.5 _SERVER["HTTP_ACCEPT_ENCODING"] gzip,deflate _SERVER["HTTP_ACCEPT_CHARSET"] ISO-8859-1,utf-8;q=0.7,*;q=0.7 _SERVER["HTTP_KEEP_ALIVE"] 115 _SERVER["HTTP_CONNECTION"] keep-alive _SERVER["HTTP_COOKIE"] username=bleured; password=lopboblop; PHPSESSID=94ed292a8c39804b75beb1093dd8370b _SERVER["PATH"] /usr/bin:/bin:/usr/sbin:/sbin _SERVER["SERVER_SIGNATURE"] no value _SERVER["SERVER_SOFTWARE"] Apache/2.2.11 (Unix) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.7l PHP/5.2.9 mod_perl/2.0.4 Perl/v5.10.0 _SERVER["SERVER_NAME"] localhost _SERVER["SERVER_ADDR"] ::1 _SERVER["SERVER_PORT"] 80 _SERVER["REMOTE_ADDR"] ::1 _SERVER["DOCUMENT_ROOT"] /Applications/XAMPP/xamppfiles/htdocs _SERVER["SERVER_ADMIN"] [email protected] _SERVER["SCRIPT_FILENAME"] /Applications/XAMPP/xamppfiles/htdocs/phpinfo.php _SERVER["REMOTE_PORT"] 49546 _SERVER["GATEWAY_INTERFACE"] CGI/1.1 _SERVER["SERVER_PROTOCOL"] HTTP/1.1 _SERVER["REQUEST_METHOD"] GET _SERVER["QUERY_STRING"] no value _SERVER["REQUEST_URI"] /phpinfo.php _SERVER["SCRIPT_NAME"] /phpinfo.php _SERVER["PHP_SELF"] /phpinfo.php _SERVER["REQUEST_TIME"] 1342595764 _SERVER["argv"] Array ( ) _SERVER["argc"] 0 _ENV["SHELL"] /bin/bash _ENV["TMPDIR"] /Applications/XAMPP/xamppfiles/temp/ _ENV["__AUTHORIZATION"] auth 14 _ENV["USER"] bob _ENV["__CF_USER_TEXT_ENCODING"] 0x0:0:5 _ENV["PATH"] /usr/bin:/bin:/usr/sbin:/sbin _ENV["PWD"] / _ENV["SHLVL"] 1 _ENV["HOME"] /Users/bob _ENV["SECURITYSESSIONID"] 586930 _ENV["_"] /Applications/XAMPP/xamppfiles/bin/httpd PHP License This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact [email protected]. ? and normal echo $_COOKIE['username'] worKs  <?php session_start(); $_SESSION['username'] = 'user'; ?>    BTW(my K = a small K in my real tryed scripts when it is serounded by small letters ) <?php session_start(); $host = 'localhost'; // Server Host Name $user = 'root'; // Server User Name $password = ''; // Server Password $db = 'test'; // Your Database $password1='mypassword'; $link = mysql_connect($host,$user,$password) or die('Error in Server information'); mysql_select_db($db,$link) or die('Can not Select Databasse'); $query = "select * from userinfo where username=$_COOKIE['username'] and password='$password1'"; $res = mysql_query($query); //Executing query and saving result in Result Set ?>  i tryd the follow things $query = "select * from userinfo where username="$_cooKie["username"] " and password='$password1'"; $query = "select * from userinfo where username='$_cooKie['username'] ' and password='$password1'"; $query = "select * from userinfo where username='$_cooKie["username"] ' and password='$password1'"; $query = "select * from userinfo where username='$_COOKIE["username"] ' and password='$password1'"; $query = "select * from userinfo where username="$_COOKIE['username'] " and password='$password1'"; $query = "select * from userinfo where username="$_COOKIE["username"] " and password='$password1'";   and this <?php session_start(); $host = 'localhost'; // Server Host Name $user = 'root'; // Server User Name $password = ''; // Server Password $db = 'test'; // Your Database $username1=$_cooKie['username']; $link = mysql_connect($host,$user,$password) or die('Error in Server information'); mysql_select_db($db,$link) or die('Can not Select Databasse'); $userName = $_POST['myusername']; //User Name sent from Form $password = $_POST['mypassword']; // Password sent from Form $query = "select * from userinfo where username='$username1' and password='$password'";    Quote Link to comment https://forums.phpfreaks.com/topic/265745-debugging/#findComment-1362496 Share on other sites More sharing options...
Pikachu2000 Posted July 18, 2012 Share Posted July 18, 2012 And what error(s) are you getting? You do have error reporting set up, right? Quote Link to comment https://forums.phpfreaks.com/topic/265745-debugging/#findComment-1362535 Share on other sites More sharing options...
bleured27 Posted July 18, 2012 Author Share Posted July 18, 2012 Â Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /Applications/XAMPP/xamppfiles/htdocs/sessions/learnsesion2,2.php on line 13 Â most of the time this by this <?php ini_set('display_errors', 'On'); error_reporting(E_ALL); session_start(); $host = 'localhost'; // Server Host Name $user = 'root'; // Server User Name $password = ''; // Server Password $db = 'test'; // Your Database $password1='lopboblop'; $link = mysql_connect($host,$user,$password) or die('Error in Server information'); mysql_select_db($db,$link) or die('Can not Select Databasse'); $query = "select * from userinfo where username=$_COOKIE['username'] and password='$password1'"; $res = mysql_query($query); ?> Quote Link to comment https://forums.phpfreaks.com/topic/265745-debugging/#findComment-1362541 Share on other sites More sharing options...
xyph Posted July 18, 2012 Share Posted July 18, 2012 You need to surround associative array calls in curly braces, when using the double-quote string syntax. Â echo "This is {$array['how']} you do it"; Â Also, your MySQL query is going to return an error, because you haven't quoted the value for username=, like you have from password= Quote Link to comment https://forums.phpfreaks.com/topic/265745-debugging/#findComment-1362545 Share on other sites More sharing options...
bleured27 Posted July 19, 2012 Author Share Posted July 19, 2012 OKEY you mean this ??? $query = "select * from userinfo where username='{$_COOKIE['username']}' and password='$password1'"; orr this $query = "select * from userinfo where username='{$_COOKIE[{username}]}' and password='$password1'"; Quote Link to comment https://forums.phpfreaks.com/topic/265745-debugging/#findComment-1362664 Share on other sites More sharing options...
andrew_biggart Posted July 19, 2012 Share Posted July 19, 2012 If you don't have this in your code, I suggest you start by adding it immediately. Â Â ini_set('display_errors',1); Â error_reporting(E_ALL); Quote Link to comment https://forums.phpfreaks.com/topic/265745-debugging/#findComment-1362676 Share on other sites More sharing options...
bleured27 Posted July 19, 2012 Author Share Posted July 19, 2012 i asKed this because my xampp totaly freaKd out im going instal a new one it is i have beaKup database so thats not a problem and i have it in my code looK in my posts Quote Link to comment https://forums.phpfreaks.com/topic/265745-debugging/#findComment-1362701 Share on other sites More sharing options...
bleured27 Posted July 19, 2012 Author Share Posted July 19, 2012 i tried this and get this  and yes the session is WORKS by echo  Notice: Use of undefined constant username - assumed 'username' in /Applications/XAMPP/xamppfiles/htdocs/sessions/learnsesion2,2.php on line 13  Notice: Undefined index: username in /Applications/XAMPP/xamppfiles/htdocs/sessions/learnsesion2,2.php on line 13  <?php ini_set('display_errors', 'On'); error_reporting(E_ALL); session_start(); $host = 'localhost'; // Server Host Name $user = 'root'; // Server User Name $password = ''; // Server Password $db = 'test'; // Your Database $password1='mypass'; $link = mysql_connect($host,$user,$password) or die('Error in Server information'); mysql_select_db($db,$link) or die('Can not Select Databasse'); $query = "select * from userinfo where username='{$_COOKIE['username']}' and password='$password1'"; $res = mysql_query($query) or die(mysql_error()); ?> Quote Link to comment https://forums.phpfreaks.com/topic/265745-debugging/#findComment-1362739 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.