Jump to content

xcandiottix

Members
  • Posts

    330
  • Joined

  • Last visited

    Never

Posts posted by xcandiottix

  1. If your host lets you- you could place it outside the public_html folder and then access it via the script.  I have done this with flat files on my own website.  The scripts can still read them via an absolute link while it is hidden and not accessible to the public.

     

    Hope that helps.

     

    Yes this is the direction I want to go... i noticed for some of my scripts I have to use an absolute link to access the XML and i was trying to figure out what i can do. I'm not sure I can get out side of the public directory but my host does let me have good permission control, so hopefully i can figure out something. Thanks!

  2. Yes javascript. ..... could I possibly hide the XML on the server so its not "open game" but when it is needed I could have php read the file for the exact things I need and then print that to a file? Basically I just dont want someone to either A. type the url of the xml file and view it or B. make an application that goes and gets everyone's xml and takes data from it.

  3. If I have an XML file which my site reads from with JS and PHP is it possible to set the file or folder the XML page is in to be un-seeable by visitors but it can still be written to and read from with php and read from with JS?

     

    I have sensitive information on the XML page and I am trying to decide if I should make a second XML file or not.

  4. I really like your color.... i think its very appealing. The icons also look very nice too. As for usability.... on the surface it seems like a neat idea... trying to actually use the site is another.... granted i was only on for about 2 minutes but it seemed complicated ... this could be that since theres not a lot of users yet, the content isn't there. I would try to simplify the flow of the site and try to tighten up the site's explanations.

  5. It feels like there's too much white space. Also, the icons for everything seem a bit intrusive. I like your page explanation on the front page but it's not clear as to how it would help me.. but again, your test pool here are mostly people who have their own website(s) and wouldn't need a service like this. Keep going with it though and see what happens.

  6. I don't the problem is the design but it's more a matter of what's the point. Upon visiting your site.. i really have no idea what its for, what the name of the site is, why i need to be looking thru it, or what data i should expect to find. I recommend that you try branding your website and the design will follow. Create a logo, color scheme, banner, a cool title font, etc etc and things should start to come together.

  7. Your entire site and its content and its message get lost in all the ads just like everyone else is saying. It seems like the site actually might be pretty decent looking if you can sort things out. Although you do get paid the most for front page ads, i think it's bad form to load up the front page with ads because this is an immediate signal to a visitor to navigate away.

  8. I added the print session code and now I can't get it to repeat the problem. Very strange. I see it was mentioned that session_register is depreciated... does that mean I need to not use this? I believe before when I wrote this part of the code that the variables would not appear with out including this. Is it important to change this or can I still run it with out any problems? I don't get any error messages at any point.

  9. I have a sign in page that forwards to a user page. I keep having a problem where when the user enters their username and password, they are forwarded to their user page but their status is not logged in. If I log in a second time everything is fine. I don't know if the page refresh is the issue or not?

     

    Sign In

    session_save_path("/tmp/");
    session_set_cookie_params(0,'/','.site.com');
    session_start();
    session_register('active');
    session_register('user');
    
    if($row['db_Username'] == $usernameOK){
    	if($row['db_Password'] === $passwordOK){
    		//set session
    		$uncookie = $row['db_Username'];
    		$idcookie = $row['db_Id'];
    		$_SESSION['active'] = $idcookie;
    		$_SESSION['user'] = $uncookie;
    		header("Location: http://www.site.com/member/user_page.php?u=".$uncookie."");
    		exit;
    		//end
    	}
    

     

    user_page.php

     

    session_save_path("/tmp/");
    session_set_cookie_params(0,'/','.site.com');
    session_start();
    
    if (isset($_SESSION['active'])){ //this code is NOT getting triggered although it should be since this was set on the previous page
    }
    else{
    $restricted = 1;
    }
    if($restricted == 1){
    if(!isset($_GET['u'])){
    	echo '<meta http-equiv="refresh" content="1;url=http://www.site.com">';
    }
    else{
    	$statusbar = 'You are not logged in <a href=http://www.site.com/public/signin.php>Click here to log in</a>';
    
    

     

    I chopped the code to just show the parts that seem to be involved so ignore any small syntax errors (missing { etc).

    Any suggestions?

  10. I think you would need to check if the field in your DB is set with the isset command.

     

    If your table is as so:

     

    Name          level      stat

    Monster 1 | level 2 | stats

    Monster 2 | level 3 | stats

    Monster 3 | level 4 |

     

    The you can put in your array:

     

    if(!isset('stat')){

    echo this row

    }

     

    so if the stat row has no data it will echo it... if it does have data it will skip it.

  11. What is the file that's actually stored on the server called? Is it just called the "session" file? (just curious)

     

    Now, you say that the first value is the amount of time the cookie exists AFTER the browser closes? Some of the documentation on php.net said the session could expire without a page refresh which to me says that the cookie or session may expire due to inactivity.

     

    Also, can you comment on whether my second page code will refresh the session time limit correctly?

     

    Thank you for your time.

  12. Just got done checking out php.net and want to make sure I understand this right. My code is as follows on a sign in page:

    session_save_path("/tmp/");
    session_set_cookie_params(600,'/','.site.com');
    session_start();
    session_register('active');
    session_register('user');
    

     

    Does this mean that the cookie set on the server expires in 600 seconds? When I view the cookies on my browser it says they wont expire until I close my browser (chrome). I'd like the cookie on the client machine to expire as well.

     

    Also, on the user page I have this:

    session_save_path("/tmp/");
    session_set_cookie_params(600,'/','.site.com');
    session_start();
    

     

    Will this renew the session/cookie to a new 600 second expire?

     

    Thanks

     

     

  13. Got it. For anyone interested:

    $xmltabname = $dom->getElementsByTagName("Name");
    $xmltabname->item($i)->textContent = $_POST['tabname'.$i.''];
    

     

    should be:

    $xmltabname = $dom->getElementsByTagName("Name");							
    $xmltabname->item($i)->setAttribute("N",$_POST['tabname'.$i.'']);
    

     

     

  14. XML File

    <Name N="john">
    

     

    PHP File

    $xmltabname = $dom->getElementsByTagName("Name");
    $xmltabname->item($i)->textContent = $_POST['tabname'.$i.''];
    

     

    I'm trying to update my XML file, as above I want to change N="john" to $_POST['tabname'.$i.'']. I'm not sure how to construct the second line of the php code. In place of textContent i've tried nodeValue but I'm not hitting the attribute.

     

    Can anyone point me the right way?

     

    Thanks

  15. Here's how...

     

    window.onmousemove=function(){

    window.onmousemove=null;

    title1=xmlDoc.getElementsByTagName("Name")[0].getElementsByTagName("Cell")[0].getElementsByTagName("title")[0].childNodes[0].nodeValue;

    document.getElementById("title1").innerHTML=title1;

    };

  16. I got it to work, I recopied your code and also noticed that in my XML file <banner> is actually <Banner> so I made that adjustment. The xml file was changed, I tested "pants" in the input box but the XML file now showed:

     

    <main_table>

    pants

    </main_table>

     

    But with the capital B and your correct code everything looks cherry!  Truly, thank you so much for this.. I've been fighting this thing for a week trying to get it. If I can ever help you out in anyway just let me know.  :D

     

    PS Thanks for the effort too BizLab .. much appreciated!

  17. Yeah, just thought of that after checking permissions.... full path works and refreshes the page upon hitting submit but the XML file remains unchanged. This seems like something so easy to accomplish but i'm having a hell of a time  :wtf:

  18. Regarding the "Catchable fatal error":

    $doc->saveXML("http://www.site.com/users/".$userid.".xml");
    

    should be

    $doc->save("http://www.site.com/users/".$userid.".xml");
    

    Then I get a "Cannot open file because of HTTP headers" error

    I change it to:

    $doc->save("../users/".$userid.".xml");
    

    No error but the XML file is also unchanged.

     

    Wolphie, I'll try your solution next

  19. Shoot... that looked just too good to be true:

     

     

    Catchable fatal error: Argument 1 passed to DOMDocument::saveXML() must be an instance of DOMNode, string given, called in /html/member/user_page.php on line 51 and defined in /html/includes/member/editpage.php on line 1012

     

    Any idea on that? Line 51 doesn't really have anything to do with this so that's strange.

×
×
  • 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.