-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
Technically I think one would want to use JS for this kind of thing, but you could try this: if (stripos($_SERVER['HTTP_USER_AGENT'], 'iPhone') ===false && stripos($_SERVER['HTTP_USER_AGENT'], 'Android') === false && stripos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') ===false) { // go to non-mobile page using header call header("Location: desktophome.php"); exit(); } else { // go to Mobile page instead header('Location: mobilehome.php"); exit(); |
-
PHP PDO variable not working in query but static value works
ginerjm replied to ArshSingh's topic in PHP Coding Help
Ok - a var dump of $user before the query is not what we want to see. Good luck. Can't seem to communicate with you. -
Two things - 1 - it is 'highest', not 'heighst' 2 - Why do you use proper syntax when you type $_GET['return_url'] but when you use $row[price] or $row[shipping1] you don't? By not using quotes on your indices you cause PHP to have to figure out what you mean. Use quotes on your index values to make it clear to php what you mean. Not saying this is the cause of your problem, but we can eliminate it by fixing it.
-
See - it pays to listen to what people are telling you.
-
PHP PDO variable not working in query but static value works
ginerjm replied to ArshSingh's topic in PHP Coding Help
In one of them you pass a string value; in the other I'm assuming you pass a numeric value. As for 'it returns "NULL"', that's odd. Either it should return something from the query results, or if there are no results (which I asked you to check for me) it should return an undefined value since $user_det will not be defined. So - once again - show the number of rows returned from the query to confirm that it actually runs. PS - What is this 'object' you are returning? Isn't it just an array? Why return this array instead of the array from the query? -
PHP PDO variable not working in query but static value works
ginerjm replied to ArshSingh's topic in PHP Coding Help
Did you notice the key difference in your two statements? And - you didn't answer my questions. -
What you have posted looks just fine to me. If you meet those conditions you go to google.com. What ELSE are you trying to do here?
-
PHP PDO variable not working in query but static value works
ginerjm replied to ArshSingh's topic in PHP Coding Help
Are you sure it returns a 'null' value or could it possibly be 'False'? Code looks good to me, just thinking that there is a problem with the query itself or that there are no rows returned. Echo out your get var before the call and then in your function check if there are any rows returned by the query. -
This code: <?php $include(process.php) ?> Try this: <?php include("process.php"); ?>
-
As was mentioned earlier - you need to name these files with a .php extension if you have php code in them.
-
What is the name of the long file of html you just posted? And where is the php that goes in there?
-
Change this: $query1 = "SELECT MAX(shipping1) FROM $table1 WHERE inventar='$inventor'"; $result1 = $link1->query($query1) or die ("Database Error!"); $row = mysqli_fetch_row($result1); echo $shippall."<br>"; } to: $query1 = "SELECT MAX(shipping1) as maxshipping1 FROM $table1 WHERE inventar='$inventor'"; $result1 = $link1->query($query1) or die ("Database Error!"); $row = mysqli_fetch_row($result1); echo $row['maxshipping1'] . "<br>"; } Of course, you really should rewrite this since you shouldn't be running a query inside a loop
-
View display image BLOB with PHP/ORACLE!
ginerjm replied to elyssonraphael's topic in PHP Coding Help
You have several errors here. 1 - you are sending out that header line for EVERY record you retrieve in your query. Bad. 2 - you begin your process loop by fetching an array. Then your next statement you fetch another (assoc) array. You're losing the first row 3 - where does that error message come from? I don't see it in your code. Turn on php error checking (see my sign) and see if you get any errors. Also - you echo out an img tag to display your image, so what is the following print statement supposed to do? -
And try to write better English when you post such long descriptions. It makes it easier for us to read and, uh, like, understand what you are saying. Helps when you break up your thoughts into sentences with punctuation and capital letters. Sloppy code is uh, like, forgivable in a uh, like, learning situation, but not uh like sloppy English.
-
What jazzman is pointing out is that PHP is very very case sensitive. I might add that I think your 'required' attribute on the input tag is incorrect.
-
Im new to PHP and here's what I want to do...
ginerjm replied to PHPUserNoob88's topic in Applications
Try posting in the CMS forum? -
If you want to pretend to be a programmer, you'll have to pretend to learn as well. Try it. You might like it. And no - we're not going to throw something together for you. Even if you need it ASAP..... You might also work on your English too.
-
Yes I know that div tags are for design purposes. But when all your div tags have the same class/id on them, what's the point? Especially when you are so new to this kind of thing. Who's coaching you?
-
So - besides fixing the script you already posted as I suggested, you want us to write your 'send.php' script for you? Can I ask why you have placed each of your input elements inside their own individual div tags? What's the point?
-
Your html is a bit off kilter. The method and action attributes belong on a form tag, not a div one.
-
What would be the best way to add filters on a page?
ginerjm replied to helloworld001's topic in PHP Coding Help
Great idea - that's how one would do it. Be sure you spell all your code correctly. People can make allowances for misspelled words, but PHP cannot. -
Why don't you begin by writing some code and then let us help you get it working.?
-
One of the first rules of database design and normalization is to never put the same data items in one field. Your tags are each one a separate piece of data. They are therefore equal. And because of that they should be stored separately into a separate table as separate rows. So for each combination of Id/Title/Url you should have but one record with a tag. If there are more tags with those same attributes then you need to have a separate record with each new tag. Then when you are looking for the tags for a specific combination of Id/Title/Url you run a query that pulls all the rows with those particular values. You can then loop thru those result rows and capture each of the tags. Output them as you wish.
-
Whatever specific criteria you have for selecting the desired record or records s/b used in the query's Where clause. No brainer. Using non-specific arguments (ie, using 'Like') is something you will have to consider the merits of. Obviously that kind of search is resource-consuming. If the search for specific values can limit the results to a manageable number, then perhaps using an 'if' in your results-processing loop can reduce your final results further. It all depends again on the size of your results and the size of your table (rows). As for sorting, if you can sort the results using the Order By clause, then of course you do it. Again - no brainer. Now that you have limited the # of rows returned, your code can then do whatever manipulation is left to do while you are looping thru the results and preparing your output. As an aside - I wouldn't count on users supplying you with the contents of a "long string" to be searched for in your table. Users are notorious for not making correct input. And of course you WILL sanitize the inputs your users are providing before running your query. Using prepared queries here would also be recommended. IMHO - your concern about a "big table" of 30-40 columns is not that much of one. A 'big table' is one with many, many rows, ie, thousands of them. So this entire question seems unnecessary, but it shows that you are thinking.