Jump to content

carlg

Members
  • Posts

    104
  • Joined

  • Last visited

    Never

Everything posted by carlg

  1. Let me try one last time (username field already has user1 as downloading this file) You could also choose a delimiter to place between the user names update tablename set username = concat(username, "user2") where filename = "Thedownloadfile.txt";
  2. OK, let me try, I don't know the names of your fields so I'll make em up. insert into tablename (field1, field2, field3, username) values select field1, field2, field3, "2ndUser" from tablename where usnername = "1stuser" I don't have a database in front of me right now, but you may or may not need the values clause. Let me know if this helps, I may have the sytax messed up a bit, but the concept is there.
  3. I'm not sure what you are talking about. Based upon this statement it makes me think you are asking how to concatenate?
  4. You should get a line number where the error message is. Look at that line number and the lines before and after it. Unexpected tvalue is many times a missing dollar sign ($) Also check for missing semi colons.
  5. OK, I think I found a good solution. I'll post it here in case someone is following this thread. I created a global php variable called $localroot. Let's say I'm running the site from www.example.com, I change $localroot to equal http://www.example.com If I want to run the site at www.myexample.com I chane $localroot to equal http://myexample.com This way I cold move the site and it's structure anywhere I want and all I need to do is change the $localroot variable.
  6. I have a directory structure which kind of resembles the following: $DOCROOT/includes $DOCROOT/myproducts $DOCROOT/images There is a file called banner.php in the includes folder which is actually the banner of every page of my site. It uses an image which is stored in the images subfolder. Every file in my site uses banner.php including index.php which is in $DOCROOT. Files in the myproducts directory also include banner.php. The problem is that since the products subfolder and index.php are different locations, the path for the image changes. How do you solve this problem? I know I could use absolute paths (Put the http:// in front of the img path, but what if I want to move the site from server to server easily, for testing purposes.) Thanks for the info!!
  7. OK, maybe I need to word this better. My directory structure looks something like this $DOCROOT/includes $DOCROOT/myfiles I made the banner for my site and called it banner.php. It resides in the includes subdirectory. banner.php has some img tags within the code and I include banner.php in all of my php pages. I have a file in myfiles called mypage.php and it includes banner.php. All of the text from banner.php is showing up perfectly fine but all of the images are not there. If I call up a file that is in the DOCROOT that has banner.php included, the images show up fine. Hope I'm more clear thanks carl
  8. I have an include file which is in my main directory. I have a file in a sub dir that includes this file. so I have ini_set (include_path, "../"); include ("myfile.php"); myfile.php lives in ../ which is the parent dir myfile.php includes some <img> tags, but th images are not being found since they are in another dir How do I fix this? Thanks
  9. Thanks guys I may look more into the mod_rewrite I thought the scripts would be kinda neat, but I will research further. carl
  10. They would bring up a page called honda.php which would show summaries of all of the honda allowing them to click a link for further detail. honda.php is not static since the number of hondas can be different on any given day. I was reading somewhere that I can use mod_rewrite to solve this problem, but I'm still not sure if it's the way to go.
  11. I'm just wondering how some of you handle SEO with your php pages. Let me give an exmaple of a scenario. Let's say I have a site that sells cars. Users of the site create an account and list their cars for sale (So my site sells cars that are owned by many different people). When the seller enters the details for a new car it goes into a mysql table. Now lets say a buyer searchs for Honda, it goes to the database, pulls out the Hondas and dynamically creates the pages (using php). Problem is google is not finding the indiviually created page that looks something like this showcar.php?carid=234 My solution to this problem is run a cron job that looks for changes to the "cars" database table. Everytime a user edits a car or enters a new one, I could call php from the command line passing in the id variable from the db table and generating a static HTML file. Now I will have 1 html file for every car that is in my datbase which makes it more SEO friendly. I figure in about 2-4 hours, I could throw together some shell scripts to do this. What do you think? How do you overcome this problem? Thanks for any input Carl
  12. I am using php with apache. I have an application where the user uploads files. When the files land on my linux server, they are owned by apache who is the username that actually runs the apache server. What if I want the files to be owned by a different user? Is there a way? I use move_uploaded_file to rename the file once it lands. I know that php has a chown function, but you must be root to use it. Thanks
  13. Thanks for everyone's help. The solution was in the link above. I needed to reference the variable as $_POST['save_x'] instead of $_POST['save']
  14. OK here's a more simple program that demonstrates the problem <link rel="stylesheet" type="text/css" href="area.css"> <?php print "the value is " . $_POST['save']; if (($_POST['save'] == "Save Photo 1")) { $newname = "images/newfile_1.jpg"; move_uploaded_file($_FILES['img1']['tmp_name'], $newname); } ?> <form action="<?php print $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data" method="POST"> <div class="piccontrol"> <div class="pctitle">Photo</div> <div class="photo"><img width="400" height="300" src="images/10_1>"></img></div> <div class="icontrol">Image File: <input type="file" name="img1"></input></div> <div class="icontrol"> <span><input type="image" src="savephoto.gif" name="save" value="Save Photo 1"</span> <span><a href="<?php print $_SERVER['PHP_SELF'] . "?action=del" . $step . "&id=1";?>"><img src="deletephoto.gif" border="0"></img></a></span> </div> </div> </form> This works fine in non MS browsers. In the IE browsers the $_POST['save'] variable does not get populated. I'm wondering if IE has a problem with the input type = image? Carl
  15. Sorry, I do have the form tag, i just did not include it in the post. I just put snippets in to make it less complex for posting purposes. Thanks
  16. Is anyone aware of any IE issues that could be causing my problems. Everything works fine in FireFox. With IE (6 or 7) it seems like either the form is not getting submitted or there is a problem with the file upload. Here is some of my HTML <div class="piccontrol"> <div class="pctitle">Photo<?php print " " . $step; ?></div> <div class="photo"><img width="400" height="300" src="images/<?php print $filearray[$step]; ?>"></img></div> <div class="icontrol">Image File: <input type="file" name="img<?php print $step; ?>"></input></div> <div class="icontrol"> <span><input type="image" src="nj_savephoto.gif" name="save" value="Save Photo<?php print $step;?>"</span> <span><a href="<?php print $_SERVER['PHP_SELF'] . "?action=del" . $step . "&id=" . $id;?>"><img src="deletephoto.gif" border="0"></img></a></span> </div> </div> Here is the code that includes the above code $step = 1; include ("picuploadcontrol.php"); $step = 2; include ("picuploadcontrol.php"); $step = 3; include ("picuploadcontrol.php"); $step = 4; include ("picuploadcontrol.php"); $step = 5; include ("picuploadcontrol.php"); $step = 6; include ("picuploadcontrol.php"); Here is my code that processes the form input if ($_POST['save']=="Save Photo 1") { $newname = "images/" . $id . "_1.jpg"; move_uploaded_file($_FILES['img1']['tmp_name'], $newname); reSizePhoto ($newname); } if ($_POST['save'] == "Save Photo 2") { $newname = "images/" . $id . "_2.jpg"; move_uploaded_file($_FILES['img2']['tmp_name'], $newname); reSizePhoto ($newname); } if ($_POST['save'] == "Save Photo 3") { $newname = "images/" . $id . "_3.jpg"; move_uploaded_file($_FILES['img3']['tmp_name'], $newname); reSizePhoto ($newname); } if ($_POST['save'] == "Save Photo 4") { $newname = "images/" . $id . "_4.jpg"; move_uploaded_file($_FILES['img4']['tmp_name'], $newname); reSizePhoto ($newname); } if ($_POST['save'] == "Save Photo 5") { $newname = "images/" . $id . "_5.jpg"; move_uploaded_file($_FILES['img5']['tmp_name'], $newname); reSizePhoto ($newname); } if ($_POST['save'] == "Save Photo 6") { $newname = "images/" . $id . "_6.jpg"; move_uploaded_file($_FILES['img6']['tmp_name'], $newname); reSizePhoto ($newname); } It seems as if the $_POST is not coming thru on ie browsers. Your help is appreciated Thanks Carl
  17. Is there a way to "turn off" the default schema requirement?
  18. Did that to. I did the following yum remove mysql-gui-tools.1386 and then I reinstalled
  19. I'm running fedora 8. I installed the mysql gui tools using yum. mysql is working perfectly fine from the command line. I have a problem when I try to use the query browser (GUI tool) It tells me I need to specify a default schema, but then it hangs forever when I try to specify the default schema. If I try to click on the database objects on the left side of the screen it will also hang forever. Although I could run a query through the gui tool, I need to specify the db name before the table name. I actually tried googling this problem before posting and other's have had it, but I have found no solutions. What could be causing this? Thanks Carl
  20. Thanks for the info That worked. Not sure why i need it here When I did www.mydomain.com it did not need the http://
  21. I use php to create an email that gets sent out. There are some hyperlinks in the mail. When the user gets the mail, I want them to be able to click on the links. The following link works fine www.mydomain.com but this link www.mydomain.com/abc.php?myvar=12 does not. It appears in the mail, but it appears as text that the user cannot click, the user is forced to copy/paste the link into browser. Any suggestions?
  22. I am in the process of starting my own web design company. I have Virtual Private Server that I rent from a web host. I have one of my own sites hosted thru this server. I can host multiple domains from this server. When I create a site for a customer, I also want to handle the hosting for my customer so I can collect a monthly fee. This way the customer does not have to worry about setting up domains, hosting, etc. I would take care of all of that stuff. Would it be a typical thing for me to just put my customers site on my VPS? And point their domain to my VPS and then charge them a monthly hosting/maintenance fee? What about domains? Should I keep the customer's domain name in my name under my account so I can maintain it for them and just give them a contract or something that says that if they stop using my service, they can take the domain? How do you set up these things in your business? Thanks for the help Carl
  23. What is the best way to have a user download a csv file? I can create the file, but when the user clicks on a link to the file it actually displays the file in the browser. I want it to have the popup box where it says "Where do you want to save this file?" and allows the user to save it. How can I do this? Thanks Carl
  24. Did not restart the server I will try that
×
×
  • 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.