-
Posts
200 -
Joined
-
Last visited
Everything posted by mostafatalebi
-
I have. It does not work means that it leaves the variables empty as they are, it does not assign them with value "required" as I have stated; something is skipped. Everything works as it should, only the variables are left empty
-
Thanks I have done this but unfortunately it does not work. I first did this: if(isset($_POST['submit'])) { if($_POST['input'] == "") { $alert['input'] = "Required"; include(HTML); // and in html in error place there is the above variable ($alert['input']) } else { Do the mysql. } } else { include(HTML); }
-
Javascript? I prefer to have the most basic functions done without any possibility of malfunctioning. If I use JS, then what happens to those users having their browser JS turned off?
-
You are right buddy, but what about server-side specific actions such as prevention from double-username registration? I definitely need some sort of PHP-HTML interation and the problem is how I can then send back data from form processor to HTML page. My friend is right about one single page which contains all the code, but what about those situations such as mine where there are two files, which however, is common.
-
Hello everybody I don't know if I have set the title of this thread truly or not, but I go on I have a HTML form page with a div for error next to each for element. divs are filled with a php code echoing an empty variable. so up to here nothing happens inside the div. but as the form is processed further into another file which is a form-processor, in case of error, how I can set a value for those variables inside the div? because all of this processes does not happen in one single page, and happens withing two pages (HTML form, form processor script), How I can send data back to HTML page where there are PHP codes inside the div and set a value such as "Required!" or "Please do not leave empty" etc. for thos variables? Is it correct to use $_SESSION? Thanks
-
User Authentication And Registration
mostafatalebi replied to mostafatalebi's topic in PHP Coding Help
I HAVE FOUND THE PROBLEM. THANKS different from what I have already said: the erro is about mysqli prepared statement syntax this my form processor: <?php $input['firstname'] = ""; $sql = new mysqli("localhost", "root", "", "sample"); mysqli_report(MYSQLI_REPORT_ALL); if(isset($_POST['submit'])) { $input['firstname'] = htmlentities($_POST['firstname'], ENT_QUOTES); if($stmt = $sql->prepare('INSERT INTO sampleData (firstname, last) VALUES (?,?))')) { $stmt->bind_param("ss", $input['firstname'],$input['firstname']); $stmt->execute(); echo "Successfully Done."; $stmt->close(); } else { echo "failed"; } } ?> AND THIS IS MY HTML FORM <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> </head> <body> <form action="inc/form_processor.php" method="post" > <input type="text" name="firstname" /> <input type="submit" name="submit" value="Send" /> </form> </body> </html> IT DOESN"T WORK. The problem is with my sql syntax -
User Authentication And Registration
mostafatalebi replied to mostafatalebi's topic in PHP Coding Help
Then What should I do? How is it common to process a registration form then? -
Hello I have made a user registration page. I have question(s). Is my workflow mentioned below true and working? I have made an HTML+CSS (in php format) page and then have left the action attribute of registration form empty. Then I have made a .php for processing the registration. I have made a conditional, that if(isset($_POST['submit'])) is true then INSERT INTO database and if false then include("htmlPage.php') But my problem is that When I click on submit button nothing happens and the pages moves toward topmost as if the submit button is attached to an anchor point.
-
Ha! Thanks alot
-
I mean I have a table, with six rows. Each row has a text in it. I want to query the table and get all six rows, putting each row's text into a variable, so at the end I have six variables or an array with six element. Something like looping through. But I don't know how
-
Hello I have a mySQL table with six rows, How can I query all of them and put them one by one in a variable or an array? thanks
-
Oh! very simple solution, thank you a a lot man...
-
How Can I make a link available only to paid users, so the users outside the site don't access the file-download simply by copy-pasting a link into their url bar?
-
I didn't get the point bro
-
Hello I am going to purchase a Download Host, and it does not support Database. I have to purchase a Regular Host next to it. The ordinary workflow is that I put the link of files (which have been upload in my Download Host) in my website. But how Can I authenticize my download links? so that a link is only valid for about 1 day and after that expires? Thanks
-
Using Php In A Javascript Function
mostafatalebi replied to mostafatalebi's topic in PHP Coding Help
Thanks, very practical information. I have a javascript function that converts English Numerals into Persian Numerals, and the number as the argument of javascript function must be retrieved from a database -
Using Php In A Javascript Function
mostafatalebi replied to mostafatalebi's topic in PHP Coding Help
Thanks -
Hello I have a javascript function that need to get the information from a database. How can I incorporate into my javascript a PHP script which gets the information from a database? Second Question: Is AJAX hard to learn?
-
Hello everybody I have been always recommended not to use tables for non-tabular data and not use it for layout purposes. For layout purposes, instead use <div> and CSS. Why? It is much more harder to control the flow of layout elements using <div> tag. For instance I have a website, that content are mainly placed in three section: left bar, center column, right bar. The two marginal bars are for links and new, and the center area is for main content. Achieving this with <div> is much more harder, it slips. For instance, I use float:right/left but it doesn't work while using three column tables I easily manage my layout. Please HELP ME
-
Thank you man...exactly
-
Hello everybody I'm designing an online translation-services site, and a question is just wandering around my head: May I make a table for each translator respectively? because I want the translator to be able to see all her/his records, payments and more... Can anybody give me a comprehensive explanation of such process?
-
Thanks. nice explanation
-
Hello everybody this is a script from a tutorial on tutsplus.com I do not know what this variable $row (red-colored) means really. Where does it belong to? thanks <?php /* * This class has all the functions to work with mysql-PHP, and all of them are designed to be * flexible with every project. */ class SQL { protected $_statement; protected $_qStatement; function __construct($host, $user, $pass, $database) { $this->_statement = new mysqli($host, $user, $pass, $database); } /** * * @param string $query It receives a set of strings as SQL statement. */ function Query($query) { $this->_qStatement = filter_var($query, FILTER_SANITIZE_STRING); $stmt = $this->Prepare(); $stmt->execute(); $result = $this->dynamicBindResult($stmt); $stmt->fetch(); } protected function Prepare() { if(!$stmt=$this->_statement->prepare($this->_qStatement)) { trigger_error("No preparation has been done. Please correct the statement or syntax-contaminated region.", E_USER_ERROR); } return $stmt; } protected function dynamicBindResult($stmt) { $paramatere = array(); $results = array(); $name = ""; $result = $stmt->result_metadata(); while($field = $result->fetch_field()) { $paramatere[] = &$row[$field->name]; } call_user_func_array(array($stmt, "bind_result"), $paramatere); while($stmt->fetch()) { $x = array(); foreach($paramatere as $keyName => $keyValue) { $x[$keyValue] = $keyName; } $results = $x; } return $results; } }
-
How Can I read the title of a word document? for instance there is a distinct pattern in the file such as: Title: whateverTitle Writer: whateverWriter Subject: wateverSubject
-
Thanks alot. but I will add questions probably here.