231 Posted Topics

Member Avatar for nonshatter

Hi all, I have a been developing an Online auction website using PHP and Mysql for the last few weeks. I have implemented everything including the 'bidding', 'buy it now' options of the auction etc. I don't know much about AJAX to be honest, but I think it is the …

Member Avatar for fxm
0
4K
Member Avatar for niths

You could use a header re-direct to reload the logout page? Not sure if this is a fool proof solution though [CODE] header ('Location: /logout.php); [/CODE]

Member Avatar for nonshatter
0
84
Member Avatar for LloydFarrell

Hey Lloyd. You're on the right track. However, from a quick glance, it looks as though your sql statement is causing you problems. This is how I would do it: [CODE] <?php $id = $_SESSION['id']; $id = addslashes($id); $sql=mysql_query("SELECT * FROM memberst WHERE id='$id'"); $result=mysql_fetch_assoc($sql); $counter = $result['counter']; if ($counter …

Member Avatar for nonshatter
0
949
Member Avatar for nonshatter

Hi all, I have just made a search bar for a site but I am having trouble trying to return the number of results that are found. E.g. I want it to print "Your search terms returned 'xx' results" after each search. This is my code: [CODE] <?php include ('db.php'); …

Member Avatar for Virtualbase
0
2K
Member Avatar for bsewell

Do you have [CODE]<?php session_start(); ?>[/CODE] at the top of your pages?

Member Avatar for Virtualbase
0
285
Member Avatar for nonshatter

Hi, I have never used table locking before. Would something like this be sufficient? Basically I want to only allow exclusive write access to the bid table: [CODE] <?php $query = "LOCK TABLES bid WRITE"; $placebid = mysql_query("INSERT INTO bid (auction_id, seller_id, bidder_id, b_timestamp, b_currentprice) VALUES ('$id', '$uid', '$ruid', NOW(), …

0
67
Member Avatar for nonshatter

Hi all, I'm need to devise a server-side method of preventing multiple form submissions. The form is submitted to the same page. I have read about generating a unique value in a session and insert a hidden input field to detect multiple submits, but would this work with a same-page …

Member Avatar for JRM
0
126
Member Avatar for MDanz

Is there an alternative way to send the words in the textarea to another page without using a form and submit button? Yes, you can use a PHP Session: Grab text from textarea and put it into a session: [CODE] <textarea name="text"> </textarea> <?php $texttosend = $_POST['text']; $_SESSION['textareatext'] = $texttosend; …

Member Avatar for vibhaJ
0
947
Member Avatar for boet

[CODE]`courier` float NOT NULL default '0',[/CODE] Needs to be: [CODE]`courier` float(4,2) NOT NULL default '0',[/CODE] Or however many digits you want each side of the decimal point. E.g. Float (2,2) is a number like 23.96 or Float(4,7) gives a number like 1234.1234567 Or it could be that you don't need …

Member Avatar for JRM
0
106
Member Avatar for nonshatter

Hi all, Is it possible to use the same javascript code in a while loop? The first record that is pulled from the database displays the javascript counter. Yet on the second iteration of the while loop (a new record pulled from the database), the javascript just seems to get …

Member Avatar for diafol
0
745
Member Avatar for nonshatter

What features does PHP/MySQL provide to deal with concurrent systems? E.g, If I have a table, and I only want to allow one user to update at any one time. I want to put a lock on the database until the update is complete, then once that request is processed, …

Member Avatar for nonshatter
0
591
Member Avatar for jhbalaji

Would you care to tell us: a) Where you got this from b) Why you want it decoded

Member Avatar for freedompeace
0
145
Member Avatar for nonshatter

Hey guys, Sorry if I am cross-posting, but I can't seem to find a solution to this problem. I have a PHP while loop that retrieves records from my database. Inside the loop, I also have a Javascript counter that I need to generate for each record I retrieve (for …

Member Avatar for almostbob
0
154
Member Avatar for tania88

Hey, You can make a database request based on what the user enters in your login form. For example, if the user enters their username to login, you could say something like: [CODE] // Get Username from login form. This could be an email address or // another type of …

Member Avatar for tania88
0
97
Member Avatar for nonshatter

Hey, I have been trying to devise a way to insert a formatted PHP date() variable ($expires) into a publicly available javascript countdown clock. Obviously, this is made difficult because PHP is server-side and Javascript is client-side. This first piece of code is me adding a number of days to …

Member Avatar for BeachyUK
0
238
Member Avatar for nonshatter

Hey guys, I am in need of a live real-time clock to count down to zero depending on the length of days specified in a database (Like an auction count-down timer). For example, I can retrieve the length of time specified in the database, somehow put that value into the …

Member Avatar for nonshatter
0
708
Member Avatar for jokomamamita

Why do you want the user to enter the user id? Shouldn't this be handled by an auto increment field in your database? This is roughly how I would validate it... [CODE] <?php function VerifyForm(&$values, &wrong) { if (strlen($values['userid']) == 0) { $wrong['userid'] = 'Enter your user id'; } return …

