PHP - Make Directory On New User Sign-up
Hi guys, I've got a snippet of code that's supposed to make a new directory with the user's unique ID (member_id) in the database. I have the code here but I get a myriad of errors including the infamous "at line 1 error, and the directory does not create. Please help me!!
//Create Directory $queryString2 = $_SERVER['QUERY_STRING']; $query2 = "SELECT member_id FROM members WHERE $queryString2 = $row[activation]"; $result2 = mysql_query($query2) or die(mysql_error()); mkdir("/home/gafferzo/www/members/clubs/" . mysql_result($result2,0), 0777); Similar TutorialsThe Script:
<?php echo "<h1>The Hashtag: </h1>"; echo $_GET['hashtag']; ?>An example for the URL on localhost: /search.php?hashtag=#xboxIf I am not using the number sign, then the word "xbox" does get printed on screen, if I do use the number sign then the hashtag "#xbox" does not get printed on screen. Any suggestions on how to do this? this code is to create a new user based on posted variables. it works fine for creating the necessary tables and granting privileges. but then when i log out as root and try to log back in as the user it's failing. why is it failing? Thanks, G. Code: [Select] <?php extract( $_POST ); include( '../php/userobject.php' ); @ $db = mysqli_connect('localhost', 'root', 'xxxxxx', 'mealchamp'); if ( mysqli_connect_errno() ) { echo 'Error: could not connect to database as root.<br />'; exit; } else echo 'Connected to database as root.<br />'; $query = "SELECT username FROM userlist WHERE username = $uname"; $result = mysqli_query($db, $query); if ($result) echo 'That user name is already taken.<br/>Please hit back on your browser, and try a different user name.<br/>'; else { echo 'That username is available.<br/>'; echo "$fname<br/>"; echo "$lname<br/>"; echo "$add1<br/>"; echo "$add2<br/>"; echo "$city<br/>"; echo "$prov<br/>"; echo "$ctry<br/>"; echo "$post<br/>"; echo "$email<br/>"; echo "$uname<br/>"; echo "$pass1<br/>"; echo "$sex<br/>"; echo "$birth<br/>"; echo "$height<br/>"; echo "$weight<br/>"; $query = "INSERT INTO userlist (firstname, lastname, address1, address2, city, province, country, postal, email, username, password, sex, birth, height, weight) VALUES ('$fname', '$lname', '$add1', '$add2', '$city','$prov', '$ctry', '$post','$email','$uname', '$pass1', '$sex', '$birth', '$height', '$weight')"; $result = mysqli_query($db, $query); if ($result) echo "Userlist was updated successfully<br />"; else echo "Could not update userlist"; $query = "CREATE TABLE ".$uname."_persfood (persfoodid INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, food VARCHAR(30) NOT NULL)"; $result = mysqli_query($db, $query); if ($result) echo "Personal food table was created successfully<br />"; else echo "Could not create personal food table<br />"; $query = "GRANT select ON mealchamp.userlist TO ".$uname." IDENTIFIED BY '$pass1'"; $result = mysqli_query($db, $query); if ($result) echo "User priveleges were granted successfully<br />"; else echo "Could not grant user priveleges<br />"; $query = "GRANT select, insert, update, delete, index ON mealchamp.".$uname."_persfood TO ".$uname." IDENTIFIED BY '$pass1'"; $result = mysqli_query($db, $query); if ($result) echo "User priveleges were granted successfully<br />"; else echo "Could not grant user priveleges<br />"; mysqli_close($db); @ $db = mysqli_connect('localhost', $uname, $pass1, 'mealchamp'); if ( mysqli_connect_errno() ) { echo 'Error: could not connect to database as user.<br />'; exit; } else { echo 'Connected to database as user.<br />'; ?> so the user is reading a story, to finish reading he has to click a link that redirects them to the signup page. Code: [Select] <?php session_start(); $beginurl = $_SERVER['HTTP_REFERER']; $_SESSION['beginurl'] = $beginurl; echo $_SESSION['beginurl']; ?> <html> <head> </head> <body> <script type="text/javascript"><!-- location.replace("http://www.mysite.com/members/"); //--></script> </body> </html> When they get to the second page, they have to click a link that opens up a modal. this is the code that runs when they hit the register button Code: [Select] session_start(); $beginurl = $_SESSION['beginurl']; $beginurl= (isset($_SESSION['beginurl'])) ? $_SESSION['beginurl'] : 'Error'; if( $_SESSION['status'] ='authorized') $_SESSION['$makemodal'] = 0; //sends the user to the page upon successful password credential if(!isset($_SESSION['SESS_USERID'])||(trim($_SESSION['SESS_USERID']=='admin'))) { echo '<script language="javascript">'; echo "top.location.href = $beginurl"; echo '</script>'; exit(); } Am I passing this variable correctly? and I'm not sure if the top.location.href towards the bottom is correct either, right now after I hit the register button I'm redirected to a blank page where the url is, "http://www.mysite.com/function Error() { [native code]}" Hi, I am creating an application that manages movie information. I was wondering if there was a way of letting a user navigate to a directory and select it as their default movie directory. i will then scan the sub directory names and compare them to a table in the Db. This latter part I can manage, its letting a user define their own default directory that is causing me problems. Any examples I have found are relating to file uploading similar to this Code: [Select] <form name="file_uploader" action="upload.php" method="post" enctype="multipart/form-data"> <input type="file" name="data"><br /> <input type="submit" name="upload" value="Upload File"> </form> Thanks for your time and consideration. Ran the following but got a segfault as it doesn't seem to support php7.4. ./vendor/bin/concrete5 c5:install -i So I changed ./vendor/bin/concrete5 from: #!/usr/bin/env php <?php ... to #!/usr/bin/env php72 <?php ... I am sure I will forget I did this and would rather configure either the directory or the user to use php72. Is this possible? Also, should I be making any other changes? For instance, maybe: "config": {"platform": {"php": "7.2.30"}} Thanks I have a page site.com/register/signup.php I want to echo out the current directory: register. When I use getcwd() I get: /home/user1234/public_html/register instead of: register or if I am inside this directory site.com/register/image/ then I want to echo out: register/image I have also tried the server[self] command but that too gives you the full directory. Does anyone know how to echo out only the current directory starting AFTER the public_html? How to configure the server to restrict a user from accessing the directory structure, by changing the URL? for example: if the server redirects the user to the following URL upon successful login. http://mysite/dir1/dir2/dir3/phpfile.php currently, if i try change the URL to http://mysite/dir1/ even though there is no index webpage for dir1/, the directory structure gets exposed. how do i go about restricting the user from accessing the directory structure and throw an error message at him like "you are not authorised to view this", whenever a "smarty-pants" user tries to edit the URL manually. The user should only be able to see the webpages which the server redirects him to. nothing else. How to configure the PHP server such that, if the URL is modified manually, server should redirect to an error page instead of exposing the directory structure. images are uploaded to a directory and the sql database contains the filename. I added 'url' field and am trying to link the two I have used on of the posts to help me adapt some script however I'm not sure I have the syntax right. The image in DW live view looks ok and I get the link finger ok but when previewed in browser the image is not shown at all or any link. Any ideas <? echo !empty($row['pic']) ? "<a href=\"{$row['url']}\" <img src=\"js/images/{$row['pic']}\">" : ''; ?> it echos out to a table Mike Hi All I am trying to set up a system that where a user sets up an account the system automatically sets up a new directory and inserts template files into it. I understand mkdir is something to do with it. Does anyone know how to go about this please? thanks I have a paypal shopping cart form. Right now the form submits to paypals normal site and works fine. But the problem is the user can use firebug and change the price before sending to paypal. So i want the form to submit to my php script, where ill whatever is in the session, not what was posted, create an NVP string from that post, then POST that to paypal. I thought i could do this with cURL, but cURL always responds, it never actually takes the user to paypal with post. Is there a way to mimic what a form submit does completely in PHP? Hey, guys. I'm a programmer and i've designed an application to assist in an online game. When users visit my website for whatever reason i want to display the amount of users currently using my application. As you may have guessed i'm not to crash hot at php or any web related languages at that . What i think will work, is when my application starts up, i can make it visit a webpage in the background and just idle there while they are using the program, when they close the program obviously it is no longer viewing that webpage. So if there some sort of php counter i can make for this? I was reading some sources to php counters and they count the amount of "sessions" and display that, i was just curious if my program navigates to a webpage upon opening and it doesn't do anything will this 'time it out'? Anyway, any help is appreciated. Thanks. This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=347193.0 Login.php Code: [Select] <?php session_start(); mysql_connect("localhost","root") or die(mysql_error()); mysql_select_db("cute") or die(mysql_error()); $username = $_POST['username']; $password = $_POST['pass']; if (isset($_POST["submit"])) { $log = "SELECT * FROM regis WHERE username = '$username'"; $login = mysql_query($log); $row = mysql_fetch_array($login); $number = mysql_num_rows($login); if ($number > 0) { $_SESSION['username'] = $row['username']; $_SESSION['userlevel'] = $row['userlevel']; if($_SESSION['userlevel']==1) { $_SESSION['is_logged_in'] == 1; header("Location: form2.php"); } else if($_SESSION['userlevel']== 0) { $_SESSION['is_logged_in'] == 1; header("Location: registration.php"); } } Registration.php Code: [Select] <?php echo 'Welcome:' .$_SESSION['is_logged_in'];?> form2.php Code: [Select] <?php session_start(); if (empty($_SESSION['is_logged_in'])) { header("Location:chatframe.php"); die(); // just to make sure no scripts execute } ?> <?php mysql_connect("localhost","root") or die(mysql_error()); mysql_select_db("cute") or die(mysql_error()); $message=$_POST['message']; $a=$_SESSION['username']; if(isset($_POST['submit'])) //if submit button push has been detected { if(strlen($message)>1) { $message=strip_tags($message); $IP=$_SERVER["REMOTE_ADDR"]; //grabs poster's IP $checkforbanned="SELECT IP from ipbans where IP='$IP'"; $checkforbanned2=mysql_query($checkforbanned) or die("Could not check for banned IPS"); if(mysql_num_rows($checkforbanned2)>0) //IP is in the banned list { print "You IP is banned from posting."; } else { $thedate = date("U"); //grab date and time of the post $insertmessage="INSERT into chatmessages (name,IP,postime,message) values('$a','$IP','$thedate','$message')"; mysql_query($insertmessage) or die("Could not insert message"); } } } ?> <html> <head> <script type="text/javascript"> function addsmiley(code) { var pretext = document.smile.message.value; this.code = code; document.smile.message.value = pretext + code; } function a() { var x = document.smile.message.value; if(x=="") { alert("Please insert an message!"); return false; } } </script> <style type="text/css"> body{ background-color: #d8da3d } </style> </head> <body> <form name="smile" method="post" action="form2.php" onSubmit="return a()" > Your message:<br><textarea name='message' cols='40' rows='2'></textarea><br> <img src="smile.gif" alt=":)" onClick="addsmiley(':)')" style="cursor:pointer;border:0" /> <img src="blush.gif" alt=":)" onClick="addsmiley('*blush*')" style="cursor:pointer;border:0" /> <input type='submit' name='submit' value='Send' class='biasa' ></form> <br> <br> </body> </html> In this registration.php when im called back its appear nothing im means the number is not showing and the login code even im had also put the "$_SESSION['is_logged_in'] == 1;" outside if else userlevel statement and then i put $d= $_SESSION['is_logged_in'] == 1; and im echoing back but it is nothing im thinks something wrong in session is login and also still it cannot redirect to admin -form2.php when session is login in is 1 I'm creating a social network for a friend and I need to make a flash webcam to talk to another flash webcam. I have all the flash code working, now all I need is a way to let users match themselves up to each other without other users being able to barge in. What areas of php do I need to learn about to do this? Dallas. Hi everyone... I would like to implement a questionnaire/survey system that has only two Answers (Yes /No). Basically, this questionnaire system will be widely used on Mobile Phones. It will be looking something like this below: http://awardwinningfjords.com/2009/06/16/iphone-style-checkboxes.html Lets say a user selects a response as No (Using the above slider button for a question). That response should be recorded in the database with User Details + Time Stamp. Also, I would like to generate a report for each question (Responses of Multiple Users) and a report at a User Level for the entire questionnaire/survey (s). Can some one guide me the fastest & easiest way to achieve this? I'm a new learner of PHP. Regards Sandeep Hello everybody,
I am honestly quite a newb when it comes to mod_rewrite.
We run a small social media page with different areas and I would like to change the URLs to something more clean and professional.
User profiles look like this:
http://www.sky-mp3.com/index.php?action=cm&siteid=59&wahl=artists&tat=details&keyid=477siteid 59 is the artists list and the keyid at the end is the ID of the artist but should be like: http://www.sky-mp3.com/mischuraor in worse case like: http://www.sky-mp3.com/user/mischuraCMS pages look like this: http://www.sky-mp3.com/index.php?siteid=106but should be like: http://www.sky-mp3.com/charts(page name instead of siteid) What I know so far: - I have to add something to the .htaccess file - I need to change something in the code (but I don`t know where) Im good he? What would be the first step on the path to clean URLs for me? I found alot of infos here and there but found nothing yet for this specific case. Kind regards from and thx in advance from Cologne Hi guys, I've been working on a script for a while now, and I'm sure it doesn't look great and all, and it's probably really messed up.. But right now I've finally got it working! There's only 1 thing I'd really like to add.. Searching through & listing of remote directories! The directories I'm trying to list have directory listings enabled, and I think it *should* be possible. I just have no clue how. Here's my current code in a beautiful mix of HTML and PHP: <? $border_size = "0"; function returner($what) { $what=explode("/",$what); $tps=count($what); $what=$what[$tps-1]; return $what; } $page_url= ""; $home_url=returner(__FILE__); if(isset($_GET['q'])) { $qtext=$_GET['q']; } else { $qtext=""; } function getdirsize($directory, $format=FALSE) { $size = 0; if(substr($directory,-1) == '/') { $directory = substr($directory,0,-1); } if(!file_exists($directory) || !is_dir($directory) || !is_readable($directory)) { return -1; } if($handle = opendir($directory)) { while(($file = readdir($handle)) !== false) { $path = $directory.'/'.$file; if($file != '.' && $file != '..') { if(is_file($path)) { $size += filesize($path); } elseif(is_dir($path)) { $handlesize = getdirsize($path); if($handlesize >= 0) { $size += $handlesize; } else { return -1; } } } } closedir($handle); } if($format == TRUE) { if($size / 1048576 > 1) { return round($size / 1048576, 1).' MB'; } elseif($size / 1024 > 1) { return round($size / 1024, 1).' KB'; } else { return round($size, 1).' bytes'; } } else { return $size; } } if(isset($_GET['type'])){ $type=$_GET['type']; } else { $type="new"; } $textures=0; $models=0; $avatars=0; $seqs=0; $sounds=0; foreach (glob("textures/*.jpg") as $texture){ $textures++; } foreach (glob("models/*.zip") as $model){ $models++; } foreach (glob("avatars/*.zip") as $avatar){ $avatars++; } foreach (glob("seqs/*.zip") as $seq){ $seqs++; } foreach (glob("sounds/*.zip") as $sound){ $sounds++; } ?> <!DOCTYPE html> <html> <head> <title>ObjectPath Search</title> <style type="text/css"> #wrapper { width: 850px; margin: 30px auto 30px auto; padding: 10px; } body { color:#C6C6C6; background:#1E1E1E; /* margin:0; padding:0; */ overflow-x:hidden; } #tabs { font: 85% "Trebuchet MS", sans-serif; } .left { float: left; } .right { float: right; } a:link, a:visited, a:active { color: #3DB015; text-decoration: none; } a:hover { color: #00E0FF; } h2 { color: #3DB015; padding-bottom: 0.2em; font-size: 110%; } ul#icon {margin: 0; padding: 0;} ul#icon li {margin: 1px; position: relative; padding: 1px 0; cursor: pointer; float: left; list-style: none;} ul#icon span.ui-icon {float: left; margin: 0 1px;} </style> <link type="text/css" href="http://objects.jk-hosting.com/search/css/black-tie/jquery-ui-1.8.2.custom.css" rel="stylesheet" /> <script type="text/javascript" src="http://objects.jk-hosting.com/search/js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="http://objects.jk-hosting.com/search/js/jquery-ui-1.8.2.custom.min.js"></script> <script type="text/javascript"> function formHandler(form){ var URL = document.form.site.options[document.form.site.selectedIndex].value; window.location.href = URL; }; $(function(){ // Tabs $('#tabs').tabs(); }); </script> </head> <body> <div id="wrapper"> <div id="tabs"> <!-- Tabs start --> <ul> <li><a href="#tab-search">Search</a></li> <li><a href="#tab-list">List Objects</a></li> <li><a href="#tab-info">OP info</a></li> </ul> <div id="tab-search"><!-- Searchtab start --> Please enter a string to search for, and choose a folder to search in. <br /><br /> <form name="Search"> <input type='hidden' value='search' name='type'> <input value='<? print $qtext; ?>' type='text' name='q'> <select name='map'> <option selected='selected' value='models'>Models</option> <option value='avatars'>Avatars</option> <option value='textures'>Textures</option> <option value='seqs'>Seqs</option> <option value='sounds'>Sounds</option></select> <input type='submit' value='Search'> </form> </div> <!-- Searchtab end --> <div id="tab-list"><!-- Listtab start --> Please pick a folder to browse. <br /><br /> <form name="form"> <select name="site" onChange="javascript:formHandler()"> <option value="#">Look in folder...</option> <option value="<? print $page_url; ?>?type=list&map=models">Models</option> <option value="<? print $page_url; ?>?type=list&map=avatars">Avatars</option> <option value="<? print $page_url; ?>?type=list&map=textures">Textures</option> <option value="<? print $page_url; ?>?type=list&map=seqs">Seqs</option> <option value="<? print $page_url; ?>?type=list&map=sounds">Sounds</option> </select> </form> </div> <!-- Listtab end --> <div id="tab-info"><!-- Info tab start --> The OP currently contains: <br /><br /> <table> <tr><td><b><? echo $models; ?></b></td> <td>Models</td></tr> <tr><td><b><? echo $avatars; ?></b></td> <td>Avatars</td></tr> <tr><td><b><? echo $textures; ?></b></td> <td>Textures</td></tr> <tr><td><b><? echo $seqs; ?></b></td> <td>Seqs</td></tr> <tr><td><b><? echo $sounds; ?></b></td> <td>Sounds</td></tr> </table> </div> <!-- Info tab end --> </div> <!-- Tabs end --> </div> <!-- Start PHP generated content --> <? if($type=="search" || $type=="list") { $M=$_GET['map']; if($type=="search") { $Q=$_GET['q']; $empty="Nothing found with <b>\"" . $Q . "\"</b> in it's name.<br />\nPlease make a more general search query, or try a different folder.\n\n"; } else { $Q=""; $empty='This folder is empty'; } if($M=="textures") { $ext="jpg"; } else { $ext="zip"; } $i=0; print "<hr>\n"; $endfile=array(); $endsize=array(); $endsize2=array(); foreach (glob($M."/*".$Q."*.".$ext) as $filename) { $filename = explode(".", $filename); $filename=$filename[0]; $filename = explode("/", $filename); $filename=$filename[1]; $i++; $endfile[$i]=$filename; if($ext=="jpg") { $endfile[$i]="<a name='".$endfile[$i]."' href='".$pageurl."?type=view&name=".$endfile[$i]."&folder=".$M."&from=".$type."&addon=".$Q."'>".$endfile[$i]."</a>"; } $endsize[$i]=$size; $endsize2[$i]=$size2; } if($i != 1) { print "<b>".$i."</b> items were found.\n<hr>\n"; } else { print "<b>".$i."</b> item was found.\n<hr>\n"; } echo("<table width='100%' border='" . $border_size . "' cellspacing='0' cellpadding='0' >\n"); if($i!=0) { for ($t = 1; $t < $i; $t++) { $thumbfile = $M."/".$endfile[$t].'.jpg'; if(file_exists($thumbfile)) { $thumbnail = "<a name='".$endfile[$t]."' href='".$page_url."?type=view&name=".$endfile[$t]."&folder=".$M."&from=".$type."&addon=".$Q."'><ul id='icon'><li class='ui-state-default ui-corner-all' title='".$endfile[$t]."'><span class='ui-icon ui-icon-image'></span></li></ul></a>"; } else { $thumbnail = ""; } if($t=="1") { echo("<tr><td width='10%'>Number</td><td width='3%'><ul id='icon'><li class='ui-state-default ui-corner-all' title='".$endfile[$t]."'><span class='ui-icon ui-icon-image'></span></li></ul></td><td width='60%'>Name</td></tr>\n"); } echo("<tr><td>" . $t . "</td><td>".$thumbnail."</td><td>" . $endfile[$t] . "</td></tr>\n"); flush(); } $thumbfile = $M."/".$endfile[$t].'.jpg'; if(file_exists($thumbfile)) { $thumbnail = "<a name='".$endfile[$t]."' href='".$page_url."?type=view&name=".$endfile[$t]."&folder=".$M."&from=".$type."&addon=".$Q."'><ul id='icon'><li class='ui-state-default ui-corner-all' title='".$endfile[$t]."'><span class='ui-icon ui-icon-image'></span></li></ul></a>"; } else { $thumbnail = ""; } echo("<tr><td>" . $t . "</td><td>".$thumbnail."</td><td>" . $endfile[$t] . "</td></tr>\n"); } print "</table>\n"; if($i=="0") { print $empty; } } elseif($type=="view") { $filename=$_GET['name']; $folder=$_GET['folder']; if($_GET['from']=="list"){ $addon="?type=list&map=".$folder."#".$filename; } if($_GET['from']=="search"){ $addon="?type=search&q=".$filename."&map=".$folder."#".$filename; } print"<center><a href='".$home_url."'>Home</a></center>"; print "<hr>\n<center><img src='".$folder."/".$filename.".jpg'></img></center>\n<hr>\n<br />\n<a href='".$page_url."".$addon."'>Previous Page</a>\n"; } $htmlshow=""; if($_GET['type']=="returnOPfile") { if(isset($_GET['split'])) { $splitter=$_GET['split']; } else { $splitter=" | "; } if(isset($_GET['html'])) { $htmlshow="<br />"; } foreach (glob("textures/*.jpg") as $texture){ if(isset($_GET['size'])) { $size=$splitter.filesize($texture); } $texture = explode("/", $texture); $texture=$texture[1]; print "textures".$splitter.$texture.$size."\n".$htmlshow; } foreach (glob("models/*.zip") as $model){ if(isset($_GET['size'])) { $size=$splitter.filesize($model); } $model = explode("/", $model); $model=$model[1]; print "models".$splitter.$model.$size."\n".$htmlshow; } foreach (glob("avatars/*.zip") as $avatar){ if(isset($_GET['size'])) { $size=$splitter.filesize($avatar); } $avatar = explode("/", $avatar); $avatar=$avatar[1]; print "avatars".$splitter.$avatar.$size."\n".$htmlshow; } foreach (glob("seqs/*.zip") as $seq){ if(isset($_GET['size'])) { $size=$splitter.filesize($seq); } $seq = explode("/", $seq); $seq=$seq[1]; print "seqs".$splitter.$seq.$size."\n".$htmlshow; } foreach (glob("sounds/*.zip") as $sound){ if(isset($_GET['size'])) { $size=$splitter.filesize($sound); } $sound = explode("/", $sound); $sound=$sound[1]; print "sounds".$splitter.$sound.$size."\n".$htmlshow; } } ?> <!-- End PHP generated content --> </body> </html> So right now my question to you PHP freaks is, can you please help me edit my script so I can search through a remote directory? *This* is one of the directories I wish to be able to search through & list.. Thanks in advance. Edit; It might help if you know what the site currently looks like. *Click* i have made an delete files script which works for only one directory but not sub directory so i want to delete files of same extention from directory and subdirectory. My current code is Code: [Select] <? $dir = 'hmm/'; function scanr($dir){ $arr = glob($dir.'/*.jpg'); foreach($arr as $vv){ //check if $vv is a file if(is_file($vv)){ //if file, get the filename $vx=explode('/',$vv); $file=$vx[count($vx)-1]; // if no extension delete the file unlink($vv); // print the deletion message echo $vv." deleted!<br>";}else{ // if $vv is a dir then scan it again for files scanr($vv); }} } scanr($dir); ?> Hi, We currently have an RSA key in XML format, and am trying to sign it with PHP and phpseclib, however we are struggling to do it. We have managed to decrypt and encrypt it, but can not find a way to sign it. They key has been generated with .NET. Cheers Hello, The number sign does not seem to be showing up after a GET request. I've set up a script for an example: text.php: Code: [Select] <?php session_start(); mysql_connect("localhost", "*****", "*******************9") or die(mysql_error()); mysql_select_db("*****") or die(mysql_error()); function safe($var) { $var=mysql_real_escape_string(addslashes(htmlspecialchars($var, ENT_QUOTES, 'UTF-8'))); return $var; } $N=safe($_GET['N']); echo"$N"; ?> Say the url is text.php?N=### None of the symbols show up. Thankyou, GB. |