Notice: Undefined offset: 1 in C:\xampp\htdocs on line 93
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
$message = $run_message['message'];
$user_query = mysql_query("SELECT username,imagelocation FROM users WHERE id='$from_id'");
$run_user = mysql_fetch_array($user_query);
$from_username = $run_user['username'];
$image = $run_user['imagelocation'];
$url = $message;
preg_match(
'/[\\?\\&]v=([^\\?\\&]+)/',
$url,
$matches
);
$id = $matches[1];
$width = '320';
$height = '200';
$object = '<object width="' . $width . '" height="' . $height . '"><param name="movie" value="http://www.youtube.com/v/' . $id . '&hl=en_US&fs=1?rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' . $id . '&hl=en_US&fs=1?rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="' . $width . '" height="' . $height . '"></embed></object>';
echo "<p><a href='profile.php?user=$from_id'><img src='$image' width='50' height='50'></a><br><a href='profile.php?user=$from_id'><b>$from_username</b></a><br/>$message<br>$object<hr></p>";
?>
$message = $run_message['message'];
$user_query = mysql_query("SELECT username,imagelocation FROM users WHERE id='$from_id'");
$run_user = mysql_fetch_array($user_query);
$from_username = $run_user['username'];
$image = $run_user['imagelocation'];
$url = $message;
preg_match(
'/[\\?\\&]v=([^\\?\\&]+)/',
$url,
$matches
);
$id = $matches[1];
$width = '320';
$height = '200';
$object = '<object width="' . $width . '" height="' . $height . '"><param name="movie" value="http://www.youtube.com/v/' . $id . '&hl=en_US&fs=1?rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' . $id . '&hl=en_US&fs=1?rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="' . $width . '" height="' . $height . '"></embed></object>';
echo "<p><a href='profile.php?user=$from_id'><img src='$image' width='50' height='50'></a><br><a href='profile.php?user=$from_id'><b>$from_username</b></a><br/>$message<br>$object<hr></p>";
?>
Graag in het vervolg bij code, [code] [/code] tags gebruiken.[/modedit]
Gewijzigd op 02/07/2013 20:40:10 door Bas IJzelendoorn
$id = $matches[1];
Blijkbaar bestaat in $matches geen waarde met key 1.
en waar komt $run_message vandaan?
while($run_message = mysql_fetch_array($message_query)){
$from_id = $run_message['from_id'];
$message = $run_message['message'];
De reden waarom ik $message in de variabele url zet omdat url moet verwijzen naar de youtube link die opgeslagen staat in de database onder de record 'message'.
Gewijzigd op 02/07/2013 23:29:27 door george mendel