edbr 22 Junior Poster

im sure im missing something obvious, i just cant see it any more.
i had a fail on a site as i tried live, i tried to break the problem down i found the error as below with a foreach and an if condition.
This is working fine on my local server but not live.

 $sql = "SELECT * FROM data"; 
    $result = mysqli_query($test,$sql);
    mysqli_fetch_array($result );
    foreach($result as $row){
        if( $late['area']=='Sanur'){
    echo  $row['title'].'<br>';
        }}      

It has to be something basic i am sure but im cooked!

edbr 22 Junior Poster

ok dumb i get it now

edbr 22 Junior Poster

strangest thing is i see the form fields but they donot appear in the page source or if i print_r ($_post) i am not getting the data so csomething seekms amiss

edbr 22 Junior Poster

thanks for c;larifying that, i got it. i got bogged down with the choices i think. :)

edbr 22 Junior Poster

i think it would be better to use an existing , this seems to create on the fly though

edbr 22 Junior Poster

i am trying to get to modify this script .
i have a form that returns the longditude and latitude from google map api.
I am trying to insert that data into a new form. With a lot of uyahoogling i made some progress but canyt nail this down or find clear directions where im going wrong.

so the original code is

  g.geocode(address, function(data) {
        if(data != null) {
          olat = data.latitude;
          olng = data.longitude;

 $('#geocode-result').append("Latitude: " + olat + "<br />" + "Longitude: " + olng + "<br /><br />");

thats is fine that it appends to a div
so my modification is

 $('<input>').attr({
    type: 'text',
    id: 'geocode-long', 
    value: olng
}).appendTo('form');

   $('<input>').attr({
    type: 'text',
    id: 'geocode-lat', 
    value: olat
}).appendTo('form');

this kinda works but i want this to enter into a new form , not the existing form but i cannot find how to specify that. its frustrating but oi really cant find a reference to do that, im assuning its in the append to form but not sure how to be more specific.

edbr 22 Junior Poster

sqlite might be an option for you

edbr 22 Junior Poster

googled and found thisClick Here

edbr 22 Junior Poster

`

 <?php
    $a = "Unemployed";
    if ($a == "Employed, Locally"  || $a == "Employed, Abroad"){
    echo "hi";
    }
    elseif ($a == "Unemployed"){
    echo "hello";
    }
    ?>`
edbr 22 Junior Poster

No such file or directory
atal error: require_once(): Failed opening required 'EzOptions.php

couple of clues there i would say

edbr 22 Junior Poster

phone a friend?

edbr 22 Junior Poster
function closeWin() {
    myWindow.close();   // edit myWindow to your window name
}
matrixdevuk commented: This is what they needed. +5
edbr 22 Junior Poster

@diafol i have a similar linux history to yours but i just installed linuxmint on a new laptop and so far so good. worth a look at perhaps.

diafol commented: You may convince me :) +15
edbr 22 Junior Poster

iamthwee banned? im shocked. hes not really jeremy clarckson is he?

edbr 22 Junior Poster

only the php elements will be hidden so you will have to look at the code for the page i would think

edbr 22 Junior Poster
edbr 22 Junior Poster
<?php echo date('Y') ;?>
edbr 22 Junior Poster
edbr 22 Junior Poster

cant you put the bank names into an array then check
if in_array?

edbr 22 Junior Poster

list($image_width, $image_height) = getimagesize($_FILES["file"]["name"]);

edbr 22 Junior Poster

this works

list($width, $height) = getimagesize('path to image');
echo "width: " . $width . "<br />";
echo "height: " .  $height;
edbr 22 Junior Poster

are your seetings like the following?

function smtpmailer($to, $from, $from_name, $subject, $body) {
global $error;
$mail = new PHPMailer();  // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 0;  // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true;  // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
$mail->Host = 'smtp.gmail.com';
$mail->Port = 465;
$mail->Username = GUSER;  
$mail->Password = GPWD;          
$mail->SetFrom($from, $from_name);
$mail->Subject = $subject;
$mail->Body = $body;
$mail->AddAddress($to);
if(!$mail->Send()) {
$error = 'Mail error: '.$mail->ErrorInfo;
return false;
} else {
$error = 'Message sent!';
return true;
}
edbr 22 Junior Poster

well, have changed all my site to use prepare and try, I struggled with some pagination issues converting that to prepared statements, though but seem to have got it so far.
next issue concerns crf, which confounds me a bit, any one got opinions on crf magic? i dont want to be under false imression that im safe and toasty. http://csrf.htmlpurifier.org/

edbr 22 Junior Poster

session_destroy()

edbr 22 Junior Poster

dont understand your question

edbr 22 Junior Poster
edbr 22 Junior Poster

i think i have my answer but id like to keep this thread opem for now tilli run through all my site issues

edbr 22 Junior Poster

thanks both of you. i susupect thats my vunerabilities i had converted to mysqli a whaile ago but did not use prepared statements. i dumbly thought i was toasty with that andthat the permissions were select only. i have now read further which clearly i should have before,
well im working my way through the site now making the changes.
i eventually downloaded vega scanner which pointed me to my fails, impressed with that just wished id known before so hopefully im on the road to secure site

edbr 22 Junior Poster

are you sure port 8080 is free?

edbr 22 Junior Poster

ok first question, if i may
i have a select based on a $_get value renamed $where. the value is a 4 numbers is this enough of a filte to stop a posissible vunerability?

$where = filter_input(INPUT_GET, 'recordID', FILTER_SANITIZE_NUMBER_INT
);

edbr 22 Junior Poster

thank you. i have two areas i need to check, first being an 'admin' section that i really should have changed yonks ago so thats my first. i deleted that straight away till i rewrite it.
I just downloaded the zap vunerability scanner so im hoping that will show light on the error. Never used it but looks promising.
hacker did me a favour in that not much damage done except to my blood pressure

edbr 22 Junior Poster

sorry it freaked ne out just time to update its an old site and i should have not been complacent with upgrading security .still im open to suggestions

edbr 22 Junior Poster

very embarassing but i just got hacked by the folloeing, any advise truly welcome

    Hacked By : Mr.HaurgeulisX196 TypingText = function(element, interval, cursor, finishedCallback) { if((typeof document.getElementById == "undefined") || (typeof element.innerHTML == "undefined")) { this.running = true; return; } this.element = element; this.finishedCallback = (finishedCallback ? finishedCallback : function() { return; }); this.interval = (typeof interval == "undefined" ? 100 : interval); this.origText = this.element.innerHTML; this.unparsedOrigText = this.origText; this.cursor = (cursor ? cursor : ""); this.currentText = ""; this.currentChar = 0; this.element.typingText = this; if(this.element.id == "") this.element.id = "typingtext" + TypingText.currentIndex++; TypingText.all.push(this); this.running = false; this.inTag = false; this.tagBuffer = ""; this.inHTMLEntity = false; this.HTMLEntityBuffer = ""; } TypingText.all = new Array(); TypingText.currentIndex = 0; TypingText.runAll = function() { for(var i = 0; i < TypingText.all.length; i++) TypingText.all[i].run(); } TypingText.prototype.run = function() { if(this.running) return; if(typeof this.origText == "undefined") { setTimeout("document.getElementById('" + this.element.id + "').typingText.run()", this.interval); return; } if(this.currentText == "") this.element.innerHTML = ""; if(this.currentChar < this.origText.length) { if(this.origText.charAt(this.currentChar) == "<" && !this.inTag) { this.tagBuffer = "<"; this.inTag = true; this.currentChar++; this.run(); return; } else if(this.origText.charAt(this.currentChar) == ">" && this.inTag) { this.tagBuffer += ">"; this.inTag = false; this.currentText += this.tagBuffer; this.currentChar++; this.run(); return; } else if(this.inTag) { this.tagBuffer += this.origText.charAt(this.currentChar); this.currentChar++; this.run(); return; } else if(this.origText.charAt(this.currentChar) == "&" && ! this.inHTMLEntity) { this.HTMLEntityBuffer = "&"; this.inHTMLEntity = true; this.currentChar++; this.run(); return; } else if(this.origText.charAt(this.currentChar) == ";" && this.inHTMLEntity) { this.HTMLEntityBuffer += ";"; this.inHTMLEntity = false; this.currentText += this.HTMLEntityBuffer; this.currentChar++; this.run(); return; } else if(this.inHTMLEntity) { this.HTMLEntityBuffer += …
edbr 22 Junior Poster

what about a slide down div ? http://api.jquery.com/slidedown/

edbr 22 Junior Poster

or simply

<?php
echo mt_rand();
?>
edbr 22 Junior Poster

tr{background-color:#ede6c9; color: black;}

edbr 22 Junior Poster

looks good , struggling a bit setting up PDO and sqlite but seems to be a path problem

edbr 22 Junior Poster
SimonIoa commented: Thanks edbr +2
edbr 22 Junior Poster

do you have a distinction in your database for admin?

edbr 22 Junior Poster

undefined function sqlsrv_connect() a clue maybe?

edbr 22 Junior Poster

love learning.array_reverse, thats neat

edbr 22 Junior Poster

perhaps explode then echo in reverse

<?php 
$hello  = "hello world";
$part = explode(" ", $hello);
echo $part [1]; // piece1
echo $part [0]; // piece2
?>
edbr 22 Junior Poster

i dont so what is Balance carry forward? i know balance forwarding in accounts but dont understand thia at all

edbr 22 Junior Poster

to do what?

edbr 22 Junior Poster

<input type="image" src="submit.gif" alt="Submit" width="48" height="28"> that should work

edbr 22 Junior Poster
edbr 22 Junior Poster

RewriteEngine On
RewriteRule ^blog/([^/]*)$ /?id=$1 [L] then i think

edbr 22 Junior Poster

not good with these but should that not be

    RewriteRule ^blog/([a-zA-Z0-9]+)$ /viewposts.php?id=$1 [L]
edbr 22 Junior Poster

did you AddHandler php-cgi .phtml ... ?

edbr 22 Junior Poster

<input name="Submit" type="submit" value="Submit">