[Solved] HTML Form Submit pass array to PHP [closed]

You can use hidden inputs: <input type=”hidden” name=”image_ids[]” value=”1″> <input type=”hidden” name=”image_ids[]” value=”2″> <input type=”hidden” name=”image_ids[]” value=”3″> Just create a new hidden input for each image id, with the same name image_ids[]. Note that when you append [] to the name of various input fields, these values are submitted as an array, in this case … Read more

[Solved] How to get attribute of href on the basis of selected text? [closed]

Try this : put id for anchor tag <a id=”anchor1″ href=”https://stackoverflow.com/questions/25931155/site.com/register.php?mid=username&mode=bn&bid=1″> use below javascript <script> var href = document.getElementById(‘anchor1’).href; //get index of ? var indexStart = href.indexOf(‘?’); var indexLast = href.length; //get href from ? upto total length var params = href.substring(indexStart+1, indexLast); //get tokens with seperator as ‘&’ and iterate it var paramsArray = … Read more

[Solved] Echo after header

If you read something about header in php functions, you will came to know that nothing gets printed after header as you are giving instructions to redirect on index.php However to achieve the same, you can use session variables. So, on the page where you are redirecting to index.php: $_SESSION[‘error’]=true; header(‘location: index.php’); On index.php, check … Read more

[Solved] log into Facebook directly through a php script

It´s not possible to do that, for very good reasons. You need to use an App and implement login: https://developers.facebook.com/docs/facebook-login/v2.3 You can´t just store username and password and auto-login with a PHP script. 1 solved log into Facebook directly through a php script

[Solved] php calculator switching multiplier based on input

It is simple, but you must provide the user way enter that value. For example by the GET parameter number$userInput = $_GET[‘number’]; Then you only need to create basic if statement. You can read about it at http://php.net/manual/en/control-structures.if.php $somma = $bxs+$bs+$bm+$bl+$bxl+$b2xl+$nxs+$ns+$nm+$nl+$nxl+$n2xl; if($userInput <= 30){ $somma *=$m1; }else if($userInput >30) { $somma *=$m2; } else if($userInput … Read more

[Solved] PHP contact form with Jquery validation not working

Notice: Undefined variable: message in /Users/kobigo/Sites/yedikitamuhendislik.com/sendEmail.php on line 61 Look at what appears to be line 61: $message .= “Gönd.: ” . $name . “<br />”; You’re trying to append to $message, but you never defined it in the first place. You can append to it after it’s been defined, but on this first line … Read more

[Solved] How to disable Script on certain selected page

Its common problem if are using duplicate ids in different scripts. For egs, if you are using name as id in login script and the same id is used in search script, so definately these 2 would create conflits with the same id name Now, to reslove this you can have 2 options Add unique … Read more

[Solved] Display all usernames saved in database [duplicate]

$con = new mysqli(“blank”, “blank”, “blank”, “blank”); $result = mysqli_query($con,”SELECT * FROM users WHERE user_id > 0″); while ( $row = mysqli_fetch_assoc ( $result ) ) { echo $row [ ‘username’ ] .”<br />”; } It’s nothing more than looping over your result. 4 solved Display all usernames saved in database [duplicate]