Everything posted by tomyates
-
Where to find clients : websites with inquiries
Get yourself a profile on http://www.theconsultantnetwork.com
-
Shorten a URL using PHP
I think you need to clarify your question. Do you own mywebsite.com or is it hosted elsewhere and you have a new domain which you would like to point at this 3rd party site? Cheers T
-
How to use session variables in php across sites, have them store for remembering from user input, and with input validation
Ah okay so as along as your using them on the same site then thats fine I would have an include file which will go at the very top of every page you would like to use / edit the sessions e.g sessions.php ------------------ <?php session_start(); $name = ''; $email= ''; if(isset($_SESSION['name'])){ $name = $_SESSION['name']; } if(isset($_SESSION['name'])){ $email = $_SESSION['email']; } ?> So you can easily output $name and $email wherever you wish and it will be carried from page to page. So on form submission you would put the following code <?php if($_POST['submitted']){ $_SESSION['name'] = $_POST['name']; $_SESSION['email'] = $_POST['email']; } ?> <form action="" method="post"> <input type="hidden" name="submitted" value="1" /> <input type="text" name="name" /> <input type="text" name="email" /> <input type="submit" value="Update" /> </form> Hope this helps T
-
database and search forms?
By the sound of your question Im guessing you have no expericne with programming and databases e.g PHP & MYSQL In which case the first step is to get to grips with those - otherwise youll need to find yourself a web developer who could do this for you. Hit me up if you need some help Cheers T
-
How to use session variables in php across sites, have them store for remembering from user input, and with input validation
Are you looking to access session variables accross multiple domains? This is not possible, sessions are bound to its parent domain otherwise this would cause secruity flaws
-
Update MYSQL Database with a PHP/HTML Form
So if($_POST['update']){ $sql = "UPDATE `customers` SET `name` = '$escaped_name', `phone` = '$escaped_phone', ???? ???? ??? ??? WHERE `customer_id` = '$editid' "; Hope this is what you where after? T }
-
Database advise
Okay great! Theres no need to set up any relationship settings / foreign keys etc, just using LEFT JOINS like you have is perfectly fine! But INDEX's on important column which you search on to keep things quick. e.g on your orders page im guessing you will have order_id (which will be primary key), and customer_id to link the order to a customer. Because you will be using that field in your queries to find all orders from a particular customer etc, make sure that field has an INDEX. Hope this helps Cheers T
-
Warning: Cannot modify header information PHP Warning(Heres How to fix)
MYSQL error before header location, similar to `HTML outputted before header function, but sometimes overlooked.
- Javascript Code Injection
-
jQuery update with checkbox to update db doesnt work
First things first, Get FireBug installed on firefox and watch the AJAX call to check the response (you might get an error to debug that way) Second, do youself a favour use PDO or wrap those $_POST variblaes with mysql_real_escape_string() before using them in your queries, someone could SQL Inject the living crap out of that. T
-
PhP Security
Use PDO for your DB Queries with PHP Get yourself an SSL certificate Encrypt the social security number MAKE SURE YOUR SERVER IS SECURE T
-
PHP - Shopping cart probs :(
It looks very over complicated to me I would suggest just storing a product ID and qty in session So on each $_POST submission you would do this if($_POST['item_id']){ session_start() $itm_id = $_POST['item_id']; $qty = $_POST['qty']; $_SESSION['cart']['items'][$itm_id]+=$qty; } Then use MYSQL to query the DB against the ID's in the cart to show the Items. Drop me a PM if your struggling T
-
Database advise
Hi Mate First off, what language (PHP, ASP?) are you coding in, and what database server (MSSQL, MYSQL?) T
-
Need Help with Simple Login Page with One Username and Password
Hi Buddy For that you just need to learn $_POST variables and If statements 1) Set up a form on your HTML page target="nameofphpfile.php" method="post" 2) Inside "nameofphpfile.php" have the following $actual_user = 'tom'; $actual_password = 'tomspass'; $entered_username = $_POST['username']; $entered_password = $_POST['password']; 3) Then we check that the POST variables match the user and pass we set so we would put if($entered_username == $actual_user && $entered_password == $actual_password){ // User has now logged in } The concept is here, but its very very basic at the minute. if your wanting to create a login section which keeps the user logged into the website whilst they're browsing etc, you need to learn sessions and mysql; Anyway if you want any help drop me a PM, im happy to help T