Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. Look into "magic quotes"..
  2. Despite the awkward PHP tags and missing semi-colons, that would run as expected assuming $row_rsworksorders1['intraartapproval'] was set. What happens if you dump out the value..? var_dump($row_rsworksorders1['intraartapproval']);
  3. Define 'does not seem to work'..
  4. Actually, to correct myself, you'd need the date in "YYYY-MM-DD" format (as MySQL dates are): $expire_date = date("Y-m-d", strtotime("+30 days"));
  5. Yikes, thought my old school was rough. I'd say if this was for a different topic of website, the design would be fairly well done. But I don't think you've particularly though about what you're designing for, as others have mentioned. I also think the layout is quite restrictive, in that it's not a fluid layout, it's quite thing and image heavy. You don't really have room to add say a large image if you wanted to later. Looking at the source there's a lot of room for improvement. You're using a table layout, deprecated tags (such as <center>), there's no doctype, some images are missing alt attributes, you're using the old hacky spacer.gif trick, etc, etc. Looks like Dreamweaver or something?
  6. You wouldn't use an IF, you'd just use a WHERE clause within your query to only match records with that date. What exactly is it you're trying to do?
  7. You can use strtotime in combination with date() to easily add a number of days: $expire_date = date("m/d/y", strtotime("+30 days")); Then you can use that within your WHERE clause, which should look something like: where date_field = '{$expire_date}' Assuming you've set-up `date_field` as "date" data type.
  8. Well to be honest you're not really using the right data type for that type of condition; I'd use 'date'. That way you only need to check if it's equal, and not within a range of seconds.
  9. From what I've read it's impossible to append or merge anything into a cursor in that way. Normally I'd use a join for something like this, but obviously as it's calling another procedure I can't, and the code within that procedure is about 100 lines long so I can't really just duplicate it. Can anybody suggest a work-around that would allow me to achieve the same thing? Thanks
  10. Ahh, of course. Sorry my bad. I started using in_array() but when I thought about extending it to store the from text I modified the array to store the IP as the key, but I should have also switched to using array_key_exists: $known_ips = array( '123...' => 'from the office', // etc. ); $ip = $_SERVER['REMOTE_ADDR']; if (array_key_exists($ip, $known_ips)) { $ip = $known_ips[$ip]; // you may want to use a different var name here now? } That should work for you.
  11. Can you be more specific with how it doesn't work?
  12. Yeah that's normal behaviour, PHP only sees the query as a string of text and so doesn't parse the variable. When you actually execute the query do you know which you're parsing or are they run in some form of loop? I'm thinking you could replace variables with '%s' and use sprintf to add the dynamic values..?
  13. I'd use in_array to lookup the IP address within an array of known IPs. You could also extend it to store the 'from' text and have multiple known IPs: $known_ips = array( '123...' => 'from the office', // etc. ); $ip = $_SERVER['REMOTE_ADDR']; if (in_array($ip, $known_ips)) { $ip = $known_ips[$ip]; // you may want to use a different var name here now? } You could even pull the list in dynamically from another data source (e.g. a database).
  14. How are you executing the query?
  15. Why don't you just modify your current code to use a drop down? I'm sure it wouldn't be too difficult to implement..
  16. You could just use: // 1st query $sql="select * from spl WHERE spl1 LIKE ('%$search%') LIMIT 1"; $result=mysql_query($sql) or die (mysql_error()); $rows=mysql_fetch_array($result); $passon=$rows['orsku']; //added code if (!is_numeric($rows['orsku'])) { echo 'The data must consist only of numeric characters.'; } You'll most likely want to store the error as opposed to just echoing it out though, otherwise how will you to determine later if there actually was an error?
  17. Sorry to be more clear, "cResults" in the procedure call is the cursor I'm trying to populate with the page information.
  18. Hey up. I'm quite stuck on this after playing around with it for about five hours. Basically I'm working on a pretty extensive Oracle framework, trying to use 1 procedure to populate a cursor in my procedure. So I build up a list of IDs within a cursor: cursor cPages is -- get a list of matching pages select pages.page_id from (....) That part's no problem. But later I want to loop through the cursor, calling a procedure to populate another cursor. So far I've been trying: -- get the page information for each page for vPage in cPages loop getPage(vPage.page_id, pSitecode, pLang, pAuthLevel, cResults, cLocale); end loop; Currently this does work but only returns the last page - obviously must be overwriting the cursor each time. Could somebody please point out what I'm doing wrong? Thanks a lot for any help you can give! Adam
  19. What were the errors?
  20. You're missing a quote at the end of the string: $mesaj = "your new password $random_pass; I'm assuming the hashes were added when you copied the code?
  21. To answer your question, yes the data would get submitted. Couldn't you have just done a test to find out though?
  22. http://www.php.net/manual/en/refs.compression.php
  23. Adam

    PHP DOM

    If I understand you right, you may have better luck using getElementsByTagName() -- since I can't see any IDs used within your XML.
  24. PHP has a built-in function to highlight a given string. I wouldn't imagine C# having the same I'm afraid, but you could look for a JavaScript solution such as: http://softwaremaniacs.org/soft/highlight/en/
  25. (....) } $s='<select name="'.$name.'" id="'.$name.'">'."\n"; //Do query and error checking here. if (!$result=mysqli_query($dbc,$query)) Where?
×
×
  • 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.