Jump to content

zeta1600

New Members
  • Posts

    9
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

zeta1600's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm not a programmer... I hope you can help. I have a downloadable file (e.g. pdf, jpg, mp3) I currently have direct links to the files ie: <a href="mysite.com/files/sample.pdf">file</a> What I want to do is not allow the users to be able to grab that link and pass it around. So, I want the link to be one-time urls. I found this code, but I have no idea what I'm supposed to do with it. I think I am supposed to save this as a something.php file. Then, what? And, is there any thing in this code I change to reflect my need? Like where is $file coming from? <?php $downloadable = "something random here"; $path = md5($downloadable . $_SESSION['something'] . $_SERVER['REMOTE_ADDR']); echo "http://download.server.com/" . $path . "/" . $file; ?>
  2. Oh my... are you able to peak at the java code you give me above to see what the problem might be?
  3. Psycho... I ended up using the following to open in a new window. It works fine in almost all browsers except for Internet Explorer. Can you help? <form action="../"> <select name="myDestination" onchange="this.form.WINDOW_NAMER.value++; ob=this.form.myDestination; window.open(ob.options[ob.selectedIndex].value ,'Window_Name'+this.value)"> <?php foreach ((array)$node->field_buy_at as $item) { ?> <?php $store = $item['display_title']; $url = $item['display_url']; ?> <? echo "<option value='$url' target='_blank'>$store</option>";?> <?php } ?> </select> <input name="WINDOW_NAMER" type="HIDDEN" value="1"> </form>
  4. AyKay47... thank you! thank you! I don't know how to mark this resolved...
  5. I have this code to pull the first few words from the body text to use as a title. But, when the body contains apostrophe, it shows on my title as &#39;. I found the following code that's supposedly fixes the code. But, I can't figure out how. I need to add this: $return = = htmlspecialchars_decode(token_replace($output, 'node', $node), ENT_QUOTES); Or something similar ... to this: $limit = 10; $text = $node->body[$node->language][0]['value']; $text = strip_tags($text); $words = str_word_count($text, 2); $pos = array_keys($words); if (count($words) > $limit) { $text = substr( $text, 0, $pos[$limit]); $text = trim( $text ); $text = rtrim( $text, '.' ); $text = trim( $text ) . '...'; } return $text; Thanks in advance.
  6. Wow, Psycho, thanks! (never thought I'd ever say those words together) I'll give this a shot and let you know what other questions I have. I really hope this helps somebody else. Boy, I have so often wished I knew php. Can you recommend a basic bare bones tutorial? .... Hmmmm.... the selection didn't go anywhere nor opened a new window.
  7. Well, SergeiSS, that's a good question. It's because I'm not a programmer. I actually got something to work through fumbling the www. Here it is. If you have any suggestions on how to clean this up, I would appreciate it. I have this to open in the same window (and another below to open in a new window): <!-- Pull Down Store --> <select onChange="window.location='<? print ($url); ?>'+this.value"> <?php foreach ((array)$node->field_buy_at as $item) { ?> <?php $store = $item['display_title']; $url = $item['display_url']; ?> <? echo "<option value='$url'>$store</option>";?> <?php } ?> </select> <!-- Pull Down Store --> Or open it in a new window: <form action="../"> <select name="myDestination" onchange="this.form.WINDOW_NAMER.value++; ob=this.form.myDestination; window.open(ob.options[ob.selectedIndex].value ,'Window_Name'+this.value)"> <?php foreach ((array)$node->field_buy_at as $item) { ?> <?php $store = $item['display_title']; $url = $item['display_url']; ?> <? echo "<option value='$url' target='_blank'>$store</option>";?> <?php } ?> </select> <input name="WINDOW_NAMER" type="HIDDEN" value="1"> </form>
  8. I have the following code currently: <?php foreach ((array)$node->field_buy_at as $item) { ?> <?php print $item['view'] ?> <?php } ?> I would like to make the list a drop down with a link so that when a user selects, he goes to a new page. I tried the following: <select name="select"> <?php foreach ((array)$node->field_buy_at as $item) { ?> <?php $url = $node->field_buy_at[0]['url']; $store = $item['view']; ?> <? echo "<option value='$url'>$store</option>";?> <?php } ?> </select> I'm pretty sure it's this "$url = $node->field_buy_at[0]['url'];" that I don't have correct.
  9. I am not a php programmer. But, I have done some tweaking with existing scripts to customize it... a little bit. I am working on a site using a script called Phormer. This is a php * gallery without the need for a mysql database. Of course it doesn't come with documentation. My customer is not yet willing to move to a new hosting company. It would be so much easier for me if it did so I can use an easier script. Anyway, I was wondering if any of you could help me. He wants the urls to end up with a seo friendly. Is this possible? I think it is. I have read a couple of things and tested and tweaked some Rewrite rules, but I can't seem to get it to work. Here is a couple url samples: http://www.mysite.com/plants/?p=114 http://www.mysite.com/plants/?p=50 We'd like to use words instead of the numbers. So, pulling from a * name... hope to hear from you soon. thanks in advance.
×
×
  • 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.