ki Posted February 15, 2007 Share Posted February 15, 2007 is there a way I can make it so my form (thats included) will go to the same page (with variables) and still process? Link to comment https://forums.phpfreaks.com/topic/38638-php_self/ Share on other sites More sharing options...
trq Posted February 15, 2007 Share Posted February 15, 2007 Just dont give your form an action attribute. eg; <form method="post"> Link to comment https://forums.phpfreaks.com/topic/38638-php_self/#findComment-185453 Share on other sites More sharing options...
ki Posted February 15, 2007 Author Share Posted February 15, 2007 Thanks, also, its for a forum I used like if (!$_SESSION[logg] == 0) or something { include(file.login) } else { display forum crap } but when i post it it goes to a blank screen, buit it set the variables i needed to logon but i need it to display the other page contents? any suggestions? Link to comment https://forums.phpfreaks.com/topic/38638-php_self/#findComment-185465 Share on other sites More sharing options...
Kemm Posted February 15, 2007 Share Posted February 15, 2007 Thanks, also, its for a forum I used like if (!$_SESSION[logg] == 0) or something { include(file.login) } else { display forum crap } but when i post it it goes to a blank screen, buit it set the variables i needed to logon but i need it to display the other page contents? any suggestions? Can you post the code maybe? Link to comment https://forums.phpfreaks.com/topic/38638-php_self/#findComment-185466 Share on other sites More sharing options...
ki Posted February 15, 2007 Author Share Posted February 15, 2007 SAMPLE: if ($_SESSION['logged_in'] == 0) { include("login.php.inc"); } else { $forum_id = $_GET['forum']; } LOGIN.PHP.INC <? ob_start(); require_once('config.php'); session_start(); if(isset($_POST['submit'])) { mysql_crap_here $_SESSION['logged_in'] = 1; $_SESSION['username'] = $_POST['username']; $_SESSION['password'] = $_POST['password']; session_write_close(); } else { echo "INPUT HERE"; } ?> Link to comment https://forums.phpfreaks.com/topic/38638-php_self/#findComment-185482 Share on other sites More sharing options...
Kemm Posted February 15, 2007 Share Posted February 15, 2007 SAMPLE: if ($_SESSION['logged_in'] == 0) { include("login.php.inc"); } else { $forum_id = $_GET['forum']; } LOGIN.PHP.INC <? ob_start(); require_once('config.php'); session_start(); if(isset($_POST['submit'])) { mysql_crap_here $_SESSION['logged_in'] = 1; $_SESSION['username'] = $_POST['username']; $_SESSION['password'] = $_POST['password']; session_write_close(); } else { echo "INPUT HERE"; } ?> The second code, start it with <?php ? Link to comment https://forums.phpfreaks.com/topic/38638-php_self/#findComment-185484 Share on other sites More sharing options...
ki Posted February 15, 2007 Author Share Posted February 15, 2007 Would it matter? But also login.php.inc is processed after the check to see if the user is logged in. So refresh? Or anyone know a code to refresh the page? Link to comment https://forums.phpfreaks.com/topic/38638-php_self/#findComment-185486 Share on other sites More sharing options...
Kemm Posted February 15, 2007 Share Posted February 15, 2007 Would it matter? But also login.php.inc is processed after the check to see if the user is logged in. So refresh? Or anyone know a code to refresh the page? Just use a simple javascript code: <FORM> <INPUT TYPE="button" onClick="history.go(0)" VALUE="Refresh"> </FORM> And dont you need "<?php" in front of all codes? Link to comment https://forums.phpfreaks.com/topic/38638-php_self/#findComment-185493 Share on other sites More sharing options...
trq Posted February 15, 2007 Share Posted February 15, 2007 What is the problem? Your question is exteremely vague. Link to comment https://forums.phpfreaks.com/topic/38638-php_self/#findComment-185495 Share on other sites More sharing options...
Balmung-San Posted February 15, 2007 Share Posted February 15, 2007 And dont you need "<?php" in front of all codes? Not if you have short tags (<? code ?>)or asp tags (<% code %>)enabled, but it's highly suggested you use <?php, as that's compatible in all configurations. As for the problem at hand, besides the question being vague, I'm thinking it may have to do with your file extension. Is your web server setup to handle .inc as a PHP file? Link to comment https://forums.phpfreaks.com/topic/38638-php_self/#findComment-185507 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.