-
Posts
1,041 -
Joined
-
Last visited
-
Days Won
17
Everything posted by gw1500se
-
Pull Page Content's Styling onto Category Template
gw1500se replied to nvrsmr's topic in PHP Coding Help
I suggest that you learn to program before trying to take on this project. This is a help forum not a free coding forum. Without understanding the basics you are doomed to failure. Perhaps you would be better off asking for help on the job offerings forum. -
Now what does your MySQL query look like and is it returning what you expect?
-
Cookies do not have "descriptions." They have keys and values and keys with spaces are a bad idea. So what does $_COOKIE contain after you set it and where you are trying to verify it.
-
Pull Page Content's Styling onto Category Template
gw1500se replied to nvrsmr's topic in PHP Coding Help
Perhaps you are not getting a response because it is unclear what your terminology means. When you say the formatting and styling is not being pulled, yet the content is, makes no sense, at least to me. Are you saying you CSS is not being pulled? Did you echo $page and $content to make sure it is what you expect? Do they contain valid CSS data and the proper tags? Is error reporting turned on? -
Add that code in various places in your code. That is how you debug this stuff. Put the code in various places where you think your logic is flowing. You can then see where it disappears or is not being set.
-
What do you mean "blank" file? I suggest you look at the cookie array at the beginning of your code as necessary so you can see what is being set and when: echo "<pre>"; print_r($_COOKIE); echo "</pre>";
-
Not necessarily just tags. Any HTML including white space.
-
When using it from a template does the 'setcookie' get executed before any HTML output?
-
Looks like you need to upgrade to version 8.
-
I mean for you to enter that on the command line of the machine running the MySQL server.
-
What version of mysql or mariaDB are you using? mysql -V
-
Those lines getting the error (which you did not post) contain spaces in the filename. Depending on how they are used, you need to use %20 instead if the spaces. You probably want to use urlencode on the path string.
-
1. please use the code icon (<>) and specify PHP. It makes your code much easier to read. 2. learn to indent your code. 3. what is up with ?> and <?php and no intervening HTML? It makes it very difficult to see where your code blocks end. Your code should look more like this: for($i=0;$i<6;$i++) { $title = ($_POST['hidden_name'.$i]); $price = ($_POST['hidden_price' . $i]); $quantity = ($_POST['quantity' . $i]); if($quantity>0){ $shortStr= substr($price,1,-1); $flatVal=(float)$shortStr; $flatVal=$flatVal*$quantity; $totalItem=$flatVal*$quantity; $total+=$flatVal; } } I didn't include everything in the loop and if blocks as it is too difficult to follow but you should get the idea.
-
The warning has nothing to do with your IDE. The problem is the version of PHP and version of mysqlnd. Run the following code to get the version of PHP and the version of mysqlnd. <?php phpinfo(); ?> You probably need to update one or the other. You also do not say which is line 15 and you are not use the code icon which makes your code easier to read.
-
Don't make people go to a 3rd party web site. Post your code here using the code icon (<>) and specify PHP.
-
1. When posting PHP code use the code icon (<>) and specify PHP. Similarly do the same for HTML. 2. Never, ever use web data directly in queries. Use prepared statements to prevent injection attacks. 3. Don't use * in SELECT statements. List only those columns that you actually are going to use. 4. During development turn on all error reporting. error_reporting(E_ALL); Did you echo $_POST['search'] to make sure it contains what you expect? Did you check they httpd log to see if there are any errors there?
-
Adapt the standard compound interest formula: A=P(1+r/n)^(nt) Where: A= amount P=principle r= interest rate n= number of compoundings per year t= number of time periods For continuous compounding use: A=Pe^(rt) Where: t=time in years (can be a fraction) e= mathematical constant (2.71828)
-
Php code to get metadata from folder having mp3 files
gw1500se replied to sapnawat's topic in PHP Coding Help
OK, use that. -
Php code to get metadata from folder having mp3 files
gw1500se replied to sapnawat's topic in PHP Coding Help
I don't know where that directory is, you do. I only know the path you had originally did not make sense so I made a suggestion. You have to provide the correct path. -
Php code to get metadata from folder having mp3 files
gw1500se replied to sapnawat's topic in PHP Coding Help
The message is clear. The path is wrong. You probably want: $directory = "C:\Users\%username%\Desktop\Rajesh song"; -
Problems displaying all records after updating a record
gw1500se replied to raymon's topic in PHP Coding Help
Using '.name' is definitely wrong as it looks like 'name' is the column you want. I suspect that is because of a misplaced quote which are unnecessary anyway. You also should not be using 'SELECT *'. List only those those columns you actually need. Your first query is dangerous. You need to use prepared statements. Never use web page data directly into a query as you are at risk of injection attacks. Finally the ';' is not really needed but that is a minor point. $result = $mysqli->query("SELECT studentid,name,pacomment FROM data WHERE classroom = $classroom ORDER BY name") or die($mysqli->error); -
Problems displaying all records after updating a record
gw1500se replied to raymon's topic in PHP Coding Help
Order by 'name' or order by '.name'? -
How to print out multiple rows from database
gw1500se replied to Andreycon's topic in PHP Coding Help
You don't need the 'while'. Do the 'fetchall' once then run your 'for' loop. Anyway, I agree with Barand, PDO is a better choice. -
How to print out multiple rows from database
gw1500se replied to Andreycon's topic in PHP Coding Help
Add: AND name='Stone Cold' to your WHERE clause in the query. Assuming 'name' is that column name. -
I think fetch returns false only on failure. A query can be successful but return no rows. You might want to check to that condition.