Member Avatar for rajarajan2017
0
231
Member Avatar for nonshatter

Hey guys, I am really close with this but can't quite get it right... All I am trying to do is retrieve the users details based on their 'u_id' and display them. [CODE] <?php require ('dbconnect.php'); $user = $_SESSION['username']; //Get the users username $requestuid = mysql_query("SELECT u_id FROM user_usr WHERE …

Member Avatar for nonshatter
0
83
Member Avatar for nonshatter

Hey, I have a combo box and want to populate it with the selected value upon page reload. For a normal text field I would usually do something like this: [CODE] <input type="text" name="title" value="<?php echo $_SESSION['sellform']['title']; ?>"> [/CODE] How could I do the same for a drop-down box? E.g: …

Member Avatar for whiteyoh
0
1K
Member Avatar for nonshatter

Hey guys, I have reached my wits end with this..! This code works on two of the servers that I have tested, but doesn't want to work on the third server that I need it on! It displays fine, but when the form data is posted back itself to be …

Member Avatar for nonshatter
0
160
Member Avatar for azegurb

Yes, this is possible through the use of sessions. Have a look here: [URL="http://php.about.com/od/advancedphp/ss/php_sessions.htm"]http://php.about.com/od/advancedphp/ss/php_sessions.htm[/URL]

Member Avatar for nonshatter
0
96
Member Avatar for nonshatter

Hey guys, I have been moving and testing my scripts on a different web server, but I am not getting the same results on both computers. Here is the code: [CODE] <?php session_start(); //THIS FUNCTION VALIDATES INPUT function VerifyForm(&$values, &$errors) { if (strlen($values['firstname']) == 0) { $errors['firstname'] = 'Please Enter …

Member Avatar for nonshatter
0
67
Member Avatar for nonshatter

Hey guys, I have a drop-down box which lists manufacturers of computer products. I want it so that when a user clicks "Other" from the drop-down box, a new input field appears below it which asks them to specify an alternative manufacturer. [CODE]<select name="cat" id="cat" onchange="setCategories();"> <option value="components">Components</option> <option value="pcs">Desktop …

Member Avatar for nonshatter
0
166
Member Avatar for nonshatter

Hi guys, Basically I'm making an auction website (kinda like eBay), and am trying to make my database 2NF compliant (and eventually 3NF compliant). Here is an outline of my tables/fields: [ATTACH]14300[/ATTACH] I know I need to split the tables up into additional tables so that data isn't repeated, but …

Member Avatar for nonshatter
0
123
Member Avatar for nonshatter

Hey I hope someone can help me here because I am pretty stumped on this one... All I'm trying to do is to update my user_usr table with the submitted form data. It was working perfectly the other day so I must have changed something somewhere. The code and the …

Member Avatar for nonshatter
0
175
Member Avatar for nonshatter

Hey guys, this is probably a really simple question for you experts so I hope you can help..! Basically I have three separate html fields for the user's date of birth: "year" "month" and "date" All I'm trying to do is to take these three from the form and insert …

Member Avatar for nonshatter
0
112
Member Avatar for nonshatter

Hi, I just have a quick/probably dumb question about this vulnerability... "OpenSSH before 5.1 sets the SO_REUSEADDR socket option when the X11UseLocalhost configuration setting is disabled, which allows local users on some platforms to hijack the X11 forwarding port via a bind to a single IP address, as demonstrated on …

Member Avatar for nonshatter
0
161
Member Avatar for nonshatter

Before I begin i'm sorry if this is a noobish question. Basically I'm trying to import a 'forum.sql' file into mysql so that I can access and manipulate it through a Java servlet. The path to the sql dump file is /home/floyd/Desktop/forum/forum.sql so i open a terminal window, cd into …

Member Avatar for mwasif
0
269
Member Avatar for nonshatter

Hey guys, basically what i'm trying to do is take each line from two text files and store them into two variables, salt and original. I then want to pass these 2 variables to a different method called: crypt(String salt, String original) How would I go about doing this? Many …

Member Avatar for ~s.o.s~
0
113
Member Avatar for nonshatter

Hey, can anyone tell me what's wrong with this method? I keep getting <identifier> expected error on line 1. [CODE]public static void FaultHandler (DatagramSocket aSocket, InetAddress aHost, int proxyPort, byte[] requestArray, rec_bytes) { int faultCount = 0; while ( faultCount < 4 ) { DatagramPacket request = new DatagramPacket(requestArray, requestArray.length, …

Member Avatar for nonshatter
0
87
Member Avatar for nonshatter

Can anyone shed some light on these errors? [CODE] public void FaultHandler () { int faultCount = 0; while ( faultCount < 4 ) { DatagramPacket request = new DatagramPacket(requestArray, requestArray.length, aHost, proxyPort); aSocket.send(request); try { aSocket.setSoTimeout(4000); aSocket.receive(reply); } catch ( SocketTimeoutException e ) { faultCount++; continue; } catch ( …

Member Avatar for Cronless
0
212

The End.