Jump to content

dannyb785

Members
  • Posts

    544
  • Joined

  • Last visited

Everything posted by dannyb785

  1. Ok do it like this... I have a get_midnight function I've made. and I put in a time value and it spits out the value of midnight of that day. So what you do it get the midnight value and then do a search in the database of any value that is > the midnight value. That way you'll find everything that has a timestamp of today. function get_midnight($timestamp) { $day = date("j", $timestamp); $month = date("F", $timestamp); $year = date("Y", $timestamp); $midnight = strtotime("$month $day $year"); return $midnight; } so then your query would be SELECT * FROM Table WHERE CurrentDate > '$midnight' provided currentdate is the value of the row that you want, if it was done today EDIT: the output is referring to the resource probably because it was done incorrectly. Come to think of it, yea, the only reason it's ouputting is because there's an error in the query
  2. Which is exactly what I figured was the reason.
  3. How much php do you know? Are you getting paid for this? If so, I think it's sad your company hired someone and is paying them who doesnt know php basics. Here's a quick way to do what you need. When they view the page with the form(or whatever is being timed), place 2 hidden variables. one variable is the time that they started the form($now = strtotime("now")) and the other is a encrypted hash of that date plus some other data unknown to the user(for example, $hash = md5($now."form") ). the encryption is so that someone can't duplicate the form with a later time in case they go over their time limit. So then, once the form is submitted, you compare the values. Firstly, that the difference between the $_POST data $now and the time at the point of submission(get another $submitted = strtotime("now") value right when the form is processed) is not greater than the amount of time given(allow 30 seconds or so leeway). Then, once it has been verified that the time in the $_POST value has not exceeded the time allowed, do a compare with the $hash value. Check that if($hash = md5($now."form") ) { sumitted properly } else { hack attempt } Hope that made sense
  4. No, I didn't. I dont think it's typos. Consistently, anytime I accidently sent as mail as if it's from another domain(gmail or whatever), it sends nothing. And the minute I change it to the right domain, it sends. weird
  5. do you know enough php to take a query I give and make it work? $query = "SELECT * FROM Order,Item WHERE Order.order_item_id=Item.item_id AND Order.order_id='$id' ";
  6. Are you trying to find rows in your database whose date corresponds to the current day? If so, there's an easier way(and less buggy). Let me know if thats correct
  7. ^ I've had issues on my server sending emails with the "From" header not corresponding to my domain. But it may work for him...
  8. I have no idea what that meant but here is what your problems probably are: 1) not redirecting... it is likely that configuration.php outputs something onto the screen. When output is made, it wont redirect. end of story. 2) Where is your data coming from? Will you show us the form you're using to remove the data to begin with? If you dont have a form, then there's your problem right there. But if you do, show it to us. 3) thirdly... since this page is only meant to delete a row, why are you doing anything with $_POST['aName'],$_POST['sid'], and$_POST['description']? In fact, why do those variables even exist? I think the most crucial thing right now is what does your form page look like. EDIT: @PFMaBiSmAd - I'm pretty sure that there shouldnt be an error if $aid is empty.. it just wont delete anything.
  9. But the centering problems are all about how the menu is setup around everything else. And since everything is output in js, I have no way of telling what is placed inside of what.
  10. only during production. And get rid of them once everything is working correctly No, you should ALWAYS have error handling - period. How you implement that error handling can be different during development (e.g. echo'ing the error directly to the page) than in production where you should show a "friendly" error message to the user and save the actual error to a log file or some other back-end reporting repository. Not sure what your experience has been. But in my 10 years in software a product is in "production" when you release it to the end-user. I meant development when I said production. my baaaaad.
  11. ^ omg... dude, I said put the style code in the TD!!!! Please read posts more carefully
  12. There was 2 errors in the code I gave. one was you need to remove the single quotes in the $row array when it's been put in double quotes. Second was remove the query that was called within the while statement. That should do it. I'm sorry you had to find the script somewhere and that it works... bc that means you probably have no idea why your previous code wasnt working. not a good way to solve problems
  13. If we tell you, you wont learn anything. You need to just read up on each of these things.
  14. When I do these types of things for my stuff, I need to give each input field a unique name. I'm not sure what you're doing by calling it "checkbox[]', I would suggest "cb$row[recordID]" as to give each a unique name then step through each using current() and next()
  15. are we supposed to just guess your aim sn? Why didn't you try out my code? I gave you the info for the form page and the process form page. That's all you need.
  16. ^I was just notifying whoever may help that more than one person will benefit from the answer
  17. Sorry to post and not give an answer, but this is a great question and i would like to know also.
  18. Did you type up the code when it was working? Did you know what you were doing? If I ask you to grab user "bobbyjoe" and tell me his user id, could you do that? You need to know how to grab info from a table and process it correctly to get the info. putting a quert into a variable $sql isn't going to magically put the last value into $lastlogin
  19. This isn't php. You CAN use php however.. whatever page your form goes to(if <form action=process.php and method="POST"> and the <input type=text name=goto>) make a file called "process.php": <?php header("Location: $_POST[goto]"); ?> booyah. one line of php code. if that doesnt work for some reason, do: <?php header("Location: http://www.mydomain.com/$_POST[goto]"); ?>
  20. If these filenames are in a database you can do SELECT * FROM 'Files' WHERE file_name LIKE '%-10-%' OR '%01-01-200%' or modify accordingly. I prefer to keep track of files in a database. Easier to search for info(to me, anyways)
  21. CRAP, just realized this goes on MYSQL area, not php.. sorry! please move it, mods! Hi all, In my database, I have a table called "Header", which just holds the id and the name of the header. The header in my site is any variation of multiple images that are faded through using javascript(like a slideshow). The images for each given header is located in 'Header_Image' table. The columns for each are: Header h_id - h_name Header_Images hi_id - hi_dest - hi_type(this links to h_id) where hi_dest is the image's location and hi_type identifies which header it belongs to. Now, in my main area where I'm looking at all the different headers I've created, I wish to display them all(easy enough, with a SELECT * FROM Header query), but within each header outputted, I wish to display the number of images assigned to each header WITHOUT doing a new query within each query(I this can be done easily that way, but I don't want unncecessary extra queries). I know there's a way to use the count() function but every time I use it, it doesn't include headers that don't have any images. It'll only display those that have atleast one image. Can anyone help me? I'm almost positive I should be using the count() function but I'm probably using it wrong.
  22. ditto. these questions need to be more clear
  23. Your code has many issues and to solve it would require me to write it all. Look over all of the replies so far and use what you know about php to figure it out. I don't know what I know bc people told me everything. I had to sit through hours of trouble-shooting jus to get one dumb thing to work before.
  24. I dont know that you can go from http://link.com/ to http://link.com/1234 with just a GET form alone.
×
×
  • 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.