Jump to content

Recommended Posts

Did you upload the image to your website as well?

 

your path will be checked relative to your webserver, not your computer, once you move your page to the internet.

 

if you wanted it to read off your computer still.. I think you would have to make the path something like

src="file://c:\yourdir\otherdir\myimage.jpg"  .. and then it would pretty much only work for you..

 

You should store the images and html on the webserver, and make sure your webpage points to the image correctly relative to it's location on the server

ok. i pulled the images file over to the server side. its been a good 9 months since i've done anything with this website so that was a simple mistake. i am supposed to be making an online portfolio for school but seeing as i have not taken many of my design classes yet i dont have a lot to put in it and i dont know anything about flash and things that might make this easier on me. i took PHP last semester and thats the last time in did anything like this. theres my life story... sorry. :) but yes i pulled the file and it is still a question mark... i do not know what i am doing wrong but i dont want to have to use a photo bucket type site to host my images.

Well to start simple:

 

If you upload index.html(or index.php) to your server, and then you upload myimage.jpg as well, and on your web server you can see both at the same time (meaning without having to click other folders), you would use code like this:

 

<html>
<head><title>My Portfolio</title>
</head>
<body>
  <img src="myimage.jpg" alt="My Image" />
</body>
</html>

 

If you still have trouble, let me know.

sweet i get it but since i have all of my images in a folder i type <img src="images/myimage.jpg"> that worked and one more thing for my contact page i have added forms it looks like this.

 

Name:<br>

<form method=GET action="make_xml.php">

<textarea name="$field1" rows='2' cols='15'></textarea><br>

Email:<br>

<form method=GET action="make_xml.php">

<textarea name="$field2" rows='2' cols='15'></textarea><br>

Comment:<br>

<form method=GET action="make_xml.php">

<textarea name="$field3" rows='10' cols='55'></textarea>

 

<input type="submit" value="Send Message" />

 

</form>

 

<?php

// Use HTML Entities

print $field3;

print $field2;

print $field1;

 

?>

 

<br>

 

 

 

what do i do to make the forms work for people to be able to send me messages? if this is too much to ask i understand. i will figure this out in time. thanks for your help already though.

umm.. well, it depends how you want them to send you messages...  they can email you, post to a database etc...

 

for a form, you only need one start form tag..

 

could be named contactme.html

<form action="your_script.php" method="POST">
Name<br /><input type="text" name="name" />
Email<br /><input type="text name="email" />
Comment<br /><textarea name="comment" rows=2" cols="15"></textarea>
<br />

<input type="submit" value="Send Message" />
</form>

 

your_script.php

<?php
print_r($_POST);//this will show you an array of things sent from contactme.html
?>

note: if you plan to use $_POST things, you will want to run their values through a filter first to remove malicious content.

 

emailing to you:

$name = htmlentities($_POST['name']);

 

inserting into a database:

$name = mysql_real_escape_string(htmlentities($_POST['name']));

 

These are not complete answers, but basic, essential, things you should keep in mind when exposing your form to the internet.

 

 

Other info, you'll notice I put method="POST" instead of GET.  This is personal preference, but I more commonly use $_GET when passing things through URLs... I always tend to use POST when submitting forms where the user gets to input something.

action="(something)", is where the page will send this data from the form, via the method you set (get or post, usually).

the fields are then accessed by the appropriate method, and then their name element..  that is why $_POST <- method ['name'] <- element name ($_POST['name']) will hold the value sent from <input type="text" name="name" />

 

Try playing around with it now that you know how to make your form properly, and how to see the data you sent.

A good tutorial site for beginning php stuff, and mysql database stuff is tizag.com.  I would give it a glance.

 

--If you have more questions, try something out of what you want to accomplish, and post to this, or a new thread.  Gl!

this is a quick start for you on the your_script.php link the action is set for in the above comments form

Change Dropfaith@gmail.com to your email address  and header location

http://www.lawrenceguide.org/thankyou.php to a page of your choice i like to kick people over to a thank you page to let them know the script worked and that i will contact them soon

<?php
  $name = $_REQUEST['name'] ;
  $email = $_REQUEST['email'] ;
  $message = $_REQUEST['message'] ;

  mail( "dropfaith@gmail.com", "Feedback Form Results",
    $message, "From: $email" );
  header( "Location: http://www.lawrenceguide.org/thankyou.php" );?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.