Jump to content

sandbudd

Members
  • Posts

    514
  • Joined

  • Last visited

    Never

Everything posted by sandbudd

  1. just had to swap them around this works and thanks again for the help <?php if(empty($row_Recordset1['fb'])){ //empty() returned true : so there is nothing echo 'FB'; }else{ //empty() returned false so it is NOT true that there is nothing //so we can print it out: echo '<a href="javascript://" " title="' . $row_Recordset1['high_school'] . ' Football Schedule" onClick="popupfunction(\'/highschool/schedules/' . $row_Recordset1['fb'] . '\');" class="style3" >FB</a>'; }
  2. will thought I had it but now the popup function does not work argh... <?php if(empty($row_Recordset1['fb'])){ //empty() returned true : so there is nothing echo 'FB'; }else{ //empty() returned false so it is NOT true that there is nothing //so we can print it out: echo '<a href="javascript://" onClick="popupfunction(\'/highschool/schedules/' . $row_Recordset1['fb'] . '\'" title="' . $row_Recordset1['high_school'] . ' Football Schedule");" class="style3" >FB</a>'; } ?>
  3. Never mind I got it...long day <?php if(empty($row_Recordset1['fb'])){ //empty() returned true : so there is nothing echo 'FB'; }else{ //empty() returned false so it is NOT true that there is nothing //so we can print it out: echo '<a href="javascript://" onClick="popupfunction(\'/highschool/schedules/' . $row_Recordset1['fb'] . '\'" title="' . $row_Recordset1['high_school'] . 'whats up");" class="style3" >FB</a>'; } ?>
  4. Okay this works and displays correctly the next question is I want to add onto the title statement with some copy example $row_Recordset1['high_school'] then add something else.... Here is the code that works so far <?php if(empty($row_Recordset1['fb'])){ //empty() returned true : so there is nothing echo 'FB'; }else{ //empty() returned false so it is NOT true that there is nothing //so we can print it out: echo '<a href="javascript://" onClick="popupfunction(\'/highschool/schedules/' . $row_Recordset1['fb'] . '\'" title="' . $row_Recordset1['high_school'] . '");" class="style3" >FB</a>'; } ?>
  5. the $something is pulling from the database it would actually be $high_school what you suggested display $something
  6. Hey guys I am trying to add title tags to a link... something like title="$something then more information"; but can't get it to work. Here is the working code without the title attribute. Any help would be great <?php if(empty($row_Recordset1['fb'])){ //empty() returned true : so there is nothing echo 'FB'; }else{ //empty() returned false so it is NOT true that there is nothing //so we can print it out: echo '<a href="javascript://" onClick="popupfunction(\'/highschool/schedules/' . $row_Recordset1['fb'] . '\');" class="style3">FB</a>'; } ?>
  7. I tried that but it didn't work, tried again and it did...thanks for the help must of missed typed something
  8. any help guys I have tried several combinations and can't it to work.
  9. Tried this with no luck <?php $d = file_get_contents("http://restaurantsanddiners.com/includes/leftcopy.php"); echo $d = str_replace("%STATEINSERT%", $stateinsert, $d); echo $d .= str_replace("%CITYINSERT%", $cityinsert, $d); ?>
  10. Hey everyone thanks for the help but I need to know how to continue the echo statement... this is what I tried but does not work. <?php $cityinsert = "Auburn"; $stateinsert = "Alabama"; $countyinsert = "Jefferson"; $table = "auburnAL"; ?> <? $d = file_get_contents("http://mysite/includes/leftcopy.php"); echo $d = str_replace("%STATEINSERT%", $stateinsert, $d); echo $d = str_replace("%CITYINSERT%", $cityinsert, $d); ?>
  11. btherl that worked perfect if you have time could you explain to me why that worked and what exactly I did so I know in the future? And thank you so much for you help!
  12. should mention that the it is pulling from another website
  13. What I am trying to do is pull the content of another page which works fine and then do echo statements. It does display the content of the page but not the echo statements. outside page lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum <?php echo $stateinsert ?> lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum <?php echo $cityinsert ?> <?php echo $stateinsert ?> lorem ipsum lorem ipsum lorem ipsum lorem ipsum <?php echo $countyinsert ?> Lorum Ipsom Lorum Ipsom Lorum Ipsom </p> <?php $cityinsert = "Auburn"; $stateinsert = "Alabama"; $countyinsert = "Jefferson"; $table = "auburnAL"; ?> <?php $d = file_get_contents("http://mysite.com/includes/leftcopy.php"); echo ($d); ?> It displays the lorem ipsum but won't display the echo statements.
  14. Andy-H it pulls the information of the db row and displays it in a form...then it can be changed including the image and updated...
  15. Andy-H I am simply trying to write an upload script that uploads the image to the folder images and then updates the database with the name of the image... Here is the complete script I have now. <?php // Connect database. $host=""; // Host name. $db_user=""; // MySQL username. $db_password=""; // MySQL password. $database=""; // Database name. mysql_connect($host,$db_user,$db_password); mysql_select_db($database); // ***** This part will process when you Click on "Submit" button ***** // Check, if you clicked "Submit" button if($_GET['page'] == "update") { $id = (int)$_GET['id']; $title = $_POST['title']; $photo = $_FILES['photo']['name']; //This is the directory where images will be saved $target = "images"; $target = $target . DIRECTORY_SEPARATOR . $photo; $urlTarget = $target . '/' . $photo; //move file from temp location to target location if( move_uploaded_file($_FILES['photo']['tmp_name'], $target) ) { $url = 'http://' . $_SERVER['SERVER_NAME'] . $urlTarget; // Do update statement. mysql_query("update ads set photo='$photo', url='$url', title='" . mysql_real_escape_string($title) . "' where id=$id") or die(mysql_error()); } // Close database connection. mysql_close(); ?> <!-- END OF PHP CODES AND START HTML TAGS --> <html> <style type="text/css"> <!-- .style2 {font-size: 12px} --> </style> <body> <br> <br> <!-- set this form to POST method and target this form to itself ($PHP_SELF;)--> <form enctype="multipart/form-data" id="form1" name="form1" method="post" action="?id=<? echo $id; ?>&page=update"> <table width="707" border="0" cellpadding="3" cellspacing="0" class="appfields"> <tr> <td><p> </p> <p><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14"><strong><?php echo "<img src=images".$row['photo'] ."> "; ?></strong></span></p> <p> <label><span class="style2">ALT/TITLE</span> <input type="text" name="title" id="title" value="<?php echo $row['title'] ?>"> </label> </p> <p><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14"><strong> <label> </label> </strong><span class="style2">HTTP://</span><strong> <label> <input type="text" name="url" id="url" Value="<?php echo $row['url'] ?>"> </label> <br> <br> </strong></span><strong> <input type="file" name="photo" /> </strong> <input type="submit" name="Submit" value="Submit" /> Image needs to be 200px wide</p></td> </tr> </table> <p> </p> <p> </p> </form> </body> </html>
  16. changed it to this is it is really weird but what happens say I upload an image called cans.jpg .... it does not put it in the image folder but in the root and is displayed as imagescans.jpg it does write it to the database correctly. <?php if($_GET['page'] == "update") { $id=$_GET['id']; $url=$_POST['url']; $title=$_POST['title']; $photo=$_FILES['photo']['name']; // < --- this line // Do update statement. mysql_query("update ads set photo='$photo', url='$url', title='$title' where id='$id'") or die(mysql_error()); } // ************* End update part ************* // *** Select data to show on text fields in form. *** // Get id parameter (GET method) $id=$_GET['id']; // Get records in all columns from table where column id equal in $id and put it in $result. $result=mysql_query("select * from ads where id='$id'"); // Split records in $result by table rows and put them in $row. $row=mysql_fetch_assoc($result); ?> <?php // Close database connection. mysql_close(); ?> <?php //This is the directory where images will be saved $target = "images"; $target = $target . basename( $_FILES['photo']['name']); //This gets all the other information from the form $pic=($_FILES['photo']['name']); //Writes the photo to the server if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) ?>
  17. I have gone through this thing and cant find the error...too close to the problem
  18. sorry writes the link does not upload the image
  19. This is to upload an image then write the link to the database. It does upload the image but does not write the link to the database. Any help would be great... <?php // Connect database. // ***** This part will process when you Click on "Submit" button ***** // Check, if you clicked "Submit" button if($_GET['page'] == "update") { $id=$_GET['id']; $url=$_POST['url']; $title=$_POST['title']; $photo=$_FILES['photo']['name']; // < --- this line // Do update statement. mysql_query("update ads set photo='$photo', url='$url', title='$title' where id='$id'") or die(mysql_error()); } // ************* End update part ************* // *** Select data to show on text fields in form. *** // Get id parameter (GET method) $id=$_GET['id']; // Get records in all columns from table where column id equal in $id and put it in $result. $result=mysql_query("select * from ads where id='$id'"); // Split records in $result by table rows and put them in $row. $row=mysql_fetch_assoc($result); ?> <?php // Close database connection. mysql_close(); ?> <?php //This is the directory where images will be saved $target = "http://www.entertainfortwayne.com/images/ads/"; $target = $target . basename( $_FILES['photo']['name']); //This gets all the other information from the form $pic=($_FILES['photo']['name']); //Writes the photo to the server if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) ?> <!-- END OF PHP CODES AND START HTML TAGS --> <html> <style type="text/css"> <!-- .style2 {font-size: 12px} --> </style> <body> <br> <br> <!-- set this form to POST method and target this form to itself ($PHP_SELF;)--> <form enctype="multipart/form-data" id="form1" name="form1" method="post" action="?id=<? echo $id; ?>&page=update"> <table width="707" border="0" cellpadding="3" cellspacing="0" class="appfields"> <tr> <td><p> </p> <p><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14"><strong><?php echo "<img src=http://www.entertainfortwayne.com/images/ads/".$row['photo'] ."> "; ?></strong></span></p> <p> <label><span class="style2">ALT/TITLE</span> <input type="text" name="title" id="title" value="<?php echo $row['title'] ?>"> </label> </p> <p><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14"><strong> <label> </label> </strong><span class="style2">HTTP://</span><strong> <label> <input type="text" name="url" id="url" Value="<?php echo $row['url'] ?>"> </label> <br> <br> </strong></span><strong> <input type="file" name="photo" /> </strong> <input type="submit" name="Submit" value="Submit" /> Image needs to be 200px wide</p></td> </tr> </table> <p> </p> <p> </p> </form> </body> </html>
  20. got it just realized was putting in wrong spot...getting tired
  21. tried this and don't work <?php echo '<a href="http://'.$row['url'] .'"\" target=\"_BLANK\" border=\"0\""><img src="images/ads/'.$row['photo'].'" /></a>'; ?>
  22. take that back when I put an actual URL into the db it was fine...still need to know the other stuff...
×
×
  • 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.