wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
If you want to change the background color of the div then use the :hover persuado-class. like so: [code]changeme:hover { color: #000000; }[/code] [b]NOTE:[/b] This will not work in IE(6), How it will if you use javascript.
-
You can use preg_raplace like so: [code]<?php $string = "This \"string\" has; : got some 'unsafe' chars!"; $string2 = preg_replace("([;:\"'])", "", $string); echo $string2; ?>[/code] Or you can use str_replace like so: [code]<?php $string = "This \"string\" has; : got some 'unsafe' chars!"; $string2 = str_replace(array(";", ":", "\"", "'"), "", $string); echo $string2; ?>[/code]
-
To do what you want to do it doesnt require any PHP coding at all. All you need to do is create a smple javascript function which you call it with the [b]onClick[/b] attribute when some one clicks a link/image/button or what ever which hides your menu. have a loot at [a href=\"http://www.phpfreaks.com/forums/index.php?s=&showtopic=90723&view=findpost&p=363935\" target=\"_blank\"]my post here[/a] to see what the javascript code looks like, just 5 lines of code!
-
Change your function to the following: [code]function newsPost($post) { $post = nl2br(htmlspecialchars($post)); //convert two spaces into " " this will force the browser to not ignore the spaces $post = str_replace(" ", " ", $post); return $post; }[/code]
-
You will want to give secound1.php frame a name. Then with your link use the [b]target[/b] atrribute like so: [b]target="secound1FrameNameHere"[/b] When you click the link the browser will goto the secound1.php frame rather than the whole page.
-
If you are creating a PHP script which can weave its way into forum that can ban users without you being a moderator or admin then this is classed as hacking. If you are requesting someone to create a script that can hack into a forum and ban a certain person then think again becauase this communitly will not help you. Thread closed.
-
You might want to look into [a href=\"http://uk.php.net/manual/en/function.fsockopen.php\" target=\"_blank\"]fsockopen[/a] instead. With fsockopen you can set when it timesout.
-
For what you want to do is not possible with PHP alone. If you are using an Apache webserver then you might want to look into mod_rewrite as this is how you can transform your url into www.centraldirectory.net/category_name/
-
PHP doesnt have a global variable called $VAR. $VAR is set in your script somewhere which might holds a users name in $VAR[4] and then sets a cookie which stores the username of the user. In order to understand where $VAR[4] is set or how it is being created I (or we) cant really tell you how $VAR is set or what it is doing. You wont be able to find $VAR anywhere at php.net as its not a predifined (global) variable.
-
*SOLVED* $r = my_query("select hold from users where hold='y'");
wildteen88 replied to StirCrazy's topic in PHP Coding Help
Do this: [code]$sql = "SELECT * FROM users"; $query = mysql_query($sql) or die("MySQL Error: " . $query . " : " . mysql_error()); $user = mysql_fetch_array($query); if($user['hold'] == "Y") { header("Location: banned.php"); } //continue login process or what ever here as user is not banned. [/code] -
Oh, in that case do this: [code]$profile[$key]["image"] = "<img src=\"path/to/image/here.gif\" alt=\"No Photo Available\" />";[/code]
-
PHP is a (web) programming langauge. It allows you to build complex web applications such as forums, blogging sites etc. PHP is not like HTML where you can get a site up and running in less than 5 minutes. If you want to create a PHP enabled websitwe you still need to use HTML to make the overal layout of your site and CSS to apply styles to your site. If you want a site that is powered by PHP (and MySQL) then you will need to site down and learn PHP (and MySQL) as PHP is a programming lanaguage it'll take a lot longer to learn it. Finding tutorials on PHP isn't a problem as it such a popular programming language for websites. As someone has pointed out above read through the PHP tutorials over at w3schools.com and if you want a database backend too then you'll want to learn abit about SQL. Another good site to learn PHP and MySQL would be [a href=\"http://www.php-mysql-tutorial.com/\" target=\"_blank\"]php-mysql-tutorial.com[/a]. This site steps you through the basics of PHP and MySQL and then moves on to creating small web applications such as a Guestbook, User Authentication and also steps you through how to create bigger applications too like a Content Management System. But the fun dont stop there. There are plenty of books on PHP and MySQL that teachs you more advanced web applications and programming methods such as OOP etc. However you should always bookmark [a href=\"http://www.php.net\" target=\"_blank\"]http://www.php.net[/a] as this is the first place you should always go to learn how to use a certain PHP function and other PHP releated stuff too.
-
If you want an image to display tnen placed the path of the image in side the " marks like so: [code]$profile[$key]["image"] = "path/to/image/here.gif";[/code]
-
Gettin The Following Session Cookie Error ...why?
wildteen88 replied to cnagra's topic in PHP Coding Help
The actuall error is comming from checklogin.php on line [b]1[/b] (this is where the output has started) and the error is being triggered on line [b]34[/b] in checklogin.php. What is on line 1 in checklogin.php? -
Change this: [code]<?php $url1 = $row_bprofile['broker_url']; if($url1 = "not null") { echo 'homepage:<a href="<?php echo $row_bprofile['broker_url']; ?>" target="_blank"> click here</a>'; } else {echo;} ?>[/code]to [code]<?php $url1 = $row_bprofile['broker_url']; if($url1 != "" && strlen($url) >= 6) { echo "homepage: <a href=\"" . $row_bprofile['broker_url'] . "\" target=\"_blank\">click here</a>"; } ?>[/code]
-
[!--quoteo(post=367176:date=Apr 21 2006, 02:15 PM:name=Endrew)--][div class=\'quotetop\']QUOTE(Endrew @ Apr 21 2006, 02:15 PM) [snapback]367176[/snapback][/div][div class=\'quotemain\'][!--quotec--] 1. Is there any php function that checks variable existence? 2. Is there any php function that refreshes page? Thnx [/quote] Yes PHP has a function whether a variable exists or not this function is called [b]isset[/b]. For your secound question PHP can refresh the page with the header function ie: [code]header("Refresh: 5; URL=http://www.google.com");[/code] With the above code your page will refresh after 5 secounds and then it'll take you to google. Just change the number 5 to amount in secounds you wish your page to refresh and change [a href=\"http://www.google.com\" target=\"_blank\"]http://www.google.com[/a] to the site or file you wish your user to be redirected to.
-
mypage.php?X=Y not included in PHP_SELF??
wildteen88 replied to Mattyspatty's topic in PHP Coding Help
Do something like this: [code]$_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'][/code] $_SERVER['QUERY_STRING'] gets everthing after the ? in the url. -
In the following code your cookie wont be set as your are outputting html to the browser and so PHP cannot set the cookie. You cannot sent anytrhing to the browser before the use of setcookie.[code]<html> <title>Set ship cookie</title> <body> <?php include "dbinfo.inc.php"; if (isset($_POST['submit'])){ $objid = $_POST['objid']; setcookie( 'objid', $objid, time()+60*60*24*30, '/', '*edited*'); echo "<br>$objid"; }else{ echo "The post didn't come through"; } ?> </body> </html>[/code]
-
change "" to [b]"block"[/b] instead.
-
Evertime you uses session_start() you have to call your session variables out. You can just call the ones you want to be used. You dont have to inititate the variables either. If you want to check to see if certain session variables are set on each page request you could create a file called session.php which checks whether certain session varables are set then just include that file.
-
What redbullmarky meant was instead of looping through your results in a for loop just use a while loop. [code]while($row = mysql_fetch_assoc($results)) { echo '<table><tr><td width="137" valign="top">SAMPLE ROW DAta</td> <td width="425">SAMPLE ROW DAta</td></tr></table>'; }[/code]
-
safe mode a problem with permissions on file upload form
wildteen88 replied to bmbc's topic in PHP Coding Help
You will not be able to get around safe mode unless you have access to the main php.ini file. It is down to your webhost to have safe_mode turned ofd or not. safe_mode will block certain processes and so you cannot upload any files greater than 1Mb. If you want to be able to upload bigger files then you'll want to look into dedicated servers where you own a whole server just for your site and and get to control hopw PHP operatres however dedicated hosting can be expensive. -
If you want to get the submitted data from the form then you'll do this: [code]<?php $name = $_POST['YourName']; $rname = $_POST['RealName']; echo "HI you're name is " . $name . ", your real name is: " . $rname; ?>[/code]
-
The way the link changes to a text box is made by the Javascript DOM, but AJAX is involved to do the edting of the text so the changes get saved to the database.
-
It works fine for me. Whats the problem? If I selected 2 from the menu na orange square appears in the brown box and if I select 1 a red box apears in the brown box.