Jump to content

CroNiX

Staff Alumni
  • Posts

    1,469
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by CroNiX

  1. Same thing...where is $www, $email, $pwd coming from in your query? They're not defined! Those also come from $_POST. You are also using the very old and deprecated mysql driver which will be removed from php soon, so you're code will already be obsolete. Use mysqli or PDO. Do yourself a favor and enable error reporting. Check to see if your query actually works, and if not have it display the error so you can tell. These things should be obvious if you view the errors.
  2. if($submit) Where is submit defined?
  3. I'd advise using a popular responsive/mobile css framework and not muck with stuff like this with so maaaany different devices/sizes/resolutions which are constantly changing Twitter Bootstrap would be good, and it's easy to use.
  4. Several things. First and foremost, don't you use the js console in your browser? It shows these errors, like "ReferenceError: errorCode is not defined". In the $.each parameters you pass to the function, you define as error_code but in your check you check for errorCode, which doesn't exist like the error says. Where you are using errorCode in the $each loop, it is actually the array index of message. It works like: $.each(object, function(index, data){}); So that line should be if(message.error_code != -1 ){ Also, in that loop, you return false which will prevent anything else from executing in the loop. Maybe you just have that there for testing?
  5. Likely no. The extension needs to be from the same version of php. I'd reinstall php from scratch. You will likely need a more modern version anyway if it was installed "years ago". Since it doesn't sound like you have messed with this stuff much, I'd take mikosiko's advice and use WAMP, which will install a current Apache/MySQL/PHP stack all at once, and they will all work together because it's made to.
  6. Can't use mssql (Microsoft SQL) unless you have their database server installed, and I wouldn't recommend doing that. I'd look in your php extension directory and see if php_pdo_mysql.so (or .dll if windows) is present, if so just add the line to your php.ini like the others.
  7. That only happens if you don't have mysql (don't use that) or mysqli extension enabled in php.
  8. Sorry, not meaning to hijack the thread but wanted to answer you. My invoicing app runs only on my internal home network, not publicly accessible to anyone but myself. So, no user auth or actual security of any kind. It's well written and have had no issues in the last 5 years of using it.
  9. Yes, but he said for his own use so it didn't sound like that would be an issue. I have an invoicing app that I created that runs on my local machine and I am the only one who accesses it. If I was coding it for multiuser use I would have coded it differently than I did. There is 0 security in it as I'm the only one who uses it. I do agree with your points.
  10. PHP really wouldn't be best for this. Its just not designed for this kind of task and it would be very inefficient, slow and resource (cpu/ram) intensive. That said, it would be helpful to see an example image as I have no idea on what you mean by "identity card" or what the rest of the background looks like. If these images are all fairly consistent, like a drivers license, there are php "edge detection" scripts that could help give you coordinates of the "contrasted" border, so you can crop from those. It does it by creating several copies of the image, like in greyscale, and contrast the dark/light areas. There is very little useful info I could find in google.
  11. Probably the most efficient way would be to have your script create a text file and store the last number used. That way you could just quickly read the file to determine what the next number should be to rename the new file, and also overwrite the old number with the new one. Otherwise you'd have to do something like scan the dirs and do comparisons to see what the highest number is, which would get slower and slower as you add more images.
  12. Once I removed the outer most open/close brackets, php json_decode() worked and also jQuery (not going through php) could read it as an object.
  13. You won't be able to do all of that with mod_rewrite. mod_rewrite (apache) knows nothing about your php code, how it works, or what the ids, for example, translate to. All it knows is what the requested URL is and can only rewrite it using the same values basically. Like it has no way of knowing that siteid=59 translates to mischura as that's internal to your php app. It could rewrite something like http://www.sky-mp3.com/index.php?action=cm&siteid=59 to http://www.sky-mp3.com/cm/59 If your app used the username instead of the user ID, then it would work like you wanted, but you'd have to alter the way your app works and not use IDs and use the names of the entities instead. The app can get the user id based on the username. http://www.sky-mp3.com/index.php?action=cm&siteid=mischura could then be http://www.sky-mp3.com/cm/mischura
  14. Never tried to do that...but I'd say using a database would be MUCH better for this sort of task, especially if the domains are on different physical servers. I'd also do what google does and use a 1px hidden image, which would request the image from a certain domain. <noscript> <img height="1" width="1" style="border-style:none;" src="http://theSiteThatIsCollectingInfo.com/app.php" alt=""> </noscript> and on that server app.php would just be a simple php script that gets the data from $_SERVER (user agent), stores it in the db if it isn't there, and if it is there increment the total for that UA by 1
  15. Try removing the outermost brackets (one [ at beginning and one ] at end) Then you should be able to access: data.entry_id data.expiration_date data.title data.url_title data.error_messages_m (array of objects) data.success_messages_m (array of objects)
  16. That isn't a well formed json object. I can't parse it with php or jquery. It causes errors, so this is probably why you're having problems.
  17. What do you mean "responseText"? I don't see that in that json object.
  18. No, that's actually probably best as whenever you create a new variable it uses memory, so reusing them would save a bit of ram.
  19. Yes, you can't 'alert' an object. Use the browser's js console, or firebugs, to see the object and be able to traverse it. instead of alert(data); use console.log(data);
  20. This code will generate a separate dropdown for each hour since the <select></select> is within the loop. You only want the <option> generated in there. They will also all be filled with the same value since you're using "<option>{$formatted_start_time}</option>" which was created before the loop.
  21. Another thing you can do is add a class to elements that you assign an event to, and then use the :not selector to avoid reassigning them to the same elements. example: function assignClick(selector) { $(selector + ':not(.assigned)').click(function() { //target element that does NOT also have 'assigned' class //add 'assigned' class to this element, so we can avoid readding this event to previously assigned elements $(this).addClass('assigned'); var UserID = $(this).val(); var Status = "GetData"; $.post('/Admin/Users/Verified/approveUser.php', { UserID: UserID, Status: Status }, function(data) { $('.OverlayWrapper').html(data); assignClick('.Approved'); //assign the event to the new data retrieved via ajax }); $('.OverlayContainer').show(); }); } Then: $(document).ready(function() { $('.CloseOverlay').click(function() { $('.OverlayContainer').hide(); }); assignClick('.Approved'); //assign to .Approved });
  22. When you set up a click event, or any other targeted event, it can only target the elements that are currently in the DOM. If you bring in new elements, like via ajax or something, you need to add the event to the new element(s) as it knows nothing about previously assigned events. One challenge is to not resetup events that have already been assigned to existing elements. For instance, if you do something like $('.someclass').click(... and you have 3 buttons with .someclass, those 3 will have the click event assigned. If, via ajax, you bring in 3 more buttons with .someclass, you don't just want to rerun the $('.someclass').click(... because the original 3 elements will get assigned the event twice while the new ones will only have it once. There are several ways to do that. Look into jQuery "off" and "on" methods for one solution. Look into event namespaces as well.
  23. Probably because you left off the < in <div...in more than one place, too.
  24. Oh, for the image size, that should be done with css. <div class="image-holder"> ...images </div> CSS Rule: .image-holder img {max-width:800px; max-height: 600px }
×
×
  • 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.