Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
Check this thread out... Replies 4, 5, 6 and 7.
-
I'm just kidding, timmah!
-
[SOLVED] Creating Webpages with the PHP GET Method
Maq replied to topflight's topic in PHP Coding Help
The require_once belongs in the main.php. So main.php is sort of a template. Depending on what the user clicks on it will load in another page. require_once() will load whatever page you want in that spot. Try it out. -
It's just a forum with a style, they're all the same except for the styles. I like the header but I think you need to change the colors scheme. I don't like the puke green with the bright yellow...
-
You should try to keep the main container intact. For example when you click on any of the quick links it opens up a whole new page that looks nothing like the original. Try to keep everything in the center. That's just my opinion.
-
If you call, nl2br(addslashes($message)); It will perform the addslashes then nl2br. In some cases it can make a difference.
-
$user = $_GET['user']; $pw = $_GET['pw']; //check database to see if they exist and match. Then you would update a part in mysql...
-
[SOLVED] Creating Webpages with the PHP GET Method
Maq replied to topflight's topic in PHP Coding Help
I thought the whole point of this was to call in different pages? It's almost the same as the user profile pages but instead you're going to require a page. So you have main.php (the one we've been coding), contactus.php, joinus.php, and news.php. So if the user clicks on the link with the variables ?page=contactus, we will know what page they are trying to get to. Then we take the page variable from the URL and use that to figure which page the user wants to see. In this case, they want to see contactus.php. So you should have another PHP file names contactus.php that we can call (require_once) that will show the contact content. Does this make any sense? -
Where do you set the session? When you login you should set the session, like: $_SESSIONS['username'] = "FilipKrstic"; Can you post your code too?
-
Yes cURL is very popular but depending on you situation you may want to use file_get_contents() instead.
-
Does anyone have any good XSLT examples/tutorials they would like to share? I've only found a couple that are very basic. I also saw the XSLT cookbook or w/e online but don't really like it. Can't seem to find anything decent. Thanks!
-
session_start(); require_once("../config.php"); if(isset($_SESSION['mcp']) || isset($_SESSIONS['username' ) { echo "Welcome " . $_SESSIONS['username'] . " "; echo "What is mcp? " . $_SESSIONS['mcp'] . " "; } else { echo "Need to login first"; } ?>
-
If you want to refer to them by there last digits then you need to take the sub string from the actual variable name. This, for example, will display all the variables with a 1 at the end of the variable. *NOT TESTED* while ($row = mysql_fetch_row($xyzQuery)) { for ($i=0;$i if(substr($$row[$i], 1) == 1) { echo $row[$i]; } } } or you can access by first letter... $string = $$row[$i]; if($string[1] == 'a') { echo $row[$i]; }
-
There are many tutorials that deal with this as it is a very common feature. This one looks decent. It's better to come back with a specific question(s).
-
Same with strings... Look in the manual... "http://www.mysite.com/page.php?id=1&alpha=downloads" $i = $_GET['alpha']; switch ($i) { case "downloads": echo "Yay! downloads"; break; case "uploads": echo "uploads"; break; } ?>
-
You first need to fix what premiso mentioned, but something like this? $i = $_GET['id']; switch ($i) { case 0: echo "i equals 0"; break; case 1: echo "i equals 1"; break; case 2: echo "i equals 2"; break; }
-
Huh? What's your problem?
-
(middle finger)
-
[SOLVED] Creating Webpages with the PHP GET Method
Maq replied to topflight's topic in PHP Coding Help
$page = $_GET['page']; $call_page = $page . ".php"; echo "This is the page you should call! " . $call_page; if($page == "main") { require_once("$call_page"); } elseif($page == "contactus") { require_once("$call_page"); } elseif($page == "joinus") { require("$call_page"); } elseif($page == "news") { require_once("$call_page"); } ?> Main Roster Join Us News -
Are you sure there are results for that query? Everything looks fine to me...
-
[SOLVED] Creating Webpages with the PHP GET Method
Maq replied to topflight's topic in PHP Coding Help
A switch may be better but w/e. Where I echo out those variables you should be calling your external files (require_once). You can get the file names by doing: $call_page = $page . ".php"; So if the user clicks on the link "?page=roster" you would do: And all you have to do is require $call_page. if($page == "main") { echo "main"; } elseif($page == "contactus") { echo "contact"; } elseif($page == "joinus") { echo "joinus"; } elseif($page == "news") { echo "news"; } -
I thought DarkWater already set you straight... Add or die(mysql_error()) at the end of your query!
-
Oh boy... What's the difference between the homepage and the other pages, different content? -The color scheme is awful. -There is no point to the site. -A personal site with ads? -What are we suppose to critique there's not much there... Sorry, but I don't like it at all.
-
What do you get when you echo out $query in the first example? You've probably done this but did you add or die(mysql_error()) to your mysql_query()?
-
Hrmmm, I see.