How to put extension with a ? on it?

Started on the old forum in August 2011 · view the original in the archive · old links redirect here

#error #php-coding #social-mobile-network

6 replies · 438 views · started 15 years ago · 1 min read

4 participants
s3nzo Developer · 156 posts #1

Hey guys i'm creating a social network now my problem is when i want to put a link to another user's profile. say i want to click on a link

mysite/viewprofile.php?s3nzo

which links to a user profile with the nick name of s3nzo how can i perform this?

razzbee Developer · 130 posts #2

Well ,I wonder how you are creating ur social network if U cant do this simple task..By the way,do it this way

<?php
//lets say this is ur link to get user's nickname
//http://adrazz.net/user_profile.php?id=10 This is our link
//so lets get the username with the link

if(!empty($_GET['id'])){
//lets do few clean up.note its basic add more filtering

$user_id=htmlentities($_GET['id']);
$user_id=mysql_real_escape_string($user_id);

//now lets query from the database

$query_user=mysql_query("SELECT username FROM users WHERE id='$user_id';")or die(mysql_error());

$user_data=mysql_fetch_array($query_user);

//our user name
$username=$_user_data['username'];
}

And we are done..Note,U have to add more stuff cos this is basic...8)

s3nzo Developer · 156 posts #3

You obviously didn't understand my question which explains why you call it a simple task any way thanks for your effort

subzero Super moderator Fellow · 3,954 posts #4

u need to work around that also you can't have any other action or other page in one header.

but if you work around

$? = $_GET["?"]; $?(.) = $_GET['?(.)'];

wild Card (.*)

Make sure you clean up with html chapters

👍 1
Share

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

CreativityKills Lead · 833 posts #5

truthfully using modrewrite to make site.com/username and witout scorn i rilly dnt fink ur ready to undergo a project like dat, u'll regret the amount of holes u'll have like lava. If u really wana start sumtin huge like dat use a framework, half d jobs dun plus its optimized and unit tested. U mite argue u want sumtin dats 100% urs, bt if u dnt get it rite, trust me u wil regret it.

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close