Jump to content

ShadowMage

Members
  • Posts

    3,476
  • Joined

  • Last visited

Everything posted by ShadowMage

  1. I have a set of radio buttons whose "checked" status is set in PHP when printing to the screen. The "checked" property is set, yet the box doesn't get checked. See the attached photo. Can anyone explain what's going on here?
  2. Yes, it does. If I initialize the variable to null and try to access an index, I get the same result. No errors, no output. Strange...Still feels like I should get some kind of error...
  3. if (trimmeddelpass!=="") { if (deletestate==0) { //Ajax request here } else if (deletestate==1) { //Different Ajax request here }} else { $('#delerror').html('message'); return false;} Should accomplish the same thing, but you only need to do the trimmeddelpass check once and eliminate a few lines of redundant code.
  4. Based on the AJAX comments, I'd say a different request would be sent, depending on deletestate. That said, the code could be restructured to be more efficient and/or make more sense.
  5. var_dump on $string returns NULL. If I initialize arrTest as an empty string, it throws an "Uninitialized string offset" error. As for the echos...that was an oops. I wrote the code in about 2 seconds and my fingers just automatically typed it...
  6. Trying to understand something here. The following code: class Test { public $arrTest; public function __construct() { $this->arrTest = array("one"); } public function toString() { $string = $this->arrTest[0]; echo $string; }}$test = new Test();echo $test->toString(); Runs perfectly fine. No errors. Outputs "one" just as I'd expect. If I change the __construct function as follows: $this->arrTest = array(); I get an error saying there's an undefined index. Just as I would expect. And if I try to access a property that doesn't exist, say: $string = $this->unknownProperty; I get an error trying to access an undefined property. Just as I would expect. Here's where I don't quite understand what's going on: class Test { public $arrTest; public function toString() { $string = $this->arrTest[0]; echo $string; }}$test = new Test();echo $test->toString(); This code produces nothing. No errors, no output. Shouldn't this generate some kind of error? Undefined index or property or something? (Error reporting is set to E_All)
  7. Personally, I wouldn't put any price information on my website. If I did, though, I'd maybe give an hourly rate and then maybe give a list or chart depicting the average number of hours it takes to do certain kinds of projects. And of course, a disclaimer saying that each project is unique and may or may not require the same amount of hours.
  8. Thanks! Definitely a big help. I'll have to give these things some thought and see what I come up with.
  9. What would it cost? What do you mean what would it cost? What you're trying to do is pretty simple stuff. Just get the value of each text box and perform the needed operations. Look up getElementById and the value property.
  10. Hmm....would the PayPal API allow me to process multiple payment gateways or would it restrict me to requiring customers to set up a PayPal account? I'll have to look into that. If it allows me to use gateways other than PayPal, I could definitely go that route. I just don't want to have to try setting up payment processing stuff myself. [edit] Wow, there's a lot of different APIs for PayPal..... Long story short is that, with the right API, PayPal does indeed let me process credit cards and stuff without customers having to have a PayPal account. [/edit] As for products and requirements, I'm not entirely sure. Product base will likely be fairly large (possibly several thousand). Not sure what sort of requirements you're asking about. It's going to be a simple mom&pop online store selling camping and outdoor stuff and drop shipping from third party warehouses. It also needs to be easy to manage products and orders and whatnot as well as possibly altering certain elements of the page (like images and such) because my mom will be the one managing it and she has no knowledge of web design/development at all.
  11. Good to be back! Good to see some of the veterans are still around. I've heard the same things about Magento so I think that one's out of the question. I need something easy to work with since I've never worked with this kind of stuff before. Did you look at OpenCart? What are your thoughts on that one? I also thought about just writing everything from scratch but I imagine that would be a huge undertaking.
  12. Hi guys, Just wondering if you could give me some recomendations on frameworks for online shopping carts. I've found a few (and I like the looks of OpenCart) but I don't really know what I'm looking for in terms of security and usability (for someone experienced in programming like myself and someone with absolutely zero knowledge like my mom). Any advice/guidance would be appreciated. Thanks.
  13. Where? In the PHP files? It isn't that, because I changed the _index.php file so that the only thing in it is this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html><head><title>Major Web Portal (Vantage 6.1)</title></head><body><?phpecho "Hello World!";?></body></html> ...and I still get the old index page. Funny thing is, if I rename it, I get a "Directory listing not allowed" page. So it doesn't seem to be redirecting to the old site. It seems to me like there's a cached version somewhere, but I don't know where that could be.
  14. I'm trying to add a second website in IIS 5.0 (yes, that means we're on Server 2000). This second site is basically a clone of the first. Both are internal company intranet sites not accessible to the outside world. I managed to get it added, and set up the host header names so that browser requests go to that site. Unfortunately, I have a bit of a problem and it's a strange one (or strange to me at least) and the only thing I can figure is that I've got something set up incorrectly. Here's the deal: Our old site is at webportal.major.com. The new site is at vantageportal.major.com. I made a complete copy of the webportal directory and pointed the new site at that directory. Here's the problem: The new site seems to still be getting its content from the old directory. Changes I make to pages in the vantageportal directory don't reflect in the pages displayed in the browser (yes, I've tried clearing cache and all that jazz). Here's the really weird thing: I created a test HTML file in the vantageportal directory and can access it just fine using the vantageportal URL but not with the webportal URL, just as I'd expect. So, can anyone tell me why the rest of the content seems to pull from the old directory?
  15. You don't even need JavaScript. You can use pure CSS to make tooltips like that. Then they look pretty and work even if JS is disabled.
  16. Refreshing the page doesn't necessarily clear the browser's cache. You usually have to do that manually.
  17. You can set the background color of the table (and it's cells if need be) to be transparent. That way the canvas will show through.
  18. That was one of the options I was thinking about. I don't like the idea of adding "unnecessary" lines but what you're saying about readability makes a lot of sense. Thanks guys, I think this is the route I'll take.
  19. I'm not really sure that any of those options are feasible. I'll try to explain it a bit more:I have a page (let's call it PageA) with a sidebar containing a long list of items. Clicking one of those items sends an AJAX request with the item ID and a few other parameters as POST data to my script mentioned before. This script generates and returns (echoes) an HTML string which is then used to populate a content pane on PageA with information on the selected item. I would like to be able to add the item ID to the URL of PageA (as a query string) to enable linking/bookmarking of specific items. The script will also be accessed from other pages, but producing different outputs for those pages. The list of items will always be the same and the pages rely on much the same information, so to me it didn't make sense to create multiple scripts for each page. Personally, I don't really like the idea either. Which is why I asked for suggestions... ^_^I suppose it probably doesn't matter too much, anyway, since this is a personal project that will never see the open web, but I still like to keep up on good/bad practices. If I get in the habit of using bad practices, I'll regret it when it really does matter.
  20. Is writing to the $_POST variable bad practice? The reason I ask is because I have a script that is normally accessed through AJAX, but I would also like to use require to include the output in a different file. In this script, I check for several $_POST variables and use them in generating the output. If I simply include the file, $_POST will obviously not be set, so I thought I could just set the appropriate $_POST variables before including the file. It works, I'm just not sure if it's a good idea. If this is not the best way to handle this, what are some other options? I have a few in mind, but I want some professional opinions. Thanks.
  21. I have always used / in my file paths and in fact I am using / in my current file path which uses the full absolute path including drive letter. I am using / in all of my require calls (which are all relative paths). I also realize that Windows uses a drive letter to refer to the drive root, but I am not trying to access the drive root. I am trying to access the web root which I've always been able to do by starting my file path with a /. Indeed, the path was not correct as it now works using '../images/PanelTypes/Type'.$x.'.jpg' (yes, that's with / not \)I apparently confused myself into using the wrong relative path. :blink:But that still doesn't explain why my original '/'.$rootDir.'.......' didn't work. Like I said, I've always been able to access the webroot with / before. ($rootDir is referring to my application root, not the webroot in case there was any confusion there.) EDIT: After a quick test, it appears that I am also confused about having used / to access the webroot. I must have been confusing PHP paths with HTML paths (as in the src attribute of an image) because using / to access the webroot does work there (I just tested to confirm).Apparently, I'm much too easily confused...
  22. The server is a Windows server, but I do have remote access to it. The echo exactly matches the real path to the files (including case) minus the webroot part of it. Do I need to use the full absolute path including drive letter and webroot? That wouldn't make much sense.EDIT: Well, it does work when I use the full path with drive letter and webroot. I changed nothing else in the path. That seems like very bad design. What happens if the webroot changes? Is there a way to dynamically retrieve the webroot?EDIT2: Found it. $_SERVER['DOCUMENT_ROOT'] seems to point to the webroot. Still, it seems foolish that file_exists would require a full path... Very good question. From everything I can see, though, the paths are correct.
  23. I have the following code: $fName = 'NotFound';if (file_exists('/'.$rootDir.'/images/PanelTypes/Type'.$x.'.jpg')) {// if (file_exists('./images/PanelTypes/Type'.$x.'.jpg')) {// if (file_exists('images/PanelTypes/Type'.$x.'.jpg')) { $fName = 'Type'.$x;}$html.="<td>\n<input type='radio' name='pnlType".$setID."' id='pnlType".$x."_".$setID."' value='".$x."'".$disableFG." />\n";$html.="<label for='pnlType".$x."_".$setID."'>Type ".$x."</label>\n<img src='images/PanelTypes/".$fName.".jpg' alt='Type ".$x."' /></td>\n"; For whatever reason, the only image that ever shows up is the 'NotFound' image. Am I doing something wrong? The commented if statements are variations that I've tried. And yes, I have verified that the file paths are correct (including the $rootDir and $x variables; $x is incremented throughout a loop) and that files exist (some types do and some do not, for example, Type1.jpg exists but Type3.jpg does not but I always get the NotFound image). Please help. Thanks.
  24. Otherwise, I think the only other option is to use JavaScript to scroll.
  25. Just thinking out loud here, but what if you wrap the textarea in a div and make that div just small enough so that the scrollbar won't fit. If you set overflow hidden on that div, the scrollbar of the textarea should be hidden from view. I see you already have the textarea wrapped in a div with an id of parent, so all you need to do is add the CSS: #parent { overflow: hidden; width: 400px; /*adjust until the textarea scrollbar is hidden*/} I'm pretty sure that the scrollbar width varies by browser so you might have to add a little bit of right padding to the textarea to completely hide the scrollbar.
×
×
  • Create New...