Craig Hopson
Members-
Posts
212 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by Craig Hopson
-
function menu (){echo 'menu';}function menu2 ()echo 'menu2';}if (isset($_GET['x'])) switch ($_GET['x']) { case 'menu1': menu(); break; case 'menu2': menu2(); break; default: echo 'menu';}echo '<a href="index.php?x=menu1">Menu1</a>';echo '<a href="index.php?x=menu2">Menu2</a>'; this is what im using but rather than using href use AJAX so it dont reload the page each time i just swaps the function over
-
the RewriteRule does work on my server i just dont know the correct syntax i'm googling it as we speak but not making much sence i found this http://www.cheatography.com/davechild/cheat-sheets/mod-rewrite/ i maybe asking the wrong questions here but i have index.php?x=menu1, index.php?x=menu2, index.php?x=menu3, ect would mod-rewrite be able to change it to my-site.com/menu1, my-site.com/menu2, my-site.com/menu3,or am i wasting my time?
-
mine is LiteSpeed V5.5 can it still be done or can it be done with PHPalso where does the value $1 come from?
-
ok i tried thisRewriting yoursite.com/user.php?username=xyz to yoursite.com/xyzHave you checked zorpia.com.If you type http://zorpia.com/roshanbh233 in browser you can see my profile over there. If you want to do the same kind of redirection i.e http://yoursite.com/xyz to http://yoursite.com/user.php?username=xyz then you can add the following code to the .htaccess file. [color="#800000"]RewriteEngine OnRewriteRule ^([a-zA-Z0-9_-]+)$ index.php?x=$1RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?x=$1[/color] but it didnt work
-
ok next problem using function menu (){echo 'menu';}function menu2 ()echo 'menu2';}if (isset($_GET['x'])) switch ($_GET['x']) { case 'menu1': menu(); break; case 'menu2': menu2(); break; default: echo 'menu';} how do i change between functions dynamicly like with AJAX or JAVASCRIPT???
-
using this code if (isset($_GET['x'])) switch ($_GET['x']) { case 'menu1': echo 'menu1'; break; case 'menu2': echo 'menu2'; break; default: echo 'menu';} if $_GET['x'] = null then i want it to auto go to default automaticly how would i do this? SORTED IT USE ELSE STATMENT!!!
-
Which way is best tho
-
Why switch & case like that and not my way????? What is the differance???
-
i think i've found a way to do this but not shore if its OK to do it this way so heres the code <html><head></head><body>Hello this is a test <p><a href="index.php?x=menu1">menu1</a> <a href="index.php?x=menu2">menu2</a> <?if($_GET['x'] == menu1){echo 'menu1'; }if($_GET['x'] == menu2){echo 'menu2'; } ?> </body></html>
-
hi guys how can i get http://my-site.com/index.php?x=menu to http://my-site.com/menu i have a site running already witch i the config file it has this to change how its displayed in the url bar, $ubase = $uhome.'/index.php?x=';$ubase = $uhome.'/'; i've looked through the code but cant figure out how they did it Thanks
-
Thanks again great advise
-
Hmmm ok thanks lots to look at then Thanks to all
-
what sort off php security problem would i be looking for?? is there a list off DONT's??
-
Shore i understand that thanks i only ask cos i had my site hacked by WhiteCollarGroup they didn't do anything other than upload a index.html file as below <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Hack!</title><style type="text/css">html, body{ height: 100%;}div#space{ width: 1px; height: 50%; margin-bottom: -251px; float:left}div#container{ width: 500px; height: 502px; margin: 0 auto; position: relative; clear: left;}</style><style type="text/css">body{ margin: 0; padding: 0; background-color: #000000; color: #FFFFFF;}</style></head><body><div id="space"><br></div><div id="container"><hr id="Line1" style="color:#FFFFFF;background-color:#FFFFFF;border:0px;margin:0;padding:0;position:absolute;left:13px;top:78px;width:465px;height:17px;z-index:1"><hr id="Line2" style="color:#FFFFFF;background-color:#FFFFFF;border:0px;margin:0;padding:0;position:absolute;left:20px;top:422px;width:457px;height:14px;z-index:2"><hr id="Line3" style="color:#FFFFFF;background-color:#FFFFFF;border:0px;margin:0;padding:0;position:absolute;left:4px;top:435px;width:491px;height:20px;z-index:3"><hr id="Line4" style="color:#FFFFFF;background-color:#FFFFFF;border:0px;margin:0;padding:0;position:absolute;left:25px;top:93px;width:14px;height:100px;z-index:4"><hr id="Line5" style="color:#FFFFFF;background-color:#FFFFFF;border:0px;margin:0;padding:0;position:absolute;left:25px;top:183px;width:14px;height:100px;z-index:5"><hr id="Line6" style="color:#FFFFFF;background-color:#FFFFFF;border:0px;margin:0;padding:0;position:absolute;left:25px;top:262px;width:14px;height:100px;z-index:6"><hr id="Line7" style="color:#FFFFFF;background-color:#FFFFFF;border:0px;margin:0;padding:0;position:absolute;left:456px;top:257px;width:14px;height:100px;z-index:7"><hr id="Line8" style="color:#FFFFFF;background-color:#FFFFFF;border:0px;margin:0;padding:0;position:absolute;left:456px;top:178px;width:14px;height:100px;z-index:8"><hr id="Line9" style="color:#FFFFFF;background-color:#FFFFFF;border:0px;margin:0;padding:0;position:absolute;left:456px;top:88px;width:14px;height:100px;z-index:9"><div id="wb_Text1" style="margin:0;padding:0;position:absolute;left:14px;top:6px;width:461px;height:16px;text-align:left;z-index:10;"><font style="font-size:13px" color="#000000" face="Arial">Double click to edit</font></div><div id="wb_Text2" style="margin:0;padding:0;position:absolute;left:17px;top:4px;width:462px;height:56px;text-align:center;z-index:11;"><font style="font-size:48px" color="#FFFFFF" face="Arial"><b>WhiteCollarGroup</b></font></div><div id="wb_Text3" style="margin:0;padding:0;position:absolute;left:49px;top:58px;width:397px;height:16px;text-align:center;z-index:12;"><font style="font-size:13px" color="#FFFFFF" face="Arial">WCG147 - 0KaL - #M0rph - NB - #payL04D - Sub7</font></div><div id="wb_Text4" style="margin:0;padding:0;position:absolute;left:49px;top:105px;width:402px;height:304px;text-align:left;z-index:13;"><font style="font-size:13px" color="#FFFFFF" face="Arial">Hi, admin! Greatings from Brazil.<br>We hacked this website because his security is low.<br><br>A greetz to Orchid, my (0KaL) friend from Indonesia.<br><br>Do you hate us? Really? Without problems.<br>Want to contact police? Really? Without problems.<br>Want to contact us? Really? Without problems:<br>Website: www.wcgroup.host56.com<br>E-mail: whitecollar_group@hotmail.com<br> (do not send questions like "why you hacked my site?" please)<br><br>This is your uname -a:<br>Linux blurr.3v0.net 2.6.18-408.el5.lve0.8.58ent #1 SMP Wed Mar 14 15:22:14 EDT 2012 i686<br><br>Now we must be sign out. Thanks for the space for post this message, admin. You know, we love you <3 .<br>Goodbye.</font></div><hr id="Line10" style="color:#FFFFFF;background-color:#FFFFFF;border:0px;margin:0;padding:0;position:absolute;left:456px;top:329px;width:14px;height:100px;z-index:14"><hr id="Line11" style="color:#FFFFFF;background-color:#FFFFFF;border:0px;margin:0;padding:0;position:absolute;left:25px;top:334px;width:14px;height:100px;z-index:15"></div></body></html> Has anyone else had any dealings with this????
-
Hi i have been using this function to clean values before entering into my database function clean($str) { $str = @trim($str); if(get_magic_quotes_gpc()) { $str = stripslashes($str); } return mysql_real_escape_string($str);} $name = clean($_POST['name']);$password = clean($_POST['password']);$email = clean($_POST['email']);$comment = clean($_POST['comment']); Is this a good way to do it, is it secure, is it RIGHT...... Thanks in advance
-
thank you how would i remove blank lines please
-
No I know that but all 3 test lines are the same entry one field in the SQL
-
Hi all, not shore where to start with this one... SQL Table Entry `comments`This is a test line 1This is a test line 2This is a test line 3 The code echo $row['comments'] The outputThis is a test line 1 This is a test line 2 This is a test line 3 how do i display the output like its stored in the SQL RequiredThis is a test line 1This is a test line 2This is a test line 3
-
Hmmmm thanks I'll look at a different way of doing what I want
-
cool thanks for your help one last thing in my iframe i displaying photos how can i make the iframe a set size ie 600px X 600px yet the picture will fit the iframe perfect
-
ok, so a class would be a group of functions? and how would i call the functions like this <a href="<? MyFunction();?>">TEST</a>
-
oh i see, no i didnt define html or body!!!so if i set it to PX instead of % it should be ok?
-
Hi guys, ok this is the situation i have this basic menu example... <a href="upload.php" class="navbarmenu2" >UPLOAD A PHOTO<br><font size="2" color="lightgray">click here to upload<br>your photos now</font></A><a href="view.php" class="navbarmenu2" >VIEW YOUR PHOTOS<br><font size="2" color="lightgray">click here to view<br>your photos now</font></A><a href="viewm.php" class="navbarmenu2">VIEW MESSAGES<br><font size="2" color="lightgray">click here to view<br>your messages</font></A><p><a href="slide.php" class="navbarmenu2">VIEW SLIDESHOW<br><font size="2" color="lightgray">click here to view<br>a slideshow of your photos</font></A><a href="myinfo.php" class="navbarmenu2">INFORMATION<br><font size="2" color="lightgray">click here to view<br>account information</font></A><a href="zip.php?id=<?echo $_COOKIE["id"];?>" class="navbarmenu2">DOWNLOAD<br><font size="2" color="lightgray">click here to download<br>all your photos</font></A><p><a href="settings.php" class="navbarmenu2">SETTINGS<br><font size="2" color="lightgray">click here to view<br>account settings</font></A> as you can see this requires 7 other files to run is there a way to use less files or even just one file without using the $_GET or $_POST varables??maybe functions (PHP) not javascript (i REALLY cant do that YET) lol a example script would be nice if any one has time Thanks
-
Sorry for the delay yes i have <!DOCTYPE> declaration what do you mean by