wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
use strtotime thedarkwinter its compatible for PHP3, 4 and 5
-
The sql file should still work. Strange why your host has downgraded mysql to 4.0.27
-
The included files become part of the file including them. So if you included header.php from the includes folder into links.php which is in the website folder then all paths from header.php go from the website folder and not the lincludes folder.
-
Its a bug with the overflow I think, if you add two lines it should add a scroll bar. Which i did for you.
-
WHy dont you use PHP to send the email? PHP can send emails. So why not create a link which send the user to your contact page if you ahve one. Also the problem is you need to escape your double quotes in the string. Like you dont with this: [code]<font color=\"white\">We are sorry but the d...[/code]
-
Umm looks like you're using mod_rewrite. Could you post the the urls in their raw state you should be able to get these by looking in the htaccess file that does the mod_rewrite.
-
[quote author=animedls link=topic=109704.msg443099#msg443099 date=1159454831] i think i unedrstand but i tkae it , i would have tochaneg all my urls/links on the site to the format "?page=blahblah" I only include this code on the index page right ? [/quote] No. Just chnage [b]page[/b] in the $_GET var to the name of the variable that holds the page that is being reguested. What is the format of the urls?
-
You can change the whole of the following: [code]$firstname = mysql_escape_string(strip_tags($_POST['firstname'])); $lastname = mysql_escape_string(strip_tags($_POST['lastname'])); $email = mysql_escape_string(strip_tags($_POST['email'])); $phonenumber = mysql_escape_string(strip_tags($_POST['phonenumber'])); $homeaddress = mysql_escape_string(strip_tags($_POST['homeaddress'])); $citystate = mysql_escape_string(strip_tags($_POST['citystate'])); $country = mysql_escape_string(strip_tags($_POST['country'])); $domainname = mysql_escape_string(strip_tags($_POST['domainname'])); $username = mysql_escape_string(strip_tags($_POST['username'])); $password1 = mysql_escape_string(strip_tags($_POST['password1'])); $password2 = mysql_escape_string(strip_tags($_POST['password2'])); $rules = mysql_escape_string(strip_tags($_POST['rules'])); $legalinfo = mysql_escape_string(strip_tags($_POST['legalinfo'])); $age = mysql_escape_string(strip_tags($_POST['age'])); $sitedetails = mysql_escape_string(strip_tags($_POST['sitedetails'])); $aboutus = mysql_escape_string(strip_tags($_POST['aboutus'])); [/code] Into just the following few lines: [code=php:0]foreach($_POST as $field => $value) { if(isset($_POST[$field]) && !empty($_POST[$field])) { ${$field} = mysql_real_escape_string(strip_tags($value)); } }[/code]
-
By live example you mena something like this: [code]<?php // check that page is set and that its not empty, if it is set and not empty we'll use the page variable // else we'll set it to a efualt value which is home $page = isset($_GET['page']) && !empty($_GET['page']) ? $_GET['page'] : 'home'; switch($page) { case 'home': $title = "Welcome"; $content = 'Welcome home dude!'; break; case 'about': $title = "About us"; $content = 'so you wanno know stuff about me!'; break; case 'products': $title = 'My products'; $content = 'Hey the following are my products'; break; default: $title = '404 Error'; $content = "Sorry the page '<i>" . $page . "</i>' you reguested was not found. Please try again"; break; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php echo $title; ?></title> </head> <body> <h1><?php echo $title; ?></h1> <p><?php echo $content; ?></p> <p> <hr /> Pages: <a href="?page=home">Home</a> | <a href="?page=about">About Us</a> | <a href="?page=products">Products</a> | <a href="?page=duffPage">A duff page</a> </p> </body> </html>[/code]
-
Trying to move html code through the url and catch it with $_GET
wildteen88 replied to Trevors's topic in PHP Coding Help
To starta session add the follow at the very top of every page, prefereably on line 1, that will use sessionss: [code=php:0]<?php session_start(); ?>[/code] Now to set/read a session: [code=php:0]// set a session var: $_SESSION['session_var_name_here'] = 'some value'; //read session var: echo $_SESSION['session_var_name_here'];[/code] So with your problem you'll wnat to do this: [code=php:0]// dont for get to start the session $_SESSION['htmlStuff'] = <<<HTML add your html code here HTML;[/code] Tnen on the page you wnat to use the html you can access it using $_SESSION['htmlStuff'] variable, agian dont forget to added session_start(); at the top of the page. Also make sure THERE IS NO OUTPUT before you use the session_start function. Otherwise your page may fail to load or you'll get a header already sent error message. -
Prehaps [url=http://www.firepages.com.au/php_usb.htm]this si[/url] what you're after?
-
You should do something like this: [code=php:0]$album = (isset($_GET['album']) && !empty($_GET['album']) ? $_GET['album'] : 'main');[/code]
-
There will be major changes to php6 a few settings/features willl be going. Such as register galobals, safe mode, magic quotes and more. There was a page linked on the php.net site to what they be removing from PHP for version 6. I'll see if I can digg it up. This it [url=http://php6dev.blogspot.com/#cleanup-of-functionality]here[/url]. You can readup on whats being removed/added to php6.
-
This is not possible. PHP doesnt know when the client closes the browser/leaves your site. You might be able to trigger a php script using Ajax when the user closes/leaves.
-
Hi welcome to phpfreaks.com I would recommend you to read up on the [url=http://php.net/switch]switch statement[/url] if you dont understand the code. it is basically an if/elseif statement. But this is what the code is doing. It is grabing a [b]url variable[/b] called [b]page[/b] (example url: mysite.com/index.php?page=home) you can access this variable by using [b]$_GET['page'][/b]. Now it creates a variable called [b]title[/b] ($title) based on the value of the page variable ($_GET['page']). So if page is set to home, it'll trigger the first case in the switch, which is home and set the title variable to hold the string [b]Welcome[/b]. If its not home it'll check to see if page is set to about. If its it'll set the title variable to hold the string [b]About Us[/b]. Now on this line it echos out the titile variable: [code]<title><?php echo $title; ?></title>[/code] Hope that helps. The manual shoudl be able to clear up on how the swtich statement actually works.
-
Setup of PHP, MYSQL and Apache on windows
wildteen88 replied to lucerias's topic in PHP Installation and Configuration
Have a go through [url=http://www.expertsrt.com/tutorials/Matt/install-apache.html]this tutorial[/url] Note: make sure you have downloaded the zipped binaries package for php and not the php installer. -
Button onClick/onSubmit the button's value will change.
wildteen88 replied to marknt's topic in Javascript Help
You'll need to add the following into your submit button tag: [code]onclick="this.value = 'Logging In...'"[/code] Eg: [code]<input type="submit" name="login_btn" value="Login" onclick="this.value = 'Logging In...'" />[/code] -
Add this to your stylesheet: [code]a img { border: none; }[/code] Should remove the border from any image within an anchor tag ([nobbc]<a></a>[/nobbc])
-
According to the manual you can get this file from the MS SQL Server CD.
-
Have a read of this [url=http://www.phpfreaks.com/forums/index.php/topic,95378.0.html]FAQ[/url]. NOTE: That FAQ is for the mysql extension. However you can still follow it to enable the mssql extension. The mssql extension is called php_mssql.dll. Also you need to copy a file called ntwdblib.dll from MS SQL to the php installation folder, or the Windows follder (WINNT or WINNT/SYSTEM32). Have a read of [url=http://uk.php.net/manual/en/ref.mssql.php]this page[/url] for more info.
-
displaying data from my sql
wildteen88 replied to edkuan's topic in Editor Help (PhpStorm, VS Code, etc)
Thats a bit of a long winded way of doing it. You can use the [url=http://uk.php.net/manual/en/function.str-repeat.php]str_repeat[/url] function. Example: [code=php:0]$rating = str_repeat("*", $row['dinner_rating']); echo $rating;[/code] -
You dont need to unistall it either! Just copy the httpd.conf.default to httpd.conf and boom you have a new httpd.conf file! Also I think theres a command you can use to regenerate the httpd.conf file too.
-
Dreamweaver: Wount connect to my database!?
wildteen88 replied to AbydosGater's topic in Editor Help (PhpStorm, VS Code, etc)
Looks like your mysql account for the database isnt setup properly. As I failed to connect to your MySQL server with the details provided: [code=php:0]echo "Connecting to MySQL...<br /><br />"; mysql_connect('abydosgaters.com', 'stargate_test', 'testing') or die(mysql_error()); echo "connected to MySQL server<br /><br />"; echo "Selecting database...<br /><br />"; mysql_select_db('stargate_test') or die(mysql_error()); echo "Selected database";[/code] -
If you dont understand a function/keyword in PHP or whatever is in the code. Imediatly go to php.net. You'll leave the site know how to use the function/keyword and when to use it etc. php.nts documentation is on of the best you'll ever come across.
-
[code]Chnage this: [coce]$result = mysql_query("INSERT INTO classes (dayname, day, month, year, title, description, cost, location, contact) VALUES ('$dayname', '$day', '$month', '$year', '$title', '$description', '$cost', '$location', '$contact')"); if (!mysql_query($SQL,$con)) { die('Error: ' . mysql_error()); }[/code] to this: [code]$sql = "INSERT INTO classes (dayname, day, month, year, title, description, cost, location, contact) VALUES ('$dayname', '$day', '$month', '$year', '$title', '$description', '$cost', '$location', '$contact')"; mysql_query($sql, $con) or die('Error: ' . mysql_error());[/code] DOnt just lift the code of the net. Learn and understand the code first before using it. Also code your scripts yourself. Dont do any of the copy 'n' paste malarky you dont learn as much. Just learning how to efficiently copy 'n' paste stuff.