Hi James,
I think your second listing should actually be coded:-
$listing = [
'one' => $x,
'two' => $y,
'three' => $z
];
Hi James,
I think your second listing should actually be coded:-
$listing = [
'one' => $x,
'two' => $y,
'three' => $z
];
Hi James,
$response[] = will create (if it doesn't exist) or append the right-hand value to the $response array. So if $html->data->identifier is a simple string, e.g. 'Price', then a new array would be ['Price'] or array(0=>'Price')
$order->get_items() appears to be a nested object not an array. I've created a copy and iterated through it below.
$obj = (object) array(365 => (object) array('name'=>'steel wool 3', 'qty' => 1) );
//print_r($obj);
foreach($obj as $key => $obj2) {
foreach($obj2 as $key => $value) {
echo $value.'<br>';
}
}
Hi,
Sorry for the delay in replying. Can you describe in a non-technical way what it is that you are wanting to achieve?
This type of id?
<img id="457" src="image.png">
What is part ? is it a string of html or a numeric ?
I've created a small piece of code based on yours, but without the frills, for you to review.
Hi,
.val() is for form values. you need to use .text()
<img src="" id="pics">
<script>
var m=new Date();
var imageArray = [
"Holiday/HolidayDesktops/Newyear.jpg",
"Holiday/HolidayDesktops/Vday.jpg",
"Holiday/HolidayDesktops/St.Patday.jpg",
"Holiday/HolidayDesktops/Easter.jpg",
"Holiday/HolidayDesktops/MemorialDay.jpg",
"Holiday/HolidayDesktops/NatFlagDay.jpg",
"Holiday/HolidayDesktops/July4.jpg",
"Holiday/HolidayDesktops/WomensEqualityDay.jpg",
"Holiday/HolidayDesktops/LaborDay.jpg",
"Holiday/HolidayDesktops/Halloween.jpg",
"Holiday/HolidayDesktops/Thanksgiving.jpg",
"Holiday/HolidayDesktops/Christmas.jpg",
];
document.getElementById("pics").src=imageArray[m.getMonth()];
</script>
What is it's purpose in refreshing every 10 seconds?
Do you record the amount of times it's reloaded?
oops, should have asked did you want 2,3,4 or 2,2,3,3,4 ?
(prompted by pritaeas's code).
2,3,4 or 2,2,3,4 ?
That's what the bottom link is for ;-)
To get you started...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Test</title>
</head>
<body>
<form id="js-tracker-form" name="tracker" action="/tracker" method="POST">
<p><input type="checkbox" name="check1" value="1"> <input type="text" name="check1date" value=""></p>
<p><input type="checkbox" name="check2" value="1"> <input type="text" name="check2date" value=""></p>
<p><input type="checkbox" name="check3" value="1"> <input type="text" name="check3date" value=""></p>
<p><input type="submit" name="submit" value="Submit"></p>
</form>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
var today = new Date();
$("#js-tracker-form").on("click","input[type=checkbox]",function(){
if($(this).prop("checked")) {
//the actual checking of the element beats this event handler
$(this).next().val(today.toDateString());
} else {
$(this).next().val('');
}
});
</script>
</body>
</html>
I use jQuery (a JavaScript library). Can you provide the FORM code ?
This is done using JavaScript not PHP. It is "client-side" scripting/programming.
I've not tested this but I don't think you need to iterate your selectors to add the keyup event handler. You should be able to use the following code:-
$(".txtt").keyup(function() {
calculateSum();
});
There are so many ways to play with this. I've used an array to complement the table structure and seeded the array with either text (to display) or 1 (which currently displays a hyphen and if not set increment a counter.
<?php
$rows = 14;
$columns = 5;
$ins = array(
0 => array(
0 => 'Driver\'s Seat',
1 => 1,
2 => 1,
3 => 1,
4 => 1
)
);
for($i = 1; $i<13; $i++) {
$ins[$i][2] = 1;
}
$count = 1;
?>
<table border>
<?php for($row = 0; $row<$rows; $row++): ?>
<tr>
<?php for($col = 0; $col<$columns; $col++): ?>
<td>
<?php
if(array_key_exists($row,$ins) AND array_key_exists($col,$ins[$row])) {
if(is_numeric($ins[$row][$col])) {
echo '-';
} else {
echo $ins[$row][$col];
}
} else {
echo $count;
$count++;
}
?>
</td>
<?php endfor; ?>
</tr>
<?php endfor; ?>
</table>
You can add css etc. yourself (you may need to move the TD inside the php block to add appropriate classes).
//simulate posted field
$_POST['formfield']='Is #star contained in your #database of #hashtags?';
preg_match_all('/#\w+/',$_POST['formfield'],$matches);
if($matches[0]) {
foreach($matches[0] as $hashtag) {
$sql = "select hashtag from `hashtag-table` where hashtag = '".substr($hashtag,1)."'";
$result = mysql_query($sql);
echo mysql_num_rows($result) ? $hashtag.' found<br>' : $hashtag.' not found<br>';
}
}
Sorry everyone it's mysql - been using CI query builder recently so haven't gotten around to the mysqli syntax, or even PDO.
and are the hashtags in your database in a single column?
e.g. hashtags varchar(200) NOT NULL
so the sql would be something like:-
select count(hashtag) from hashtags where hashtag = $thisHashTag
Is there more than one field in the form?
You could write a function for your value testing:-
<?
function selected($expr)
{
return $expr ? ' selected="selected"' : '';
}
?>
<label>Time Zone:</label><select name="timezone">
<?
$timezns = timezone_identifiers_list();
foreach ($timezns as $timezn) {
echo '<option value="'.$timezn.'"'.selected($timezn == $row['timezn']).'>'.$timezn.'</option>';
}
?>
</select>
How do you know which is my timezone?
Hi Sabarinadh,
Did you copy and paste?
Is the error pointing to the line which I supplied?
I have tested it here and all is well.
echo '<li><a style="text-decoration :none" href="playerslist.php?id='.$rows['id'].'">'.substr($rows['name'],0,50).'</a></li>';
$(document).ready(function() {
clearTextBox();
});
function clearTextBox()
{
$('#txtName').val = "";
$('#txtContactEmail').val = "";
$('#txtMessage').val = "";
}
$('#btnReset').on("click",function() {
clearTextBox();
})
..and is your script running off www.url.ro/underpublic/searchforprice.php ?
Sorry for repeating your reply EvolutionFallen. Fingers working faster than brain/eyes. ;-)
I haven't checked your code, but there's no need to use $location
if (in_array($search_zip, $loc1)) {
header("Location: http://dr.gorillaadvertising.net/no-service-in-your-area/"); die;
} else {
header("Location: http://dr.gorillaadvertising.net/order-dry-cleaning/"); die;
}
More explicitly www.yourwebsite.com/underpublic/searchforprice.php
What happens if you take the crossDomain: true
line out?
Try something like:-
#footer {
font: italic normal 12pt Cambria;
background: transparent;
text-shadow: 1px 1px #fff;
color: #535353;
position: fixed;
bottom: 0;
left: 0;
height: 40px;
width: 100%;
z-index: 999;
}
after this line (27) $sql="SELECT id FROM admin WHERE username='$username' and passcode= ' $md5pass '";
add die($sql);
and compare with what's in your database field.
Which type of PayPal payment are you using?
Not sure why you have two solutions. I would simply use (untested).
I assume that this is inside <script> tags, inside a php file?
reloadResponses();
function reloadResponses()
{
$('#responses').load('pages/community/load-responses.php?id=<?php echo $id;?>');
setTimeout(reloadResponses,10000);
}
Can we view the page?
I don't think you need to loop. I haven't had time to test but this page looks like you could adapt JorgeM's code and simply select the textboxes.
Why don't you review the js function the page is calling.
Your update column NAP_TO has an alias reference of cel (cel.nidt) but your table is not aliased this way.
is your update table named
LTE_noria_cellulecel_bk_up
or
LTE_noria_cellule
?
Your first code block appears not to have been copy/pasted correctly. There is an end comment block which errors.
Please add the following line
echo $site->ur().'<br>'.$site->get_param('zone_bde').'<br><br>';
above the first $sql block that is not working and then copy paste the actual (not working) block.
and then die($sql);
after the $sql block.
What is displayed when you die($sql);
?
Hi Glenn,
Not actually answering your question but just offering some advice.
Move your if/else to the top and then you'll only need one block of html.
This code is just a simulation of your code to show how you can code the form handler process.php. I have ommitted some text boxes in my form.
form
<form action="preview.php" method="post">
<p><input type="checkbox" name="ch-gas" value="Gas"> Gas <input type="text" name="gas" value="200"></p>
<p><input type="checkbox" name="ch-toll" value="Toll Fee"> Toll Fee </p>
<p><input type="checkbox" name="ch-gps" value="GPS"> GPS <input type="text" name="gps" value="200"></p>
<p><input type="checkbox" name="ch-lostkey" value="Lost Key"> Lost Key</p>
<p><input type="checkbox" name="ch-parkingfee" value="Parking Fee"> Parking Fee <input type="text" name="parkingfee" value="200"></p>
<input type="submit" value="Preview">
</form>
process.php
<?php
foreach($_POST as $field => $value) {
preg_match('/^ch\-([a-z]+)$/', $field, $matches);
if($matches) {
if($_POST[$matches[1]]!="") {
echo $_POST[$field].': '.$_POST[$matches[1]].'<br>';
}
}
}
?>
Does you page use JavaScript to add a text field if a checkbox is checked?
OK. I've had forms like this in the past and have wondered "do I really need the checkbox?" if the user enters a value in the text box would this be enough to say that they have selected "Gas: 200" ?
Are you using a database to populate the checkbox/input fields?
Absolutely love the new layout!
I Would stick a load of smileys here if there were any ;-)
I personally would go with option 1.
I don't proclaim to know much about SEO but from what I've read about seeding pages with keywords just for the sake of moving up (Google) rankings is not recommended.
Good content (apparently) trumps seeding.
Where do you intend to "display" the keywords? meta or visible on the actual pages?
Either way your includes sound like they could be used for this purpose
The way my site works is that I do several includes at the beginning and end of each page script.
First is a site configuration, which basically connects to the database and gets all the site specific information from the DB.
Then a page header script that does utility work based on which page is loaded, as well as the <head> <title> <Meta tags> and JS scripts.