View Full Version : Coding?
Austin Klei
02-16-2010, 07:36 PM
How do i make a url like this:
http://www.yourdomain.subdomain.com/blah-h2.html?username=check
^not a real link, its what i want.
And i dont have CGI access.
And then that url makes any parts with a username say their name like:
Welcome CHECK,
For any user. I have a login form, that will send certain users to a certain page, but i want it to be a user friendly where it says: "Welcome, USERNAME"
How would i do this?
The link to the page i want it to have the "Welcome, USERNAME" is: http://teamsoh.forumotion.com/userhomephp-h8.htm
The login page is: http://teamsoh.forumotion.com/sohmainlogin-h7.htm
(which i know you can see the passwords on the source code, i unencrypted them...)
Use this:
Username: member3
Password: password1
djr33
02-17-2010, 03:10 AM
<?php echo $_GET['username']; ?>
Any server side language can do this (PHP, CGI, ASP, etc.).
If your host does not support any server side language(s) then:
1. I'd suggest getting a better host.
2. You can try to use Javascript and it is possible, but it's annoying and not as reliable (since it's happening in the browser rather than on the server, so the browser must cooperate with your code and might fail to output what you want depending on the system).
Austin Klei
02-20-2010, 03:40 AM
I cannot use it, but i see my portal for my website can do this:
/portal.htm?pid=3
How?
auriaks
02-20-2010, 03:52 AM
if you use .html extention you can't process the PHP. the extention must be .php
take a look to his website, abviously he is using php :D
djr33
02-20-2010, 05:07 AM
In the server configuration (through .htaccess for example) file extensions can be controlled: .htm can be processed as php code, or anything you'd like.
However, this still means that there is some kind of software on the server processing it, and it probably has a default extension. If it's PHP, then .php will probably work. If it's ASP, then .asp; another option to try is JSP (Java server programming). And there are many other languages.
I don't know how your portal works or what your server configuration is, but in theory you should be able to access this if it exists somehow on the site.
One possibility is that your host disables direct access to configurations but sets up some system specifically to allow portals. This is somewhat unlikely, but it's not unlikely that there may be some security restrictions causing you problems. I recommend looking for a host that allows you more access if you plan to start using server programming languages.
One other possibility is that you could use .htaccess files to use mod_rewrite which is an apache module that basically takes the request url and then serves a different file. In = "page.php"; out = "anotherpage.htm". Of course it frequently gets much more complex than that, and this could in theory handle forwarding that form of URL to "regular" pages.
Austin Klei
02-20-2010, 04:22 PM
Lets use another site of mine as an example, (i dont want this coded on this website)
http://www.aeroware.realbb.net/portal.htm?pid=3
How is that possible to work?
Austin Klei
02-20-2010, 04:23 PM
Oh and is it also possible to make it in a script, for example via the username they use in the form, without having to make a certain page for each person.
djr33
02-21-2010, 12:48 AM
Yes, this is all very possible, but you must use a server side language. PHP, ASP, JSP, CGI, Perl, and various others are all possible. This is not possible without that. A very BASIC version could be put together using Javascript, but that's probably a bad idea.
You probably also want to start using a database, such as MySQL, which will then work with PHP, etc.
1. Get a server that supports one of these languages (or don't bother trying)
2. Find an introduction tutorial and start looking at what the purpose of each language is-- what can you do with it?
3. Then and only then start trying to fix these specific problems... you need that background to get anything done.
Some introductory information is available here.
http://dynamicdrive.com/forums/showthread.php?t=25847
Remember that "PHP" has approximately the same capabilities as any server side language, but it's just the most popular, so you can use any you would like, but you do need one of them (and it doesn't have to be PHP).
Austin Klei
02-21-2010, 01:59 AM
Could i use an external php page, but still use a .htm?user=username ?
djr33
02-21-2010, 06:31 AM
You NEED PHP on the server, regardless of what you call the files. There is no way around that.
You CAN setup .htm to be parsed as .php, but if .php files won't work, then .htm as .php won't work either.
Without a serverside language you can't include "external" files, though I'm not sure if that's exactly what you mean.
I am confused by the way you are asking the question, so there may be a way to do this, but whatever way you do it you will need PHP (or another type of serverside code).
.htaccess alone can handle the URLs, I believe, but that won't do anything for you toward getting dynamic content on the pages.
Austin Klei
02-21-2010, 04:24 PM
I dont think i have CGI access, nor php access. I'll check with the support board of my host and see what they say. Still i need ideas on how i could make it work.
By the way, the credentials are updated to it:
Username (The first field): demo
Password (the second field): dynamic
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.