Open Chriswilldo opened 9 years ago
Sigh still works. Sorry. Still kind of bothers me though..
I lied. The coding still works, but it doesn't switch the picture until i refresh. When I left avatar.php untouched it would switch the image right away, but in its' original size. Then after refreshing, it would shrink? If I change it to match the avatar-container coding, it'll hide show no image, then appear when i refresh. Again not a huge deal, but I am kind of curious as to why my aptana likes to italic my single quote when under a style tag? Even when I switch it class, form, etc, it doesn't italic it. Only under style... Any ideas?
You have inputed an invalid css inside the html tags... the code looks just like this:
<div /*etc*/ style="background-image: url( ´../uploads/{php}')"
So starting in that code you have misplaced a '
with a ´
at the start, that the browsers would have trouble reading probably, and the second thing is that you need to make sure the <?php echo $opened['avatar'];?>
comes in the format of the image, like image.jpg
.
fixed:
<div /*etc*/ style="background-image: url('../uploads/{php}')"
I didn't place the italic ' on purpose. It does it for me automatically.
See what I mean?
It's not a huge issue to me. If anything all i have to do is refresh and it'll work. I just wanted it to work right away like shown.
what browser are you using?
I'm using firefox now as recommended in the series, but sometimes I like to switch to chrome just to see if it's working properly on both. If your asking about what Aptana n Xampp their both the latest version you can get. aptana 3.6.1, xampp 3.2.1.
maybe more info on what refreshing the page for you means?
If I refresh, it'll change the picture. So it still technically works, but I need to refresh it. Because in the video it shows how you should be able to drag the picture into the drop box and it would switch the picture instantly without refresh. However on mine.. Because of the italic ' , it won't work to its' full potential. Still, I can't really complain because I've dealt with worse errors. At least it works. I was just hoping to figure out why that was.
Now that makes sense.... the ajax you have is worng, could you please post that code? I can find the error for you. :smile:
ajax/list-sort.php:
<?php
include('../../config/connection.php');
$list = $_GET['list'];
foreach ($list as $position => $id) {
$q = "UPDATE navigation SET position = $position WHERE id = $id"; $r = mysqli_query($dbc, $q); echo mysqli_error($dbc);
}
?>
ajax/avatar.php: (My avatar container div class in this is also affected with the italic ' syndrome.)
<?php
include('../../config/connection.php');
$id = $_GET['id'];
$q = "SELECT avatar FROM users WHERE id = $id"; $r = mysqli_query($dbc, $q);
$data = mysqli_fetch_assoc($r);
?>
ajax/navigation.php:
<?php
include('../../config/connection.php');
$label = mysqli_real_escape_string($dbc, $_POST['label']);
$url = mysqli_real_escape_string($dbc, $_POST['url']);
$q = "UPDATE navigation SET id = '$_POST[id]', label = '$label', url = '$url', status = $_POST[status] WHERE id = '$_POST[opened]'";
$r = mysqli_query($dbc, $q);
if($r) { echo 'Saved
'.$q; } else {
echo mysqli_error($dbc).'
'.$q;
}
?>
ajax/pages.php:
<?php
include('../../config/connection.php');
$id = $_GET['id'];
$q = "DELETE FROM pages WHERE id = $id"; $r = mysqli_query($dbc, $q);
if($r) { echo 'Page Deleted'; } else {
echo 'There was an error...(break tag)'; echo $q.'(break tag)'; echo mysqli_error($dbc);
}
?>
I had to write in break tags here otherwise it would space it out here. Hope that makes sense.. Let me know if you need to see any more of my coding.
Flor the avatar.php you should have after that code the image html. The script it's supposed to load the data given by this file, so if you don't put the image html (with the php to get the image) it will just empty the image you have. That is also why you have to refresh the page to see the new image
When i type it out, the coding looks perfect, however in my actual coding the single quote by url( slants. This has never happened before and it bothers me. I assumed it was because i set my language to us int, but that didn't change anything. Not sure what to do here.. I'll see if it still works in my coding, but I'm assuming it doesn't...