Click here to Skip to main content
15,441,020 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Web Server on Linux Pin
azraelmr129-Nov-21 1:45
professionalazraelmr129-Nov-21 1:45 
GeneralRe: Web Server on Linux Pin
markkuk29-Nov-21 10:16
Membermarkkuk29-Nov-21 10:16 
GeneralRe: Web Server on Linux Pin
azraelmr130-Nov-21 21:33
professionalazraelmr130-Nov-21 21:33 
AnswerRe: Web Server on Linux Pin
pkfox15-Nov-21 22:02
professionalpkfox15-Nov-21 22:02 
QuestionI need some assistance for do several customisation Pin
Member 154187496-Nov-21 7:04
MemberMember 154187496-Nov-21 7:04 
AnswerRe: I need some assistance for do several customisation Pin
OriginalGriff6-Nov-21 7:05
mveOriginalGriff6-Nov-21 7:05 
QuestionASP.NET Core (5.0) Web App background images Pin
#realJSOP2-Nov-21 1:38
mva#realJSOP2-Nov-21 1:38 
QuestionUpload content onto Bootstrap card Pin
MekaC27-Oct-21 17:35
MemberMekaC27-Oct-21 17: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 21:49
mveRichard Deeming27-Oct-21 21:49 
AnswerRe: Upload content onto Bootstrap card Pin
phil.o27-Oct-21 22:11
mvephil.o27-Oct-21 22:11 
QuestionHow to retrieve images from one file and place them in another file? Pin
MekaC26-Oct-21 1:29
MemberMekaC26-Oct-21 1:29 
QuestionTip to build perfect mobile application Pin
novelsmith13-Oct-21 7:40
professionalnovelsmith13-Oct-21 7:40 
AnswerRe: Tip to build perfect mobile application Pin
megaadam18-Oct-21 5:11
professionalmegaadam18-Oct-21 5:11 
QuestionASP.Net Core Web API Exception - Can't Find System.Data.Linq Pin
Kevin Marois11-Oct-21 6:40
professionalKevin Marois11-Oct-21 6:40 
AnswerRe: ASP.Net Core Web API Exception - Can't Find System.Data.Linq Pin
Dave Kreskowiak11-Oct-21 8:01
mveDave Kreskowiak11-Oct-21 8:01 
GeneralRe: ASP.Net Core Web API Exception - Can't Find System.Data.Linq Pin
Kevin Marois11-Oct-21 8:33
professionalKevin Marois11-Oct-21 8:33 
GeneralRe: ASP.Net Core Web API Exception - Can't Find System.Data.Linq Pin
#realJSOP2-Nov-21 0:43
mva#realJSOP2-Nov-21 0:43 
GeneralRe: ASP.Net Core Web API Exception - Can't Find System.Data.Linq Pin
Richard Deeming2-Nov-21 1:14
mveRichard Deeming2-Nov-21 1:14 
GeneralRe: ASP.Net Core Web API Exception - Can't Find System.Data.Linq Pin
Kevin Marois2-Nov-21 4:34
professionalKevin Marois2-Nov-21 4:34 
AnswerRe: ASP.Net Core Web API Exception - Can't Find System.Data.Linq Pin
Richard Deeming11-Oct-21 22:11
mveRichard Deeming11-Oct-21 22:11 
GeneralRe: ASP.Net Core Web API Exception - Can't Find System.Data.Linq Pin
Kevin Marois12-Oct-21 7:34
professionalKevin Marois12-Oct-21 7:34 
GeneralRe: ASP.Net Core Web API Exception - Can't Find System.Data.Linq Pin
#realJSOP2-Nov-21 1:01
mva#realJSOP2-Nov-21 1:01 
QuestionSecuring A Web API Pin
Kevin Marois20-Sep-21 11:51
professionalKevin Marois20-Sep-21 11:51 
AnswerRe: Securing A Web API Pin
#realJSOP2-Nov-21 1:06
mva#realJSOP2-Nov-21 1:06 
GeneralRe: Securing A Web API Pin
Kevin Marois2-Nov-21 4:35
professionalKevin Marois2-Nov-21 4:35 

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.