sKunKbad
Members-
Posts
1,832 -
Joined
-
Last visited
-
Days Won
3
Everything posted by sKunKbad
-
Do you mean you are trying to strip the links out of an existing HTML document?
-
Problem modifying headers + other strange problems
sKunKbad replied to Koopa's topic in PHP Coding Help
Without seeing your page that has the DOCTYPE in it, it would be hard to say what is causing the error. If your localhost server doesn't have an email MTA installed, you might be getting your error because the server doesn't know what to do. I get a different error on my localhost when I try to send mail, but an error is an error. -
I cant read it, but one of the links in the home page seems to go to a completely unstyled page.
-
I'm using FF3.5 on a Mac, and the lower area doesn't line up with the top area. It is shifted to the left by about 2 cm.
-
I've been a "super moderator" of a vBulletin form before, and I hate it. I think this forum is fine the way it is.
-
Need quick help with Warning: mysql_num_rows() error
sKunKbad replied to botlife's topic in PHP Coding Help
You have a bad query. Try running it directly on MySQL or phpMyAdmin and see that it is bad. -
Without even trying to understand the dynamics of how sessions work in php, all you have to know is that there is an array which you can store data, and that array is $_SESSION. This array is available to you anytime session_start() is placed before any output to the browser. If you don't know how to work with arrays, your chances of using sessions are limited at best.
-
So you have a bad query. I really can't help you with your complex query, but when you figure out what is wrong, you will have your problem solved. Maybe head over to the MySQL forum and ask...
-
I was suggesting putting that in your code, right before your foreach statement. If your query is even returning anything at all, you would be able to see it.
-
what does var_dump($jobs); output ? var_dump($jobs);
-
You won't be able to do this with any of the built in template tags. You will need to either find an existing plugin, or create a plugin for this. One thing that would be easy would be to look for the plugin that allows you to write php in a sidebar widget, and then connect to your database and retreive specific posts as you prefer. You say Wordpress is "Amazingly simple", but it really isn't when you need something that it doesn't do, and that there is no plugin for.
-
You start the session on any page that requires storing or retrieving data from the session: <?php session_start(); You can then use the $_SESSION array for whatever you need. <?php //store data $_SESSION['my_key'] = 'my_value'; //retrieve data $data = $_SESSION['my_key'] ; //delete unset($_SESSION['my_key']); This $_SESSION array is saved on the server, and the cookie that is put in the user's browser identifies them to use the session that belongs to them. If the user doesn't have cookies enabled, then there is sometimes a fallback to the session ID being placed in the URL, but this isn't the best thing to do.
-
form validation with select option data + input data
sKunKbad replied to wandor's topic in PHP Coding Help
I think you are making this too complicated. You could have the form post to the same page, and process on top. if($_POST) { // do validation and output error or thank you message } if(!$_POST OR $error) { // show form echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; // form elements go here echo '</form>'; } -
OK.... I just don't know. It's hard to diagnose because there are quite a few things that look wrong. I think you should run your query directly inside MySQL or phpMyAdmin, and see if you are getting what you expect. Also, until you validate the output of your exam, your form itself could be messing up what you think is perfect. Maybe somebody else will chime in.
-
Yes, this is probably where your problem comes from. I just want to add, that this exam system would be fundamentally flawed, because if the user simply views the source code, they would have all of the correct answers. If it matters, it should be changed. When I have created an exam in the past, the questions, answers, and scores were held in an XML file, and then parsed with SimpleXML for question and answers retrieval, and also for scoring. This makes changing the questions, answers, and scoring easy too. An instructor can just create a new XML file, and the new test is ready to go.
-
If you look at the result of your database query, you must have skipped 1 and 9, and there is now a 21 and 22. Also, your opening form tag needs to be above your while loop, and the closing form tag needs to be before your closing table tag.
-
In correct_exam.php, you are checking for the value of $_POST[1], but there is no key [1] or [9] in your var_dump: array(23) { ["timer"] => string(0) "" [19] => string(1) "a" [13] => string(1) "a" [5] => string(1) "a" [4] => string(1) "a" [10] => string(1) "a" [14] => string(1) "a" [21] => string(1) "a" [12] => string(1) "a" [22] => string(1) "a" [20] => string(1) "a" [18] => string(1) "a" [7] => string(1) "a" [16] => string(1) "a" [8] => string(1) "a" [11] => string(1) "a" [2] => string(1) "a" [15] => string(1) "a" [6] => string(1) "a" [17] => string(1) "a" [3] => string(1) "a" ["now"] => string(0) "" ["viewexam"]=> string(3) "yes" } Your score was 90 You also have a key [21] and [22]. Did you notice?
-
what does var_dump($_POST) output?
-
You could define something in the script that includes or initializes the script you want to protect, and then check for it at the top of that script. core.php <?php define('CORE_LOADED',1); include "protected.php"; ?> protected.php <?php if(!defined('CORE_LOADED')) exit('No direct script access allowed'); ?>
-
Is there a $_POST[0] ??
-
So, what's your question? If you want to have good validation, why not try formmail from tectite.com
-
what happens when you var_dump the post array at the top of the code?
-
I have a 1024 x 600 screen res, and get a horizontal scroll bar with this design, when it really shouldn't require one. I also see nothing but the banner and menu when loading the page. To me, the banner is a bit too large in height.
-
If you use a good text editor, you can set it to search through all of the files in your site, and find the link. Wherever it is, you should be able to find it. If you were hacked, it could be in an include, or even in an .htaccess file.