Jump to content

Eminem

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Eminem's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I want to make an input box where users will place a URL of an image in. How do I make it so that PHP checks if it's a PNG and if it has a certain height and width in an if statement?
  2. How can I go about making it so that two codes will be executed in an "else"? <?php if ($user = " ") echo "Please specify a username!"; elseif ($pass = " ") echo "Please enter your password!"; else mail($to,$subject,$message); echo "Hello World!" ?> I want else to run not only mail, but Hello World! too. I want it so that Hello World! doesn't show up in the if and elseif situations... only in an else situation.
  3. Now, is there a way to get some html after each result when something is listed from the database? Like this: $result = mysql_query("SELECT * FROM something"); while($row = mysql_fetch_array($result)) { echo $row['title']; } Shows: I want there to be a <img src="something.png"> after something is listed like this: How can I do this?
  4. Thanks, everyone! Now, is there a way to get some html after each result when something is listed from the database? Like this: $result = mysql_query("SELECT * FROM something"); while($row = mysql_fetch_array($result)) { echo $row['title']; } Shows: I want there to be a <img src="something.png"> after something is listed like this: How can I do this?
  5. Thanks. Another thing, in the PHP form -- how can I get the PHP to automatically convert carriage returns to HTML line breaks? Like how would I get this: To look like this: Instead of like this: Any ideas or something?
  6. I have a form on my site that submits content to my homepage and I have a question. How can I have PHP submit a time in the database for each submission? Is there a function for this?
  7. I want to make a generator where one submits letters and it outputs it in different letters. Let's say the letter 'S' turns to '&'. If someone submits a word with the letter 'S', it would output it as '&'. So SMF would become '&MF'. Any suggests or tips on what or how I could go about doing this for every letter?
  8. I want $row['realName'] to link to its profile. How would do that?
  9. How would I go about placing that into the code I gave?
  10. Well, I'm new to PHP. I decided to make something that finds users on my SMF forum by connecting to the database. Now, I want to make the results links to their profiles on SMF. I'd assume I should use this code: <a href="', $scripturl, '?action=profile;u=', $member['id'], '"></a> And here is my whole file: <?php $con = mysql_connect("localhost","username","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_db", $con); $result = mysql_query("SELECT * FROM smf_members"); while($row = mysql_fetch_array($result)) { $a[]= $row['realName']; } mysql_close($con); $q=$_GET["q"]; if (strlen($q) > 0) { $hint=""; for($i=0; $i<count($a); $i++) { if (strtolower($q)==strtolower(substr($a[$i],0,strlen($q)))) { if ($hint=="") { $hint=$a[$i]; } else { $hint=$hint." <BR> ".$a[$i]; } } } } if ($hint == "") { $response="No members with the text specified."; } else { $response=$hint; } echo $response; ?> Here is the search itself. As I said earlier, I want to make the results link to their profile. Any help?
  11. It ends up being just a period as the link. I was a hyperlink that will still link to where it does. Let's say that $txt['profile_show_pets'] shows "Show this member's Pets. I want to make it so it says "Show this person's animal. I want to change the hyperlink text.
  12. $txt['profile_show_pets'] What does this mean? I see it in an SMF forum's .php file? How can I create a Hyperlink using "$txt"? Like this?: <a href="', $scripturl, '?action=profile;u=', $context['member']['id'], ';sa=showPets">', $txt['profile_show_pets'], '.</a><br />
  13. Something that probably complicates the situation is the fact that I want to be able to click a user's avatar in an SMF Forum to show the personal text, custom profile field, country flag, personal text, and other stuff that goes under the user's avatar in the post.
  14. Is there a way to get Javascript into a php file? Should I do this: <php? phpcodehere ?> javascript <php?
  15. Is there a code that enables one to click something to show it, then click it again to hide it? Let's say there's an image, when someone clicks it text appears under it, when someone clicks it again the text disappears.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.