premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
You want to look into mod_rewrite using .htaccess if you are using an Apache server.
-
Please use [ code] [ /code] tags for posting code in (no initial space). <?php session_start(); // Define your username and password $username = "a"; $password = "b"; # define a redirect url $redirect_url = "http://www.mydomain.com/page.php"; if (isset($_SESSION['logged_in']) && $_SESSION['logged_in'] == "yes") { header("Location: $redirect_url"); } if (($_POST['txtUsername'] == $username) && ($_POST['txtPassword'] == $password)) { $_SESSION['logged_in'] = "yes"; header("Location: $redirect_url"); die; } ?> A little redundant, but that should work to avoid logging in twice.
-
You are trying to move a file to your website url, you need to use the actual server path like /home1/website/flyers/ instead of http://etcetc
-
PHP Warning: mysql_close(): no MySQL-Link resource supplied
premiso replied to camdenite's topic in PHP Coding Help
Don't use mysql_close. It is not necessary or needed. That should fix that error. (See the man page above for more information on that). Unless you are using persistent connections, it is not necessary. Also you are not showing us where you are calling mysql_close that would help. Please use [ code] [ /code] tags (no initial space) for posting code! -
That makes more sense. Thanks, I must have just read over it, I guess I could of just went to the site and found out.
-
Magic Quotes I would suggest turning them off, as they are depreciated in PHP 6 and disabled in PHP 5 by default.
-
if (!$_SESSION) { session_start(); } calling session_start(); at the top of the page without an if is "OK" to do. That is just extra code and is probably causing your issue. Remove the if then move session_start() to the top of your login page.
-
The only reason I point it out, is I know of a forum that an admin got in and informed them they were using illegal software, they actually made a post a sticky/global announcement, before shutting the site to "off". Now whether this was really VBB Admin going in there or just an exploit someone found in the code I have no clue. This was back in 2001 ish.
-
I am not, but my supporter status gives me ad-free browsing, someone is causing some headaches. EDIT: I am an idiot w00t!
-
<?php if ($_SESSION['logged_in'] != "yes") { header("Location: http://www.mydomain.com/login.php"); die; } ?> You were using the wrong operator check, use != instead of !== for this scenario and see if that helps you.
-
I am not sure how it would actually work with PHP and AJAX. I know it is possible, given online chats. You can try and google "Chat Queues PHP" and see what comes up as that may give you a base of code. Me, I would code it in Java, but that is me.
-
When creating the folder/displaying it you can use str_replace to strip out any whitespaces. You should also be weary of filtering usernames, so the user cannot add / or ' as it can cause problems on the server if you allow them to create folders in such a way. But why have a folder for members?
-
trim ?
-
Extra comma: hrclienta, hrhunts // removed comma here.
-
<?php $domain = $_POST['domain']; $arrayofdomains = explode("\n", $_POST['domain']); $arrayofdomainentries = array(); foreach ($arrayofdomains as $domain) { $arrayofdomainentries[] = array( // first element 'domain' => $domain, 'language' => 'en', 'somethingelse' => 'xx', 'somethingelse' => 'xx' ); } ?> That should work, not sure how you determine the somethingelse's but yea.
-
[SOLVED] Can You Put an include in an if else statement?
premiso replied to limitphp's topic in PHP Coding Help
Notice the post at the top of this forum: "Can you do *insert thing*?" -
I take it SMF is free? I guess I never looked into it. I know VBB does it so they can "thwart" people from using it who did not pay for it. I do not know if they still practice it, but I know at one point they had that in their code.
-
For an assignment, as long as the teacher does not care, I would use it. np, the problem arises is when someone actually does use that code, which a teacher can generally tell a beginners code from someone who knows php code and they start searching, find this topic and wham, he is in trouble for that. I do understand that, it would really be his problem, but by just helping him along, a teacher would not punish them for that and they learn it. Some times just pointing out the right direction is great But it is like the old saying, "You give a mouse a cookie....", you keep giving him stuff and he keeps wanting you to give him more, you teach him it, he learns it and will learn how to find solutions on his own.
-
explode at the linebreak character "\n" <?php $domain = $_POST['domain']; $arrayofdomains = explode("\n", $_POST['domain']); ?>
-
Dude, how is he going to learn if you just give it to him. This is a homework assignment, make them actually learn how to do it on their own, not give them the answer.
-
How do you normally set a font-size? Are you required to use the div tag? Why not make it easier to just use the <font> tag? No styling required, unless that is what the assignment calls for. Look up on the <font> tag in html to see how it is used. From there, you can hopefully find out. If not read up on echo and print on how to print/echo variables in PHP.
-
What about the option that SMF coded a "sleeper" in their code? Someone who found it or knew about it used to exploit it. I know VBB code's sleeper's in their code, maybe SMF did the same?
-
rand would be your best bet. Take a look into that.
-
[SOLVED] Keep query data after reload help PLEASE - newbie
premiso replied to hane's topic in PHP Coding Help
Fixed the code above to have proper syntax, here is correct example: $link = '<a href="directory/your-page.php?cat=' . $cat . '&subcat=' . $subcat . '&area=' . $area . '">your link</a>'; And this should be using "$_GET" not $_POST, since variables appeneded to an array is "GET"ting the data, when it is in a form and method="post" it is "posting" the data. $cat=$_GET['cat']; $subcat=$_GET['subcat']; $area=$_GET['area']; -
I do not really know. I never used a CMS. http://www.cmsmadesimple.org/ Seems like a nice one, if you google CMS PHP you should find a bunch of results on it. If you are stuck on doing it yourself, that is a tutorial I would look into. The categories you probably will not find a tutorial on, you just have to look into recursion for displaying them etc.