Jump to content


  • Posts

  • Joined

  • Last visited


Profile Information

  • Gender

beegro's Achievements


Newbie (1/5)



  1. Assuming you're doing this session_set_cookie_params(0, "/", ".weblyize.com", false); in the parent domain. Then the session should work unless your subdomain is on a different box. If it's on a separate box you'll have to figure out how you want to share the session files between them. I'm sure you already know this but I'm just reiterating it to be thorough.
  2. Try removing the actual numbers out of the html array. PHP will assign the numeric indexes for you appropriately. <input type="text" name="hdds[][hddbrand]" id="hddbrand"><br/> Model and/or size,type: <input type="text" name="hdds[][hddtype]" id="hddtype"><br/> SN: <input type="text" name="hdds[][hddsn]" id="hddsn"><br/> Notes: <input type="text" name="hdds[][hddnotes]" id="hddnotes" size="50">
  3. Let me know if I'm missing something but why wouldn't you just use a 2-dimensional array like $elem['Date1'] = array('event1', 'event2', 'event3');
  4. Hi rocky, The problem you're having is that the isset() function is always evaluating to TRUE because it sees that there is a value for $_POST['sub']. By nature, when you post a form PHP receives all of the form elements with 'name' attributes in the HTML. Therefor, the check you are doing isset($_POST['sub']) is invalid because it will always evaluate to TRUE when pressing the submit button. I think the problem you're having is not in the PHP but in the javascript. To stop your form from being submitted when the javascript evaluates to false, I'd suggest moving the javascript call to the onsubmit event of the form itself. <form action="add.php" method="post" onsubmit="return check();"> This should allow the return value from the javascript function to override the default action from the "onsubmit" event. Don't forget that "return" command.
  5. It sounds like the web server isn't a member of the group that has rights to write to the file. Try chgrp -R apache test chmod -R 0775 test
  6. Thanks for posting that solution. I've had a similar problem previously and my fix was much less elegant than this.
  7. Could you post some of your code? It's hard to help if we can't see the problem.
  8. To clarify: Are you wanting to get the contents, separated by a space, into an array from withing the "<!--" and "-->" strings?
  9. For the most part, I think your OO approach is correct. However, I would probably break the validation of the form data out from the class. In short, handle validation of form data in a PHP page/script and handle argument validation within the class. This will allow you to send appropriate messages back to the browser for missing/mal-formed/incomplete form entries while your classes manage their attributes and arguments as if they come from a script.
  10. The extension is actually part of the filename. It's especially difficult because the native operation of an extension-less name denotes a directory. Depending on what type of server you're using you may be able to deploy some rewrite rules that actually re-write the URL to point to the php script but this also depends on your directory structure. You're in a bit of a fix here. I'd really suggest grepping through your code and changing links without extensions to links with extensions. Anyone else know a better way??
  11. What you're talking about looks like ModRewrite. However, I'm missing how $do is working into a re-write of yoursite.com/index.php?id=$id into yoursite.com/$id/$do
  12. Try this out $page = file_get_contents('http://www.example.com/'); $sub = stristr($page, "myid="); $num = sub_str($sub, 0, 6); // assuming the value will always be six characters If you need to find the id for any variable length you'll have to split on the space after the value, but I'm sure you can figure the rest out.
  13. Metacharacters are any characters that have special, interpretable meaning. In PHP we have (\n, \r, \t, etc.) in strings that are metacharacters. How you should filter your inputs all depends on what you want to do with those values later. Are you simply wanting to echo them back to the browser or will you actually be doing something else with them?
  14. Take a look at what the submitThisOnce() function does. It could do many different things (AJAX, adding additional elements, simply submitting the form, etc.) If it's a simple submit then you can easily use cURL to send values to the "action" target.
  15. I agree with xtiancjs on not making a habit of hacking XML to get it to parse with SimpleXML. I only offered the str_replace() hack since the namespace URLs within the XML resolve to 404 pages and therefor cannot be used for parsing children.
  • 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.