Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. Still same problems as before. I get a corrupted file Uploaded file: http://www.ukfilehost.com/v/4371943/php.ico.html The correct size for the file is around 29KB, your site confirms this on the download page. When I download the file I only get 350Bytes
  2. The standard mail function doesn't support authorisation protocols for sending email from a protected email server. GMail uses SSL which mail() doesn't support. If your email address/ip address is blacklisted then there's not much you can do.
  3. is php_iolV2.dll in the extension folder C:\AppServ\php5\ext does that extension require extra libraries? Have you restarted Apache when you made changes to the php.ini and/or the httpd.conf? I did a search on php.net and couldn't find any info on that extension. So I cant help you much as I don't know what that extension is.
  4. you wont as the included file will be included into a.php any file paths that is in b.php will be relative from a.php and not b.php. This how includes work. What you might want to do is set up a constant and call it ROOT that has an absolute path to your websites root, example path: /usr/mysite_com/public_html/ Then when you go to use include you do something like this: include ROOT . 'path/to/script/from/root/folder'; That will make your include use absolute paths rather than relative. Or another option is to add the extended folder to the include_path if you have access to the php.ini, or you can use .htaccess / ini_set to modify the php configuration.
  5. Doesn't it add a setting to the ACP? As just looking briefly at the code it is querying the database for permissions and I see code that sets up settings to allow who can see your blank pages. The code should have permissions built into.
  6. With the provided scripts i got strange character outputs This was because the data in the attendanceinfo.txt file was sort of corrupt, most probably due to the encoding or something. This is what was causing the csv file to have all wierd data underscores after ever character etc. However looking at the text file closely I managed to identify each line in the text file. For some reason on line returns it had aload of square block ype symbols . I had to go in and manually and edit each line - very tedious work! Find and Replace didn't work. After formatting the text files so there is no corruption. I tested again. This time it displayed correctly and the data written to the csv file was readable. Example corruption when opening the txt file after download (lines 1-7): Ref: ATT.515D LIVINGSTON SCHOOL DISTRICT Page 1 ਍䐀愀琀攀㨀  ㈀⼀㈀㄀⼀ 㜀                  㔀     䰀䤀嘀䤀一䜀匀吀伀一 䠀䤀䜀䠀 匀䌀䠀伀伀䰀ഀഀ Time: 9:40:52 Student Absences from 2/13/07 to 2/13/07 Absence Types: (Au) (Ae) (T ) ਍ⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀⴀഀഀ Homeroom Homeroom Daily ਍匀琀甀搀攀渀琀 ⌀ 匀琀甀搀攀渀琀 一愀洀攀                   䌀氀  吀攀愀挀栀攀爀         一甀洀戀攀爀    ㄀  ㈀  ㌀  㐀  㔀  㘀  㜀  㠀  㤀                    刀攀愀猀漀渀  䐀愀琀攀ഀഀ ------------------------------------------------------------------------------------------------------------------------------------ (the ? marks is the [] type characters I see - the browser renders these characters differently) When reformatted to correct format, example lines 1-7: Ref: ATT.515D LIVINGSTON SCHOOL DISTRICT Page 1 Time: 9:40:52 Student Absences from 2/13/07 to 2/13/07 Absence Types: (Au) (Ae) (T ) Homeroom Homeroom Daily ------------------------------------------------------------------------------------------------------------------------------------ I have attached the reformatted txt file. Your code should work now. [attachment deleted by admin]
  7. MySQL supports the DECIMAL data type. DECIMAL is basically an alias of DOUBLE They both hold a decimal of 24 to 53 digits FLOAT also holds a decimal but only 23 digits.
  8. Upload went fine. However still having problems with downloads. I Upload the screenshot that I attached in my last post when to download and only got 350bytes reported size on your site is 52.52 KBytes I can download fine at other places, such as imageshack.
  9. I tested your file upload. I upload an icon file (php.ico). Nothing special just an icon i use for my php files. Upload went fine. I noticed an area called description. I did not get an option to add a description. Is this a feature for registered users only? If its for registered user then perhaps display message saying "this is only available to registered users only" in red/bold text. Rather than just description. Went to download the file, reported size off the file is supposed to be 29.22KB however when I download it I only get 350bytes Then I tried a simple text file. About 2KB in size. Just had a few sentances in. Filled out the upload form. Submited. Uploaded and I get unexpected results (see attached screenshot). I tried twice and got the same result. The generated url for the file to be downloaded is this: http://www.ukfilehost.com/v/7624802/.html Are text files disallowed? If they are wouldn't it be better to display a warning message saying what file extensions are not allowed. [attachment deleted by admin]
  10. You have output on line 4 in header.php which is causing this error. Not line 174 from dcc_process.php Suppressing errors doesn't mean the code will then work. As all you will get is a white screen
  11. Its not just error_reporting you want to set. You also want to turn display_errors on too in the php.ini if you don't turn on display_errors then no errors are going to displayed regardless of what error_reporting is set to.
  12. serialize is good for storing an array in a single database table/cookie or any other form of storage. Sessions get their data serialize. If you want to use the serialized data then you can use unserialize, to un-serialize the data. Example (Using a Cookie): <?php if(!isset($_COOKIE['test'])) { // some dummy data will do $data = array('username' => 'foobar', 'age' => 50); // serialize the data to be stored in the cookie // The serialized string: // a:2:{s:8:"username";s:6:"foobar";s:3:"age";i:50;} $cookie_data = serialize($data); // set the cookie setcookie('test', $cookie_data, time()+3600); echo '<a href="?p=2">Get the cookie!</a>'; } else { echo 'Get the cookie:<br /><br /> Cookie recieved (<i>serialized string</i>):<br />' . $_COOKIE['test'] . '<br /><br />'; echo 'Unserialize cookie:<br /><br />'; $test_cookie = unserialize($_COOKIE['test']); echo 'Cookie unserilized<br /><br />Contents of cookie: <pre>' . print_r($test_cookie, true) . '</pre>'; } ?> Output buffering is good for creating a cache. heres a good tutorial that creates a basic cache.
  13. You'll want to do lost / won and not won / lost ((2 / * 100);
  14. If you are creating a forum then you will want to look into database normalization. What I'd do is create two tables topics and posts Self explanatory the table names. topics stores topics and posts stores posts. The first post of the topic will be stored in the topics forum. Then any posts made in that topic will be stored in the posts table. You link the two tables together by storing the topics id in the posts table. Then when you go to display the posts for the specific topic you do a simple query like this: SELECT * FROM posts WHERE topic_id = $topic_id That is obviously very basic. Your query will come more advanced than that if you go into database normalization.
  15. The implode error may be caused because you are not passing it an array. implode only accepts an array nothing else. Also make sure you are not feeding it a multidimensional array. I don't think it can process multidimensional arrays. the other error is usually caused because you have an error in your SQL query. To see if your sql query has an error add or die(mysql_error()); to the end of mysql_query function that is near line 107 in catlistings.php
  16. Can't you wrap quotes around yes and no instead? That way PHP will tread yes and no as a string and not as a boolean.
  17. Add the following line to the top of script: date_default_timezone_set('Europe/London'); <?php date_default_timezone_set('Europe/London'); // get the current hour (24 hour clock) and increase by 1 $n_hour = date('H')+1; // Here we work out the hour, in 12 hour clock format // we also set the am / pm of the hour if($n_hour > 23) { $n_hour = date('g', mktime($n_hour)); $m = 'am'; } elseif($n_hour > 11) { $n_hour = date('g', mktime($n_hour)); $m = 'pm'; } else { $m = 'am'; } // get the current minutes $c_mins = date('i'); // take the current minutes from 60 (60 minutes in an hour) $l_mins = 60 - $c_mins; // Now we set up the message to be shown. $time_left = 'There are ' . $l_mins . 'minutes left until ' . $n_hour . $m; // echo the message we setup above echo $time_left; ?> I typed j instead i for the the date function when getting the current minutes. That is corrected now.
  18. Simple code: <?php // get the current hour (24 hour clock) and increase by 1 $n_hour = date('H')+1; // Here we work out the hour, in 12 hour clock format // we also set the am / pm of the hour if($n_hour > 23) { $n_hour = 12; $m = 'am'; } elseif($n_hour > 11) { $n_hour = date('g', mktime($n_hour)); $m = 'pm'; } else { $m = 'am'; } $c_mins = date('j'); $l_mins = 60 - $c_mins; $time_left = 'There are ' . $l_mins . 'minutes left until ' . $n_hour . $m; echo $time_left; ?>
  19. Yes that is should make your data secure that is being inserted into the database. mysql_real_ecape_string escapes most if not all characters that can harm your query.
  20. Why don't you give the radio buttons a value of YES and NO in the HTML rather than getting PHP to set the value in the php.ini Do you agree? Yes: <input type="radio" name="confirm" value="Yes" /> <input type="radio" name="confirm" value="No" /> That way when when you access the data submitted from the form which ever radio button the user submitted it will return the string 'Yes' or 'No' for $_POST['confirm'] rather than true or false. Remember radio buttons can only submit 1 value from the same group of radio buttons. You must name every radio button that belongs to a group the same name.
  21. I get 66.3507 as the result. When I run the above query on a test table I set up. What data types do you have set? fieldA and fieldB should be INT and fieldC should be FLOAT
  22. Are the database credentials you are using correct? Are the ones godaddy supplied when you got your hosting account? $dbServer = "h41mysql19.secureserver.net"; The line above should be the mysql servers hostname. If you don't know it localhost should do $dbuserName = "kaikohe2"; The line above is the username for connecting to the MySQL server $dbpassword = "**********"; The line above is the database for the username supplied above $dbName ="kaikohe2"; The line above is for your the database you wish to use.
  23. Your WHERE clause should be at the end of the query. "UPDATE users SET jailed='0', jyear='0', jday='0', jailreason='0', jailedby='0' WHERE id = '{$mem['id']}'"
  24. add an or die clause after mysql_query function like so: $unjail = mysql_query("UPDATE users WHERE id = '{$mem['id']}' SET jailed='0', jyear='0', jday='0', jailreason='0', jailedby='0'") or die('Error:<br />' . mysql_error());
  25. This should do it: <td align="left">' . $row['first_name'] . ' ' . $row['last_name'] . '</td> Umm, ken beat me.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.