![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
wildteen88
-
Posts
10,480 -
Joined
-
Last visited
Never
Posts posted by wildteen88
-
-
-
You'll need to use the QSA flag (query string append) on your rewrite rules
-
You can use a loop, such as a for loop
$field_array_count = count($field_array); for($i = 1; $i < $field_array_count; $i++) { echo $field_array['field' . $i]; }
However what you doing in each option?
-
I'd just apply htmlentities once the username has been validated/verified.
-
You shouldn't be going to www.localhost.com you should be going to http://localhost/ or http://127.0.0.1/
If http://localhost/ is redirecting to http://www.localhost.com/ then add
127.0.0.1 localhost
to your hosts file (located in C:/Windows/System32/drivers/etc/)
-
If just "L_IMG" is being returned from your query then you can use constant, eg
echo constant($row['field_name_that_has_the_constant']);
-
That is not possible. You cannot hide the path to the image. The image will always be downloaded to the clients machine so you want be able prevent the user from grabbing the image.
-
Your curl script is working. The problem is that the url
http://affiliates.beso.com/product-search/content?publisherId=57085&categoryId=&keyword=paintball%20mask&showDesc=imageDescriptionText&col=4&row=4&placementid=1&minMarkdown=0&w=140&h=160
Is only returning this html code
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xml:lang="en" lang="en"> <head> <link rel="stylesheet" type="text/css" href="http://img13.beso-images.com/s2static/us/pb/6706a675/local/css/common/product_gallery.css"/> <script type="text/javascript" src="http://img13.beso-images.com/s2static/us/pb/6706a675/local/js/widget/content.js"> </script> <script type="text/javascript" src="http://img13.beso-images.com/s2static/us/pb/6706a675/local/js/widget/util.js"> </script> </head> <body onload="BesoWidget.searchForProducts();" id="iframe-body"> <form name="config"> <input id="sho.publisherId" type="hidden" value="25225"> </input> <input id="sho.apiKey" type="hidden" value="638b348a826889501ea9d18d8984ab44"> </input> <input id="sho.serverTimeout" type="hidden" value="5000"> </input> <input id="sho.serverUrl" type="hidden" value="http://catalog.bizrate.com"> </input> <input id="sz.assetid" type="hidden" value="2795"> </input> </form> </body> </html>
The list of products appears to be being listed dynamically using JavaScript.
-
if you're storing the url of the image in your database then you do not need to the following
$image_path = getimagesize($row['images']); header ('Content-Type: ' . image_type_to_mime_type($image_path[2])); echo "<p id='images'>", $image_path = getimagesize($row['images']) . "</p>";;
You'd just pass
$row['images']
to your img tagecho '<p id="images"><img src="' . $row['images'] . '" /></p>';
-
Dont place constants within quotes. Constants are not parsed within strings.
Display a constants value
echo CONSTANT_NAME_HERE;
Using a constant within a string, you'd use concatenation
echo "some text here " . CONSTANT_NAME_HERE . " more text here";
-
A good place to start would be developer.android.com. Here are a few tutorials for creating android apps.
As andriod uses Java it'll probably be a good idea getting familiar with Java.
-
-
An app for what? Desktop application, Web application, mobile phone/tablet app?
-
The code in that tutorial is what you'll need to use in order to make page links. There is no built-in function that will do this for you. The code is actually very simple. You will only need to modify a cople of lines of code to make it work with your code.
The first bit of code you need to modify is this part
// find out how many rows are in the table $sql = "SELECT COUNT(*) FROM numbers"; $result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR); $r = mysql_fetch_row($result); $numrows = $r[0];
You will only need to edit the sql query (
$sql = "SELECT COUNT(*) FROM numbers";
) so it returns the number of threads in the current forum.The next bit you edit
// get the info from the db $sql = "SELECT id, number FROM numbers LIMIT $offset, $rowsperpage"; $result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR); // while there are rows to be fetched... while ($list = mysql_fetch_assoc($result)) { // echo data echo $list['id'] . " : " . $list['number'] . "<br />"; } // end while
In the above block you can just replace the query ($sql) which your current query for getting the threads. Just add
LIMIT $offset, $rowsperpage
to the end of your query And finally replace the while loop which your loop for displaying the threads. -
To create pages from results of your queries you need to use pagination
-
Set a width/height to div#image or add some content to the div for the background image to display.
-
You'd justwrap your login form in an if statement which checks to see if the user is logged in. If they're not logged in they display the login form. If they are logged in show the "hello user" text
Example code.
<?php if($your_variable_here_to_determin_whether_the_user_is_logged_in) { // display "hello user text"; echo "Hello, $username...."; // change $username to your username variable } else { ?> your login form html here <?php } ?>
-
Just wrap <?php echo $title ?> in an anchor tag, example code
<a href="yourpage.php?id=<?php echo $id ?>"><?php echo $title ?></a>
-
You need to give is_dir the full path to the folder. You cant just give is_dir the name of the folder. Change your code to
$search_path = '/home/*******/public_html/images/'; $contents = scandir($search_path); foreach ($contents as $content) { if (is_dir ("$search_path/$content")) { echo "$search_path/$content is a directory<br>"; } else { echo "$search_path/$content is NOT a directory<br>"; }}
-
-
mysql_fetch_array expects a result resource, not the number of rows your query returns. A result resource is returnedby mysql_query. So you need to pass thee $select variable to mysql_fetch_array, not the $r variable
$select=mysql_query("SELECT * FROM search WHERE id='".$_GET['id']."'"); $r = mysql_num_rows($select); while($row= mysql_fetch_array($r)){
Change
$row= mysql_fetch_array($r)
to$row= mysql_fetch_array($select)
in hyperlink_results.phpAlso when developing your scripts you should configure PHP so error_reporting is set to E_ALL and set display_errors to on. You can do this either within your php.ini or within your scripts using
error_reporting(E_ALL); ini_set('display_errors', 1);
Enabling these two directives will display any PHP errors on screen rather than a blank screen.
-
First, mysql_query does not return an array of results but a result resource. You'll need to use a while loop with mysql_fetch_assoc to loop through the results your query returns.
$sql = "SELECT * FROM Games"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) == 0) die("No records found"); // loop through the results returned by your query while($data = mysql_fetch_assoc($res)) { $title=$data['gametitle']; ?> <div id="gametitle"> <?php echo $title ?> </div> <?php } ?>
-
Use a negative look behind
/(?<!_)src=([\'"])?(.*?)\\1/
-
is this only 1 row retrieving..infact i have more than 8 rows in the deparment dabase
Because mysql_fetch_assoc only retrieves one row at a time. You need to use a while loop to loop through the results from your query, like how the manual demonstrates for mysql_fetch_assoc
Dynamic TD Rowspan
in PHP Coding Help
Posted
Not really sure what you mean but try