AdamCCFC Posted January 23, 2010 Author Share Posted January 23, 2010 Ohh yerr my bad! Ok, so now it prints at the top Array () Link to comment https://forums.phpfreaks.com/topic/189472-why-am-i-getting-this-warning/page/2/#findComment-1000230 Share on other sites More sharing options...
p2grace Posted January 23, 2010 Share Posted January 23, 2010 Try clicking one of the links... the array should be filled with the data provided through the $_GET vars. Link to comment https://forums.phpfreaks.com/topic/189472-why-am-i-getting-this-warning/page/2/#findComment-1000232 Share on other sites More sharing options...
AdamCCFC Posted January 23, 2010 Author Share Posted January 23, 2010 Nope nothings happening Link to comment https://forums.phpfreaks.com/topic/189472-why-am-i-getting-this-warning/page/2/#findComment-1000233 Share on other sites More sharing options...
schilly Posted January 23, 2010 Share Posted January 23, 2010 you'll have to look at the source code to see the array or change the print_r to this: echo "<pre>" . print_r($_GET,true) . "</pre">; Link to comment https://forums.phpfreaks.com/topic/189472-why-am-i-getting-this-warning/page/2/#findComment-1000236 Share on other sites More sharing options...
AdamCCFC Posted January 23, 2010 Author Share Posted January 23, 2010 <pre>Array ( ) </pre><TABLE border'1' width='300'<TR><TD>Laura Roberts</TD></TR><TR><TD>My mam dreamt that my aunty gave birth to a pasty and a sausage roll! Lol. She said we were all ther</TD></TR><TR><TD>mam,aunty,birth,pasty,sausage roll</TD></TR><TR><TD><a href="/mydreamz/comments.php"?action=show&id="19">Comments (0)</a></TD></TR></TABLE></br><TABLE border'1' width='300'<TR><TD>Ellyn Moore</TD></TR><TR><TD>Had a dream my boyfriend said my mam had a nice set of thighs. Bad times! </TD></TR><TR><TD>boyfriend,thighs,bad</TD></TR><TR><TD><a href="/mydreamz/comments.php"?action=show&id="18">Comments (0)</a></TD></TR></TABLE></br><TABLE border'1' width='300'<TR><TD>Steph Howell</TD></TR><TR><TD>My dog had AIDS :|</TD></TR><TR><TD>dogs,aids</TD></TR><TR><TD><a href="/mydreamz/comments.php"?action=show&id="17">Comments (0)</a></TD></TR></TABLE></br><TABLE border'1' width='300'<TR><TD>Sarah</TD></TR><TR><TD>I was watching Heroes and Sylar started to chase me</TD></TR><TR><TD>sylar,heroes</TD></TR><TR><TD><a href="/mydreamz/comments.php"?action=show&id="16">Comments (0)</a></TD></TR></TABLE></br><TABLE border'1' width='300'<TR><TD>Ayla</TD></TR><TR><TD>I had a secondary school reunion with old school friends. However, I wasn't very nice to them, look</TD></TR><TR><TD>secondary school,children</TD></TR><TR><TD><a href="/mydreamz/comments.php"?action=show&id="15">Comments (1)</a></TD></TR></TABLE></br><a href="/mydreamz/comments.php"?action=all'">'View all dreams'</a> that's the source code! Link to comment https://forums.phpfreaks.com/topic/189472-why-am-i-getting-this-warning/page/2/#findComment-1000239 Share on other sites More sharing options...
schilly Posted January 23, 2010 Share Posted January 23, 2010 OK your href links are wrong in displayDreams: <a href="/mydreamz/comments.php"?action=show&id="19"> should be <a href="/mydreamz/comments.php?action=show&id=19"> so change this line echo "<TR><TD><a href=\"{$_SERVER['PHP_SELF']}\"?action=show&id=$id\"{$row['dream_id']}\">Comments ($comment_row[0])</a></TD></TR>"; to echo "<TR><TD><a href=\"{$_SERVER['PHP_SELF']}?action=show&id={$row['dream_id']}\">Comments ($comment_row[0])</a></TD></TR>"; then try your links. Link to comment https://forums.phpfreaks.com/topic/189472-why-am-i-getting-this-warning/page/2/#findComment-1000245 Share on other sites More sharing options...
AdamCCFC Posted January 23, 2010 Author Share Posted January 23, 2010 You are an absolute star! Works now Need to sort a few bits out once the link has been clicked, but I can leave that till the morning! Just like to thank everyone who's helped me with this, means a great deal to me! Link to comment https://forums.phpfreaks.com/topic/189472-why-am-i-getting-this-warning/page/2/#findComment-1000247 Share on other sites More sharing options...
p2grace Posted January 23, 2010 Share Posted January 23, 2010 What does the url look like when the array is empty. Can you post the entire url so we can check if the $_GET variables are being set correctly? Link to comment https://forums.phpfreaks.com/topic/189472-why-am-i-getting-this-warning/page/2/#findComment-1000248 Share on other sites More sharing options...
AdamCCFC Posted January 23, 2010 Author Share Posted January 23, 2010 Ok, so when the link is clicked the URL goes like this http://localhost/mydreamz/comments.php?action=show&id=15 depending on which link has been clicked the id will change Link to comment https://forums.phpfreaks.com/topic/189472-why-am-i-getting-this-warning/page/2/#findComment-1000250 Share on other sites More sharing options...
schilly Posted January 23, 2010 Share Posted January 23, 2010 glad it worked Link to comment https://forums.phpfreaks.com/topic/189472-why-am-i-getting-this-warning/page/2/#findComment-1000303 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.