Jump to content


Photo

Help on: Creating a Simple Url Submission..


  • Please log in to reply
6 replies to this topic

#1 0o0o0

0o0o0

    Advanced Member

  • Members
  • PipPipPip
  • 50 posts

Posted 31 January 2013 - 05:56 PM

what im trying to do is make a single button or page url submission, for after I create websites for clients..

simply click and she goes.

The ones out there now are sending urls to spammers, and emails to spammer companies.. When you do a website for someone and 3 weeks later they say the mail is discusting, repetitive they dont know whats business and whats junk. I just want to make my own private and control the places it submits too. Without giving some third party my clients new url and email address.

This works but ONLY on the last entry.. so say 10 in DB.. it only visits the 10th. Ive read some "array" threads but just need a tiny tiny bit of help on what I may be doing wrong.


thanks!


<?php

$sql = mysql_query("SELECT domainonly FROM urlsubmitdb");

while($line = mysql_fetch_assoc($sql)){
		
$domainonly[] = $line;	
}

foreach($domainonly as $e){		
		
$d = 'http://www.';
$f = '/blabla=123&blabla=submitexamplelink';

$e = $e['domainonly'];
$g = "$d$e$f";

header('location:'.$g);

usleep(3000000); // 3000000 wait for 3 seconds

?>



Cant be all that bad code, the lights are still on in Manhatten!

Edited by 0o0o0, 31 January 2013 - 05:57 PM.


#2 requinix

requinix

    Transforming Moderator

  • Moderators
  • 6,135 posts
  • LocationWA

Posted 31 January 2013 - 07:41 PM

You can't do a header() redirect to multiple locations at once. The browsers will ignore everything up to the last one.
Rethink how you want users to do this. Maybe your script can submit the URLs directly?

[edit] Code critique: please don't use one letter variable names for non-trivial variables.
$d = 'http://www.';
What the heck does $d mean?
header('location:'.$g);
What was $g? What does it mean?

In your short code sample it's easy to scroll up, but when you do it to code with hundreds of lines (or more) you're only creating grief for those who have to read it. Including yourself in the future.

Edited by requinix, 31 January 2013 - 07:43 PM.


#3 0o0o0

0o0o0

    Advanced Member

  • Members
  • PipPipPip
  • 50 posts

Posted 31 January 2013 - 10:20 PM

critique?

Edited by 0o0o0, 31 January 2013 - 10:28 PM.


#4 requinix

requinix

    Transforming Moderator

  • Moderators
  • 6,135 posts
  • LocationWA

Posted 31 January 2013 - 10:43 PM

Question?

#5 0o0o0

0o0o0

    Advanced Member

  • Members
  • PipPipPip
  • 50 posts

Posted 31 January 2013 - 10:54 PM

Your weird.

#6 requinix

requinix

    Transforming Moderator

  • Moderators
  • 6,135 posts
  • LocationWA

Posted 31 January 2013 - 11:34 PM

*You're.

#7 0o0o0

0o0o0

    Advanced Member

  • Members
  • PipPipPip
  • 50 posts

Posted 01 February 2013 - 07:27 PM

I Kick You




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com