Click here to Skip to main content
15,173,031 members
Home / Discussions / Web Development
   

Web Development

 
PinnedHow to get an answer to your question Pin
Chris Maunder4-Sep-10 3:25
cofounderChris Maunder4-Sep-10 3:25 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder12-Jul-09 23:40
cofounderChris Maunder12-Jul-09 23:40 
QuestionMessage Closed Pin
20-Jan-22 19:57
MemberMike micheal 202220-Jan-22 19:57 
Generalusing web API Pin
Southmountain17-Jan-22 9:44
MemberSouthmountain17-Jan-22 9:44 
GeneralRe: using web API Pin
OriginalGriff17-Jan-22 9:55
mveOriginalGriff17-Jan-22 9:55 
GeneralRe: using web API Pin
Southmountain17-Jan-22 10:00
MemberSouthmountain17-Jan-22 10:00 
GeneralRe: using web API Pin
RickZeeland17-Jan-22 10:56
mveRickZeeland17-Jan-22 10:56 
GeneralRe: using web API Pin
Slacker00718-Jan-22 1:18
professionalSlacker00718-Jan-22 1:18 
GeneralHow can i create social media sharing links for my website? Pin
Vijay Bishnoi15-Jan-22 20:45
MemberVijay Bishnoi15-Jan-22 20:45 
QuestionHow can i create social media sharing links for my website? Pin
Vijay Bishnoi15-Jan-22 20:45
MemberVijay Bishnoi15-Jan-22 20:45 
QuestionWhat is program is better to use than Dreamweaver for Website Design? Pin
David Mills 202112-Jan-22 22:44
MemberDavid Mills 202112-Jan-22 22:44 
QuestionPHP quota on server Pin
JR21226-Dec-21 0:45
MemberJR21226-Dec-21 0:45 
Questiongreating Pin
BEBEL AZOO20-Dec-21 21:03
MemberBEBEL AZOO20-Dec-21 21:03 
AnswerRe: greating Pin
Connie Rucker21-Dec-21 4:00
MemberConnie Rucker21-Dec-21 4:00 
QuestionWeb Server on Linux Pin
#realJSOP14-Nov-21 3:39
mva#realJSOP14-Nov-21 3:39 
AnswerRe: Web Server on Linux Pin
markkuk15-Nov-21 0:21
Membermarkkuk15-Nov-21 0:21 
GeneralRe: Web Server on Linux Pin
azraelmr129-Nov-21 2:45
professionalazraelmr129-Nov-21 2:45 
GeneralRe: Web Server on Linux Pin
markkuk29-Nov-21 11:16
Membermarkkuk29-Nov-21 11:16 
GeneralRe: Web Server on Linux Pin
azraelmr130-Nov-21 22:33
professionalazraelmr130-Nov-21 22:33 
AnswerRe: Web Server on Linux Pin
pkfox15-Nov-21 23:02
professionalpkfox15-Nov-21 23:02 
QuestionI need some assistance for do several customisation Pin
Member 154187496-Nov-21 8:04
MemberMember 154187496-Nov-21 8:04 
AnswerRe: I need some assistance for do several customisation Pin
OriginalGriff6-Nov-21 8:05
mveOriginalGriff6-Nov-21 8:05 
QuestionASP.NET Core (5.0) Web App background images Pin
#realJSOP2-Nov-21 2:38
mva#realJSOP2-Nov-21 2:38 
QuestionUpload content onto Bootstrap card Pin
MekaC27-Oct-21 18:35
MemberMekaC27-Oct-21 18:35 
Hey there!!!

Im trying to attach image upload to bootstrap card(home.php) as well place the image in gallery(gallery.php). When I hit submit Im taken to a blank page instead of seeing image displayed on home page. Here is my code:

```
   <div class="modal-body">
       <form action="upcontent.php" method="post" enctype="multipart/form-data">
  Upload Image
   <input type="file" name="image" id="image"> 
   <div>
<textarea name="comments" id="comments" style="font-family:sans-serif;font-size:1.2em;">
</textarea>
</div>  
   <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>       
  <input type="submit" value="Submit" name="submit">
</form>
<div class="row row-cols-1 row-cols-md-2 g-4">
<?php
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);     
$mysqli = new mysqli("'');
$query =  "SELECT username,comment,image FROM tbl_member ORDER BY ID DESC";
$result = $mysqli->query($query);

//  Loop thru comments and display all of them
while($row = $result->fetch_array(MYSQLI_ASSOC) ) {
    printf("%s (%s)\n", $row["username"], $row["comment"],$row["image"]); 
?>
    <div class="col">
        <a href="pro.php">
            <div class="card">
                 <img src="<?php echo $fetch['location']?>" class="card-img-top" alt="...">
	        <div class="card-body">
                    <h5 class="card-title"><?php echo $row["username"];?></h5>
                    <p class="card-text"><?php echo $row["comment"];?></p>
                </div>
            </div>
        </a>
    </div>
</div>
<?PHP
}
?>
 
```


```
<?php
	require_once 'conn.php';
	
	if(ISSET($_POST['upload'])){
		$image_name = $_FILES['image']['name'];
		$image_temp = $_FILES['image']['tmp_name'];
		$image_size = $_FILES['image']['size'];
		$ext = explode(".", $image_name);
		$end = end($ext);
		$allowed_ext = array("jpg", "jpeg", "gif", "png");
		$name = time().".".$end;
		$path = "img/".$name;
		if(in_array($end, $allowed_ext)){
			if($image_size > 5242880){
				echo "<script>alert('File too large!')</script>";
				echo "<script>window.location = 'home.php'</script>";
			}else{
				if(move_uploaded_file($image_temp, $path)){
					mysqli_query($conn, "INSERT INTO `image` VALUES('', '$name', '$path')") or die(mysqli_error());
					echo "<script>alert('Image uploaded!')</script>";
					echo "<script>window.location = 'home.php'</script>";
				}
			}
		}else{
			echo "<script>alert('Invalid image format!')</script>";
			echo "<script>window.location = 'home.php'</script>";
          echo "<script>window.location = 'gallery.php'</script>";
		}
		
		
	}
?>
```

Thank ya Smile | :)
SuggestionRe: Upload content onto Bootstrap card Pin
Richard Deeming27-Oct-21 22:49
mveRichard Deeming27-Oct-21 22:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.