-
Posts
1,469 -
Joined
-
Last visited
-
Days Won
12
Everything posted by CroNiX
-
$dbselect = mysqli_select_db($this->dbname); As the error indicates, you aren't using mysqli_select_db() correctly. See the manual for what it's missing. First parameter should be the resource, not the db name.
-
The main problem, as ginerjm pointed out, is your first div. It contains the form attributes (method and action) that belong in the <form> tag. There are no such attributes in HTML for DIVs. Beyond that, the purpose of this site is to help people with THEIR problematic code, not write code from scratch for others. If this is beyond what you can do the appropriate forum would probably be the Job Offerings forum and pay someone to do it for you.
-
<script type="text/javascript" src="clock.js"> That assumes "clock.js" is in the same directory as the actual script being executed, which is probably not the case. Use a full path to clock.js, or a URL, like src="/assets/js/clock.js" or "http://yoursite.com/assets/js/clock.js".
-
How are we supposed to know what you want to do with the data from the form? Put it in the database? Send an email? What are you wanting to do here?
-
You need session_start(); at the top of any page that will use session. When you log the user in, fill session with their appropriate details. You can then check $_SESSION['some_var'] on any other pages to check that they are logged in and do things like display their username, or whatever you want to do. Have you read up on sessions?
-
To clarify, $todayRepost35 is defined outside of your repostEndSelect() function, so repostEndSelect() knows nothing about it since it's not in scope. You need to either define that variable within the function, or pass the variable TO the function like repostEndSelect($todayRepost35) Also, you never call your function so it doesn't get executed. You just define it.
-
First and foremost, the mysql driver has been deprecated and will be removed from an upcoming version of PHP, so your code won't work as it's not futureproof when that happens. You really should use PDO or MySQLi driver or you're going to have to rewrite all of your DB stuff in the near future. Might as well do that now before that happens. Do you get any errors from die('Error: ' . mysql_error());?? In your query, $name and $comment, assuming they're text, need quotes around them. They should also be escaped before entering them in the db.
-
your $emailTo is also missing a quote.
-
For more info on what requinix is saying, the problem (assuming you defined $pdo somewhere outside your function), is an issue of variable scope.
-
I don't know why you're ignoring what everyone who is more experienced is telling you. If it's on the net and someone has access to it (like behind a login, or just open to the public), it can be copied. Period. You can spend as much time on this as you wish, but you won't accomplish what you're after and in the end you have only wasted your time. Even if you "obfuscate" the url the video is being pulled from (how would the video player play the video if it doesn't have the correct URL to retrieve it from), there are many browser plugins that will still allow a user to just download the video to save it. After all, you are sending the video TO the browser.Just google "prevent video download" and read up on the thousands of articles that will tell you it's not possible. This is no different from "how can I prevent someone from copying an image from my website". You can't.
-
Need a jQuery function to remove a CSS class based upon browser width
CroNiX replied to simcoweb's topic in Javascript Help
If you're going to use resize(), I'd highly suggest looking into a debounce function to use in conjunction with it. The problem with resize() is it fires many, many times while the browser is being resized which would trigger your code as many times which is overkill and can lead to problems (non-responsive for periods of time) with the browser depending on how much code you are executing. Using a debounce method would slow the number of times your code is executed. Try this to see what I mean and check your js console as you resize the browser: $(window).resize(function(){ console.log('resizing'); }); Also try it on different browsers to see how much different the resize() event gets triggered in various browsers. -
Try putting the spans in a div container, and use the positioning on that container. I believe the problem is the absolute positioning of the spans. http://jsfiddle.net/sr5fta4m/4/
-
Need a jQuery function to remove a CSS class based upon browser width
CroNiX replied to simcoweb's topic in Javascript Help
I'd use a CSS media query instead of javascript for this. Not only is it shorter code, but will work whenever the browser gets resized while your code will only check and do it once, when the page initially loads. https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries -
There is a basic syntax error I had in my code that you copied and pasted. I didn't test it. I just created it here in a post. It should be obvious if you study that line the error message states. Sorry for not just telling you what it is. This is basic php stuff and you NEED to know how to do it to debug code or you will never be able to code anything on your own. It's an essential/required skill you really need to learn.
-
You will always be able to get the full url from HTML based video....otherwise the browser wouldn't know the url to retrieve the video from in order to play it.
-
We don't know what you've changed/altered from the original code so "line 9" is pretty meaningless. You should post your new code. But...from what I can see: $countryOptions = buildSelectOptions($countries); Where is $countries being created that you are sending to buildSelectOptions()? Also, this isn't doing anything except continuously writing over the same variables and then you never do anything with them anyway. while($Ctry_info = mysqli_fetch_array($clist_res)) { $Ctry_ID = ($Ctry_info['CID']); $Ctry_Name = ($Ctry_info['Country']); } You probably want to be doing: $countries = array(); while($Ctry_info = mysqli_fetch_array($clist_res)) { $countries[$Ctry_info['CID'] = $Ctry_info['Country']; } $countryOptions = buildSelectOptions($countries);
-
You could store a message in session before redirecting, and then on the page you're redirecting to check to see if that session variable exists (your thank you message) and if it does, display it. You could also do something like adding a GET parameter to the url of the page you're redirecting to, and then checking for that variable on the page and display a message the same way. JS: window.location.href="http://yoursite.com/?message=thank-you"; PHP on page getting redirected TO: if (isset($_GET['message']) AND $_GET['message'] == 'thank-you') { echo 'Thank you for creating your account'; } Personally I'd use sessions.
-
Why not just use height=100% and same as width for the textareas, like using a CSS class? Then if the TD size changes the textarea will resize. Shouldn't really need JS for this, it can be done with just CSS. JS resize() browser event gets fired a hell of a lot of times while resizing which is overkill for what you're doing.
-
Since you didn't include a METHOD in your <form> tag, the default is used which is GET. You're checking POST. You are also trying to "echo $list" and $list is an array, you can't echo arrays. Use var_dump() or print_r() on arrays.
-
Have you tried just setting the background of your submit button to be an image using css?
- 3 replies
-
- clickable image
- html to php
-
(and 1 more)
Tagged with:
-
Try removing the very last php closing tag. They are unnecessary and can cause issues if any whitespace comes after them. And when I highlight that code there is whitespace after. Could be the forum doing that or copy/paste inconsistencies, but just best to leave those ending php tags off if nothing comes after it.
- 4 replies
-
- parse error
- syntax error
-
(and 1 more)
Tagged with:
-
Check the manual for session_destroy(), just calling setcookie() doesn't do anything as you didn't supply any data. They have examples on how to properly do that to a session cookie.
-
Duplicate every row of table AND also change one field?
CroNiX replied to galvin's topic in MySQL Help
Not sure why you're using week number. What happens next year when the weeks start over? Best to use an actual date field imo. That will help with sorting, too, since it will sort by year/month/day, in that order, which is probably what you want when displaying comments. -
Duplicate every row of table AND also change one field?
CroNiX replied to galvin's topic in MySQL Help
So you're only trying to seed the db with test data and this won't be a part of the real app? -
Probably because that's what you're trying to load: $book_model = $this->loadModel('Admin'); If admin_model.php doesn't exist, it can't be loaded, so when you try to use $book_model on the next line (the var that you loaded the model into) it's "not an object".