- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
18 Posted Topics
function otherfunction (arg){ console.log(arg); } function executeFunction(otherfunction){ } executeFunction(otherfunction( "hello") ); This seems redudant , suggestions?? ![]() | |
What i'm i doing wrong? here is my code FUNCTIONS.PHP <?php function get_header(){ include 'header.php'; } function get_footer(){ include 'footer.php'; } HEADER.PHP <?php function set_title($title){ echo $title; } ?> <!DOCTYPE html> <html> <head> <title><?php set_title();?></title> <meta charset="UTF-8"> <meta name="description" content="Photography site" /> <meta name="keywords" content=" Angelic Photography" /> <!-- <link … | |
I'm trying to work with the codeigniter CMS BONFIRE.I've used codeigniter before, I actually have an installation of both pure codeigniter and bonfire on my local server.First off I've been having trouble with my .htacess files on my xammp server but that's a topic for another day.My Bonfire installation for … | |
I've worked with alot of jquery galleries before but this one won't work.I'm using Twitter bootstrap and I wonder if it's JS bootstrap files are interfering with the JS file for the Unslider jquery gallery -> [Unslider](http://unslider.com/) that I'm using. ` <!-- Bootstrap Core CSS --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- … | |
![]() | Re: Found this working cord on runnable, simple with Jquery ajax . [Runnable](http://runnable.com/UkmDoGPTV7wtAAja/how-to-use-jquery-validation-ajax-call-on-success) ![]() |
//index.php $img_dir ="C:/xampp/folders/img/*.jpg"; $thumb_width = 100; // Open a known directory, and proceed to read its contents $scan= glob($img_dir); foreach($scan as $image) { $im= imagecreatefromjpeg($image); $img_width = imagesx($im); $img_height=imagesy($im); $thumb_height= floor ($img_height *($thumb_width/$img_width)); $new_img=imagecreatetruecolor($thumb_width,$thumb_height); imagecopyresized($new_img, $im, 0,0, 0, 0, $thumb_width, $thumb_height, $img_width, $img_height); $thumb_path = "C:/xampp/folders/thumbs/"; imagejpeg($new_img,$thumb_path); } The error … | |
Re: First off strict validation of datatype ($string,$email) It just so happens I wrote a simple class for that // my validate function class Myvalidatefns{ function validate($var){ return is_string($var) && ctype_alpha($var); } function validEmail($email){ return filter_var($email, FILTER_VALIDATE_EMAIL); } function validIntfields($int){ return filter_var($int,FILTER_VALIDATE_INT); } function isValid($var){ if($this->validate($var)){ null; }else{ echo "Only alphabetical … ![]() | |
Re: you can use the php code <?php header('Location:http://localhost/submit.php'); ?> To a submit.php page that displays "Your input has been submitted sucessfully" or one that displays the information the user just entered | |
var 1 = document.getElementById("1").click(); var 2 = document.getElementById("2").click(); var 3 = document.getElementById("3").click(); if(1){ userChoice =="1"; }else if (2){ userChoice == "2"; }else if (3){ userChoice == "3"; } I'm working on code that gets user choice when the user clicks on a div.I'm attempting to 'get' the element and assign … | |
Re: http://jqueryui.com/ http://jquery.malsup.com/ http://wowslider.com/slideshow-jquery-salient-squares-demo.html | |
<?php // post_view.php require 'connection.php'; $id =$conn->lastInsertId('id'); $stmt = $conn->prepare('SELECT * FROM posts WHERE id = LAST_INSERT_ID(id) LIMIT 1'); $stmt->execute(array('id' => 'LAST_INSERT_ID(id)')); while($row = $stmt->fetchAll(PDO::FETCH_ASSOC)) { //$row is an array object? that has one array in index 0 print_r($row); echo '<h2>'.$row[':title'].'</h2>'; //echo '<em>Posted '.date('F j<\s\up>S</\s\up>, Y', $row['date']).'</em><br/>'; echo nl2br($row[':body']).'<br/>'; echo … ![]() | |
<?php function html_escape($input) { return htmlspecialchars($input, ENT_COMPAT | ENT_HTML401, 'utf-8'); } require 'connection.php'; if(!empty($_POST)) { $ustmt=$conn->prepare('UPDATE posts SET title = :title, body=:body, WHERE id = :id'); $lpstid = $_GET['id']; $ustmt->bindValue('title', $_POST['title']); $ustmt->bindValue('body',$_POST['body']); $update_stmt->bindValue('id' , $lpstid); $ustmt->execute(); while($row = $update_stmt->fetch()){ print_r($row); } if($ustmt) redirect('post_view.php?id='.html_escape($_GET['id'])); } $sstmt = $conn->prepare('SELECT (title,body) FROM posts … ![]() | |
i have a form that posts to a database and i was testing code that prevents any javascript or othe client-side scripting from being submitted to the database.All javascript code i submitted ended up in the database, i figure this is bad.How can i prevent this? | |
<?php // post_add.php if( isset ($_POST['title']) && ($_POST['body']) && !empty($_POST) ){ require 'connection.php'; $stmt = $conn->prepare('INSERT INTO posts (title,body) VALUES (:title, :body)'); $stmt->bindValue(':title', $_POST['title']); $stmt->bindValue(':body', $_POST['body']); $stmt->execute(); echo 'Entry posted. <a href="post_view.php?id='.$conn->lastInsertId().'">View</a>'; }else if(empty($_POST['title']) || empty($_POST['body']) ){ echo "no values entered"; } ?> As my code is , empty fields … | |
Re: Alot of people like notepad++ but i love komodo edit, it's a very powerful editor, you can view your code in a komodo window as you go but can also configure it with a browser to display you results insanteneously. HAPPY CODING !! ![]() | |
I found this code online and i want to understand it, i have read the php documentation but i have found out that the php programming community offers better explanations PHP Code: function mysql_safe_query($query) { $args = array_slice(func_get_args(),1); $args = array_map('mysql_safe_string',$args); return mysql_query(vsprintf($query,$args)); } I figure the function isn't a … | |
I'm trying to create a simple blog and for some reason , it doesnt retrieve the dummy content from the mysql database. here is my entire code <?php $db_host = "host"; // Place the username for the MySQL database here $db_username = "root"; // Place the password for the MySQL … | |
I'm working on a php blog , i created a database and it has several fields, i performed an sql command retrieving the id , performed a $query then a mysqli_fetch_array on the $query i retrieved the id and stored it ina variable as follows `$pid=$row['id']; so that the link … |
The End.